Trait piet_common::kurbo::ParamCurve[]

pub trait ParamCurve {
    pub fn eval(&self, t: f64) -> Point;
pub fn subsegment(&self, range: Range<f64>) -> Self; pub fn subdivide(&self) -> (Self, Self) { ... }
pub fn start(&self) -> Point { ... }
pub fn end(&self) -> Point { ... } }

A curve parametrized by a scalar.

If the result is interpreted as a point, this represents a curve. But the result can be interpreted as a vector as well.

Required methods

pub fn eval(&self, t: f64) -> Point

Evaluate the curve at parameter t.

Generally t is in the range [0..1].

pub fn subsegment(&self, range: Range<f64>) -> Self

Get a subsegment of the curve for the given parameter range.

Loading content...

Provided methods

pub fn subdivide(&self) -> (Self, Self)

Subdivide into (roughly) halves.

pub fn start(&self) -> Point

The start point.

pub fn end(&self) -> Point

The end point.

Loading content...

Implementors

impl ParamCurve for PathSeg

impl ParamCurve for ConstPoint

impl ParamCurve for CubicBez

pub fn subdivide(&self) -> (CubicBez, CubicBez)

Subdivide into halves, using de Casteljau.

impl ParamCurve for Line

impl ParamCurve for QuadBez

pub fn subdivide(&self) -> (QuadBez, QuadBez)

Subdivide into halves, using de Casteljau.

Loading content...