tolerance.forBox
The kernel’s default tolerance for an input of a given extent: the box diagonal × 1e-9.
Usage
Tolerance.forBox(box: BBox, angleRad?: number): ToleranceParameters
boxBBoxThe bounding box of the input (of all inputs, for an operation on several). Required. In model.
angleRadnumberAngle below which two directions count as parallel; the default is one degree (π / 180). Default
DEFAULT_ANGLE_TOLERANCE_RAD. In radians.
Returns
A tolerance with source: 'bbox' and absolute = BBox.diagonal(box) × 1e-9; 0 for an empty box or a single point (exact coincidence only).
Guarantees
- absolute equals BBox.diagonal(box) * 1e-9
- it scales with the model: a box scaled by s gives s × absolute (scale invariance)
- t.source === 'bbox'
Use instead
tolerance.resolve: a caller may have passed its own tolerance, which must win
Example
Tolerance.forBox(BBox.ofPoints([Point3.origin, Point3.of(3, 4, 0)])).absolute // → 5e-9