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
57
//! Pure Rust port of the [Manifold](https://github.com/elalish/manifold) 3D
//! geometry library: guaranteed-manifold boolean operations (union,
//! intersection, difference) on triangle meshes, plus constructors, convex
//! hull, Minkowski sum/difference, SDF meshing, smoothing and 2D
//! cross-sections.
//!
//! The port targets **exact numerical match** with the C++ reference
//! (v3.5.0): same algorithms, same floating-point results, same triangle
//! topology. The optional `parallel` feature adds rayon parallelism that is
//! restricted to determinism-preserving sites, so its results remain
//! bit-identical to the sequential build.
//!
//! # Example
//!
//! ```
//! use manifold_rust::manifold::Manifold;
//! use manifold_rust::linalg::Vec3;
//!
//! let cube = Manifold::cube(Vec3::new(1.0, 1.0, 1.0), true);
//! let sphere = Manifold::sphere(0.6, 32);
//!
//! let difference = cube.difference(&sphere);
//! assert!(difference.volume() > 0.0);
//! assert_eq!(difference.status(), manifold_rust::types::Error::NoError);
//! ```
//!
//! The main entry point is [`manifold::Manifold`]; meshes move in and out via
//! [`types::MeshGL`] / [`types::MeshGL64`]. Lower-level modules mirror the C++
//! source layout and are public primarily for testing and advanced use — their
//! APIs may change before 1.0.