Skip to main content

ifc_alignment/
lib.rs

1//! `ifc-alignment` -- Linear referencing and alignment -- the IFC4x3 civil layer.
2//!
3//!
4//! IFC4x3 adds 14 alignment entities plus spiral curve types (`IfcClothoid`,
5//! `IfcCosineSpiral`). Isolated in its own crate because building-only
6//! consumers should never compile spiral curve laws.
7//!
8//! # Module map
9//!
10//! | Module | Role |
11//! |---|---|
12//! | `horizontal` | Horizontal segments: line, arc, spiral transitions |
13//! | `vertical` | Vertical segments: grades and parabolic curves |
14//! | `cant` | Superelevation (`IfcAlignmentCant`) for rail |
15//! | `referent` | `IfcReferent` stationing and chainage |
16//! | `view` | The IFC4X3 profile pin and the `IfcAlignment` hierarchy |
17//! | `placement` | `IfcLinearPlacement` and distance expressions |
18//! | `error` | Why an alignment operation failed |
19//!
20//! Horizontal lines, circular arcs and transition spirals lower to exact
21//! neutral curve graphs; a spiral is stored as its curvature law
22//! (`Curve2::Intrinsic`), never integrated here, and a `CUBIC` as its cubic
23//! parabola trimmed by arc length. A whole layout is also one plan curve
24//! parameterised by distance along it (an intrinsic curve with a piecewise
25//! curvature law, or an arc-length chain when it holds a `CUBIC`), which is
26//! what an elevated 3D centreline carries. Vertical circular arcs are the
27//! circle itself, and cant makes the centreline a banked curve that rolls
28//! the section about its tangent. Families without an exact law are typed
29//! refusals, tracked in GitHub issues.
30
31pub mod authoring;
32mod cant;
33mod curve;
34mod error;
35mod horizontal;
36mod placement;
37mod referent;
38pub(crate) mod slot;
39mod vertical;
40mod view;
41
42pub use authoring::{
43    alignment, alignment_segment, axis2_placement_linear, cant_layout, cant_segment,
44    cartesian_point, horizontal_layout, horizontal_segment, linear_element, linear_placement,
45    linear_positioning_element, point_by_distance, referent, stationing, vertical_layout,
46    vertical_segment, CantSegmentDraft, HorizontalSegmentDraft, VerticalSegmentDraft,
47};
48pub use cant::{
49    cant_at, read_cant_segment, CantAtStation, CantFrame, CantLayout, CantSegment, CantSegmentType,
50};
51pub use curve::{
52    elevation_law, gradient_curve3, lower_gradient_curve, lower_horizontal_layout,
53    lower_horizontal_layout_partial, lower_horizontal_plan, lower_horizontal_segment,
54    lower_segmented_reference_curve, lower_vertical_segment, profile_law, profile_law_within,
55    segmented_reference_curve3, vertical_profile_law, HorizontalPlan, HorizontalSeam,
56    LoweredAlignmentCurve, PartialHorizontalLayout, RefusedSegment, SeamCheck, SeamTolerance,
57};
58pub use error::{AlignmentError, AlignmentResult, ProfileSeam};
59pub use horizontal::{
60    read_horizontal_segment, AlignmentUnits, HorizontalSegment, HorizontalSegmentType,
61};
62pub use placement::{
63    resolve_linear_placement, resolve_point_by_distance, CurveMeasure, LinearPlacement,
64    PointByDistance,
65};
66#[allow(deprecated)]
67pub use referent::station_equations;
68pub use referent::{StationEquation, Stationing, STATION_TOLERANCE};
69pub use vertical::{
70    read_vertical_segment, VerticalLayout, VerticalSeam, VerticalSeamKind, VerticalSegment,
71    VerticalSegmentType,
72};
73pub use view::{AlignmentHierarchy, AlignmentView};