Struct nbez::NBez [] [src]

pub struct NBez<F, P = Point2d<F>, C = Vec<P>> where F: Float, P: Point<F>, C: AsRef<[P]> + AsMut<[P]> {
    // some fields omitted
}

An n-order bezier curve. The from_slice, split, and split_unbounded functions currently do not work.

Methods

impl<F, P, C> NBez<F, P, C> where F: Float, P: Point<F>, C: AsRef<[P]> + AsMut<[P]>
[src]

fn from_container(points: C) -> NBez<F, P, C>

fn unwrap(self) -> C

Trait Implementations

impl<F: Clone, P: Clone, C: Clone> Clone for NBez<F, P, C> where F: Float, P: Point<F>, C: AsRef<[P]> + AsMut<[P]>
[src]

fn clone(&self) -> NBez<F, P, C>

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)
1.0.0

Performs copy-assignment from source. Read more

impl<F, P, C> From<C> for NBez<F, P, C> where F: Float, P: Point<F>, C: AsRef<[P]> + AsMut<[P]>
[src]

fn from(container: C) -> NBez<F, P, C>

Performs the conversion.

impl<F, P, C> BezCurve<F> for NBez<F, P, C> where F: Float, P: Point<F>, C: AsRef<[P]> + AsMut<[P]>
[src]

type Point = P

type Elevated = NBez<F, P, Vec<P>>

fn from_slice(_: &[P]) -> Option<NBez<F, P, C>>

Currently non-functional; returns None

fn interp_unbounded(&self, t: F) -> P

Perform interpolation on the curve with no range bounds

fn slope_unbounded(&self, t: F) -> P::Vector

Get the slope for the given t with no range bounds

fn elevate(&self) -> NBez<F, P, Vec<P>>

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

fn split(&self, _: F) -> Option<(NBez<F, P, C>, NBez<F, P, C>)>

Currently non-functional; returns None

fn split_unbounded(&self, _: F) -> (NBez<F, P, C>, NBez<F, P, C>)

Currently non-functional; panics with unimplemented

fn order(&self) -> usize

Gets the order of the curve

fn interp(&self, t: F) -> Option<Self::Point>

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. Read more

fn slope(&self, t: F) -> Option<Self::Point::Vector>

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

fn interp_iter<'a>(&'a self, samples: u32) -> InterpIter<'a, F, Self>

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

impl<F, P, C> AsRef<C> for NBez<F, P, C> where F: Float, P: Point<F>, C: AsRef<[P]> + AsMut<[P]>
[src]

fn as_ref(&self) -> &C

Performs the conversion.

impl<F, P, C> AsMut<C> for NBez<F, P, C> where F: Float, P: Point<F>, C: AsRef<[P]> + AsMut<[P]>
[src]

fn as_mut(&mut self) -> &mut C

Performs the conversion.

impl<F, P, C> AsRef<[P]> for NBez<F, P, C> where F: Float, P: Point<F>, C: AsRef<[P]> + AsMut<[P]>
[src]

fn as_ref(&self) -> &[P]

Performs the conversion.

impl<F, P, C> AsMut<[P]> for NBez<F, P, C> where F: Float, P: Point<F>, C: AsRef<[P]> + AsMut<[P]>
[src]

fn as_mut(&mut self) -> &mut [P]

Performs the conversion.

impl<F, P, C> Debug for NBez<F, P, C> where F: Float, P: Point<F>, C: AsRef<[P]> + AsMut<[P]> + Debug
[src]

fn fmt(&self, f: &mut Formatter) -> Result<()Error>

Formats the value using the given formatter.