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— full horizontal + vertical + (optional) cant 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 with_cant_segments(self, segments: Vec<CantSegSpec>) -> Self
pub fn with_cant_segments(self, segments: Vec<CantSegSpec>) -> Self
Attach a pre-parsed cant profile. Used by callers that have
already located an IfcAlignment2DCant entity for this
alignment (e.g. via an IfcAlignment.AxisCant traversal). The
segments are taken in authored order with cumulative-station
indexing handled by cant_angle.
Sourcepub fn auto_attach_cant(
self,
content: &str,
decoder: &mut EntityDecoder<'_>,
) -> Result<Self>
pub fn auto_attach_cant( self, content: &str, decoder: &mut EntityDecoder<'_>, ) -> Result<Self>
Scan content for any IfcAlignment2DCant and attach the first
one found. This is a best-effort hook for callers that want the
auto-discovery convenience; in IFC4x1 the schema doesn’t
constrain how the cant is bound to the alignment, so picking
the first one is the only generic option. Files with multiple
alignments + cants should use with_cant_segments explicitly.
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. Returns 0 when no cant is authored.
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.