pub struct Offset<P, S> { /* private fields */ }Expand description
A path displaced by a constant distance from the original.
Every sampled point is shifted by distance units. The offset direction
is derived from the path’s heading; in 2D this produces a parallel curve.
Note: The current implementation offsets along the tangent direction as a placeholder. A proper 2D-specific implementation should offset along the surface normal (heading + π/2).
Implementations§
Trait Implementations§
Source§impl<P: Path + Tangent + Heading> Path for Offset<P, P::Scalar>
impl<P: Path + Tangent + Heading> Path for Offset<P, P::Scalar>
Source§type Scalar = <P as Path>::Scalar
type Scalar = <P as Path>::Scalar
The scalar type for arc-length, parameter, and distance computations.
Source§type Error = <P as Path>::Error
type Error = <P as Path>::Error
The error type for fallible operations. Must be convertible from
PathError<Self::Scalar>.Source§fn sample_at(&self, s: Self::Scalar) -> Result<Self::Point, Self::Error>
fn sample_at(&self, s: Self::Scalar) -> Result<Self::Point, Self::Error>
Sample the path at arc-length
s ∈ [0, length]. Read moreSource§fn start(&self) -> Result<Self::Point, Self::Error>
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>
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>
fn domain(&self) -> RangeInclusive<Self::Scalar>
The valid domain for arc-length sampling:
[0, length].Auto Trait Implementations§
impl<P, S> Freeze for Offset<P, S>
impl<P, S> RefUnwindSafe for Offset<P, S>where
P: RefUnwindSafe,
S: RefUnwindSafe,
impl<P, S> Send for Offset<P, S>
impl<P, S> Sync for Offset<P, S>
impl<P, S> Unpin for Offset<P, S>
impl<P, S> UnsafeUnpin for Offset<P, S>where
P: UnsafeUnpin,
S: UnsafeUnpin,
impl<P, S> UnwindSafe for Offset<P, S>where
P: UnwindSafe,
S: 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