#[non_exhaustive]pub struct PathPiece {
pub curve: PathCurve,
pub start: f64,
pub end: f64,
pub reversed: bool,
pub placement: Option<DAffine3>,
pub placement_exact: bool,
pub open_end: bool,
pub start_bound: Option<PathBound>,
pub end_bound: Option<PathBound>,
}Expand description
One piece of a CurvePath: the span [start, end] of a curve in its
station measure, traversed forwards or backwards, optionally carried by
a rigid placement; see the module documentation.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.curve: PathCurveThe curve.
start: f64Where the span starts, in the curve’s station measure from its start (negative only on a line).
end: f64Where the span ends; a measurable piece has end > start. Not read
where the end is open (Self::open_end).
reversed: boolWhether the path runs from end to start.
placement: Option<DAffine3>The rigid motion carrying the curve, if it is placed.
placement_exact: boolWhether that placement is exact, rounding aside (true with no
placement).
open_end: boolWhether the span runs to the curve’s end, which the evaluator
resolves with its own length (#298; see the
module documentation); end is then not read.
start_bound: Option<PathBound>Where the span starts when that is given as a parameter or a point
rather than a distance (#304; see the
module documentation);
start is then not read.
end_bound: Option<PathBound>Where the span ends when that is given as a parameter or a point
(#304); end is then not read. An end is bounded or open, not
both: an evaluator refuses a piece whose end is both.
Implementations§
Source§impl PathPiece
impl PathPiece
Sourcepub fn new(curve: PathCurve, start: f64, end: f64) -> PathPiece
pub fn new(curve: PathCurve, start: f64, end: f64) -> PathPiece
The span [start, end] of curve, forwards and unplaced.
Nothing is checked here: an evaluator refuses a span that is empty, not finite or outside its curve when it reads the path.
Sourcepub fn to_end(curve: PathCurve, start: f64) -> PathPiece
pub fn to_end(curve: PathCurve, start: f64) -> PathPiece
The span of curve from start to its end, forwards and unplaced,
the end left to the evaluator (#298; see the
module documentation).
Nothing is checked here: an evaluator refuses a start that is not finite, or not before the curve’s end, when it reads the path.
Sourcepub fn from_start(curve: PathCurve, end: f64) -> PathPiece
pub fn from_start(curve: PathCurve, end: f64) -> PathPiece
The span of curve from its start to end: [0, end], the station
measure starting at 0 on every curve.
Sourcepub fn whole(curve: PathCurve) -> PathPiece
pub fn whole(curve: PathCurve) -> PathPiece
The whole of curve, from its start to its end, no length stated
(#298): Self::to_end from 0. An unbounded line is its parameter
domain, from its origin to origin + direction.
Sourcepub fn between_parameters(curve: PathCurve, t0: f64, t1: f64) -> PathPiece
pub fn between_parameters(curve: PathCurve, t0: f64, t1: f64) -> PathPiece
The span of curve from its native parameter t0 to t1, t0 < t1 (except on a closed conic, below), forwards and unplaced, no distance stated (#304; see the
module documentation).
A closed conic’s angle runs round: its span runs from t0 forwards
to t1 within one turn, across its parameter seam where t1 comes
before t0, as a trim of it in its sense does.
Nothing is checked here: an evaluator refuses parameters that are not finite, not increasing or outside the curve when it reads the path.
Sourcepub fn bounded(curve: PathCurve, start: PathBound, end: PathBound) -> PathPiece
pub fn bounded(curve: PathCurve, start: PathBound, end: PathBound) -> PathPiece
The span of curve from start to end, each a parameter or a
point, forwards and unplaced, no distance stated (#304). Both lie
in the curve’s direction; on a closed conic the span runs from the
start forwards to the end within one turn.
Nothing is checked here: an evaluator refuses a point off the curve or named by several parameters, and an empty span, when it reads the path.
Sourcepub fn with_start(self, bound: PathBound) -> PathPiece
pub fn with_start(self, bound: PathBound) -> PathPiece
The same piece starting at bound rather than at a stated distance
(#304): start then holds -Scalar::INFINITY, which nothing reads.
Sourcepub fn with_end(self, bound: PathBound) -> PathPiece
pub fn with_end(self, bound: PathBound) -> PathPiece
The same piece ending at bound rather than at a stated distance
or at its curve’s end (#304): end then holds Scalar::INFINITY,
which nothing reads, and the end is no longer open.
Sourcepub fn placed(self, rigid: DAffine3, exact: bool) -> PathPiece
pub fn placed(self, rigid: DAffine3, exact: bool) -> PathPiece
The same piece carried further by the rigid motion rigid, applied
after any placement it already has; exact when that motion is.
Sourcepub fn length(&self) -> f64
pub fn length(&self) -> f64
The span’s length in its curve’s station measure, end - start;
infinite where the end is open or an end is bounded by a parameter
or a point, which only an evaluator resolves.
Sourcepub fn is_stated(&self) -> bool
pub fn is_stated(&self) -> bool
Whether every length the piece spans is stated: its own ends (not open, #298, nor bounded by a parameter or a point, #304), and its offset’s base piece’s.
Sourcepub fn frame_is_exact(&self) -> bool
pub fn frame_is_exact(&self) -> bool
Whether a frame read on this piece is exact, rounding aside: a line (an offset of a line by a constant law included), placed, if at all, exactly.
Trait Implementations§
Source§impl Extend<PathPiece> for CurvePath
impl Extend<PathPiece> for CurvePath
Source§fn extend<I>(&mut self, pieces: I)where
I: IntoIterator<Item = PathPiece>,
fn extend<I>(&mut self, pieces: I)where
I: IntoIterator<Item = PathPiece>,
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one)Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one)Source§impl From<StationPiece<'_>> for PathPiece
impl From<StationPiece<'_>> for PathPiece
Source§fn from(piece: StationPiece<'_>) -> PathPiece
fn from(piece: StationPiece<'_>) -> PathPiece
The piece, its curve copied.
Source§impl FromIterator<PathPiece> for CurvePath
impl FromIterator<PathPiece> for CurvePath
impl StructuralPartialEq for PathPiece
Auto Trait Implementations§
impl Freeze for PathPiece
impl RefUnwindSafe for PathPiece
impl Send for PathPiece
impl Sync for PathPiece
impl Unpin for PathPiece
impl UnsafeUnpin for PathPiece
impl UnwindSafe for PathPiece
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more