pub fn marching_cubes(
sdf: &dyn ImplicitSurface,
bounds: [[f64; 2]; 3],
resolution: usize,
) -> (Vec<[f64; 3]>, Vec<[usize; 3]>)Expand description
Extract an isosurface from an implicit SDF using the Marching Cubes algorithm.
§Arguments
sdf— any type implementingImplicitSurfacebounds— axis-aligned bounding box as[[xmin,xmax\], [ymin,ymax], [zmin,zmax]]resolution— number of grid cells per axis
§Returns
A tuple (vertices, triangles) where each vertex is [x, y, z] and
each triangle is [i0, i1, i2] (indices into vertices).