[][src]Trait kurbo::ParamCurve

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

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

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

Evaluate the curve at parameter t.

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

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

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

Loading content...

Provided methods

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

Subdivide into (roughly) halves.

fn start(&self) -> Vec2

The start point.

fn end(&self) -> Vec2

The end point.

Loading content...

Implementors

impl ParamCurve for PathSeg[src]

fn subdivide(&self) -> (Self, Self)[src]

fn start(&self) -> Vec2[src]

fn end(&self) -> Vec2[src]

impl ParamCurve for ConstVec2[src]

fn subdivide(&self) -> (Self, Self)[src]

fn start(&self) -> Vec2[src]

fn end(&self) -> Vec2[src]

impl ParamCurve for CubicBez[src]

fn subdivide(&self) -> (CubicBez, CubicBez)[src]

Subdivide into halves, using de Casteljau.

impl ParamCurve for Line[src]

fn subdivide(&self) -> (Self, Self)[src]

impl ParamCurve for QuadBez[src]

fn subdivide(&self) -> (QuadBez, QuadBez)[src]

Subdivide into halves, using de Casteljau.

Loading content...