Struct nbez::Bez1o [] [src]

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

Order 1 bezier curve

Fields

start: P end: P

Methods

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

fn new(start: P, end: P) -> Bez1o<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 Bez1o<F, P> where F: Float, P: Point<F>
[src]

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

fn clone(&self) -> Bez1o<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 Bez1o<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 Bez1o<F, P> where P: Point<F>, F: Float
[src]

type Point = P

type Elevated = Bez2o<F, P>

fn from_slice(slice: &[P]) -> Option<Bez1o<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) -> Bez2o<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) -> (Bez1o<F, P>, Bez1o<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 Bez1o<F, P> where F: Float, P: Point<F>
[src]

fn order_static() -> usize

Gets the compiletime-known curve order.

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

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

Performs the conversion.

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

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

Performs the conversion.

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

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

Performs the conversion.