Skip to main content

Module chain

Module chain 

Source
Expand description

Evaluation of arc-length chains (Chain2).

A chain’s parameter is cumulative arc length. Each piece is evaluated in its own local frame and placed rigidly at the end of the one before it, so reading a point resolves every earlier piece’s end first:

§Accuracy contract

A point at distance s is the exact chain’s point at a distance within ARC_LENGTH_TOLERANCE * max(1, piece length) of s on each parametric piece it crosses, and within the intrinsic quadrature’s accuracy on each intrinsic piece (machine precision on the closed forms it is pinned against, ADR 0060). The tangent is the exact unit tangent at that point: a parametric curve’s derivative or an intrinsic piece’s closed-form heading. Positions after a parametric piece carry its end error, rotated by the remaining placement; nothing is re-fitted.

§Refused by name

A malformed chain (no pieces, a non-finite or degenerate start frame, a non-finite or non-positive length, a malformed curvature law), a parametric piece that does not start at its local origin with tangent +x within PIECE_FRAME_TOLERANCE, a piece longer than its curve (named with the arc length available), and a distance outside [0, length].

Constants§

PIECE_FRAME_TOLERANCE
How far a parametric piece’s curve may sit from its local frame at its start parameter: PIECE_FRAME_TOLERANCE * max(1, length) from the origin, and PIECE_FRAME_TOLERANCE radians from +x.

Functions§

chain_certifies
Whether crate::curve::flatten2 certifies a chain’s chords: every intrinsic piece’s curvature is bounded and every parametric piece’s curve is a line, a circle, an ellipse or a B-spline with no corner anywhere in its domain (#232, #438).
chain_chord_bound
Certified bound on the distance from a chain over arc lengths [a, b] inside one piece to the chord joining its evaluated ends (#232, #438); None across a join, for a span outside the chain, a piece whose curve has no certified bound, a chain no ChainPositionTable covers, or a chain that does not evaluate.
chain_point
Point on a chain at arc length s from its start. See the module documentation for the accuracy contract and refusals.
chain_tangent
Unit tangent of a chain at arc length s (unit when the start frame is orthonormal; a skewed frame maps it as it maps an intrinsic curve’s).