Published: 2024-04-27

Updated: 2025-10-14

Dmitry Lambin

Post rating: 0.0

CGAL alternative for 3D Boolean Operations

In computational geometry and CAD modeling, selecting the right 3D boolean library is crucial for efficient and accurate operations. Two popular choices, MeshLib and CGAL, offer different strengths and weaknesses. This article compares their performance in real-world scenarios to help you make an informed decision.sculptures. Efficiency and accuracy are paramount in these applications.

In this article, we’ll compare the performance of different 3D boolean libraries under various scenarios to help you make an informed decision.

What is MeshLib?

MeshLib is an open-source 3D geometry library that allows effortless creation of powerful 3D applications and execution of advanced operations using C++, Python, C, or JavaScript. With its user-friendly interface and extensive documentation, MeshLib boolean operations simplify complex geometric tasks for developers of all levels, making it a preferred choice across industries.

What is CGAL?

CGAL (The Computational Geometry Algorithms Library, or CGAL) is an open-source software library of computational geometry algorithms, primarily written in C++, with bindings available for Scilab, Python, and Java. It offers dual licensing, providing open-source licenses for use in open-source projects and commercial licenses for other applications. Known for its precision and efficiency, CGAL boolean operations are trusted by developers for handling complex geometric computations reliably.

MeshLib vs CGAL comparison results

Testing Setup – Apple M5 MacBook Air (10-core CPU, 32 GB unified memory), macOS 26. We report the min over 10 iterations per operation; mesh I/O is excluded from the timings

For access to input and result meshes used in our tests, visit this link.

Nefertiti Case

This scenario involves large meshes (2M Triangles each) with complex topology, representing a common challenge in 3D boolean operations.

MeshLib% filename%

Union

Meshes were slightly shifted.

Mesh intersection of Nefertiti model – benchmark case with high triangle count

Intersection

Meshes were slightly shifted.

MeshLib% filename%

Difference A-B

Meshes were slightly shifted.

MeshLib 3.1.3.249
CGAL
Nefertity – Union​
0.09 (0.26)
4.4
Nefertity – Intersection
0.08 (0.23)
3.6
Nefertity – Difference
0.08 (0.23)
3.8

Comments

MeshLib demonstrates significantly faster processing times compared to CGAL. For instance, MeshLib completes the union operation (U) in 0.09 seconds, while CGAL takes 4.4 seconds, indicating MeshLib’s superior efficiency in these operations.

Dental Case

In this case, we simulate dental models (≈500K Triangles) with degeneracies and coinciding surfaces, reflecting real-world scenarios encountered in medical applications.

MeshLib% filename%

Union

Mesh intersection of dental models – medical mesh intersection test

Intersection

MeshLib% filename%

Difference A-B

MeshLib 3.1.3.249
CGAL
Dental – Union​
0.04 (0.06)
Fail
Dental – Intersection
0.05 (0.08)
Hang
Dental – Difference A-B
0.05 (0.07)
Hang

Comments

MeshLib consistently outperforms CGAL in degenerate mesh scenarios: in our 2026 benchmark CGAL failed the union operation and hung on intersection and difference, while MeshLib completed each operation correctly in about 0.05 seconds.

Simple Objects Case

In this case, we compare how algorithms behave when handling complex geometries.

MeshLib% filename%

Holed, Not Intersected

Boolean Union of meshes, one with a hole aside from the intersection part.

MeshLib% filename%

Holed Intersected

Boolean Union of meshes, one with a hole into the intersection part.
MeshLib% filename%

Self-Intersections​

Boolean Union of meshes, one with self-intersections into meshes’ intersection part.
MeshLib
CGAL
Holed, Not Intersected
Yes
Yes
Holed Intersected
No*
No
Self- Intersections
No**
No

Comments

Both MeshLib and CGAL exhibit similar performance in scenarios involving holes and self-intersections, with no significant differences observed.
* MeshLib does not support the representation of non-manifold meshes and automatically converts them to a manifold form.
** The results of such operations are not well-defined, leading to a mesh with numerous inconsistencies, such as self-intersections and degeneracies. In fact, it is not a secret that MeshBoolean operations may eventually fail outright. To explain why this might happen and what to do to avoid such outcomes, we invite you to read this overview of reasons for flawed Mesh Boolean operations.

Why choose MeshLib SDK for 3D boolean operations over CGAL?

In summary, while both MeshLib and CGAL offer robust solutions for 3D boolean operations, MeshLib demonstrates superior performance in most scenarios, with faster processing times and greater stability, particularly in handling complex meshes. Developers may prefer MeshLib for its efficiency and reliability in real-world applications.

Play Video

Try MeshLib now

Booleans, mesh repair, decimation and ICP — in your browser, as JavaScript and WebAssembly. No install, no sign-up.

Open live demo

Or install the SDK — free to evaluate

Setup guide · binaries or CMake Setup guide · binaries, MeshLibC2
Share post