Skip to main content

Reverse

Struct Reverse 

Source
pub struct Reverse<P> { /* private fields */ }
Expand description

A path traversed in the opposite direction.

Sampling at arc-length s returns the position the inner path would have at length - s. Tangent vectors are negated; signed curvature is negated.

Implementations§

Source§

impl<P> Reverse<P>

Source

pub fn new(inner: P) -> Self

Create a new reversed path.

Trait Implementations§

Source§

impl<P: Curved> Curved for Reverse<P>
where P::Curvature: Neg<Output = P::Curvature>,

Source§

type Curvature = <P as Curved>::Curvature

The type representing curvature (scalar in 2D, vector in 3D).
Source§

fn curvature_at(&self, s: Self::Scalar) -> Result<Self::Curvature, Self::Error>

Curvature at arc-length s. Read more
Source§

impl<P: Path> Path for Reverse<P>

Source§

type Scalar = <P as Path>::Scalar

The scalar type for arc-length, parameter, and distance computations.
Source§

type Point = <P as Path>::Point

The point type representing positions on the path.
Source§

type Error = <P as Path>::Error

The error type for fallible operations. Must be convertible from PathError<Self::Scalar>.
Source§

fn length(&self) -> Self::Scalar

Total arc-length of the path.
Source§

fn sample_at(&self, s: Self::Scalar) -> Result<Self::Point, Self::Error>

Sample the path at arc-length s ∈ [0, length]. Read more
Source§

fn start(&self) -> Result<Self::Point, Self::Error>

The start point of the path, equivalent to sample_at(0).
Source§

fn end(&self) -> Result<Self::Point, Self::Error>

The end point of the path, equivalent to sample_at(length).
Source§

fn domain(&self) -> RangeInclusive<Self::Scalar>

The valid domain for arc-length sampling: [0, length].
Source§

impl<P: Tangent> Tangent for Reverse<P>

Source§

fn tangent_at( &self, s: Self::Scalar, ) -> Result<<Self::Point as Point>::Vector, Self::Error>

Unit tangent vector at arc-length s. Read more

Auto Trait Implementations§

§

impl<P> Freeze for Reverse<P>
where P: Freeze,

§

impl<P> RefUnwindSafe for Reverse<P>
where P: RefUnwindSafe,

§

impl<P> Send for Reverse<P>
where P: Send,

§

impl<P> Sync for Reverse<P>
where P: Sync,

§

impl<P> Unpin for Reverse<P>
where P: Unpin,

§

impl<P> UnsafeUnpin for Reverse<P>
where P: UnsafeUnpin,

§

impl<P> UnwindSafe for Reverse<P>
where P: 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<P> PathExt for P
where P: Path,

Source§

fn reverse(self) -> Reverse<P>

Reverse the path direction.
Source§

fn concat<Q>(self, other: Q) -> Concat<P, Q>
where Q: Path<Scalar = <P as Path>::Scalar, Point = <P as Path>::Point, Error = <P as Path>::Error>,

Concatenate this path with another, compatible path.
Source§

fn offset(self, d: <P as Path>::Scalar) -> Offset<P, <P as Path>::Scalar>
where P: Tangent + Heading,

Offset the path by a distance d. Requires tangent and heading support.
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.