Trait kurbo::ParamCurveArclen
source · pub trait ParamCurveArclen: ParamCurve {
fn arclen(&self, accuracy: f64) -> f64;
fn inv_arclen(&self, arclen: f64, accuracy: f64) -> f64 { ... }
}
Expand description
A parametrized curve that can have its arc length measured.
Required Methods§
Provided Methods§
sourcefn inv_arclen(&self, arclen: f64, accuracy: f64) -> f64
fn inv_arclen(&self, arclen: f64, accuracy: f64) -> f64
Solve for the parameter that has the given arclength from the start.
This implementation is bisection, which is very robust but not necessarily the fastest. It does measure increasingly short segments, though, which should be good for subdivision algorithms.