1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//! The kernel's tolerances. Every geometric comparison uses one of these, or a value derived from
//! one in the place it is used; no module keeps a tolerance of its own.
/// Two points closer than this are the same point, in mm.
pub const LINEAR: f64 = 1e-7;
/// The largest model the tolerances are sized for, in mm.
pub const MODEL_SIZE: f64 = 1000.0;
/// Two directions closer than this are the same direction, in radians. A direction within it moves
/// a point at most [`LINEAR`] across a model of [`MODEL_SIZE`].
pub const ANGULAR: f64 = LINEAR / MODEL_SIZE;
/// The shortest stretch over which the kernel tells two surfaces that meet at a small angle apart
/// from two that touch, in mm.
pub const RESOLVED: f64 = 0.1;
/// The sine of the angle between two surfaces (or a ray and a surface) at or below which they are
/// tangent: they stay within [`LINEAR`] of each other for [`RESOLVED`] along their meeting.
pub const TANGENT: f64 = LINEAR / RESOLVED;
/// The parameter tolerance on a curve whose speed at the point is `speed` mm per unit parameter.
/// The distance within which two entities whose local tolerances are `a` and `b` coincide: the
/// sum of the two, less the one [`LINEAR`] two exact entities share, so that those still coincide
/// within [`LINEAR`]. Only imported vertices and edges, and a vertex a boolean places where two
/// solids graze, carry a tolerance above it.
/// `d <= t`, read with a few ulps of the coordinates' size at `at` to spare, so that what lies at
/// exactly a tolerance counts as within it however its coordinates round: a copy moved by exactly
/// [`LINEAR`] lies 1e-7 mm plus a few ulps away.