Elsevier

Computer-Aided Design

Volume 45, Issue 3, March 2013, Pages 705-716
Computer-Aided Design

Fast and accurate evaluation of regularized Boolean operations on triangulated solids

https://doi.org/10.1016/j.cad.2012.11.004Get rights and content

Abstract

In this paper we present a robust and accurate method for evaluating regularized Boolean operations on triangulated solids. It allows the exact evaluation of the regularized union, intersection, difference and symmetric difference simultaneously. Moreover, this approach is simpler than other methods, including those that provide an approximate evaluation or only a rendering of the result. It is based on a simple data structure and on the use of an octree which facilitates the division of the geometry into subsets for distribution among several threads, and accelerates the spatial queries needed during the process. This method is designed to be used in a multithreaded environment and it can also be implemented using an out-of-core approach. We also present some experimental results, and a comparison with other systems that also provide an exact evaluation of the Boolean operations.

Highlights

► Robust and accurate method for evaluating Boolean operations on triangle meshes. ► Process: mesh intersection, classification of triangles, regularized evaluation. ► Parts of the boundaries are grouped to optimize the classification of triangles. ► It uses an octree for accelerating spatial queries and partitioning the meshes. ► High-performance. Uses multithreading. Can be used with clustering.

Introduction

Boolean operations between solids are used in geometric modeling for the manipulation of objects and the creation of new ones. These operations, such as union, intersection, difference, and symmetric difference, are applied to the boundary of 3D objects in the same way as with other sets. New complex solids can be obtained as a combination of others, which are usually simpler. This form of 3D modeling has been used extensively in fields such as industrial engineering (CAD/CAM), virtual reality, and Computer Graphics [1], [2]. Boolean operations are the basis of Constructive Solid Geometry. Moreover, they can be used for simulation purposes, such as drilling, machining or collision detection.

The polygonal mesh is the most popular boundary representation for 3D objects. More specifically, the triangle mesh is the most versatile polyhedral representation among B-Rep representations [3]. Triangle meshes have multiple applications. They are used in CAD, virtual reality and videogames to represent polyhedral solids. This representation scheme is a standard in several areas, due to its simplicity. It can represent almost any object with a given level of detail. Moreover, it can be directly processed with graphics hardware.

A Boolean operation between polygonal models can present several problems. Many commercial CAD systems have difficulties in resolving operations with very complex models. Occasionally they fail to give a correct result (which in most cases is an empty set), or they refuse to give a result at all. Some systems are unable to resolve a Boolean operation between solids even with a medium complexity (100k–200k triangles). Numerical stability and memory consumption are the main problems, although the performance can be also an issue. Typical CAD systems operate on a data structure derived from a winged-edge, and the intersections are calculated per edge. Frequently, some hierarchical data structure is used for classifying geometric entities, such as BSP. In this case, a large number of faces in the solids can lead to an insufficient memory problem and a poor performance in most cases. Other systems avoid these drawbacks by converting the polygonal meshes into volumetric representations. After resolving the Boolean operation with voxels in a straightforward manner, the polygonal result is extracted from the volumetric result. There are other frameworks that give approximate results by using direct rendering or by performing local operations only on intersection zones [4], [5], [6]. In any case, those systems only provide approximate results in order to maximize the performance. Moreover, they tend to suffer from additional issues and special cases.

In this paper we present a method for evaluating regularized Boolean operations on triangulated meshes. The algorithm presented here is based on a classical approach for B-Reps [7], [8], [9], [10]. We focus on triangle intersection and tessellation. The first step consists of intersecting the two solids involved in the Boolean operation (mesh refinement). The second step performs the classification of the triangle set resulting from the previous step. These new meshes are conveniently tessellated so that every triangle from both meshes is totally inside, outside or on the boundary of the other mesh. Because of that, the problem of triangle classification is reduced to a point-in-solid test. The final step selects a triangle set that meets the conditions of the selected Boolean operation, and then builds the resulting solid. Our approach is optimized in several ways, therefore it is more efficient than other methods. It can operate with complex meshes without memory issues, in contrast to BSP-based methods. One of the main aspects of the algorithm is the use of an octree, which accelerates the spatial queries needed during the process. Also, by using an octree the data set can be divided into subsets for distribution among several threads of execution. This allows us to use a multicore implementation or even an out-of-core approach for working with very complex solids. The implementation tested clearly outperforms other Boolean evaluation systems that also provide an exact solution and preserves all features of the solids.

The rest of the paper is organized as follows. The next two sections present some previous work and background. Then, some preliminary steps are presented, which include key aspects of our approach. After that, the mesh refinement process, the classification of the mesh and the Boolean evaluation are presented. Finally, implementation and results are analyzed, and the paper is concluded with some final considerations about the work.

Section snippets

Previous work

Boolean operations between solids have been researched in Computer Graphics for years [11], [12]. Many approaches have been used for resolving Boolean operations and ultimately CSG trees. However, since this problem is very complex, not every method is suitable for all situations. The representation scheme determines the algorithm to be used. In this work we focus on a specific type of B-Rep, that is, triangle meshes. Other representations for 3D objects, such as volumetric structures, curved

Background

The proposed algorithm is based on some classical approaches presented by Requicha et al. [11], Hubbard [7] and others. It operates directly over the triangles from the meshes, therefore it does not need a complete winged-edge data structure, which is the classical B-Rep representation for polygonal solids. The algorithm has three main steps. The first step consists of intersecting the two solids involved in the Boolean operation. The second step performs the classification of the triangle set

Preliminary steps

