Definition

Marching cubes turns a grid of values of an implicit function (SDF, occupancy, density) into a triangle mesh of the level set (or ).

Algorithm

  1. Build a cube from 4 neighbors on one slice and 4 on the next.
  2. Index = inside/outside pattern of the 8 corners ( cases).
  3. Look up the crossed edges in a precalculated table.
  4. Place vertices on the edges by linear interpolation of the values.
  5. Normals from central differences, interpolated to the triangle vertices.
  6. Output the triangles.
MethodIdeaWeakness
Marching cubes (MC)lookup table + linear interpolationmisses sharp features, cubic cost in resolution
Dual contouring (DC)one vertex per cell minimizing with Hermite data, octreecan give non-manifold vertices, thin features
Dual marching cubes (DMC)QEF with tangent planes of the fieldcrack-free, manifold, sharp features
FlexiCubesextra parameters, differentiableused to optimize meshes end-to-end

Trap

Classical MC is not differentiable. FlexiCubes is the differentiable variant, not a faster one.

Appears in