Skip to main content

Module convert

Module convert 

Source
Expand description

Exact B-spline forms for the analytic curves.

Every curve here has a rational B-spline form that is exact: not a fit, not an approximation to a tolerance. A circle is a piecewise rational quadratic and lands on the circle at every parameter, which is the whole reason rational weights exist and why docs/PLAN.md calls them load-bearing rather than an optional extra.

§What conversion is for

Three things need it. Exchange formats describe free-form geometry and nothing else, so an exact circle has to become a NURBS to be written at all. A general affine transform (a shear, a non-uniform scale) carries a circle to an ellipse and an ellipse to something with no analytic name, but carries a NURBS to a NURBS by moving its control points, exactly. And an algorithm that only knows one representation can be given every shape in it.

§The parameter does not survive, and cannot

A circle’s parameter is its angle. Its rational quadratic form’s is not, and no reparameterization of a rational quadratic makes it one; the two are related by an arctangent. So conversion preserves the curve and not the parameterization, and every converted curve is handed back on [0, 1].

That is why this is a geometry operation rather than a topology one. An edge converted this way needs its range restated and each of its pcurves re-derived against a surface whose parameterization has also moved, and re-deriving a pcurve is a fit rather than a construction. See docs/PLAN.md.

Because the parameterization moves, an arc is built as an arc rather than built whole and trimmed: the span is what is converted, so the result covers exactly it.