u_geometry/lib.rs
1//! Domain-agnostic computational geometry library.
2//!
3//! Provides fundamental geometric primitives (2D and 3D), transformations,
4//! polygon operations, collision detection, and spatial indexing for the
5//! U-Engine ecosystem.
6//!
7//! # Modules
8//!
9//! - **`primitives`**: Core types — `Point2`, `Vector2`, `Segment2`, `AABB2`,
10//! `Point3`, `Vector3`, `AABB3`
11//! - **`polygon`**: Polygon operations — area, centroid, convex hull, winding
12//! - **`transform`**: Rigid transformations — `Transform2D`, `Transform3D`
13//! - **`robust`**: Numerically robust geometric predicates (Shewchuk)
14//! - **`collision`**: SAT-based collision detection (2D convex polygons), AABB
15//! overlap (2D and 3D)
16//! - **`minkowski`**: Minkowski sum and NFP for convex polygons
17//! - **`spatial_index`**: Linear-scan spatial indices for 2D and 3D AABB queries
18//!
19//! # Architecture
20//!
21//! This crate sits at Layer 2 (Algorithms) in the U-Engine ecosystem.
22//! It contains no domain-specific concepts — nesting, packing, scheduling, etc.
23//! are all defined by consumers at higher layers.
24//!
25//! # References
26//!
27//! - de Berg, Cheong, van Kreveld, Overmars (2008), "Computational Geometry"
28//! - Shewchuk (1997), "Adaptive Precision Floating-Point Arithmetic"
29//! - O'Rourke (1998), "Computational Geometry in C"
30//! - Ericson (2005), "Real-Time Collision Detection"
31
32pub mod collision;
33pub mod minkowski;
34pub mod offset;
35pub mod polygon;
36pub mod primitives;
37pub mod robust;
38pub mod spatial_index;
39pub mod transform;
40
41#[cfg(feature = "wasm")]
42pub mod wasm;
43
44/// Re-exports of nalgebra types commonly used with this crate.
45///
46/// Consumers can import these directly instead of adding a separate
47/// `nalgebra` dependency, ensuring version consistency across the ecosystem.
48pub mod nalgebra_types {
49 pub use nalgebra::{
50 Isometry2, Isometry3, Point2 as NaPoint2, Point3 as NaPoint3, RealField, Rotation2,
51 Rotation3, UnitQuaternion, Vector2 as NaVector2, Vector3 as NaVector3,
52 };
53}