Module clash_solid

Module clash_solid 

Source
Expand description

The intersection SOLID of a clashing pair — the overlap volume itself, as a mesh the viewer can draw opaque while ghosting both parents (the BIMcollab Zoom / Solibri presentation). A contact point tells you two elements touch; this tells you how deep, in what shape, and in which direction.

§On demand, never eager

One model here yields 81 clashes. This entry point computes ONE pair and is meant to be called when a clash row is selected, exactly like the existing on-demand @ifc-lite/clash/contact path. Nothing in the detection sweep calls it.

§Why this is gated, and what the gate is

The exact CSG kernel snaps every input coordinate to SNAP_GRID = 2^-16 m ≈ 15.26 µm and treats faces within [NearBand]’s band of each other as coplanar. Inside that band a thin overlap is not a thin solid — it is a coplanar contact, and the arrangement returns a wedge rather than the slab. Measured on the analytic box oracle (tests/clash_intersection_oracle.rs), a slab overlap reports:

penetration depthreported volume
≤ 8 snap cells (≤ 122 µm)exactly 2/3 of the truth (−33 %), at every world scale
10–24 cells (153–366 µm)high by 5e-5 (at the origin) to 0.33 (at 1000 m)
≥ 4 × the near bandexact, to f64, at every tessellation and world scale

So a naive “call the kernel and show the answer” API would draw a solid that is a third too small for precisely the shallow clashes a coordinator cares most about — and would report a volume for a 15 µm graze as if it meant something. This module therefore refuses to return a solid it cannot stand behind, and says why. The viewer draws the existing contact marker instead.

This is a real limit, not a conservatism knob: below the near band there is no exact solid to compute, only a coplanar contact, and the arrangement’s own output cannot tell you otherwise. No intersection solid exists for those pairs at this kernel’s resolution, and inventing one would be a sliver, not a finding.

Note what the sub-micron distances this kernel reports are NOT: evidence of fine coordination issues. TriMesh ingests geometry as f32 and queries it in f64, so those distances land on the f32 ULP at the pair’s coordinate magnitude — 2^-22 m ≈ 0.238 µm for coordinates in [2, 4) — repeated bit-identically across unrelated pairs, which is the signature of a quantization floor rather than a physical graze. Do not state a real-world graze distance here without a reproducible per-pair measurement behind it.

Enums§

DegenerateReason
Why no solid is being returned.
IntersectionSolid
The overlap volume of one clashing pair.

Functions§

intersection_solid
The intersection solid of two world-space meshes, or an honest reason there is none.