Expand description
The tolerance catalogue (F2c, #7774, charter #7670): every named numeric tolerance the geometry stack shares, with the unit it is measured in and why it has that value.
§Contract
- Values here are the values the code shipped with. F2c is a refactor: each constant is the literal it replaced, bit for bit. Where two sites used different values for what looks like one concept, there are two constants (see “Open policy questions” below), not a silent unification.
- Every constant states its unit. The unit tags are:
- model units: the IFC file’s length unit (mm in a mm-authored file, m in a metre file). A constant in model units means a different physical distance per file. These are the scale-dependent tolerances C3 reviews.
- metres: a physical distance, applied to data already scaled to metres.
- dimensionless: a sine, cosine, ratio or parameter fraction.
- radians, relative (a fraction of a magnitude), ulps (a multiple of f32 or f64 rounding error).
- length^n: a power of model units (squared distance, determinant).
- Thresholds are still arguments in
super::v3andsuper::mat4. This module supplies the names callers pass.
§Open policy questions (for C3, no behaviour change here)
POINT_COINCIDENT_EPS(1e-9) andCURVE_JUNCTION_EPS(1e-6) both answer “are these two profile or curve points the same point”, in model units. A 1e-9 model-unit gap is 1 nm in a metre file and 1 pm in a mm file, a few ulps of f64 at 1 km coordinates (about 0.2 pm), so large-coordinate files can miss coincidences. C3 decides whether these become metres (scaled bylength_unit_scale) or relative to the coordinate magnitude.PARAM_END_MARGINis an absolute curve-parameter clamp, so a span narrower than 1e-6 collapses to its start. C3 decides whether it becomes relative tot_max - t_min.PARTIAL_VOID_EPSandMIN_PROFILE_DIMENSIONare 1e-3 model units but are written (and were commented) as 1 mm: a micrometre in a mm file. C3 decides whether they takelength_unit_scale.- The
clashcrate keeps its own copies ofF32_ULP_SCALEandMIN_SIN_THETA(D21: clash does not depend on geometry). A test intol_testsreads clash’s source and fails if either value moves. - Deliberately not here: tolerances local to one algorithm that are already
named and documented where they apply (
plane_eps,near_band, the boolean kernel’s exact-arithmetic thresholds). Moving them would separate a value from the proof that justifies it.
Constants§
- ANGLE_
EPS - Angles closer than this are the same angle when deduplicating arc breakpoints, and a span within this of 0 or tau is degenerate or full. Unit: radians.
- ARC_
COINCIDENT_ REL - Arc end points closer than this fraction of
max(radius, 1)are coincident, so the arc is a full circle. Unit: relative. - ARC_
SWEEP_ MIN - A counter-clockwise arc sweep below this is zero (and promoted to a full circle when the end points coincide). Unit: radians.
- AXIS_
MIN_ LEN - Smallest placement axis (
IfcAxis2PlacementAxis/RefDirection after projection) accepted as a direction. Unit: dimensionless (axes are unit vectors, possibly authored with a few decimals). Coarser thanDIRECTION_MIN_LENbecause authored axes carry authoring noise. - BASIS_
EPS - A B-spline basis value or knot-span denominator below this is zero. Unit: dimensionless.
- CHORD_
TOL_ M - Absolute chord deviation budget when tessellating an arc: 0.5 mm. Unit: metres. It is a physical budget, so it is only correct on data already in metres.
- COARSE_
DIRECTION_ MIN_ LEN - Smallest accumulated direction accepted as a unit vector: an axis left after projecting it onto a plane, or a vertex normal summed from adjacent face normals. Unit: dimensionless (sums of unit vectors). Coarse on purpose: a near-cancelling sum has a direction that is mostly rounding noise.
- CURVE_
JUNCTION_ EPS - First and last point of a swept curve closer than this per axis close the
loop. Unit: model units. Coarser than
POINT_COINCIDENT_EPSbecause the two ends come from independently evaluated parametrisations. - DIRECTION_
MIN_ LEN - Smallest vector treated as a direction. Unit: the input’s units (a unit direction, a point difference in model units, or a cross product of two unit axes). 1e-12 sits about four orders above the f64 rounding error of a unit-scale cross product, so a refused vector really is degenerate.
- EDGE_
CROSS_ MIN_ LEN - Smallest vector accepted as a facet or edge normal: the cross product of two polygon edges, or a 2D edge or radial vector in profile units. Unit: model units (length^2 for the edge cross product).
- EXTRUSION_
AXIS_ COMPONENT_ EPS - An extrusion direction component below this is zero (the extrusion is along local Z). Unit: dimensionless.
- F32_
HALF_ ULP_ REL - Half a unit in the last place of an f32, relative:
2^-24. Unit: relative (ulps). The worst-case error of rounding one coordinate to f32. - F32_
ULP_ 8 - Eight f32 ULPs, relative:
2^-20. Unit: relative (ulps). The budget for a world-space position recomposed through a handful of float ops (instancing::verify), where drift beyond the stored precision is a few ULPs. - F32_
ULP_ REL - One f32 ULP at magnitude 1, relative:
2^-23(f32::EPSILON). Unit: relative (ulps). - F32_
ULP_ SCALE - The worst-case f32 ULP for a coordinate of magnitude 2 or more:
2^-22(the true ULP in[2, 4), growing for larger magnitudes). Unit: relative (ulps). The multiplier of anextentor|v|that gives an absolute noise tolerance in the same units as that magnitude, for quantities derived from f32-stored vertices. - IDENTITY_
EPS |a - b|below this in every element means “same matrix entry” when testing a placement for identity. Unit: dimensionless for rotation entries, model units for the translation column.- IDENTITY_
EPS_ STRICT - The strict variant used for representation-map origins, where an
identity result drops the transform entirely. Unit: as
IDENTITY_EPS. - LENGTH_
ZERO_ EPS - A radius, segment or span at or below this is zero length. Unit: model units.
- MIN_
PROFILE_ DIMENSION - Smallest profile width or height that extrudes. Unit: model units, commented as 1 mm (see the open policy questions).
- MIN_
SIN_ THETA - Two edge vectors with
sin(theta)below this are collinear, so their cross product defines no plane. Unit: dimensionless (a sine, 1e-3 is about 0.06 degrees). Scale-free, unlike an absolute cross-product floor. - NORMALIZE_
NONZERO normalize(v, min_len)with this threshold refuses only an exactly zero (or non-finite) vector. Unit: the input vector’s own units. Used where the caller has already established the vector is a difference of distinct points and wants every non-zero direction.- ORTHO_
EPS - Two unit axes are treated as orthogonal when
|dot|is at most this, and as the same axis whendot > 1 - this. Unit: dimensionless (a cosine, 1e-4 is about 0.6 degrees). - PARALLEL_
EPS - Two directions whose cross product is shorter than this are parallel.
Unit: dimensionless for the unit directions of
structural_edge(the sine of the angle); length^2 for the unnormalised 2D edge vectors ofgeom2d::line_intersection, whose determinant is compared directly. - PARAM_
END_ MARGIN - The last sampled parameter stays this far inside the span end so the evaluator never reads on the closing knot. Unit: absolute curve parameter units (not relative to the span; see the open policy questions).
- PARAM_
EPS - A curve parameter within this of a span end is at that end. Unit: dimensionless (a fraction of the span, or radians on a circle).
- PARTIAL_
VOID_ EPS - A void extending to within this of an extrusion’s start or end face is a through-void. Unit: model units, written as 1 mm (see the open policy questions).
- PLACEMENT_
2D_ EPS - An
IfcAxis2Placement2Dprofile placement whose location components and direction deviate from the identity by less than this is skipped, and a direction-ratio vector shorter than this falls back to +X. Unit: model units for the location, dimensionless for the direction. - POINT_
COINCIDENT_ EPS - Two consecutive profile or curve points closer than this (per axis, or in norm) are the same point and the second is dropped. Unit: model units.
- RETAINED_
ARC_ INTERVAL_ EPS_ RAD - Circular-interval endpoint margin at zero and one full turn. Unit: radians.
- RETAINED_
BOUNDARY_ JOIN_ EPS_ M - Absolute join distance for consecutive derived retained boundary endpoints. Unit: metres. Independent trigonometric evaluation may introduce roundoff.
- RETAINED_
CIRCLE_ BASIS_ EPS - Circular X-axis length deviation from unity. Unit: dimensionless.
- RETAINED_
MIN_ LENGTH_ M - Smallest admitted retained line length, circle radius or sweep thickness normal to the profile. Unit: metres. Floor of the retained request domain.
- RETAINED_
RECTANGLE_ EDGE_ EPS_ M - Maximum component mismatch between opposite parameterized rectangle edges. Unit: metres. Kept separate from minimum feature size: this checks closure of the derived rectangle that selects the rectangle qualification.
- RETAINED_
RIGID_ DOT_ EPS - Dot-product deviation of source placement axes from an orthonormal frame. Unit: dimensionless. Retained requests accept rigid placements only.
- RETAINED_
TWICE_ AREA_ EPS_ M2 - Absolute floor in twice-area checks and their source/derived agreement budget. Unit: metres squared (on twice signed area, not ordinary area).
- RETAINED_
TWICE_ AREA_ REL - Relative source/derived twice-area agreement budget. Unit: relative. Added to the separate absolute twice-area floor.
- SAMPLE_
COINCIDENT_ SQ - Squared distance below which two sampled curve points coincide (1e-6 model units). Unit: length^2.
- SAMPLE_
END_ COINCIDENT_ SQ - Squared distance below which a sampled curve’s last point already is its end (1e-9 model units). Unit: length^2.
- SEAM_
EPS - Two consecutive composite-curve segment end points closer than this (per axis) are the same joint and the repeat is dropped. Unit: model units.
- SINGULAR_
DET_ EPS - A 3x3 affine determinant below this is singular. Unit: dimensionless
(placement chains carry the unit scale in the translation only, so the
linear block is a rotation times an
IfcCartesianTransformationOperatorscale). 1e-18 is a uniform operator scale of 1e-6 per axis; the corpus minimum is 1e-3 (det 1e-9). D22: one value for glTF, the demesher and everyaffine_inverse. - TRIM_
SPAN_ MIN - A trim span of at most this is empty and falls back to the full domain. Unit: curve parameter units.