Skip to main content

mesh_grid

Function mesh_grid 

Source
pub fn mesh_grid(
    dim: [usize; 3],
    cell: f32,
    origin: Vec3,
    threshold: f32,
    shrink: bool,
    density: impl Fn(usize, usize, usize) -> f32,
) -> MeshData
Expand description

Meshes a voxel grid. density(x, y, z) > threshold means filled; uv.x carries the density. With shrink every voxel is scaled by its density (soft puffs, all faces emitted); otherwise full cubes are merged and faces between neighbours are culled.