Skip to main content

CompositeBasis

Struct CompositeBasis 

Source
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>

Source

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.

Source

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.

Source

pub fn path(&self) -> CurvePath

The composite’s pieces as a neutral CurvePath (#290), their curves copied.

Source

pub fn pieces(&self) -> &[StationPiece<'c>]

The pieces, in order.

Source

pub fn frame_law(&self, tolerance: f64) -> Result<FrameLaw<'_, 'c>, GeomError>

Certified bounds on the frame law along the composite (#316), its quadratures certified to tolerance (super::FrameLaw).

§Errors

A tolerance that is not finite and positive, by name.

Source

pub fn length(&self) -> f64

The total length in the composite’s station measure.

Source

pub fn convention(&self) -> DistanceConvention

The convention every piece, and so the composite, is measured in.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn joint_intervals_within( &self, around: f64, window: f64, tolerance: f64, ) -> Result<Vec<(usize, DistanceInterval)>, GeomError>

The composite’s interior joints that can fall within window of around (#305): each with its index among the joints and the interval Self::joint_intervals gives it at tolerance, bitwise (the tolerance shared among the same pieces, summed in the same order), for every joint whose interval meets [around - window, around + window], edges included.

Only the pieces those joints lie after are certified. Every piece before the window is, since its length moves the joints after it. A joint is known to lie past the window, and no piece after it is read, once the certified lower end of the joint before it plus a certified lower bound of its piece’s length with no quadrature (the chord between its ends, in the plan where it is measured in plan) passes the window’s end. So a piece whose length cannot be certified does not refuse the query when it lies after the window, or across its end far enough that its chord carries its own end past it; before the window, or ending within reach of it, it refuses by name. A joint left out truly lies outside the window, and one whose interval lies inside it is returned.

§Errors

A tolerance that is not finite and positive, an around that is not finite or a window that is negative or not finite, by name; and as Self::joint_intervals, for the pieces before and within the window only.

Source

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.

Source

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>

Source§

fn clone(&self) -> CompositeBasis<'c>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'c> Debug for CompositeBasis<'c>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<'c> PartialEq for CompositeBasis<'c>

Source§

fn eq(&self, other: &CompositeBasis<'c>) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<'c> StructuralPartialEq for CompositeBasis<'c>

Auto Trait Implementations§

§

impl<'c> Freeze for CompositeBasis<'c>

§

impl<'c> RefUnwindSafe for CompositeBasis<'c>

§

impl<'c> Send for CompositeBasis<'c>

§

impl<'c> Sync for CompositeBasis<'c>

§

impl<'c> Unpin for CompositeBasis<'c>

§

impl<'c> UnsafeUnpin for CompositeBasis<'c>

§

impl<'c> UnwindSafe for CompositeBasis<'c>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.