Trait nbez::BezCurve [] [src]

pub trait BezCurve<F: Float>: AsRef<[Self::Point]> + AsMut<[Self::Point]> where
    Self: Sized
{ type Point: Point<F>; type Elevated: BezCurve<F, Point = Self::Point>; fn from_slice(_: &[Self::Point]) -> Option<Self>; fn interp_unbounded(&self, t: F) -> Self::Point; fn slope_unbounded(&self, t: F) -> <Self::Point as Point<F>>::Vector; fn elevate(&self) -> Self::Elevated; fn split_unbounded(&self, t: F) -> (Self, Self); fn order(&self) -> usize; fn interp(&self, t: F) -> Option<Self::Point> { ... } fn slope(&self, t: F) -> Option<<Self::Point as Point<F>>::Vector> { ... } fn split(&self, t: F) -> Option<(Self, Self)> { ... } fn interp_iter<'a>(&'a self, samples: u32) -> InterpIter<'a, F, Self> { ... } }

Bezier curve trait

Associated Types

Required Methods

Attempt to create a curve from a slice. Fails if the slice's length does not match the curve's order + 1.

Perform interpolation on the curve with no range bounds

Get the slope for the given t with no range bounds

Elevate the curve order, getting a curve that is one order higher but gives the same results upon interpolation

Split the curve with no range bounds

Gets the order of the curve

Provided Methods

Perform interpolation on the curve for the given t, bounded on 0.0 to 1.0 inclusive. Returns None if t is not within bounds.

Get the slope for the given t, bounded on 0.0 to 1.0 inclusive. Returns None if t is not within bounds.

Split the curve at the given t, bounded on 0.0 to 1.0 inclusive. Returns None if t is not within bounds.

Get an iterator over the interpolated values of this curve, splitting the curve into the given number of samples.

Implementors