Skip to main content

Module canonical

Module canonical 

Source
Expand description

Canonical simplification: recognizing that exact geometry is secretly analytic: a B-spline surface that is a cylinder becomes the cylinder.

The input is exact geometry, not samples of unknown provenance: the decision is made against the surface’s own equation, sampled on its own chart, with its own normals. That is what separates this from reverse engineering: nothing is guessed about what the data means, only checked against a candidate the estimators propose. A candidate is accepted when every sample sits within the caller’s stated tolerance of it, and the certificate is the worst deviation actually measured; a surface that is genuinely free-form at that tolerance stays what it is.

Exchange formats routinely spell a cylinder out pointwise, and every algorithm downstream (intersection, blending, the boolean’s closed forms) is faster and exacter on the analytic carrier.

The estimators are classical: a plane is the mean normal; a sphere’s centre is where the normal lines meet, in least squares; a cylinder’s axis is the direction the normals avoid (their covariance’s smallest eigenvector), and a cone adds the linear taper of radius against height.

Structs§

CanonicalReport
A report of what was simplified, face by face.

Enums§

Simplified
What one face’s simplification found.

Functions§

canonical_simplify
Replace every free-form surface in shape that is secretly analytic, within tolerance, by the plane, cylinder, cone or sphere it is.
recognize_surface
The candidate the estimators propose, verified against every sample.