Struct lyon_geom::Monotonic

source ·
pub struct Monotonic<T> { /* private fields */ }
Expand description

A x and y monotonic curve segment, for example Monotonic<QuadraticBezierSegment>.

Implementations§

source§

impl<T: Segment> Monotonic<T>

source

pub fn segment(&self) -> &T

source

pub fn from(&self) -> Point<T::Scalar>

source

pub fn to(&self) -> Point<T::Scalar>

source

pub fn sample(&self, t: T::Scalar) -> Point<T::Scalar>

source

pub fn x(&self, t: T::Scalar) -> T::Scalar

source

pub fn y(&self, t: T::Scalar) -> T::Scalar

source

pub fn derivative(&self, t: T::Scalar) -> Vector<T::Scalar>

source

pub fn dx(&self, t: T::Scalar) -> T::Scalar

source

pub fn dy(&self, t: T::Scalar) -> T::Scalar

source

pub fn split_range(&self, t_range: Range<T::Scalar>) -> Self

source

pub fn split(&self, t: T::Scalar) -> (Self, Self)

source

pub fn before_split(&self, t: T::Scalar) -> Self

source

pub fn after_split(&self, t: T::Scalar) -> Self

source

pub fn flip(&self) -> Self

source

pub fn approximate_length(&self, tolerance: T::Scalar) -> T::Scalar

source§

impl<S: Scalar> Monotonic<QuadraticBezierSegment<S>>

source

pub fn solve_t_for_x(&self, x: S) -> S

source

pub fn solve_t_for_y(&self, y: S) -> S

source

pub fn split_at_x(&self, x: S) -> (Self, Self)

source

pub fn intersections_t( &self, self_t_range: Range<S>, other: &Self, other_t_range: Range<S>, tolerance: S ) -> ArrayVec<[(S, S); 2]>

source

pub fn intersections( &self, self_t_range: Range<S>, other: &Self, other_t_range: Range<S>, tolerance: S ) -> ArrayVec<[Point<S>; 2]>

source

pub fn first_intersection_t( &self, self_t_range: Range<S>, other: &Self, other_t_range: Range<S>, tolerance: S ) -> Option<(S, S)>

source

pub fn first_intersection( &self, self_t_range: Range<S>, other: &Self, other_t_range: Range<S>, tolerance: S ) -> Option<Point<S>>

source§

impl<S: Scalar> Monotonic<CubicBezierSegment<S>>

source

pub fn solve_t_for_x(&self, x: S, t_range: Range<S>, tolerance: S) -> S

source

pub fn split_at_x(&self, x: S) -> (Self, Self)

Trait Implementations§

source§

impl<T: Clone> Clone for Monotonic<T>

source§

fn clone(&self) -> Monotonic<T>

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<T: Debug> Debug for Monotonic<T>

source§

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

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

impl<T: Segment> Segment for Monotonic<T>

§

type Scalar = <T as Segment>::Scalar

source§

fn from(&self) -> Point<T::Scalar>

Start of the curve.
source§

fn to(&self) -> Point<T::Scalar>

End of the curve.
source§

fn sample(&self, t: T::Scalar) -> Point<T::Scalar>

Sample the curve at t (expecting t between 0 and 1).
source§

fn x(&self, t: T::Scalar) -> T::Scalar

Sample x at t (expecting t between 0 and 1).
source§

fn y(&self, t: T::Scalar) -> T::Scalar

Sample y at t (expecting t between 0 and 1).
source§

fn derivative(&self, t: T::Scalar) -> Vector<T::Scalar>

Sample the derivative at t (expecting t between 0 and 1).
source§

fn dx(&self, t: T::Scalar) -> T::Scalar

Sample x derivative at t (expecting t between 0 and 1).
source§

fn dy(&self, t: T::Scalar) -> T::Scalar

Sample y derivative at t (expecting t between 0 and 1).
source§

fn split(&self, t: T::Scalar) -> (Self, Self)

Split this curve into two sub-curves.
source§

fn before_split(&self, t: T::Scalar) -> Self

Return the curve before the split point.
source§

fn after_split(&self, t: T::Scalar) -> Self

Return the curve after the split point.
source§

fn split_range(&self, t_range: Range<T::Scalar>) -> Self

Return the curve inside a given range of t. Read more
source§

fn flip(&self) -> Self

Swap the direction of the segment.
source§

fn approximate_length(&self, tolerance: T::Scalar) -> T::Scalar

Compute the length of the segment using a flattened approximation.
source§

impl<T: Copy> Copy for Monotonic<T>

Auto Trait Implementations§

§

impl<T> RefUnwindSafe for Monotonic<T>
where T: RefUnwindSafe,

§

impl<T> Send for Monotonic<T>
where T: Send,

§

impl<T> Sync for Monotonic<T>
where T: Sync,

§

impl<T> Unpin for Monotonic<T>
where T: Unpin,

§

impl<T> UnwindSafe for Monotonic<T>
where T: 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> 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,

§

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>,

§

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>,

§

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.