pub fn marching_cubes(
field: &[f32],
isoval: f32,
nx: u32,
ny: u32,
nz: u32,
) -> McmMeshExpand description
Extracts the isosurface from a 3D scalar field using marching cubes.
§Arguments
field- Scalar field values in C-contiguous order: the value for grid point (ix, iy, iz) is stored at index(ix * ny + iy) * nz + iz.isoval- The isovalue defining the surface (surface is wherefield == isoval).nx,ny,nz- Grid dimensions (number of nodes in each direction).
§Returns
A mesh with vertices in grid-index space (integer coordinates interpolated along edges). The caller must transform vertices to world space using grid spacing and origin.
§Panics
Panics if field.len() != nx * ny * nz or if any dimension is less than 2.