Struct Bezier0

Source
pub struct Bezier0<F: Float, P: CurvePoint<F>> {
    pub point: P,
    /* private fields */
}
Expand description

Single point

Fields§

§point: P

Implementations§

Source§

impl<F: Float, P: CurvePoint<F>> Bezier0<F, P>

Source

pub fn new(point: P) -> Self

Trait Implementations§

Source§

impl<F: Clone + Float, P: Clone + CurvePoint<F>> Clone for Bezier0<F, P>

Source§

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

Returns a copy of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<F: Float, P: CurvePoint<F>> Curve<F, P> for Bezier0<F, P>

Source§

fn value_at(&self, _t: F) -> P

Get the point at a given value t in range from 0 to 1.
Source§

fn tangent_at(&self, _t: F) -> P

Get the derivative at a given value t in range from 0 to 1.
Source§

fn start_point(&self) -> P

Source§

fn end_point(&self) -> P

Source§

fn estimate_length(&self, _precision: F) -> F
where P: Distance<F>,

Estimate the length of the curve as an average between min and max estimation. The precision parameter is the maximum ration of min and max estimation. Read more
Source§

fn dot(p0: P) -> Bezier0<F, P>

Create a dot, at any t it will return the same value
Source§

fn line(p0: P, p1: P) -> Bezier1<F, P>

Create a line
Source§

fn quad_bezier(p0: P, p1: P, p2: P) -> Bezier2<F, P>

Create a quadratic bezier curve
Source§

fn cubic_bezier(p0: P, p1: P, p2: P, p3: P) -> Bezier3<F, P>

Create a cubic bezier curve
Source§

fn into_iter(self, steps_count: usize) -> CurveIterator<F, P, Self>
where Self: Sized,

Create an iterator that will generate points on the curve.
Source§

fn into_iter_inclusive(self, steps_count: usize) -> CurveIterator<F, P, Self>
where Self: Sized,

Create an iterator that will generate points on the curve, including the last point.
Source§

fn composed_curve(start_point: P) -> ComposedCurve<F, P>

Create a composed curve that will be a sequence of curves. Each segment of the curve will be represented by equal t range. For example, if you have 3 curves, they will take t ranges: 0 - 0.33, 0.33 - 0.66 and 0.66 - 1.0.
Source§

fn linear_speed( self, table_size: usize, steps_count: usize, ) -> LinearSpeed<F, P, Self>
where P: Distance<F>, Self: Sized,

Create a linear speed curve that will allow to move with a constant speed along the curve. It’s especially useful when you want to animate the movement along a composed curve. Read more
Source§

impl<F: Float, P> Debug for Bezier0<F, P>
where P: Debug + CurvePoint<F>,

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<F: PartialEq + Float, P: PartialEq + CurvePoint<F>> PartialEq for Bezier0<F, P>

Source§

fn eq(&self, other: &Bezier0<F, P>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<F: Float, P> Copy for Bezier0<F, P>
where P: Copy + CurvePoint<F>,

Source§

impl<F: Float, P: CurvePoint<F>> StructuralPartialEq for Bezier0<F, P>

Auto Trait Implementations§

§

impl<F, P> Freeze for Bezier0<F, P>
where P: Freeze,

§

impl<F, P> RefUnwindSafe for Bezier0<F, P>

§

impl<F, P> Send for Bezier0<F, P>
where P: Send, F: Send,

§

impl<F, P> Sync for Bezier0<F, P>
where P: Sync, F: Sync,

§

impl<F, P> Unpin for Bezier0<F, P>
where P: Unpin, F: Unpin,

§

impl<F, P> UnwindSafe for Bezier0<F, P>
where P: UnwindSafe, F: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.