Skip to main content

Concat

Struct Concat 

Source
pub struct Concat<A, B> { /* private fields */ }
Expand description

Two paths joined end-to-end into a single continuous path.

The combined path has length first.length() + second.length(). Sampling below first.length() delegates to the first path; the remainder delegates to the second with a shifted arc-length.

Implementations§

Source§

impl<A, B> Concat<A, B>

Source

pub fn new(first: A, second: B) -> Self

Create a new concatenated path.

Trait Implementations§

Source§

impl<A: Path, B: Path<Scalar = A::Scalar, Point = A::Point, Error = A::Error>> Path for Concat<A, B>

Source§

type Scalar = <A as Path>::Scalar

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

type Point = <A as Path>::Point

The point type representing positions on the path.
Source§

type Error = <A 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<A, B> SegmentedPath for Concat<A, B>
where A: Path + SegmentedPath, B: Path<Scalar = A::Scalar, Point = A::Point, Error = A::Error> + SegmentedPath<Segment = A::Segment>, A::Segment: PathSegment<Scalar = A::Scalar, Point = A::Point, Error = A::Error>,

Source§

type Segment = <A as SegmentedPath>::Segment

The type of individual segments making up this path.
Source§

fn segment_count(&self) -> usize

Number of segments in this path.
Source§

fn segments(&self) -> impl Iterator<Item = &Self::Segment> + '_

Iterator over all segments.
Source§

fn locate(&self, s: Self::Scalar) -> Result<(usize, Self::Scalar), Self::Error>

Map global arc-length s to (segment_index, local_s). Read more
Source§

fn segment(&self, i: usize) -> Option<&Self::Segment>

Get the segment at index i, or None if out of bounds.

Auto Trait Implementations§

§

impl<A, B> Freeze for Concat<A, B>
where A: Freeze, B: Freeze,

§

impl<A, B> RefUnwindSafe for Concat<A, B>

§

impl<A, B> Send for Concat<A, B>
where A: Send, B: Send,

§

impl<A, B> Sync for Concat<A, B>
where A: Sync, B: Sync,

§

impl<A, B> Unpin for Concat<A, B>
where A: Unpin, B: Unpin,

§

impl<A, B> UnsafeUnpin for Concat<A, B>
where A: UnsafeUnpin, B: UnsafeUnpin,

§

impl<A, B> UnwindSafe for Concat<A, B>
where A: UnwindSafe, B: 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.