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>
impl<T: Segment> Monotonic<T>
pub fn segment(&self) -> &T
pub fn from(&self) -> Point<T::Scalar>
pub fn to(&self) -> Point<T::Scalar>
pub fn sample(&self, t: T::Scalar) -> Point<T::Scalar>
pub fn x(&self, t: T::Scalar) -> T::Scalar
pub fn y(&self, t: T::Scalar) -> T::Scalar
pub fn derivative(&self, t: T::Scalar) -> Vector<T::Scalar>
pub fn dx(&self, t: T::Scalar) -> T::Scalar
pub fn dy(&self, t: T::Scalar) -> T::Scalar
pub fn split_range(&self, t_range: Range<T::Scalar>) -> Self
pub fn split(&self, t: T::Scalar) -> (Self, Self)
pub fn before_split(&self, t: T::Scalar) -> Self
pub fn after_split(&self, t: T::Scalar) -> Self
pub fn flip(&self) -> Self
pub fn approximate_length(&self, tolerance: T::Scalar) -> T::Scalar
source§impl<S: Scalar> Monotonic<QuadraticBezierSegment<S>>
impl<S: Scalar> Monotonic<QuadraticBezierSegment<S>>
pub fn solve_t_for_x(&self, x: S) -> S
pub fn solve_t_for_y(&self, y: S) -> S
pub fn split_at_x(&self, x: S) -> (Self, Self)
pub fn intersections_t( &self, self_t_range: Range<S>, other: &Self, other_t_range: Range<S>, tolerance: S ) -> ArrayVec<[(S, S); 2]>
pub fn intersections( &self, self_t_range: Range<S>, other: &Self, other_t_range: Range<S>, tolerance: S ) -> ArrayVec<[Point<S>; 2]>
pub fn first_intersection_t( &self, self_t_range: Range<S>, other: &Self, other_t_range: Range<S>, tolerance: S ) -> Option<(S, S)>
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>>
impl<S: Scalar> Monotonic<CubicBezierSegment<S>>
pub fn solve_t_for_x(&self, x: S, t_range: Range<S>, tolerance: S) -> S
pub fn split_at_x(&self, x: S) -> (Self, Self)
Trait Implementations§
source§impl<T: Segment> Segment for Monotonic<T>
impl<T: Segment> Segment for Monotonic<T>
type Scalar = <T as Segment>::Scalar
source§fn sample(&self, t: T::Scalar) -> Point<T::Scalar>
fn sample(&self, t: T::Scalar) -> Point<T::Scalar>
Sample the curve at t (expecting t between 0 and 1).
source§fn derivative(&self, t: T::Scalar) -> Vector<T::Scalar>
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
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
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)
fn split(&self, t: T::Scalar) -> (Self, Self)
Split this curve into two sub-curves.
source§fn before_split(&self, t: T::Scalar) -> Self
fn before_split(&self, t: T::Scalar) -> Self
Return the curve before the split point.
source§fn after_split(&self, t: T::Scalar) -> Self
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
fn split_range(&self, t_range: Range<T::Scalar>) -> Self
Return the curve inside a given range of t. Read more
source§fn approximate_length(&self, tolerance: T::Scalar) -> T::Scalar
fn approximate_length(&self, tolerance: T::Scalar) -> T::Scalar
Compute the length of the segment using a flattened approximation.
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more