Saipy
Saipy

Reputation: 1

How does Marching Cubes work with unsigned distances?

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!

Upvotes: 0

Views: 1303

Answers (2)

M. Ka
M. Ka

Reputation: 103

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

Upvotes: 0

hkchengrex
hkchengrex

Reputation: 4826

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.

Upvotes: 0

Related Questions