This is an algorithmic Marching Cubes implementation.