Skip to main content

Module path

Module path 

Source
Expand description

Pieces of curves laid end to end: the neutral form of a curve relation a distance runs along (#285, #290, ADR 0082).

A composite curve, a trim of one, and a run of segments each placed at a station of another curve are graph relations in axiolid-model. A reader that measures a distance along them – a station, a point or a frame at a distance – does not need the graph: it needs the spans of atomic curves the relation runs along, in order, each read forwards or backwards and carried by a rigid placement. CurvePath is that list, and PathPiece one entry of it. It owns its curves: this crate is part of the geometry data plane, whose values carry no borrowed references so that a native backend can copy them across an FFI boundary.

This module holds data and its structural composition only (reversing a path, placing it, joining paths). It measures nothing: where a span lies on its curve, whether consecutive pieces meet and which distance runs through them are read by an evaluator (axiolid-evaluate’s CompositeBasis, through the curve-evaluation contract’s path_* queries), which refuses a path it cannot measure by name. A graph compiler flattens a relation into a path (axiolid-mesh-compile’s station::curve_path).

§Reading a piece

A piece is the span [start, end] of its curve in that curve’s station measure from its start: plan distance on an elevated or banked curve, arc length on every other curve (a 2D curve lying in z = 0). A reversed piece is that span read from end to start; a placed piece is its curve carried by the rigid motion placement. The path’s distance runs end to end through its pieces, each in its own measure. The rules an evaluator applies (joints as seams read by their SeamSide, the common convention, exactness) are ADR 0082’s.

§Open ends (#298)

A caller cannot always state where a span ends: the length of an offset beside a gradient curve, a clothoid or a B-spline, and of a B-spline itself, has no closed form. A piece may therefore run to its curve’s end without stating it (PathPiece::to_end, PathPiece::whole): its open_end is set and its end holds Scalar::INFINITY, which nothing reads. The evaluator resolves the end with its own length of the curve, the number it would measure the whole curve by: exact where the length is read from stored data, its numerical estimate otherwise, so the joints after it fall where its certified joint distances say. On an unbounded line the end is its parameter domain’s, origin + direction, as inside a composite. A span from the curve’s start needs no open start, since the station measure starts there at 0 (PathPiece::from_start). Until an evaluator has resolved it, an open piece has no length here: PathPiece::length and CurvePath::length are infinite.

§Bounds at a parameter or a point (#304)

A trim of an ellipse or a B-spline at an interior native parameter, or at a point, has a station-measure distance that is itself a quadrature, so a caller without a provider cannot state it either. A piece’s start and end may therefore be given as a PathBound (PathPiece::between_parameters, PathPiece::bounded, PathPiece::with_start, PathPiece::with_end): a native parameter of the curve, or a point on it in the curve’s own coordinates (before the piece’s placement; a 2D curve’s points lie in z = 0). The bound is held in start_bound or end_bound, and the stated start or end beside it holds an infinity, which nothing reads. The evaluator resolves a point to the one parameter naming it, refusing a point off the curve or one several parameters name, and a parameter to its distance in the station measure: exact where the curve’s arc length to it is read from stored data, the same numerical estimate a piece between parameters is measured by otherwise. As both ends lie in the curve’s direction, a reversed piece is bounded as a forward one is. Until an evaluator has resolved them, a bounded piece has no length here, as an open one has none.

§Exactness

A frame read on a piece is exact, rounding aside, only on a line placed, if at all, exactly (PathPiece::frame_is_exact); on a path, only where every piece up to and including the one read is.

§Offsets (#289)

A piece may be an offset of another piece (PathCurve::Offset): the curve beside a base piece at the displacement its OffsetLaw gives in the base’s frame, measured in its OWN length from the base piece’s start (its own plan length where the base is plan-measured). The base is one span of an atomic curve, not itself an offset, with no seam of its curve inside it: an offset of a curve with seams is several offset pieces, one per span between seams, which an evaluator joins as it joins any pieces (and refuses where they do not meet). An offset of a line by a constant law is a line (PathCurve::is_line); the other rules (closed forms, collapse and cusp refusals) are ADR 0082’s.

§Growth

PathCurve, PathPiece, PathBound, PathOffset and OffsetLaw are #[non_exhaustive]: a later piece kind is a new variant an evaluator that does not know it refuses by name.

Structs§

CurvePath
Pieces of curves laid end to end, in the order the path runs; see the module documentation.
PathOffset
An offset of a base piece (#289); see the module documentation.
PathOffsets
The displacement of an offset at one place, in its base’s frame: lateral to the left, vertical along up, longitudinal along the tangent (ADR 0082’s station offsets).
PathPiece
One piece of a CurvePath: the span [start, end] of a curve in its station measure, traversed forwards or backwards, optionally carried by a rigid placement; see the module documentation.

Enums§

OffsetFrame
Which frame of the base an OffsetLaw::Linear displacement is read in: ADR 0082’s station frames.
OffsetLaw
How far, and which way, an offset lies from its base piece.
PathBound
Where a PathPiece starts or ends when its distance is not stated (#304): the evaluator resolves it to a distance in the curve’s station measure; see the module documentation.
PathCurve
The curve under a PathPiece.