boolmesh
Boolmesh is a pure Rust library for performing robust and efficient mesh boolean operations.
It is a full-from-scratch Rust implementation inspired by Elalish’s Manifold, well known for its robustness and now part of OpenSCAD.
The codebase is clean and minimal, with dependencies only on anyhow and nalgebra.
Besides being robust, Boolmesh is also very fast — for example, generating a Menger Sponge of depth 4 (the model shown on the right) takes only around 8 seconds on an Apple Silicon M4, without multi-threading.
Usage
The usage is intentionally simple, as the library exposes only one main function for end users.
To perform a boolean operation, construct a mesh buffer structure (called a Manifold) from vertex positions and face indices, then call compute_boolean() to obtain the result.
Note: Input meshes must be manifold, meaning they must not contain boundaries or overlapping geometry.
let mfd_0 = new.unwrap;
let mfd_1 = new.unwrap;
let result: Manifold = compute_boolean.unwrap;
Examples such as a Menger Sponge generator and simple mesh boolean samples can be found in the examples folder.
Roadmap
Planned upcoming implementations include:
- Multithreading support for improved performance
- A CSG tree structure for pre-computation optimization
- UV value and mesh ordering inheritance for output meshes
LICENSE
Mozilla Public License Version 2.0 (MPL-2.0)