0

I am working with signed/unsigned distance fields (SDFs/UDFs). I can render a mesh out of signed distances using Marching Cubes. But rendering a mesh out of unsigned distances also works using Marching Cubes, and I wonder why?

I am aware of, for example, this paper (DUDE: Deep Unsigned Distance Embeddings), which says that unsigned distance fields can work within the Marching Cubes environment, but as far as I understand, the algorithm discovers the boundary of the shape by finding out if points of a cube are inside or outside of the shape. How is this implemented when using unsigned distance fields where only positive distance values are present?

I would greatly appreciate an explanation of how the marching cube algorithm works in terms of unsigned distances.

Regarding the Marching Cubes implementation I used the one from DeepSDF (DeepSDF Marching Cubes Implementation), which itself uses skimage.measure.marching_cubes_lewiner

Thanks in advance!

Saipy
  • 1
  • 2

2 Answers2

0

Marching cubes determine the boundary of the shape by zero-crossings and determine the inside/outside status with signs. If you flip the signs, the outside becomes inside and vice versa -- that does not change the boundary as zero-crossings are unchanged.

So for unsigned distance fields, marching cube will work the same way if you don't care about inside/outside relations or if you know in advance where the outside is (e.g., the camera is outside). I haven't read the paper in detail, but it seems like that they start sphere tracing from the camera -- meaning that the camera is expected to be on the outside, hence resolving the distance ambiguity.

hkchengrex
  • 4,361
  • 23
  • 33
  • Hi @hkchengrex, thanks for your answer! I understand that Marching Cubes finds the surface between a point with positive distance and a point with negative distance by zero-crossing. But the same algorithm works with UDFs as well, where we dont have the zero-crossing. With two or more positive distances in the cube, how does the algorithm know that the surface must lie here? Sphere tracing is not used in the Marching Cube of DeepSDF as far as I understand. – Saipy Jul 12 '21 at 06:50
  • @Saipy UDFs can have zero-crossings -- see Fig.3 of the paper you cited. – hkchengrex Jul 12 '21 at 07:49
0

Find some new exciting work going in the direction of meshing UDFs here: https://github.com/cvlab-epfl/MeshUDF

M. Ka
  • 93
  • 7