The first step of the algorithm consists of the building of the data structure for the B-Reps. Each solid is represented by a triangle mesh, which is stored as an indexed face set. In this way, there is an indexed list of vertices and a list of triangles which reference each vertex using its index. This is one of the simplest forms for representing a triangle mesh, and allows us to share the vertices among neighboring triangles (see Appendix for more details).

The algorithm can also operate with

Mesh refinement

The mesh refinement process is the first main step of the evaluation of a Boolean operation. The goal is to obtain a resulting triangle set that meets the following conditions: each resulting triangle of the decomposition of a solid must not intersect other triangle from the other solid. Furthermore, each resulting triangle must be completely inside, completely outside or completely on the boundary of the other solid. This resulting triangle set allows us to classify every triangle from each

Mesh classification

The classification of the new triangles is the second main step of the Boolean evaluation process. There are two triangulated meshes as a result of the previous step. At this point, these meshes are conveniently tessellated so that every triangle from both meshes is totally inside, outside or on the boundary of the other mesh. This allows us to determine the classification of each triangle using only a single point located on the triangle. To test whether a triangle from mesh A is inside,

Boolean evaluation

At this point the meshes used in the Boolean operation are tessellated so that every triangle from each solid is completely outside, completely inside or on the boundary of the other solid. Also, all the triangles from each solid are also classified with respect to the other solid. This last step consists of selecting a triangle set that meets several conditions and building a new mesh with that triangle set [36]. This set is the result of the Boolean operation. Fig. 8 shows the classification

Results and discussion

We have tested our Boolean operation method with several triangulated meshes. They have different polygon quantities and different topological properties. All of the meshes have a 2-manifold representation. The implementation of the algorithm has been completely written using C++ and OpenMP. We have also tested other systems in order to compare the quality of the results and the overall performance: CGAL [37], the GNU triangulated surface library (GTS) [38], MicroStation V8 and 3ds Max 2010.

Conclusions

In this paper, we have presented an efficient, accurate and robust method to evaluate regularized Boolean operations on triangle meshes. It is based on a straightforward data structure and on the use of an octree which accelerates the spatial queries needed during the process. Although it is designed to work with 2-manifold solids, it can also provide correct results with some non-manifold meshes. It allows the exact evaluation of the regularized union, intersection, difference and symmetric

Acknowledgments

This work has been partially supported by the Ministerio de Ciencia e Innovación and the European Union (via ERDF funds) through the research project TIN2011-25259 and by the University of Jaén through the research project UJA2010/13/08 sponsored by Caja Rural de Jaén.

References (38)

  • C.C.L. Wang et al.

    Solid modeling of polyhedral objects by layered depth-normal images on the GPU

    Comput Aided Des

    (2010)
  • M.L. Rivero et al.

    Boolean operactions on general planar polygons

    Comput Graph

    (2000)
  • M. de Berg et al.

    Computational geometry

    (1997)
  • S. Krishnan et al.

    Boole: a boundary evaluation system for Boolean combinations of sculptured solids

    Internat J Comput Geom Appl

    (2001)
  • M. Mäntylä

    An introduction to solid modeling computer

    (1988)
  • Hable J, Rossignac J. Blister: GPU-based rendering of Boolean combinations of free-form triangulated shapes. In:...
  • D. Pavić et al.

    Hybrid Booleans

    Comput Graph Forum

    (2010)
  • Varadhan G, Krishnan S, Zhang L, Manocha D. Reliable implicit surface polygonization using visibility mapping. In:...
  • Hubbard PM. Constructive solid geometry for triangulated polyhedra. Tech. report CS-90-07. Brown CS....
  • M. Mäntylä et al.

    Localized set operations for solid modelling

    Comput Graph

    (1983)
  • M. Pilz et al.

    Creation and boundary evaluation of CSG models

    Eng Comput

    (1989)
  • F. Yamaguchi et al.

    A unified algorithm for Boolean shape operations

    IEEE Comput Graph Appl

    (1984)
  • A.A.G. Requicha et al.

    Boolean operations in solid modeling: boundary evaluation and merging algorithms

    IEEE Proc

    (1985)
  • J.R. Rossignac et al.

    Solid modeling

  • D. Ayala et al.

    Object representation by means of nonminimal division quadtrees and octrees

    ACM Trans Graph

    (1985)
  • D.H. Laidlaw et al.

    Constructive solid geometry for polyhedral objects

    SIGGRAPH Proc

    (1986)
  • Kobbelt LP, Botsch M, Schwanecke U, Seidel H-P. Feature sensitive surface extraction from volume data. In: SIGGRAPH’01...
  • Lorensen WE, Cline HE. Marching cubes: a high resolution 3D surface construction algorithm. In: SIGGRAPH’87. 1987, p....
  • Keyser J, Culver T, Foskey M, Krishnan S, Manocha D. ESolid: a system for exact boundary evaluation. In: SMA’02. 2002,...
  • Cited by (40)

    • Algorithm for three-dimensional curved block cutting analysis in solid modeling

      2020, Computer Methods in Applied Mechanics and Engineering
    • Efficient non-incremental constructive solid geometry evaluation for triangular meshes

      2018, Graphical Models
      Citation Excerpt :

      With P-reps, our triangle intersection test is free from constructing new points. Multiple experiments have confirmed that our approach has advantages in efficiency and robustness when compared to the state-of-the-art techniques [2,5,9–11]. Our approach is able to quickly and robustly perform CSG evaluations not only for trivial CSG, e.g. single Boolean operations, but also for large CSGs with hundreds of primitives.

    View all citing articles on Scopus
    View full text