#[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 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more