pub trait Path {
type Scalar: Scalar;
type Point: Point<Scalar = Self::Scalar>;
type Error: From<PathError<Self::Scalar>>;
// Required methods
fn length(&self) -> Self::Scalar;
fn sample_at(&self, s: Self::Scalar) -> Result<Self::Point, Self::Error>;
// Provided methods
fn start(&self) -> Result<Self::Point, Self::Error> { ... }
fn end(&self) -> Result<Self::Point, Self::Error> { ... }
fn domain(&self) -> RangeInclusive<Self::Scalar> { ... }
}Expand description
A curve that can be sampled by arc-length s.
Every path has a total length, and sample_at(s) returns a Point
for s ∈ [0, length]. The trait provides convenience methods start(), end(),
and domain().
Required Associated Types§
Required Methods§
Provided Methods§
Sourcefn 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).
Sourcefn 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).
Sourcefn domain(&self) -> RangeInclusive<Self::Scalar>
fn domain(&self) -> RangeInclusive<Self::Scalar>
The valid domain for arc-length sampling: [0, length].