CGAL Boolean Operations

From K-3D

Jump to: navigation, search

As of version 0.7, K-3D uses CGAL for 3D boolean operations.

Installation

Only CGAL 3.4 is supported. You can download the source from here. The default CGAL package does not ensure that facets and edges are ordered consistently between different runs. Since the K-3D pipeline relies on this consistency, a patch, courtesy of Peter Hachenberger, needs to be applied. It is expected that this patch will be included in the next CGAL release. The installation procedure is as follows:

  • Make sure you have the GMP and MPFR libraries and development files installed.
  • Extract the CGAL 3.4 source
  • cd to the CGAL-3.4 directory
  • Download the patch to the CGAL-3.4 directory
  • execute "patch -p0 < cgal3.4_boolean_patch.diff" in the CGAL-3.4 directory
  • Configure and build CGAL as usual

Usage

  1. Create 2 or more polygonal objects, and move them around so they intersect
  2. Select all objects to intersect
  3. From the right-click menu, select Mesh Modifier->CGALBoolean
  4. Change the "Type" property in the property panel to switch between boolean operations

Implementation details

The Booleans in CGAL rely on exact number types in order to produce correct results. As such, the polyhedra in K-3D can not be used directly, since they often contain non-triangular polygons that are not completely planar. In order to solve this, the K-3D CGAL module first triangulates its inputs, and then converts to homogeneous exact integer coordinates by multiplying all coordinates by 1e10 and rounding to the nearest integer. After the boolean operation, the excessive triangles are simplified away again using K-3D Euler operations.

Screenshots


Personal tools