← all work 3d-computer-vision

Marching cubes

Marching cubes turns a scalar field into a triangle mesh. The usual way to show it is a

Result

ground truthclosed form — sphere `4/3·π·r³`, `4·π·r²`; torus `2·π²·R·a²`, `4·π²·R·a`
grids16³ to 128³, seven resolutions
variants`lewiner`, `lorensen`
measurementsvolume error, area error, vertex distance to the true surface, time

The finding

The error is exactly second order, and that fixes the cost

Fitting log(error) against log(h) gives the observed order of convergence:

All six fits land within 0.05 of 2.00. Halving the grid spacing quarters the error — and costs eight times the memory and roughly six times the time. That is the whole trade, and it means accuracy here is bought at a known, unflattering rate: **ten times the time buys about three times the accuracy**, not ten.

Vertex distance converging at the same order as volume is the useful check. If the mesh were in the right place but the wrong size, the two would disagree.

Figures

convergence.png
convergence
cost.png
cost
meshes.png
meshes

Elsewhere

Code and full results on GitHub

Every number is read from the file the run produced. github.com/hammasbuilds · kaggle.com/muhammadhammas13