Module curve

Source
Expand description

Analytic and spline evaluation moved to the focused axiolid-evaluate package (ADR 0036). Re-exported unchanged so existing axiolid_reference::curve::* and ::surface::* callers are unaffected. Scalar reference implementation of curve evaluation (ADR 0012).

§What this closes

axiolid-curve declares Curve2/Curve3 and a CurveEvaluator trait. Until now nothing in the workspace implemented that trait, so every declared curve family was inert data. axiolid-mesh-compile worked around this with its own private circle flattener and refused ellipses and B-splines outright.

§Design

Evaluation is analytic per family, never a generic subdivision fallback:

  • Line – origin + t * direction, exact.
  • Circle – origin + r*(cos t * x + sin t * y), t in radians.
  • Ellipse – same with independent semi-axes. Note t is the parametric angle, not the polar angle; they differ except on axis.
  • Polyline – t in [0, n), integer part selects the segment. Chosen over arc-length parameterization because it is exact and stable under degenerate (zero-length) segments, which imported data contains.
  • BSpline – de Boor. Rational curves evaluate in homogeneous space and project, which is the only way to get correct rational derivatives.

Derivatives are closed-form. A finite-difference derivative would make the curvature oracle in tests/curve.rs self-referential: it would be checking a difference quotient against a difference quotient.

§Frames are used as given

Imported frames may be non-orthonormal. Evaluation applies the frame axes as written rather than orthonormalizing, so a caller sees the geometry its source actually declared. Validation is a separate concern (axiolid-heal).

Structs§

CurveJet
Position and the first two parameter derivatives of a curve.
ScalarCurve
Portable scalar curve evaluator.

Functions§

bspline_jet2
Second-order differential jet of a 2D curve.
bspline_jet3
Second-order differential jet of a 3D curve.
derivative2
First derivative of a 2D curve.
derivative3
First derivative of a 3D curve.
domain2
Domain of a 2D curve.
domain3
Domain of a 3D curve.
evaluate2
Position on a 2D curve.
evaluate3
Position on a 3D curve.
flatten2
Flatten a 2D curve over domain so the chord never deviates from the true curve by more than chord_tolerance.
flatten3
Flatten a 3D curve to a polyline within chord_tolerance.
invert2
Parameter naming point on a 2D curve, or a refusal.
invert3
Parameter naming point on a 3D curve, or a refusal.
jet2
Second-order differential jet of a 2D curve.
jet3
Second-order differential jet of a 3D curve.
locate2
Parameter of a point on a 2D curve, iterating where no closed form exists. See locate3.
locate3
Parameter of a point on a 3D curve, iterating where no closed form exists: invert3 first, and for a B-spline the nearest of 64 samples per span refined by Newton on |C(t) - p|^2. The answer must reproduce the point within tolerance, as invert3’s must.
second_derivative2
Second derivative of a 2D curve with respect to its native parameter.
second_derivative3
Second derivative of a 3D curve with respect to its native parameter.