Struct nbez::Bez4o [] [src]

pub struct Bez4o<F, P = Point2d<F>> where F: Float, P: Point<F> {
    pub start: P,
    pub ctrl0: P,
    pub ctrl1: P,
    pub ctrl2: P,
    pub end: P,
    // some fields omitted
}

Order 4 bezier curve

Fields

start: P ctrl0: P ctrl1: P ctrl2: P end: P

Methods

impl<F, P> Bez4o<F, P> where F: Float, P: Point<F>
[src]

fn new(start: P, ctrl0: P, ctrl1: P, ctrl2: P, end: P) -> Bez4o<F, P>

Create a new bezier curve, with each field of this function corresponding to the similarly-named point on the curve.

Trait Implementations

impl<F: Copy, P: Copy> Copy for Bez4o<F, P> where F: Float, P: Point<F>
[src]

impl<F: Clone, P: Clone> Clone for Bez4o<F, P> where F: Float, P: Point<F>
[src]

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

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: Debug, P: Debug> Debug for Bez4o<F, P> where F: Float, P: Point<F>
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.

impl<F, P> BezCurve<F> for Bez4o<F, P> where P: Point<F>, F: Float
[src]

type Point = P

type Elevated = Bez5o<F, P>

fn from_slice(slice: &[P]) -> Option<Bez4o<F, P>>

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

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) -> Bez5o<F, P>

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

fn split_unbounded(&self, t: F) -> (Bez4o<F, P>, Bez4o<F, P>)

Split the curve with no range bounds

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 split(&self, t: F) -> Option<(Self, Self)>

Split the curve at 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> OrderStatic for Bez4o<F, P> where F: Float, P: Point<F>
[src]

fn order_static() -> usize

Gets the compiletime-known curve order.

impl<F, P> From<[P; 4 + 1]> for Bez4o<F, P> where F: Float, P: Point<F>
[src]

fn from(array: [P; 4 + 1]) -> Bez4o<F, P>

Performs the conversion.

impl<F, P> AsRef<[P]> for Bez4o<F, P> where F: Float, P: Point<F>
[src]

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

Performs the conversion.

impl<F, P> AsMut<[P]> for Bez4o<F, P> where F: Float, P: Point<F>
[src]

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

Performs the conversion.