manifold_rust/lib.rs
1//! Pure Rust port of the [Manifold](https://github.com/elalish/manifold) 3D
2//! geometry library: guaranteed-manifold boolean operations (union,
3//! intersection, difference) on triangle meshes, plus constructors, convex
4//! hull, Minkowski sum/difference, SDF meshing, smoothing and 2D
5//! cross-sections.
6//!
7//! The port targets **exact numerical match** with the C++ reference
8//! (v3.5.0): same algorithms, same floating-point results, same triangle
9//! topology. The optional `parallel` feature adds rayon parallelism that is
10//! restricted to determinism-preserving sites, so its results remain
11//! bit-identical to the sequential build.
12//!
13//! # Example
14//!
15//! ```
16//! use manifold_rust::manifold::Manifold;
17//! use manifold_rust::linalg::Vec3;
18//!
19//! let cube = Manifold::cube(Vec3::new(1.0, 1.0, 1.0), true);
20//! let sphere = Manifold::sphere(0.6, 32);
21//!
22//! let difference = cube.difference(&sphere);
23//! assert!(difference.volume() > 0.0);
24//! assert_eq!(difference.status(), manifold_rust::types::Error::NoError);
25//! ```
26//!
27//! The main entry point is [`manifold::Manifold`]; meshes move in and out via
28//! [`types::MeshGL`] / [`types::MeshGL64`]. Lower-level modules mirror the C++
29//! source layout and are public primarily for testing and advanced use — their
30//! APIs may change before 1.0.
31
32pub mod linalg;
33pub mod types;
34pub mod polygon;
35pub mod impl_mesh;
36pub mod sort;
37pub mod constructors;
38pub mod face_op;
39pub mod edge_op;
40pub mod properties;
41pub mod svd;
42pub mod smoothing;
43pub mod collider;
44pub mod tree2d;
45pub mod boolean3;
46pub mod boolean_result;
47pub mod csg_tree;
48pub mod manifold;
49pub mod cross_section;
50pub mod subdivision;
51pub mod sdf;
52pub mod minkowski;
53pub mod quickhull;
54pub mod disjoint_sets;
55pub mod math;
56pub mod interp_tri;
57pub mod par;