Expand description
Form as the standards define it: minimum-zone, maximum-inscribed and minimum-circumscribed fits.
A least-squares fit (plane, cylinder
and the rest) makes the squared distances least, and its residuals’
peak to peak is an upper bound on form. The form a tolerance limits is
a Chebyshev (minimax) zone: the narrowest pair of parallel planes,
concentric circles, coaxial cylinders or concentric spheres that holds
every point. Each minimum zone here starts from the least-squares fit
and is never wider than its peak to peak.
§Exact and certified
flatness,circularity,circumscribed_circleandinscribed_circleare exact: the global optimum, to rounding. The slab and the ring are found over a working subset of the points whose zone, tried in every configuration the optimum can take, is grown by the points outside it until it holds them all; the enclosing circle is Welzl’s; the empty circle stands on the points’ Voronoi diagram.sphericity,cylindricity,straightness,circumscribed_cylinderandinscribed_cylinderare not convex problems. They are settled by sequential linear programming in a trust region from the least-squares fit, which converges to a point where no first-order change of the parameters narrows the zone, andZone::optimalsays whether the result meets that test: the contacts’ gradients balance, so the zone is least within the confusion distance among shapes near it.
The fits run on the calling thread, in point order, and draw no randomness but a fixed sequence: the same points give the same answer bit for bit.
Structs§
- Zone
- A fitted zone.
Functions§
- circularity
- Circularity: the narrowest ring between two concentric circles holding every point. Exact.
- circumscribed_
circle - The smallest circle holding every point. Exact.
- circumscribed_
cylinder - The smallest cylinder holding every point, from the least-squares cylinder: a shaft’s functional size.
- cylindricity
- Cylindricity: the narrowest shell between two coaxial cylinders holding every point.
- flatness
- Flatness: the narrowest slab between two parallel planes holding every point. Exact.
- inscribed_
circle - The largest circle whose centre lies in the points’ convex hull and which holds none of them inside. Exact.
- inscribed_
cylinder - The largest cylinder holding no point inside, from the least-squares cylinder: a bore’s functional size.
- sphericity
- Sphericity: the narrowest shell between two concentric spheres holding every point.
- straightness
- Straightness of a line in space: the thinnest cylinder about a line holding every point, its axis and its diameter.