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
//! BSP (Binary Space Partitioning) tree implementation.
//!
//! This crate provides a BSP tree for 3D polygon management, enabling efficient
//! spatial partitioning, ordered traversal, and polygon cutting operations.
//!
//! # Core Types
//!
//! - [`Polygon`], [`Triangle`], [`Rectangle`]: Geometric primitives
//! - [`Plane3D`]: 3D plane representation with classification operations
//! - [`Cuttable`]: Trait for splitting geometry by planes
//! - [`BspTree`]: The BSP tree container
//! - [`BspNode`]: Tree nodes holding splitting planes and coplanar polygons
//!
//! # Example
//!
//! ```
//! use bsp_tree::{BspTree, Polygon};
//! use nalgebra::Point3;
//!
//! // Create some polygons
//! let poly1 = Polygon::new(vec![
//! Point3::new(0.0, 0.0, 0.0),
//! Point3::new(1.0, 0.0, 0.0),
//! Point3::new(0.0, 1.0, 0.0),
//! ]);
//!
//! // Build the tree
//! let tree = BspTree::from_polygons(vec![poly1]);
//!
//! assert_eq!(tree.polygon_count(), 1);
//! ```
// Re-export BSP tree types at crate root for convenience
pub use ;
pub use Cuttable;
pub use ;
pub use Polygon;
pub use Rectangle;
pub use Triangle;