1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
//! Constructive solid geometry — Rust port of [three-bvh-csg@0.0.16](https://github.com/gkjohnson/three-bvh-csg).
//!
//! Enabled with the Cargo feature `bvh-csg` (implies `mesh-bvh`).
//!
//! # In the browser
//!
//! The same evaluator runs there: `csgEvaluate` (`src/wasm_csg.rs`) does the
//! boolean, and `web/bvh-csg-impl.js` keeps three-bvh-csg's `Brush`,
//! `Operation`, `OperationGroup` and `Evaluator` bookkeeping around it.
//!
//! # Against three-bvh-csg
//!
//! `tests/csg_upstream.rs` replays every evaluation the bvh-csg parity scenes
//! make, recorded from three-bvh-csg@0.0.16 itself
//! (`tests/parity/export-bvh-csg-upstream.mjs`), and holds each result to the
//! same surface area and enclosed volume. Triangle counts differ by a few
//! percent: three-mesh-bvh and [`MeshBvh`](crate::mesh_bvh::MeshBvh) build
//! different trees, so a face meets its cutting triangles in a different order
//! and is cut into a different number of pieces covering the same region.
//! `tests/parity/run-bvh-csg.js` compares the scenes' pixels from nine views.
//!
//! # Quick start (native)
//!
//! ```ignore
//! use threers::{CsgBrush, CsgEvaluator, BoxGeometry, ADDITION, SUBTRACTION};
//!
//! let mut ev = CsgEvaluator::new();
//! let mut a = CsgBrush::new(BoxGeometry::new(2.0, 2.0, 2.0));
//! let mut b = CsgBrush::new(BoxGeometry::new(1.0, 1.0, 1.0));
//! let geom = ev.evaluate(&mut a, &mut b, SUBTRACTION);
//! ```
//!
//! Examples: `bvh_csg_hierarchy`, `bvh_csg_steps` (`--features bvh-csg`).
/// f64 three.js math helpers used to match JS CSG float paths bit-for-bit where needed.
pub use CsgBrush;
pub use *;
pub use ;
pub use ;