fogleman / sdf

Simple SDF mesh generation in Python
MIT License
1.61k stars 132 forks source link

How does batching work? #6

Closed Korijn closed 3 years ago

Korijn commented 3 years ago

Cool library! I was just reading your code and noticed you call marching_cubes on subsections of the SDF, but I don't see any "stitching" code when you put the subsections back together. Doesn't that lead to lots of extra triangles on the inside of the mesh on the subsection boundaries? Just wondering if you could explain how this works :)

LeLocTai commented 3 years ago

I assume triangles are only generated on the surface of the mesh - where the distance function eval to 0

Korijn commented 3 years ago

Right, of course, how did I not think of that :) thanks!

Korijn commented 3 years ago

Let's say I could still imagine this happening in case the batch boundaries coincidence with the surface; but I guess that can be avoided somehow with the batching strategy.. there are probably some nasty edge cases.