Skip to main content

sample_surface_points

Function sample_surface_points 

Source
pub fn sample_surface_points(
    surface: &dyn ImplicitSurface,
    bounds_min: [f64; 3],
    bounds_max: [f64; 3],
    resolution: usize,
) -> Vec<[f64; 3]>
Expand description

Sample a regular grid over the given bounding box and return all grid points where |sdf(p)| < threshold.

resolution is the number of divisions per axis, so the total number of probed points is (resolution + 1)^3.

The threshold is chosen as half the grid spacing to capture at least one layer of points near the zero-level set.