[][src]Struct flo_curves::bezier::CurveSection

pub struct CurveSection<'a, C: 'a + BezierCurve> { /* fields omitted */ }

Represents a subsection of a bezier curve

Methods

impl<'a, C: 'a + BezierCurve> CurveSection<'a, C>[src]

pub fn new(curve: &'a C, t_min: f64, t_max: f64) -> CurveSection<'a, C>[src]

Creates a new curve section from a region of another bezier curve

pub fn t_for_t(&self, t: f64) -> f64[src]

Returns the t value on the full curve for a t value on the section

pub fn is_tiny(&self) -> bool[src]

Returns true if this section is so small as to represent a point

pub fn subsection(&self, t_min: f64, t_max: f64) -> CurveSection<'a, C>[src]

Creates a sub-section from this curve section (dividing it further)

Unlike calling section, this keeps the same type and avoids the need for recursive recalculation for things like the control points. This means that original_curve_t_values will return the coordinates for the same original curve as the curve that this subsection was created from.

pub fn original_curve_t_values(&self) -> (f64, f64)[src]

Returns the original t values (t_min, t_max) that this section was created from

pub fn section_t_for_original_t(&self, t: f64) -> f64[src]

Given a 't' value on the original curve, returns the equivalent value on this section

Trait Implementations

impl<'a, C: 'a + BezierCurve> BezierCurve for CurveSection<'a, C>[src]

fn start_point(&self) -> Self::Point[src]

The start point of this curve

fn end_point(&self) -> Self::Point[src]

The end point of this curve

fn control_points(&self) -> (Self::Point, Self::Point)[src]

The control points in this curve

fn point_at_pos(&self, t: f64) -> Self::Point[src]

Given a value t from 0 to 1, returns a point on this curve

impl<'a, C: Clone + 'a + BezierCurve> Clone for CurveSection<'a, C> where
    C::Point: Clone,
    C::Point: Clone
[src]

impl<'a, C: 'a + BezierCurve> Geo for CurveSection<'a, C>[src]

type Point = C::Point

The type of a point in this geometry

Auto Trait Implementations

impl<'a, C> !RefUnwindSafe for CurveSection<'a, C>

impl<'a, C> Send for CurveSection<'a, C> where
    C: Sync,
    <C as Geo>::Point: Send

impl<'a, C> !Sync for CurveSection<'a, C>

impl<'a, C> Unpin for CurveSection<'a, C> where
    <C as Geo>::Point: Unpin

impl<'a, C> UnwindSafe for CurveSection<'a, C> where
    C: RefUnwindSafe,
    <C as Geo>::Point: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.