struct CurveDist {
samples: ArrayVec<CurveFitSample, N_SAMPLE>,
arcparams: ArrayVec<f64, N_SAMPLE>,
range: Range<f64>,
spicy: bool,
}
Expand description
An acceleration structure for estimating curve distance
Fields§
§samples: ArrayVec<CurveFitSample, N_SAMPLE>
§arcparams: ArrayVec<f64, N_SAMPLE>
§range: Range<f64>
§spicy: bool
A “spicy” curve is one with potentially extreme curvature variation, so use arc length measurement for better accuracy.
Implementations§
Source§impl CurveDist
impl CurveDist
fn from_curve(source: &impl ParamCurveFit, range: Range<f64>) -> Self
fn compute_arc_params(&mut self, source: &impl ParamCurveFit)
Sourcefn eval_arc(&self, c: CubicBez, acc2: f64) -> Option<f64>
fn eval_arc(&self, c: CubicBez, acc2: f64) -> Option<f64>
Evaluate distance based on arc length parametrization
Sourcefn eval_ray(&self, c: CubicBez, acc2: f64) -> Option<f64>
fn eval_ray(&self, c: CubicBez, acc2: f64) -> Option<f64>
Evaluate distance to a cubic approximation.
If distance exceeds stated accuracy, can return None
. Note that
acc2
is the square of the target.
Returns the square of the error, which is intended to be a good approximation of the Fréchet distance.
fn eval_dist( &mut self, source: &impl ParamCurveFit, c: CubicBez, acc2: f64, ) -> Option<f64>
Auto Trait Implementations§
impl Freeze for CurveDist
impl RefUnwindSafe for CurveDist
impl Send for CurveDist
impl Sync for CurveDist
impl Unpin for CurveDist
impl UnwindSafe for CurveDist
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more