#[non_exhaustive]pub struct StationPiece<'c> {
pub curve: StationCurve<'c>,
pub start: f64,
pub end: f64,
pub reversed: bool,
pub placement: Option<DAffine3>,
pub placement_exact: bool,
}Expand description
One piece of a CompositeBasis: the span [start, end] of an atomic
curve, in that curve’s station measure, traversed forwards or
backwards, optionally placed by a rigid motion; 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: StationCurve<'c>The atomic 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, greater than start.
reversed: boolWhether the composite 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).
Implementations§
Source§impl<'c> StationPiece<'c>
impl<'c> StationPiece<'c>
Sourcepub fn whole(curve: StationCurve<'c>) -> Result<StationPiece<'c>, GeomError>
pub fn whole(curve: StationCurve<'c>) -> Result<StationPiece<'c>, GeomError>
The whole curve: [0, L], L its station length; an unbounded
line is its parameter domain [0, 1], from its origin to origin + direction.
§Errors
A curve whose length a station cannot be measured against, by name.
Sourcepub fn between(
curve: StationCurve<'c>,
start: f64,
end: f64,
) -> Result<StationPiece<'c>, GeomError>
pub fn between( curve: StationCurve<'c>, start: f64, end: f64, ) -> Result<StationPiece<'c>, GeomError>
The span [start, end] of curve, in its station measure.
§Errors
A non-finite or empty span, and one outside the curve’s measure (before its start or past its length, beyond the arc-length tolerance; a closed conic’s span may cross its parameter seam but not exceed one turn), by name.
Sourcepub fn between_parameters(
curve: StationCurve<'c>,
t0: f64,
t1: f64,
) -> Result<StationPiece<'c>, GeomError>
pub fn between_parameters( curve: StationCurve<'c>, t0: f64, t1: f64, ) -> Result<StationPiece<'c>, GeomError>
The span between native parameters t0 < t1 of curve, converted
to its station measure. A closed conic’s span may start anywhere
and cross its parameter seam (at most one turn).
§Errors
As Self::between, and the arc-length quadrature’s refusals.
Sourcepub const fn reversed(self) -> StationPiece<'c>
pub const fn reversed(self) -> StationPiece<'c>
The same span traversed the other way.
Sourcepub fn placed(self, rigid: DAffine3, exact: bool) -> StationPiece<'c>
pub fn placed(self, rigid: DAffine3, exact: bool) -> StationPiece<'c>
The same piece carried further by the rigid motion rigid (applied
after any placement it already has), exact when that motion is
(as PathPiece::placed).
Sourcepub fn offset(offset: StationOffset<'c>) -> Result<StationPiece<'c>, GeomError>
pub fn offset(offset: StationOffset<'c>) -> Result<StationPiece<'c>, GeomError>
The whole of an offset (#289): [0, L], L its own length.
§Errors
The offset’s refusals (a collapse, a cusp, a self-crossing), by name.
Sourcepub fn from_path_piece(
piece: &'c PathPiece,
) -> Result<StationPiece<'c>, GeomError>
pub fn from_path_piece( piece: &'c PathPiece, ) -> Result<StationPiece<'c>, GeomError>
The station piece of a path piece: its span checked against its
curve as Self::between checks it, then reversed and placed as
the path piece is. An open end (PathPiece::open_end, #298) is
resolved first to where the curve ends by this evaluator’s own
length, the end Self::whole reads (see the
module documentation). A bound at a parameter
or a point (PathPiece::start_bound, PathPiece::end_bound,
#304) is resolved to the curve’s parameter there
(StationCurve::parameter_at_bound) and that to its measure: a
piece bounded at both ends is Self::between_parameters (see the
module documentation).
§Errors
As Self::between and Self::between_parameters, an open end on
a curve with no bounded length, an end both open and bounded, a
bound’s refusals (StationCurve::parameter_at_bound), and a piece
kind this evaluator does not know, by name.
Sourcepub fn native_span(&self) -> Result<(f64, f64), GeomError>
pub fn native_span(&self) -> Result<(f64, f64), GeomError>
The native parameters t0 < t1 the kernel reads at the piece’s
start and end measures, the ones a point read inside the piece is
evaluated at: m / |d| on a line, m / r on a circle (past 2 pi
where the piece crosses its seam), m on a curve parameterised by
its measure, and on a polyline, an ellipse or a B-spline the
arc-length inverse from the curve’s start (a closed ellipse past its
length: 2 pi plus the inverse of the measure less the length). A
graph compiler that flattens the curve between them lands on the
points CompositeBasis::section_on reads at the same distances.
§Errors
An offset piece (it takes its basis’s parameter, not its own length), an elevated or banked curve (it is measured in plan distance), and the quadratures’ refusals, by name.
Sourcepub fn convention(&self) -> DistanceConvention
pub fn convention(&self) -> DistanceConvention
The distance convention the piece is measured in.
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 (as PathPiece::frame_is_exact).
Sourcepub fn section_on(
&self,
u: f64,
side: SeamSide,
) -> Result<SectionFrame, GeomError>
pub fn section_on( &self, u: f64, side: SeamSide, ) -> Result<SectionFrame, GeomError>
The section frame at distance u into the piece, read from side
on a seam of its curve; at the piece’s own ends it is always read
from inside the piece.
§Errors
The curve evaluators’ refusals, and a plan-measured curve placed by
a motion that tilts +Z, by name.
Trait Implementations§
Source§impl<'c> Clone for StationPiece<'c>
impl<'c> Clone for StationPiece<'c>
Source§fn clone(&self) -> StationPiece<'c>
fn clone(&self) -> StationPiece<'c>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more