Struct nbez::Bez2o
[−]
[src]
pub struct Bez2o<F, P = Point2d<F>> where F: Float, P: Point<F> {
pub start: P,
pub ctrl: P,
pub end: P,
// some fields omitted
}
Order 2 bezier curve
Fields
start: P
ctrl: P
end: P
Methods
impl<F, P> Bez2o<F, P> where F: Float, P: Point<F>
[src]
fn new(start: P, ctrl: P, end: P) -> Bez2o<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 Bez2o<F, P> where F: Float, P: Point<F>
[src]
impl<F: Clone, P: Clone> Clone for Bez2o<F, P> where F: Float, P: Point<F>
[src]
fn clone(&self) -> Bez2o<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 Bez2o<F, P> where F: Float, P: Point<F>
[src]
impl<F, P> BezCurve<F> for Bez2o<F, P> where P: Point<F>, F: Float
[src]
type Point = P
type Elevated = Bez3o<F, P>
fn from_slice(slice: &[P]) -> Option<Bez2o<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) -> Bez3o<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) -> (Bez2o<F, P>, Bez2o<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 Bez2o<F, P> where F: Float, P: Point<F>
[src]
fn order_static() -> usize
Gets the compiletime-known curve order.