Angles derive from the confusion tolerance and the geometry's extent
Every geometric decision is a distance decision against the confusion tolerance. Models are assumed to fit in a cube of side 1e5 model units centred on the origin (the model size), where an f64 coordinate is exact to about 1e-11, four orders of magnitude below the default confusion tolerance of 1e-7. Two directions are parallel, coplanar or coaxial for a configuration when turning one onto the other moves the geometry involved by at most the confusion tolerance: an angle below confusion / extent, the extent being how far that geometry reaches from the pivot of the turn. Unbounded geometry (lines, planes, cylinders, cones) is only ever the carrier of a finite part of a model, so the part that matters lies in the model's region; it reaches across the model, which gives the angular tolerance confusion / model size = 1e-12. The model size bounds the model, not each curve or surface: without such a bound the only consistent angular tolerance would be zero, since any two distinct directions eventually move infinite geometry apart by more than the confusion tolerance. Where a trimmed curve bounds the part in use, its own extent is the lever arm. A turn about a point inside the cube can reach up to its diagonal, √3 times its side; the angular tolerance ignores that factor, small against the four orders of magnitude between the f64 resolution and the confusion tolerance. The angular tolerance also guards dimensionless numbers, such as a normalized coefficient near zero, which are not geometric decisions.
A fixed angular tolerance applied to bounded geometry made the decision depend on where the geometry could have been rather than where it is: two circles of radius 10 whose normals differ by 1e-10 are 1e-9 apart, well within the confusion tolerance, yet were treated as non-coplanar and sent to the general solvers at their most poorly conditioned inputs. Deriving the angle from the extent makes "parallel" and "coincident" agree everywhere in the model.
Discretizations follow the same rule: a chord deviation below the confusion tolerance is rejected, since a segment that close to the curve already lies on it.
Considered options
- A fixed angular tolerance everywhere (the previous behaviour): rejected for the inconsistency above. It is right only for geometry spanning the model.
- A looser fixed angular tolerance (1e-10, as for a 1e3 model): rejected. It treats as parallel two planes that, across a larger model, are visibly apart, and it still ignores the extent of small geometry.
- A model size carried in
Tolerance: not now. The angular tolerance already encodes it (confusion / model size), and no caller needs another size yet. - Relative tolerances (scaled by each shape's size): rejected. Points shared between shapes of different sizes, such as a vertex where a small circle meets a large plane, must coincide by one absolute distance.