pub struct AlignmentCurve { /* private fields */ }Expand description
Parsed alignment curve. Holds horizontal and vertical segments in authored order with cumulative-start stations precomputed.
Implementations§
Source§impl AlignmentCurve
impl AlignmentCurve
Sourcepub fn parse(
directrix: &DecodedEntity,
decoder: &mut EntityDecoder<'_>,
) -> Result<Option<Self>>
pub fn parse( directrix: &DecodedEntity, decoder: &mut EntityDecoder<'_>, ) -> Result<Option<Self>>
Parse IfcAlignmentCurve (or any directrix we can reduce to a
piecewise alignment). Recognised cases:
IfcAlignmentCurve— horizontal + (optional) vertical parsing.IfcPolyline— synthesised as a chain of line segments. Each polyline edge becomes oneHSeg::Line(in XY) and oneVSeg::Line(with gradient = dz / horizontal length). This covers the relatively rare case of a sectioned-solid authored with a polyline directrix, which is spec-allowed but uncommon.
Returns Ok(None) for any other directrix so the caller can
fall back to a straight-line sweep. Errors only on malformed
recognised input (e.g. an IfcAlignmentCurve missing
Horizontal).
Sourcepub fn horizontal_length(&self) -> f64
pub fn horizontal_length(&self) -> f64
Total length of the horizontal alignment (sum of segment lengths).
Sourcepub fn evaluate(&self, station: f64) -> AlignmentFrame
pub fn evaluate(&self, station: f64) -> AlignmentFrame
Evaluate the placement frame at the given station (cumulative distance along the horizontal alignment, in file length units). Extrapolates linearly past either end.
Sourcepub fn cant_angle(&self, _station: f64) -> f64
pub fn cant_angle(&self, _station: f64) -> f64
Cant (roll about the 3D tangent) at the given station, in
radians. Stable stub that always returns 0: the parser does not
traverse the off-axis IfcAlignment2DCant relationship, so no
cant is ever authored on the curve. Kept as the seam the
SectionedSolidHorizontalProcessor reads (its cross-section roll
step is a no-op while this returns 0) so cant can be wired later
without touching the processor.
Auto Trait Implementations§
impl Freeze for AlignmentCurve
impl RefUnwindSafe for AlignmentCurve
impl Send for AlignmentCurve
impl Sync for AlignmentCurve
impl Unpin for AlignmentCurve
impl UnsafeUnpin for AlignmentCurve
impl UnwindSafe for AlignmentCurve
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
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.