DEFAULT_GEOM_HASH_TOLERANCE

Constant DEFAULT_GEOM_HASH_TOLERANCE 

Source
pub const DEFAULT_GEOM_HASH_TOLERANCE: f64 = 1.0e-3;
Expand description

Default quantization grid in metres (1 mm). Chosen as a starting point near the f32 precision floor of RTC-local coordinates; tolerance_sweep only exercises a synthetic cube today; real-revision-pair calibration is still open (see that test’s doc comment).

Safety margin is narrower than the “near-origin” framing above suggests: measured f32 ULP is 9.77e-4 m (98% of this bucket) at both 8192 m and 10 km, only just under 1 mm before crossing it at 16384 m.

What it actually depends on is the largest absolute post-rebase coordinate staying under ~16384 m (where the f32 ULP crosses 1 mm) — an incidental dependency, not a designed one. Note that is a magnitude, not a span: a model centred on the origin can span ~32 km and still satisfy it, while one sitting 20 km out fails it however small it is. RTC re-centring makes the condition typical but does not guarantee it, in two ways worth stating rather than implying:

  • rtc_offset_from_translations takes the median element translation and returns (0,0,0) unless it exceeds LARGE_COORD_THRESHOLD_METERS. A model whose bulk sits near the origin but whose outlying elements sit on a national grid is therefore not re-centred at all, and those vertices are hashed from f32 world coordinates already past this bucket.
  • Even when the rebase does fire, the offset it subtracts is the median element translation, not the model’s centre. A model is therefore not centred on it, so an outlier can still land past 16384 m even when the overall span would have fitted had the rebase been centred.

So raising that threshold is not the only thing that would need this tolerance revisited; a far-flung or widely spread model reaches the same place without any constant changing.