pub struct CompositeBasis<'c> { /* private fields */ }Expand description
Pieces of curves laid end to end as one station basis; see the module documentation.
Implementations§
Source§impl<'c> CompositeBasis<'c>
impl<'c> CompositeBasis<'c>
Sourcepub fn new(
pieces: Vec<StationPiece<'c>>,
) -> Result<CompositeBasis<'c>, GeomError>
pub fn new( pieces: Vec<StationPiece<'c>>, ) -> Result<CompositeBasis<'c>, GeomError>
The composite of pieces, in order.
§Errors
No pieces, a piece with no length, pieces measured in different conventions, and a joint whose pieces do not meet (a reversed piece or a gap), each by name; and the evaluators’ refusals reading the joints’ points.
Sourcepub fn from_path(path: &'c CurvePath) -> Result<CompositeBasis<'c>, GeomError>
pub fn from_path(path: &'c CurvePath) -> Result<CompositeBasis<'c>, GeomError>
The composite along path (#290), its curves borrowed from it: each
piece checked against its curve (StationPiece::from_path_piece),
then measured as Self::new measures them.
§Errors
As StationPiece::from_path_piece for each piece, naming its
index, and as Self::new.
Sourcepub fn path(&self) -> CurvePath
pub fn path(&self) -> CurvePath
The composite’s pieces as a neutral CurvePath (#290), their
curves copied.
Sourcepub fn pieces(&self) -> &[StationPiece<'c>]
pub fn pieces(&self) -> &[StationPiece<'c>]
The pieces, in order.
Sourcepub fn convention(&self) -> DistanceConvention
pub fn convention(&self) -> DistanceConvention
The convention every piece, and so the composite, is measured in.
Sourcepub fn section_on(
&self,
distance: f64,
side: SeamSide,
) -> Result<SectionFrame, GeomError>
pub fn section_on( &self, distance: f64, side: SeamSide, ) -> Result<SectionFrame, GeomError>
The section frame at distance along the composite, read from
side on a joint or a seam inside a piece; see the
module documentation.
§Errors
A distance that is not finite, negative or beyond the composite’s length (by more than the arc-length tolerance), and the piece’s refusals, by name.
Sourcepub fn frame_is_exact_at(&self, distance: f64, side: SeamSide) -> bool
pub fn frame_is_exact_at(&self, distance: f64, side: SeamSide) -> bool
Whether the frame at distance, read from side, is exact: every
piece up to and including the one it is read on is
(StationPiece::frame_is_exact). false for a distance outside
the composite.
Sourcepub fn seams(&self) -> Result<Vec<StationSeam>, GeomError>
pub fn seams(&self) -> Result<Vec<StationSeam>, GeomError>
The composite’s seams: every interior joint (never smooth) and the seams of each piece’s curve strictly inside the piece, at their distance along the composite, which is also the parameter reported. A seam’s distance is exact when every piece before it, and its own seam, is measured from stored data alone (not an ellipse or a B-spline).
§Errors
The seam readers’ refusals.
Sourcepub fn exact_seams(&self) -> Result<Vec<StationSeam>, GeomError>
pub fn exact_seams(&self) -> Result<Vec<StationSeam>, GeomError>
Self::seams, every one exact or refused.
§Errors
As Self::seams, and GeomError::UnsupportedInput for a seam
whose distance needs a quadrature: one after an ellipse or a
B-spline piece, or a B-spline’s corner knot.
Sourcepub fn joint_intervals(
&self,
tolerance: f64,
) -> Result<Vec<DistanceInterval>, GeomError>
pub fn joint_intervals( &self, tolerance: f64, ) -> Result<Vec<DistanceInterval>, GeomError>
Where the composite’s interior joints truly lie (#294): for each
joint, in order, a DistanceInterval containing the sum of the
true lengths of the pieces before it, each between the points read
as its ends, no wider than tolerance. A sum of lengths read from
stored data is a point interval; see super::certify for how a
numerical length is bounded.
§Errors
A tolerance that is not finite and positive, a piece whose length
cannot be certified (super::certify::UNCERTIFIED_LENGTH) or not
within the panel budget, and the evaluators’ refusals, by name.
Sourcepub fn snapped_distance(
&self,
distance: f64,
window: f64,
) -> Result<f64, GeomError>
pub fn snapped_distance( &self, distance: f64, window: f64, ) -> Result<f64, GeomError>
The distance a station at distance with the seam-snapping
window is read at along the composite (#294): the joint’s or
seam’s own distance when exactly one lies within the window, else
distance; see super::window.
§Errors
A negative or non-finite window, two seams within it
(super::window::SEAM_WINDOW_AMBIGUOUS), a seam straddling its
edge (super::window::SEAM_WINDOW_STRADDLED), and a seam whose
distance cannot be certified, by name.
Sourcepub fn pieces_between(
&self,
start: f64,
end: f64,
) -> Result<Vec<StationPiece<'c>>, GeomError>
pub fn pieces_between( &self, start: f64, end: f64, ) -> Result<Vec<StationPiece<'c>>, GeomError>
The pieces between distances start < end along the composite,
clipped: what a trim of the composite by its station measure keeps.
§Errors
A non-finite or empty interval, or one outside [0, L] beyond the
arc-length tolerance, by name.
Trait Implementations§
Source§impl<'c> Clone for CompositeBasis<'c>
impl<'c> Clone for CompositeBasis<'c>
Source§fn clone(&self) -> CompositeBasis<'c>
fn clone(&self) -> CompositeBasis<'c>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more