IFClite TypeScript API
    Preparing search index...

    Type Alias ClashDistanceKind

    ClashDistanceKind: "mesh" | "estimate"

    How a clash's distance was obtained — the two are NOT interchangeable and were indistinguishable in the output before this field existed.

    • 'mesh' — measured on the triangle meshes. For clearance it is the exact triangle-to-triangle gap. For touch it is usually that same exact gap, with one exception: a pair whose every candidate depth falls below the pair's f32 precision floor also reports touch, with distance: 0 and distanceKind: 'mesh' — there the 0 is a CLASSIFICATION (the surfaces are flush to within what the f32 source coordinates can represent; nothing is measurably penetrating), not a measured gap. For a hard clash it is the exact box-box penetration depth (minimum translation distance along a separating axis, Gottschalk), certified only when BOTH elements are — within tolerance — rectangular boxes (obb.ts); this replaced an earlier "deepest crossing-triangle vertex" probe that was a sampling artifact, converging to 0 as a mesh was retessellated instead of to the true depth (PR #2536).
    • 'estimate' — an uncertified depth: the smallest overlapping dimension of the two element AABBs, or for a box through-penetration that value capped by the box-box minimum translation distance (see below). Reported for a hard clash whenever the narrow phase could not certify a box-box depth. That happens in four shapes, all common in real models: either element is not (confirmed) a box; surfaces that only coincide (stacked layers sharing a footprint); one solid modelled wholly inside another; and a member piercing clean through the other — even when BOTH are boxes, because the box-box minimum-translation-distance is then dominated by the piercing member's own extent along the shared axis, not by the material it actually crossed, and is withheld from 'mesh' for exactly that reason. The value is then a property of the two BOXES, not of the solids — it can equal an element's own thickness rather than how far the two actually interpenetrate. Treat it as an indication of scale, not as a measurement. For a through-penetration between two boxes it never exceeds the box-box minimum translation distance, a distance proven to separate them (#5742).