[−][src]Function building_blocks_mesh::surface_nets::surface_nets
pub fn surface_nets<V, T>(
sdf: &V,
extent: &Extent3i,
output: &mut SurfaceNetsBuffer
) where
V: Array<[i32; 3]> + GetUncheckedRelease<Stride, T>,
T: SignedDistance,
The Naive Surface Nets smooth voxel meshing algorithm.
For an in-depth explanation of the algorithm, read here.
Extracts an isosurface mesh from the signed distance field sdf
. The sdf
describes a 3D
lattice of values. These lattice points will be considered corners of unit cubes. For each unit
cube, a single isosurface vertex will be estimated, as below, where "c" is a cube corner and "s"
is an isosurface vertex.
c - c - c - c
| s | s | s |
c - c - c - c
| s | s | s |
c - c - c - c
| s | s | s |
c - c - c - c
The set of corners sampled is exactly the set of points in extent
. sdf
must contain all of
those points.