pub fn cant_at(
segment: &CantSegment,
xi: f64,
rail_head_distance: Option<f64>,
) -> AlignmentResult<CantAtStation>Expand description
Evaluate a cant segment’s exact D(ξ) for both rails.
xi is the normalized position along the segment, 0.0 at
StartDistAlong and 1.0 at StartDistAlong + HorizontalLength, matching
the spec’s own ξ = s / L parameterization.
rail_head_distance is the parent IfcAlignmentCant.RailHeadDistance;
only VIENNESEBEND uses it, but every caller passes the parent’s declared
value so a caller building a chain cannot forget it for the one type that
needs it.
A VIENNESEBEND is evaluated for the section’s cant D = left - right
and its rails placed about a rotation point that stays put, or held on
a rail that keeps its height (see the module documentation). Here the
heights are compared to floating-point rounding
(SeamTolerance::strict);
CantLayout::cant_at_distance
compares them at the model’s declared precision, as the banked lowering
does.
§Errors
AlignmentError::InvalidSegmentforxioutside[0, 1], missing end values on a transition, aCONSTANTCANTwhose ends disagree, aVIENNESEBENDwithout a rail-head distance or with|D| > bat an end;AlignmentError::InvalidUnitsfor a non-positive rail-head distance;AlignmentError::Unsupportedfor a type with no base formula, and inside aVIENNESEBENDwhose rotation point moves with neither rail held.