Skip to main content

sample_deflection

Function sample_deflection 

Source
pub fn sample_deflection<C: ParametricCurve>(
    curve: &C,
    t_start: f64,
    t_end: f64,
    max_deflection: f64,
) -> Vec<(f64, Point3)>
Expand description

Adaptively sample a curve so that every chord’s midpoint deviation is below max_deflection.

Returns (t, Point3) pairs sorted by increasing t, always including the endpoints t_start and t_end.

If max_deflection is non-positive, the function returns only the two endpoints (no subdivision).