A fast, memory-efficient Constructive Solid Geometry library for three.js using a Bounding Volume Hierarchy approach.
three-bvh-csg is a Constructive Solid Geometry library for three.js that performs boolean operations on 3D meshes. It solves the performance limitations of traditional CSG implementations by using a Bounding Volume Hierarchy approach, making complex mesh operations feasible in real-time applications.
Three.js developers building interactive 3D applications that require dynamic mesh editing, CAD-like functionality, or procedural geometry generation in the browser.
Developers choose three-bvh-csg for its exceptional performance gains over alternative libraries, its memory-efficient design, and its flexible API supporting both simple operations and complex hierarchical evaluations.
A flexible, memory compact, fast and dynamic CSG implementation on top of three-mesh-bvh
Claims over 100x speed improvement over BSP-based alternatives for complex cases, enabling real-time CSG operations that were previously impractical, as highlighted in the README.
Built to be memory compact while handling dynamic operations, reducing overhead compared to traditional CSG implementations, per the project philosophy.
Supports all standard CSG operations (union, subtraction, etc.) plus experimental hollow operations, allowing for both solid and non-solid boolean effects with hierarchical chaining.
Includes helper classes like EdgesHelper and TriangleSetHelper for visualizing mesh intersections and topology during development, aiding in troubleshooting complex operations.
Marked as 'experimental, in progress' with known issues like triangle splitting bugs and numerical precision warnings that can lead to non-manifold results, making it unreliable for production.
Requires all input meshes to be perfectly two-manifold and watertight, which is often unrealistic for real-world 3D models and adds pre-processing overhead.
The project has a roadmap with help-wanted issues and incomplete features, indicating gaps in documentation and community support for advanced use cases.
CSG results use geometry draw ranges that can break standard three.js exporters, requiring manual conversion steps before exporting, as noted in the Gotchas section.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.