Skip to content

No exact 3D curve for a spiral with an elevation law, so an alignment centreline cannot be composed #105

Description

@GeneralPawz

Problem

Curve2 can carry a transition spiral exactly; Curve3 cannot.

pub enum Curve2 { Line, Circle, Ellipse, Polyline, BSpline, Intrinsic }
pub enum Curve3 { Line, Circle, Ellipse, Polyline, BSpline }

Curve2::Intrinsic holds a CurvatureLaw anchored to a start frame over
an arc length, so a clothoid, a Helmert curve and a sine-corrected
transition are all exact values rather than approximations. Curve3 has no
counterpart, and CurveRelation composes existing nodes (Composite,
Trimmed, Offset, SurfaceCurve, ParameterCurve) without offering a
way to combine a planar curve with an independent elevation law.

Why it matters

A road or rail centreline is authored as two independent laws: a planar
horizontal layout carrying the spirals, and a vertical profile giving
elevation as a function of distance along that plan. The 3D centreline is
their composition, and it is the curve every downstream question resolves
against.

With no exact 3D form, a consumer holding an exact Intrinsic2 plan plus an
exact vertical law has three options, and all three are bad:

  • approximate the spiral as a BSpline3, discarding the exactness the
    kernel deliberately preserves in 2D
  • keep plan and profile separate and make every consumer recompose them,
    which is the operation the graph exists to own
  • refuse, which is what we do today

The information is exact at the boundary and is being lost on the way in --
the same argument as #90.

Concretely, in ifc-alignment (IFC4x3): horizontal layouts lower to an
exact composite Curve2 today, including clothoid, Helmert and sine
families. Vertical segments lower separately. Nothing composes them, so
IfcGradientCurve and IfcSegmentedReferenceCurve are unimplemented, and
a product positioned along an alignment cannot be placed in space.

This is a representation gap, not a request for road semantics. What a
centreline means, what a station is, and whether a gradient is acceptable
all stay with the consumer.

Possible shapes

Not a prescription -- the kernel owns this choice:

  1. Curve3::Intrinsic -- a 3D natural-equation curve carrying curvature
    and torsion laws. Most general; also the largest change, and torsion is
    not what an alignment actually states.
  2. A CurveRelation variant composing an existing planar curve node with
    an elevation law along its arc length. Closer to how the data is
    authored, and reuses the exact 2D values already supported.
  3. An elevation law type usable with the existing Composite machinery.

Option 2 looks closest to the existing design, since CurveRelation
already composes rather than re-encodes, but that is a preference from the
consumer side, not a requirement.

Done when

  • a planar curve carrying an exact transition spiral can be combined with
    an elevation law into a single 3D curve value, without approximating
    either input
  • the composition survives a round trip through the graph
  • a point and a frame can be evaluated at a given distance along the
    composed curve
  • validation refuses a composition whose plan and elevation cover
    different arc-length domains, rather than silently clamping or
    extrapolating
  • the distinction between horizontal length, projected length and 3D length
    is preserved rather than collapsed

Verified against

crates/representations/analytic/curve/src/lib.rs on main at the time of
writing, and the v0.1.8 tag that openbimrs/ifc currently pins. The
Curve3 variant list is unchanged between the two.

Reported from openbimrs/ifc, where ifc-alignment is the blocked
consumer. Not urgent for us: alignment authoring does not depend on it, so
we are proceeding there and treating 3D composition as a typed refusal
until this lands.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

capabilityImplements an accepted capability (converted from a discussion)needs-triageFiled but not yet accepted, sized, or scheduled

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions