Skip to content

Marching Cubes

Marching Cubes is an algorithm to extract a polygonal mesh from an implicit function of the form f(x, y, z) = 0. It iterates ("marching") over a grid of cubes and determines the vertices and faces of the mesh by evaluating the function at the corners of each cube. If all corners are positive or negative, the cube is skipped. Otherwise, the function is evaluated at the corners and the mesh is constructed by interpolating the vertices along the edges of the cube. There are \(2^8\) cases for the corners of the cube, and they form 15 unique cases when considering rotations and reflections:

Marching Cubes