Skip to content
/ kigumi Public

Rock-solid Boolean operations on triangle meshes 🪨

License

Notifications You must be signed in to change notification settings

unageek/kigumi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kigumikigumi

kigumi performs regularized Boolean set operations on 3D regions defined by triangular boundary meshes. It is written in C++ and based on CGAL.

Features

With kigumi, you can:

  • Handle regions defined by open and/or non-manifold meshes.
  • Handle regions composed of disjoint components.
  • Handle special regions: the empty set and the universe.
  • Apply multiple Boolean operators simultaneously.
  • Attach custom data to mesh faces that propagate through Boolean operations.
  • Save regions in a portable binary format.

For details of the API, check Region.h and Boolean_region_builder.h.

Build instructions

On Windows • On macOS • On Ubuntu

Technical details

The following conditions must be satisfied so that Boolean operations work properly. If some are not met, the result is undefined (may emit warnings, crash, or fail silently).

  1. Boundary meshes must not have degenerate (zero-area) faces.
  2. Boundary meshes must not self-intersect, i.e., every pair of distinct faces must meet one of the following conditions:
    • They share an edge but do not intersect elsewhere.
    • They share a vertex but do not intersect elsewhere.
    • They do not intersect at all.
  3. Open boundary meshes must be clipped with a common convex region.

Additional notes:

  1. Faces that have more than three vertices are interpreted as triangle fans.

Table of Boolean operators

Note

The result of each Boolean operation is regularized, i.e., the interior and then the closure of the result is taken.

Boolean_operator:: Set notation Venn diagram
V $U$ (the universe)
A, UNION $A ∪ B$
B $(B ⧵ A)^c$
C $(A ⧵ B)^c$
D $(A ∩ B)^c$
E $(A â–³ B)^c$
F $A^c$
G $B^c$
H $B$
I $A$
J, SYMMETRIC_DIFFERENCE $A â–³ B$
K, INTERSECTION $A ∩ B$
L, DIFFERENCE $A ⧵ B$
M $B ⧵ A$
X $(A ∪ B)^c$
O $∅$ (the empty set)

Algorithm

An enhanced version of the algorithm described in [1] is used.

References

  • [1] Barki, H., Guennebaud, G., & Foufou, S. (2015). Exact, robust, and efficient regularized Booleans on general 3D meshes. Computers & Mathematics With Applications, 70(6), 1235–1254. https://doi.org/10.1016/j.camwa.2015.06.016