Skip to main content

discretize

Function discretize 

Source
pub fn discretize(
    curve: &Curve,
    range: (f64, f64),
    deflection: Deflection,
    tol: Tolerances,
) -> OgeomResult<Polyline>
Expand description

Approximate curve over range within deflection.

Adaptive bisection: split a segment whenever its midpoint is further from the chord than allowed, or the tangent turns too far across it. Uniform sampling is the obvious alternative and wastes points on the straight parts of a curve while still missing the tight ones; the whole difficulty of tessellation is that curvature is not uniform.

ยงErrors

OgeomError::Construction if the deflection settings are unusable or the range is empty; OgeomError::Domain if the range leaves the curve.