Trait piet_common::kurbo::ParamCurveNearest[]

pub trait ParamCurveNearest {
    pub fn nearest(&self, p: Point, accuracy: f64) -> Nearest;
}

A parametrized curve that reports the nearest point.

Required methods

pub fn nearest(&self, p: Point, accuracy: f64) -> Nearest

Find the position on the curve that is nearest to the given point.

This returns a Nearest struct that contains information about the position.

Loading content...

Implementors

impl ParamCurveNearest for PathSeg

impl ParamCurveNearest for CubicBez

pub fn nearest(&self, p: Point, accuracy: f64) -> Nearest

Find nearest point, using subdivision.

impl ParamCurveNearest for Line

impl ParamCurveNearest for QuadBez

pub fn nearest(&self, p: Point, _accuracy: f64) -> Nearest

Find nearest point, using analytical algorithm based on cubic root finding.

Loading content...