ifc_lite_clash/
lib.rs

1// This Source Code Form is subject to the terms of the Mozilla Public
2// License, v. 2.0. If a copy of the MPL was not distributed with this
3// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4
5//! # IFC-Lite Clash
6//!
7//! High-performance geometry kernel for clash detection. This is a faithful
8//! native port of the TypeScript reference engine in `packages/clash`: the same
9//! AABB/vector math, triangle-triangle intersection (SAT) and minimum-distance
10//! routines, per-element triangle BVHs, broad-phase candidate generation, and —
11//! crucially — the exact narrow-phase classification.
12//!
13//! All geometric computation is performed in `f64`, even though vertices and
14//! AABBs are sourced from `f32` buffers.
15//!
16//! ## Usage
17//!
18//! ```
19//! use ifc_lite_clash::ClashSession;
20//!
21//! let mut session = ClashSession::new();
22//! // positions: concatenated per-element vertex coords (x, y, z, ...)
23//! // pos_ranges: [float_offset, float_len] per element
24//! // indices: concatenated per-element LOCAL triangle indices
25//! // idx_ranges: [idx_offset, idx_len] per element
26//! // aabbs: [minx, miny, minz, maxx, maxy, maxz] per element
27//! session.ingest(&[], &[], &[], &[], &[]);
28//! let result = session.run_rule(&[], None, 0, 0.0, 0.0, false);
29//! assert!(result.records.is_empty());
30//! ```
31
32mod aabb;
33mod bvh;
34mod depth;
35mod generated;
36mod narrow;
37mod obb;
38mod triangle;
39mod tri_mesh;
40mod vec3;
41mod session;
42
43pub use aabb::Aabb;
44pub use narrow::{ClashStatus, DistanceKind};
45pub use session::{ClashRecord, ClashSession, RuleResult};
46
47#[cfg(test)]
48mod kernel_tests;
49#[cfg(test)]
50mod tests;
51#[cfg(test)]
52mod world_frame_corpus;
53#[cfg(test)]
54mod world_frame_tests;