#[non_exhaustive]pub enum DistanceConvention {
ArcLength3d,
PlanDistance,
Unsupported,
}Expand description
Which distance a CurveEvaluator measures.
Naming this is not bureaucracy. For a Curve3::Elevated the plan
distance and the true 3D arc length differ by sqrt(1 + grade^2), so a
caller that assumes the wrong one misplaces a structure by 0.125 m per
100 m at a 5% grade and 0.5 m per 100 m at 10%. A silent mismatch is
exactly the failure this contract exists to prevent, so the convention
is part of the contract rather than provider trivia.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
ArcLength3d
True arc length along the 3D curve.
Distance d advances d metres along the curve as built.
PlanDistance
Distance along the horizontal projection.
This is how an alignment is authored: both the plan and the vertical profile are functions of plan distance, and a station written on a drawing is a plan distance. It is NOT the distance a wheel travels, which is longer by the grade factor.
Unsupported
This provider cannot recover a distance for this curve.
Reported rather than approximated: an ellipse needs elliptic integrals and a B-spline needs numeric inversion, and returning the native parameter as though it were a distance would be a lie a caller cannot detect.
Implementations§
Source§impl DistanceConvention
impl DistanceConvention
Sourcepub fn is_supported(self) -> bool
pub fn is_supported(self) -> bool
Whether a distance can be evaluated at all.
Trait Implementations§
Source§impl Clone for DistanceConvention
impl Clone for DistanceConvention
Source§fn clone(&self) -> DistanceConvention
fn clone(&self) -> DistanceConvention
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for DistanceConvention
Source§impl Debug for DistanceConvention
impl Debug for DistanceConvention
impl Eq for DistanceConvention
Source§impl Hash for DistanceConvention
impl Hash for DistanceConvention
Source§impl PartialEq for DistanceConvention
impl PartialEq for DistanceConvention
impl StructuralPartialEq for DistanceConvention
Auto Trait Implementations§
impl Freeze for DistanceConvention
impl RefUnwindSafe for DistanceConvention
impl Send for DistanceConvention
impl Sync for DistanceConvention
impl Unpin for DistanceConvention
impl UnsafeUnpin for DistanceConvention
impl UnwindSafe for DistanceConvention
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