Boolean operations on multi-region solids for mesh generation

15
ORIGINAL ARTICLE Boolean operations on multi-region solids for mesh generation Andre ´ Maue ´s Brabo Pereira Marcos Chataignier de Arruda Anto ˆnio Carlos de O. Miranda William Wagner M. Lira Luiz Fernando Martha Received: 17 February 2010 / Accepted: 10 June 2011 / Published online: 28 June 2011 Ó Springer-Verlag London Limited 2011 Abstract An algorithm for Boolean operations on non- manifold models is proposed to allow the treatment of solids with multiple regions (internal interfaces) and degenerate portions (shells and wires), in the context of mesh generation. In a solid modeler, one of the most powerful tools to create three-dimensional objects with any level of geometric complexity is the Boolean set operators. They are intuitive and popular ways to combine solids, based on the operations applied to point sets. To assure that the resulting objects have the same dimension as the ori- ginal objects, without loose or dangling parts, a regulari- zation process is usually applied after a Boolean operation. In practice, the regularization is performed classifying the topological elements and removing internal or lower- dimensional structures. However, in many engineering applications, the adopted geometric model may contain idealized internal parts, as in the case of multi-region models, or lower-dimensional parts, as in the case of solids that contain dangling slabs that are represented as zero- thickness surfaces or wireframes in the model. Therefore, the aim of this work is the development of a generic algo- rithm that allows the application of the Boolean set opera- tions in a geometric modeling environment applied to finite and boundary element mesh generation. This environment adopts a non-manifold boundary representation that con- siders an undefined number of topological entities (group concept), and works with objects of different dimensions and with objects not necessarily plane or polyhedral (parametric curved surfaces). Numerical examples are presented to illustrate the proposed methodology. Keywords Geometric modeling Non-manifold solids Boolean operations Boundary representation Mesh generation Degenerate portions 1 Introduction The creation of geometric models in the context of mesh generation is an essential task when dealing with the numerical simulation of real engineering objects (Fig. 1). Numerical simulation techniques as the finite element method (FEM) or the boundary element method (BEM) require discrete models (i.e., domain meshes or boundary meshes, respectively) that are based on the geometric description of the model’s domain. In addition, the con- struction of the discrete models usually involves combi- nations of several solids that can still contain other objects of lower dimensions (such as shells and wires), resulting in complex multi-region solids. A natural manner to construct multi-region solids for mesh generation is through Boolean set operators (union, intersection and difference), which are essential tools in any solid modeling system. A. M. B. Pereira (&) Departamento de Engenharia Civil, Universidade Federal Fluminense, Rua Passo da Patria 156, Niteroi 24210-240, Brazil e-mail: [email protected]; [email protected] A. M. B. Pereira M. C. de Arruda L. F. Martha Departamento de Engenharia Civil, Pontifı ´cia Universidade Cato ´lica do Rio de Janeiro, Av. Marque ˆs de Sa ˜o Vicente 225, Rio de Janeiro 22453-900, Brazil e-mail: [email protected] A. C. O. Miranda Departamento de Engenharia Civil e Ambiental, Universidade de Brasilia, Campus Universitario Darcy Ribeiro, Brasilia 70910-900, Brazil W. W. M. Lira Centro de Tecnologia, Universidade Federal de Alagoas, Campus A. C. Simo ˜es, Maceio ´ 57072-970, Brazil 123 Engineering with Computers (2012) 28:225–239 DOI 10.1007/s00366-011-0228-8

Transcript of Boolean operations on multi-region solids for mesh generation

Page 1: Boolean operations on multi-region solids for mesh generation

ORIGINAL ARTICLE

Boolean operations on multi-region solids for mesh generation

Andre Maues Brabo Pereira • Marcos Chataignier de Arruda •

Antonio Carlos de O. Miranda • William Wagner M. Lira •

Luiz Fernando Martha

Received: 17 February 2010 / Accepted: 10 June 2011 / Published online: 28 June 2011

� Springer-Verlag London Limited 2011

Abstract An algorithm for Boolean operations on non-

manifold models is proposed to allow the treatment of

solids with multiple regions (internal interfaces) and

degenerate portions (shells and wires), in the context of

mesh generation. In a solid modeler, one of the most

powerful tools to create three-dimensional objects with any

level of geometric complexity is the Boolean set operators.

They are intuitive and popular ways to combine solids,

based on the operations applied to point sets. To assure that

the resulting objects have the same dimension as the ori-

ginal objects, without loose or dangling parts, a regulari-

zation process is usually applied after a Boolean operation.

In practice, the regularization is performed classifying the

topological elements and removing internal or lower-

dimensional structures. However, in many engineering

applications, the adopted geometric model may contain

idealized internal parts, as in the case of multi-region

models, or lower-dimensional parts, as in the case of solids

that contain dangling slabs that are represented as zero-

thickness surfaces or wireframes in the model. Therefore,

the aim of this work is the development of a generic algo-

rithm that allows the application of the Boolean set opera-

tions in a geometric modeling environment applied to finite

and boundary element mesh generation. This environment

adopts a non-manifold boundary representation that con-

siders an undefined number of topological entities (group

concept), and works with objects of different dimensions

and with objects not necessarily plane or polyhedral

(parametric curved surfaces). Numerical examples are

presented to illustrate the proposed methodology.

Keywords Geometric modeling � Non-manifold solids �Boolean operations � Boundary representation � Mesh

generation � Degenerate portions

1 Introduction

The creation of geometric models in the context of mesh

generation is an essential task when dealing with the

numerical simulation of real engineering objects (Fig. 1).

Numerical simulation techniques as the finite element

method (FEM) or the boundary element method (BEM)

require discrete models (i.e., domain meshes or boundary

meshes, respectively) that are based on the geometric

description of the model’s domain. In addition, the con-

struction of the discrete models usually involves combi-

nations of several solids that can still contain other objects

of lower dimensions (such as shells and wires), resulting in

complex multi-region solids. A natural manner to construct

multi-region solids for mesh generation is through Boolean

set operators (union, intersection and difference), which are

essential tools in any solid modeling system.

A. M. B. Pereira (&)

Departamento de Engenharia Civil, Universidade Federal

Fluminense, Rua Passo da Patria 156, Niteroi 24210-240, Brazil

e-mail: [email protected]; [email protected]

A. M. B. Pereira � M. C. de Arruda � L. F. Martha

Departamento de Engenharia Civil, Pontifıcia Universidade

Catolica do Rio de Janeiro, Av. Marques de Sao Vicente 225,

Rio de Janeiro 22453-900, Brazil

e-mail: [email protected]

A. C. O. Miranda

Departamento de Engenharia Civil e Ambiental,

Universidade de Brasilia, Campus Universitario Darcy Ribeiro,

Brasilia 70910-900, Brazil

W. W. M. Lira

Centro de Tecnologia, Universidade Federal de Alagoas,

Campus A. C. Simoes, Maceio 57072-970, Brazil

123

Engineering with Computers (2012) 28:225–239

DOI 10.1007/s00366-011-0228-8

Page 2: Boolean operations on multi-region solids for mesh generation

Constructive solid geometry (CSG) and boundary rep-

resentations (B-Rep) are traditional mathematical modeling

schemes for representing the geometric shape of homoge-

neous objects, referred to as two-manifold solids [1].

However, these traditional schemes do not handle hetero-

geneous objects (multi-region solids) or models with

degenerated portions.

Non-manifold representations are strategies to deal with

this class of problem. A modeler with a non-manifold

environment allows Boolean operations to generate real-

istic FEM and BEM discrete models. In this representation,

solids with multiple regions (internal interfaces) and

degenerate portions (shells and wires) may be represented

in a consistent way. These are situations that occur, e.g., in

the problem illustrated in Fig. 1, which contains several

materials, internal boundaries, fault surfaces, tunnel sup-

port surfaces and anchor bolts. Nevertheless, the imple-

mentation of a system that provides a non-manifold

environment is a very complex task.

1.1 State of the art and literature review

As already mentioned, two different strategies have been

traditionally proposed to model homogeneous solid

objects. In the first strategy, one aims to represent a solid

through an explicit description of its boundary, which is the

so-called boundary representation (B-rep) [2]. It is based

on data structures that describe the adjacency relationships

of the vertices, edges and faces of a solid. The other pos-

sibility is the CSG approach [3], which consists of repre-

senting a solid as a result of a sequence of set operations

(union, intersection, and difference) performed on simple

primitive solids. B-rep and CSG have complementary

advantages and disadvantages [4], and much work has been

carried out to convert from CSG to B-rep [5] and from

B-rep to CSG [6].

B-rep modeling is a natural way of constructing a solid

that is defined by its bounding surfaces. Although complex

objects can be described, in principle, by their defining

surfaces, in many cases this is not a natural way of con-

struction. In practice, modeling systems based on B-rep are

usually capable of performing set operations, which

enables one to use CSG-like operations to define solids,

while retaining the full boundary representation. A topo-

logically complete set operations algorithm for planar

polyhedra two-manifold objects was described by Mantyla

[7], introducing the vertex neighborhood classifier for

Boolean operations. Gardan and Perrin [8] proposed an

interesting method for reducing 3D Boolean operations to a

2D problem in manifold environments.

However, traditional B-rep and CSG techniques apply

when one just needs to look at an object as inducing a

three-part space decomposition: its interior, its exterior and

its boundary. For many interesting applications, such as

modeling of heterogeneous objects [9–13], this is not

enough.

In addition, in many engineering applications, the

adopted geometric model may contain idealized lower-

dimension parts, as in the case of finite element and

boundary element systems [14]. These types of systems

need the support of a unified and simultaneous represen-

tation of wires (e.g., beam elements), shells (e.g., concrete

slabs that are represented as zero-thickness surfaces) and

solid parts (e.g., foundation blocks). In these situations, one

would like to have not only a representation of each part of

the model, but also a description about the way these parts

are connected to each other.

Techniques that models heterogeneous objects and

objects with lower-dimension parts are called non-mani-

fold modeling techniques [1, 15, 16], because these objects

are not necessarily two-manifolds embedded in three-

dimensional space. Traditional modelers (based on tradi-

tional B-rep and CSG modeling techniques) could only

represent two-manifold objects, i.e., objects in which every

point on the boundary has a neighborhood that is homeo-

morphic to an open two-dimensional disk [1].

Since the late 1980s, the advantages of non-manifold

geometric modeling have been recognized [17] and several

representation schemes for non-manifold objects have been

developed [18–22]. The mathematical definition of non-

manifold objects has also been presented. Masuda [16]

defined non-manifold geometric models as cell complexes

that are subsets of 3D Euclidian space, and provided

extended Euler operators for this type of model. The con-

cept of cell complexes non-manifold geometric model is

suitable, because the model may contain wires, shells and

solid parts, or combinations of them. Arbab [23] presented

an alternative CSG-like formalism based on open sets

(called s-sets) for assemblies, i.e., objects with several solid

Fig. 1 Real engineering objects containing multiple regions (internal

interfaces) and degenerate portions (shells and wires)

226 Engineering with Computers (2012) 28:225–239

123

Page 3: Boolean operations on multi-region solids for mesh generation

parts or with internal boundaries, and formalized Boolean

operations for heterogeneous objects (s-sets).

One strategy for modeling non-manifold objects is the

direct manipulation of cells. Rossignac and O’Connor [19]

have proposed the concept of geometric complex (GC), in

which a non-manifold object is decomposed in disjoint

portions called cells, each one homogeneous in dimension

and satisfying the condition that the intersection of the

boundaries of any two cells is necessarily equal to the

union of other cells of the decomposition. Cavalcanti et al.

[24] generalized this concept and presented an approach

based on spatial subdivision for non-manifold modeling. In

this approach, any object is represented by a subdivision of

the entire Euclidian space (including the external infinite

region). This representation is called complete geometric

complex (CGC) and was implemented using the radial

edge data structure proposed by Weiler [20]. An incre-

mental approach for CGC creation considers the inclusion

of a patch of surface at a time, with the corresponding

updating of the data structure after each insertion. Simi-

larly, curve segment and vertices are inserted incremen-

tally. The insertion of a new cell (surface patch, curve

segment, or vertex) is a fundamental operation executed by

the spatial subdivision scheme and may result in the

refinement of new and existing cells due to geometric

intersection. New solid regions (which are also cells in the

decomposition) may result from surface patch insertions, as

well as new surface patches may result from curve inser-

tions. Cavalcanti et al. [24] have chosen CGC as the

mathematical model to describe a spatial subdivision. This

approach provides a basis for representing complex objects

in two steps: first, a subdivision phase and, second, a phase

with selection of active cells. The resulting object is called

an selective complete geometric complex (SCGC). For

instance, in a finite element analysis of a solid with a

cavity, the infinite external region and the cavity would be

inactive cells.

Another strategy for creation of non-manifold models is

through Boolean operations. Gursoz et al. [17] proposed a

scheme for implementing Boolean operations based on the

classification of six types of intersection pairs: vertex–

vertex, vertex–edge, edge–edge, vertex–face, edge–face,

and face–face. All of the intersections take place between

pairs of elements that belong to two different objects. After

having obtained a merged object, any Boolean operation is

achieved by selecting the appropriate point set elements in

the object.

A more general process was introduced by Rossignac

and Requicha [25]. They introduced a new class of objects,

called constructive non-regularized geometry (CNRG)

objects, and a family of operators that act on these objects.

A CNRG tree is a rooted directed acyclic graph and rep-

resents an object. The leaves are the CNRG primitives.

Internal nodes represent intermediate CNRG objects

obtained by applying certain operations to their children.

The operators are: aggregation, unification, sum, product,

subtraction, complementation, interior, closure, boundary

and regularization. CNRG operations provide a modeling

process suitable for user interaction. When followed by a

unification operator, which creates an object having only

one component, they behave exactly as the corresponding

point-set operators. Without unification, however, they

return an aggregate (or assembly) of pair-wise disjoint

components.

Cavalcanti et al. [24] advocated that space subdivisions

corresponding to CNRG objects can be implicitly repre-

sented by the corresponding tree, in the way as CSG trees

can be used to represent B-rep solids. In this case, the

CNRG operators are used only as a modeling process, as

these operators provide a convenient way to define topo-

logical and Boolean operations for SCGC objects. Indeed,

an SCGC can be seen as a CNRG whose components are

its active cells. This allows one to use CNRG operators to

build and modify SCGCs. In this context, these authors

used the CNRG operators to create heterogeneous objects

represented by SCGCs. They proposed a scheme to auto-

matically determine the material to be attributed to each

region based on region naming and a ‘‘dominance factor’’,

which establishes the material that predominates in a

combination operation.

In the last decade, some attention has been given to the

use of Boolean set operation for the creation of non-

manifold objects in the context of feature-based modeling

and modeling of heterogeneous objects, including objects

with functionally graded materials. Magalhaes and Mesq-

uita [9] proposed a solution for handling inner boundaries

in the context of mesh generation for electromagnetic

problems, assuring the design of manufacturable models.

Their work is based on the s-set CSG-like formalism pro-

posed by Arbab [23], and the implementation adopts the

radial edge data structure of Weiler [20].

The study of Gardan et al. [26] describes the use of

Boolean operations of feature-based models. As mentioned

by these authors, feature-based modeling and Boolean

operations are closely related areas, as such operations are

involved in feature instantiation or modification. Boolean

operators may also be used to combine two feature-based

models. In both situations, the modeling process is based

on the following sequence of statements: calculate the

intersections, combine, classify and extract entities (faces,

edges and vertices) of the operands.

Following an approach similar to the use of a ‘‘domi-

nance factor’’ [24], Sun and Hu [10] proposed reasoning

Boolean operations for modeling heterogeneous objects.

The reasoning Boolean operation algorithm consists of a

merging operation and an extraction operation, and is

Engineering with Computers (2012) 28:225–239 227

123

Page 4: Boolean operations on multi-region solids for mesh generation

executed according to the material-dominant information

extracted from the designed heterogeneous object database.

In their work, they perform several geometric operations

prior to the material classification.

A very comprehensive work in this area is the one

written by Qian and Dutta [11]. These authors proposed the

direct face neighborhood alteration method to handle the

two main tasks involved in the constructive operations of

heterogeneous objects with functionally graded material:

geometric boundary evaluation and material region form-

ing. In a sense, the methodology devised by these authors

generalizes and extends the use of region naming and

material-dominant information in heterogeneous object

modeling. They define mathematically three operations

that manipulate material volumes: additive, subtractive and

partition operations. These operations take into account

both geometric properties and combined material behavior

of each volume.

A similar approach is adopted by Kou et al. [12].

However, the main difference is that these authors also

consider smooth transitions of material properties

throughout the complex geometry of the heterogeneous

object. With the aid of cell adjacency information and

attribute-based reasoning, complex, smooth and versatile

material distributions can be defined upon the intricate

geometries. Their work represents versatile material vari-

ations/distributions using different heterogeneous tree

(HFT) structures.

Keiser et al. [27] present the combination of curved

primitives through the application of Boolean operations

using the concept of boundary evaluation and exact arith-

metic, and show some very expressive results.

Numerical inaccuracies are a major problem in any

system that manages simultaneously geometric and topo-

logical information. Since these systems must use floating-

point numbers to save coordinates of points, parametric or

implicit equations of curves and surfaces, and to perform

translations, rotations and other kinds of transformations

applied to primitives, they are prone to errors due to the

lack of precision in some operations. Many solutions have

already been proposed to deal with this problem, based on

diverse concepts such as the use of model-based or

machine tolerances [28], interval arithmetic and the exact

computation paradigm [29]. To date, however, no system

has been completely able to solve all kinds of problems

related to numerical inaccuracies in environments where

curved primitives are allowed.

In summary, the two main strategies used to model non-

manifold objects are: direct cell manipulation and reason-

ing Boolean operations. The former naturally handles cells

with different dimensions, such as solid regions, surface

patches and wireframes. The latter is used to model het-

erogeneous objects with inner boundaries and with no

lower-dimension or non-manufacturable part. The idea of

this work relies exactly on how to tackle this deficiency: to

consider idealized lower-dimension parts (dangling faces

or wires) in non-manifold Boolean operations, in the con-

text of mesh generation.

1.2 Main contributions

The originality of the present work consists in the develop-

ment of an algorithm to perform Boolean operations in non-

manifold environments containing curved primitives of any

type and dimension. These operations handle specific prob-

lems of non-manifold geometric modeling to generate mesh-

based models. The main idea is to extend the methodology

proposed by Cavalcanti et al. [24] based on the classification

rules introduced by Mantyla [7]. One key aspect of the pro-

posed algorithm is that it explicitly maintains the two-man-

ifold concept of boundary of topological entities. This

concept allows applying the algorithm to any kind of object,

with any shape or dimension, including dangling and loose

parts. Another important aspect is the concept of group of

entities, which allows performing Boolean operations not

just on two homogeneous solids, but also on two sets of

entities of different types and dimensions.

Common algorithms for Boolean operations in three

dimensions would only consider solids as possible input

and output data. The proposed algorithm works with enti-

ties of different dimensions, since it treats separately each

type of topological entity. Lower-dimension entities may

be of interest when one does not want to discard internal

parts of solids, dangling or loose. These parts might rep-

resent restrictions to solid finite element mesh generation

inside a region (e.g., cracks in a fracture analysis) or

interfaces between layers of different materials, with dis-

tinct properties. Another example occurs in geological

subsurface objects where a set of faults crosses one or more

horizons of rock layers. These faults are usually repre-

sented by surfaces that penetrate into the layers. Some

faults might not cross an entire layer, becoming a dangling

surface in its interior. In addition, tunneling design con-

siders anchor bolts that are usually modeled as wires in the

discrete model (Fig. 1).

It should be observed that lower-dimension parts may

result from Boolean operations between two (homogeneous

or heterogeneous) objects. However, when dealing with

manufacturable objects (which do not contain degenerated

entities), these parts are detected by the non-manifold

representation and treated in accordance with the target

Boolean operation. In many situations, these parts are

removed. The main difference between those situations and

the methodology proposed in this work is that a lower-

dimension cell may be an idealized feature of the object

that should be preserved in many operations.

228 Engineering with Computers (2012) 28:225–239

123

Page 5: Boolean operations on multi-region solids for mesh generation

Although the proposed algorithm does not involve any

specific procedure to treat inaccuracy problems, it is

important to keep in every stage consistency between

geometry and topology, based on appropriate model-based

or machine tolerances [28].

It is also important to point out that the algorithm pro-

posed in the present paper has no intention to be the only

possibility to deal with the combination of non-manifold

solids through the application of Boolean operations. It is a

satisfactory alternative to construct discrete models for

these types of solids in a consistent manner.

Finally, the main contributions may be summarized in a

classification of entities that should be removed in Boolean

operations of non-manifold and heterogeneous objects (see

Sect. 3), which is not related to any specific data structure.

Rather, the proposed classification may be adopted by any

non-manifold modeler.

1.3 Outline of this paper

In Sect. 2, the main definitions necessary to introduce the

proposed algorithm are presented, which are the concepts

of group, topological refinement of surfaces and curves,

and boundary. The algorithm for applying Boolean set

operations on B-Rep non-manifold solids is described in

Sect. 3, with the basic procedures according to the desired

operation. In Sect. 4, some examples of the application of

the algorithm are shown. Finally, the conclusions with a

summary of the main difficulties found during the devel-

opment of the algorithm are discussed in Sect. 5.

2 Basic definitions

There are three important issues to be considered before the

presentation of the proposed algorithm. First, the idea of

group of entities is discussed. Next, the topological

refinement of surface and curves is defined, since it reflects

directly on the applicability conditions of the Boolean

operations. Finally, the concept of boundary of topological

entities is introduced.

2.1 Group of entities

The first issue to be considered is the definition of group of

entities. In this context, a group is defined as a set of

topological entities forming a sub-set of the studied model.

Groups may contain vertices, edges, surface patches (faces)

and regions. A group can contain several entities with

different dimensions, including dangling entities or entities

completely loose in space.

For each topological entity, there must be a way of

accessing its adjacency information, usually available in

any model data structure. For instance, the radial-edge data

structure [20] is an example of a data representation

scheme that may provide a sufficient set of adjacency

relationships in a non-manifold environment.

The Boolean operations will be applied to two groups of

entities at a time. The two groups must be under the same

topological framework. Each group can possess any num-

ber of topological entities. These entities must be refined,

as described in the next subsection, to meet the applica-

bility conditions of the Boolean operations.

2.2 Topological refinement of surfaces and curves

The conditions of applicability of the algorithm are

established to guarantee an essentially topological treat-

ment of the problem. The pre-processing of the input data

is made to guarantee that vertices, edges and faces do not

intersect but only touch each other along their boundaries.

This means that any type of intersections between points,

curves and surface patches must be calculated, before

applying the classification phase of the algorithm, by

subdividing the respective entities into two or more entities

of the same type and creating the topological elements

(vertices, edges and faces) that will satisfy the non-inter-

section properties presented as follows:

• A face can only intersect another face along the

boundary of at least one of the two faces.

• Edges cannot intersect each other unless at their end

points.

• Edges cannot intersect faces unless at the edges’ end

points.

• Vertices must be spatially distinct.

This refinement process is described in more details in

the work of Cavalcanti et al. [24]. Regions belonging to the

same group cannot intersect each other, unless along their

boundaries; and regions belonging to different groups may

intersect (i.e., share the same space). However, no region is

created or modified at the pre-processing stage.

There are no restrictions concerning the geometry of the

model. If all the conditions commented in this subsection

are satisfied, the algorithm will not require additional

topological information.

2.3 Boundary of topological entities

The third issue for the application of the proposed algo-

rithm is regarding the concept of boundary. The boundary

of a topological entity is considered here as all entities

hierarchically inferior to it (entities of lower dimensions)

that define its contour and that can be obtained by adja-

cency relationships through its data structure. The bound-

ary of an entity can contain several disconnect portions, but

Engineering with Computers (2012) 28:225–239 229

123

Page 6: Boolean operations on multi-region solids for mesh generation

each portion must form a connected and closed set of

entities of lower dimensions. For example, the edges and

vertices of the external loop of a face, forming a closed and

alternated cycle of edges and vertices, constitute a part of

the face boundary. The same apply to the edges and ver-

tices that form an internal loop of the same face. However,

a wire edge loose in the interior of a face constituting an

internal loop formed only by this one edge is not consid-

ered as part of the face boundary. The same argument can

be used for the faces belonging to an internal shell of a

solid. If they form a closed set of faces, constituting a

smaller region inside the main region, they are considered

as part of its boundary. But an internal shell constituted by

one or more faces without forming a closed region is not

considered as part of the solid’s boundary. This particular

definition of the boundary concept does not imply that

these internal loose or dangling structures cannot be used

as input data for the algorithm of Boolean operations. It

only means that when the boundaries of entities are refer-

red in some parts of the algorithm, it does not include such

structures.

3 Proposed algorithm for Boolean operations

This section presents the proposed algorithm for Boolean

operations on non-manifold solids. The algorithm consists

of two stages. The first stage is the pre-processing stage,

which consists of the selection of the groups and their

refinement. The second and main stage consists of the

classification of the topological entities followed by the

application of the desired Boolean operation over such

entities. An optional additional stage could be a regulari-

zation procedure, which consists in eliminating from the

result of a Boolean operation all the entities of lower

dimensions that remained loose or dangling.

The proposed classification phase of the algorithm is

based on the ideas introduced by Mantyla [7] for Boolean

operations in B-Rep models. However, just the central idea

of that algorithm was used, since it is only applicable to

polyhedral two-manifold solids. In addition, Mantyla’s

algorithm works only with two solids at a time, while the

proposed algorithm works with the concept of group

defined previously.

The main steps of the proposed algorithm for Boolean

operations in non-manifold solids are summarized in

Fig. 2, for two target groups named A and B.

The first step of the pre-processing stage consists in

storing, in some appropriate lists, the topological entities

(vertices, edges, faces and regions) belonging to each

group, along with all the topologically inferior entities that

form their boundaries or that remain dangling or loose in

their interiors of regions (or faces). Every topological entity

must be stored only once, i.e., the lists of topological

entities of each group cannot have duplicated entities.

However, a topological entity may belong to different

groups. There must be separate lists to store entities in

different groups and with different dimensions (e.g., a list

containing the vertices of group A and another list con-

taining the vertices of group B).

The second step corresponds to the refinement phase.

All intersections between surfaces and curves must be

computed. Vertices created by the intersection of two edges

of different groups are classified as belonging to both

groups, as well as edges resulting from the intersection of

two faces and faces created by the overlapping of two

faces.

The first step of the main stage consists in classifying the

entities of each group that were stored in their respective

lists. The entities from one group are classified against the

entities from the other group. The following notation is

adopted: AinB, AoutB and INTERS to indicate, respec-

tively, an entity of group A that is located inside any region

of group B, an entity of group A that is located outside all

regions of group B, and an entity belonging to both groups.

Procedures for point location (point in region and point

on face) are necessary for the classification phase. The

descriptions of some algorithms for point location can be

found in works by De Berg et al. [30] and Preparata and

Shamos [31].

Classifying a vertex means testing it against all the

regions from the other group (the group that does not

contain this vertex). Classifying an edge means checking

the classification already given to its vertices. If at least one

Fig. 2 Algorithm for Boolean operations in non-manifold solids

230 Engineering with Computers (2012) 28:225–239

123

Page 7: Boolean operations on multi-region solids for mesh generation

of the vertices is inside any region of the other group or

outside all regions of the other group, the edge will be

classified in the same way as the vertex. If both vertices are

classified as INTERS, then any point belonging to the edge,

except its end points, must be tested against the regions of

the other group. The classification of the edge will be the

same given to the point.

Classifying a face (surface patch) means checking the

classification already given to the vertices belonging to its

outer loop. If at least one of the vertices is inside any region

of the other group or outside all the regions of the other

group, the face will be classified in the same way as the

vertex. If all the vertices are classified as INTERS, then any

point belonging to the interior of the face must be tested

against the regions of the other group. The classification of

the face will be the same given to the point.

In essence, applying Boolean operations over the

groups’ entities means removing vertices, edges and faces

that are not part of the result, according to their

classification. Therefore, the second step of the main stage

consists in removing undesirable faces, edges and vertices,

for a target Boolean operation, which constitutes one of the

main contributions of this paper. This step is summarized

in the tables illustrated in Fig. 3.

The order in which the removals occur is important: first

the undesirable faces are removed, then undesirable edges

and, lastly, undesirable vertices. Entities with different

dimensions are separated, and the tables in Fig. 3 show

which of these entities should be removed, according to the

Boolean operation that is currently applied, with the

assumption that group A is dominant in relation to group B

or equal. Some of the terms used in Fig. 3 require more

detailed explanation:

• numRegA refers to the number of regions of group A

bounded by the face. Thus, numRegA = 0 means a

dangling face; numRegA = 1 means an external bound-

ary of a region; and numRegA = 2 means an internal

Fig. 3 Boolean operations

algorithm: entities that should

be removed

Engineering with Computers (2012) 28:225–239 231

123

Page 8: Boolean operations on multi-region solids for mesh generation

boundary of a region. Therefore, it is important to point

out here, the importance of the boundary concept

previously described.

• nA refers to the direction of the outward normal vector

of the face of group A, which is used to check the

relative angle between the normal vectors of faces of

different groups [11].

• dangOrLoose means an edge that is located in the

interior of a face, dangling or loose, belonging to a

removed face.

• loose means a vertex that is loose in the interior of a

face, belonging to removed face.

• numFaceA means the number of faces of group A

bounded by the edge.

• numEdgeA means the number of edges of group A

incident to the vertex.

• insideA means that the face is inside any region of

group A.

• outsideA means that the face is outside all regions of

group A.

In the boxes of Fig. 3 that have a horizontal dashed line,

when at least one of the sentences is true, it means that the

analyzed entities should be removed.

In the specific case of difference operations, the faces of

the list BinA that do not bound new regions, formed after

the conclusion of the Boolean operation, should be

removed.

An example of Boolean operations (union, intersection

and difference with dominance features) between two dif-

ferent groups (called G1 and G2) is presented in Fig. 4, to

illustrate the very simple use of the algorithm proposed in

Fig. 3.

An optional stage may be a regularization of the results

of a Boolean operation. Regularization means to eliminate

from the result all the entities of lower dimensions, in

such a way that only filling volumes are allowed, i.e., the

only entities that should remain after the process of reg-

ularization are the faces belonging to the boundary of a

given region, the edges of the boundaries of these faces

and the vertices at the ends of these edges. Therefore,

loose or dangling edges and faces and loose vertices that

might eventually appear as a result of a Boolean operation

must be removed if the user requires the regularization

process.

Regularized Boolean operations are important in

applications that intend to avoid a subset of the non-

manifold results, which can be obtained by applying

Boolean operations on manifold objects (e.g., homoge-

neous solid objects). They are also important in processes

where only filling volumes are relevant or meaningful, as

in industrial processes for constructing mechanical parts.

In these processes, entities of lower dimensions, such as

faces or edges, are not representable because they have

null width.

4 Practical applications

In this section, some results obtained by implementing the

proposed algorithm in a geometric modeler system are

presented [32, 33]. It is important to emphasize that the

modeler should provide tools for surface intersection and

for point location (point in region and point on surface).

First, some manifold outputs are shown to demonstrate the

Fig. 4 Application of the proposed algorithm into two groups of

entities and the respective results for union, intersection and

difference in Boolean operations

232 Engineering with Computers (2012) 28:225–239

123

Page 9: Boolean operations on multi-region solids for mesh generation

validity of the algorithm in a manifold environment. Then,

some non-manifold results are presented, generated by

applying Boolean operations over manifold solids and over

topological entities with different dimensions (e.g., faces

and solids). Finally, a complex example is presented to

show the capability of the proposed algorithm to generate

complex engineering models. The meshes are generated

using well-established algorithms such as [33–36] for

surface mesh generation and [37] volume mesh generation.

4.1 Manifold outputs

Applying Boolean operations over simple primitives as

cylinders, boxes and spheres may lead to more complex

solids of innumerous shapes. It is possible to notice some

of these solids in Fig. 5.

Figure 6 shows all the stages of the creation of a pile

and the generation of a mesh of tetrahedrons for the solid

that represents it. First, a union operation between two

boxes and a cylinder is performed. Then, a new cylinder is

inserted in the model and subtracted from the solid gen-

erated by the union operation. The last step is the genera-

tion of a finite element mesh of tetrahedrons for the solid

generated after the difference operation. It is important to

emphasize that each solid that will serve as input data for a

Boolean operation must be recognized as a closed region

and that all the intersections between surface patches must

be calculated before the application of any Boolean

operation.

An example of Boolean operations applied to two solids

bounded by generic curved surfaces is shown in Fig. 7. The

original solids (a ‘‘twisted cube’’ and a ‘‘bottle’’) with all

the intersections between surfaces already computed are

presented in Fig. 7a. Figure 7b shows the intersection

between these two solids. The difference operation

between the ‘‘twisted cube’’ and the ‘‘bottle’’ is shown in

Fig. 7c.

4.2 Non-manifold outputs

Sometimes, even when the input data are representable in a

manifold environment, the output data may not be so. That

is the case of the results shown in Fig. 8. In the first

example, some dangling faces are part of the result (faces

that are not part of the boundary of any solid). In the

second example, there are two solids touching each other

through a common edge. This edge is adjacent to four

different faces.

An example of the application of Boolean operations

over entities of different dimensions is presented in Fig. 9.

Fig. 5 Examples of manifold

solids obtained by applying

Boolean operations over simpler

primitives

Engineering with Computers (2012) 28:225–239 233

123

Page 10: Boolean operations on multi-region solids for mesh generation

This means that two groups of entities were selected, one

containing only faces and the other containing a solid.

4.3 Complex engineering (geomechanics) model

An appropriated set of Boolean operations over non-man-

ifold solids plays an important role in the creation of

complex discrete (finite element or boundary element)

models, such as the model generation of a tunnel system

crossing geological faults and with several horizons.

It is shown in Fig. 10 the steps necessary to create a

tunnel model with four geological layers and a fault using

the proposed Boolean operation algorithm. Figure 10a

depicts the original groups used to generate the model:

group G1 contains three geological horizons (layer’s

interface), group G2 contains the fault, group G3 contains

the model bounding box limited by the ground surface, and

group G4 contains the tunnel. Figure 10b–f show prepa-

rations or results of Boolean operation applied consecu-

tively on the groups to obtain the final model, and Fig. 10g

shows a detailed view of the tunnel crossing the fault and a

horizon after the application of the Boolean operations.

The second operand G3 of the difference operations shown

in Fig. 10c is the complement of group G3.

Fig. 6 Creation of a pile:

a primitive solids, b refinement,

c union operation, d insertion of

a new cylinder, e difference

between the solid and the new

cylinder and f tetrahedron mesh

for the resulting solid (pile)

234 Engineering with Computers (2012) 28:225–239

123

Page 11: Boolean operations on multi-region solids for mesh generation

5 Conclusions

An algorithm for Boolean operations on non-manifold

models is proposed to allow the treatment of solids with

multiple regions (internal interfaces) and degenerate por-

tions (shells and wires), in the context of mesh generation.

The algorithm was implemented in a pre-existing geo-

metric modeler for finite element solid mesh generation

[32, 33]. This modeler works with a hybrid data repre-

sentation in which every model, besides being represented

by the modeler’s internal data structure, can have another

representation given by the CGC library [24], whenever the

model needs to be topologically tied up.

In general, there are two main modeling strategies for

the creation of non-manifold solids. The first is analogous

to the B-rep approach of the two-manifold modeling of

homogeneous solids. This strategy is the referred to here as

direct cell manipulation [19, 20, 22, 24], in which a cell

can be a topological entity of any dimension, such as a

solid region, a surface patch or a wire curve. The second

approach, analogous to the CSG approach of the two-

manifold modeling, is called reasoning Boolean operations

[9–12, 16, 17, 23, 25, 26]. This strategy, in general, is used

to model manufacturable heterogeneous objects with inner

boundaries, but with no lower-dimension portions. This

works proposes an algorithm for the creation of discrete

models, in the context of mesh generation, whose high-

level interface are Boolean operations. These operations

apply to two objects that are organized as groups of

selected entities of different dimensions. The main contri-

bution of this study is that the proposed methodology

handles specifically lower-dimension entities that may be

Fig. 7 a Refinement,

b intersection and c difference

between two solids bounded by

curved surfaces

Engineering with Computers (2012) 28:225–239 235

123

Page 12: Boolean operations on multi-region solids for mesh generation

of interest in idealized models with dangling or loose parts.

These lower-dimension entities might represent restrictions

to solid finite element mesh generation inside a region,

interfaces between layers of different materials or anchor

bolts in a tunnel design.

To achieve the level of generality desired, some initial

conditions had to be imposed to guarantee an essentially

topological treatment of the problem. These initial condi-

tions implicate pre-processing the input data to assure that

all topological entities just touch each other (even if not

along their boundaries). This pre-processing stage is a

refinement of surfaces and curves of the groups (operands

of the Boolean operators). In this refinement, the original

regions of the groups are preserved because they are used

in the classification phase of the proposed algorithm. After

refinement, the classification phase relies on region point

location, which is the only geometric information that is

necessary to apply the algorithm. The remaining informa-

tion is essentially topological adjacency relationship.

The pre-processing stage is a refinement of surfaces and

curves of the groups (operands of the Boolean operators).

In this refinement, the original regions of the groups are

Fig. 8 Non-manifold results

obtained by applying Boolean

operations over manifold solids

Fig. 9 Boolean operations

applied over entities of different

dimensions

236 Engineering with Computers (2012) 28:225–239

123

Page 13: Boolean operations on multi-region solids for mesh generation

preserved because they are used in the classification phase

of the proposed algorithm. After refinement, the classifi-

cation phase relies on region point location, which is the

only geometric information that is necessary to apply the

algorithm. The remaining information is essentially

topological.

The classification phase of the algorithm is summarized

in three tables (Fig. 3), which constitute another contribu-

tion of this work. These tables indicate the topological

entities that should be removed according to the target

Boolean operation (union, intersection, or difference). A

dominance factor of a group in relation to the other is used

in an entity selection. The selection also takes into account

the case in which the groups have equal dominance factor.

Usually, this case occurs in modeling of homogenous

material solids. In this case, a regularization procedure

might be necessary to eliminate undesirable dangling and

loose parts after the removal of entities for a specific

Fig. 10 Creation of a tunnel

model crossing a fault and with

three horizons: a original

groups, b preparation and c

results of the differences G1 ¼G1� G3 and G2 ¼ G2� G3,

d union G1 = G1UG2

(G1 = G2), e union

G1 = G1UG3 (G1 [ G3),

f difference G1 - G4,

g detailed view of tunnel

intersections

Engineering with Computers (2012) 28:225–239 237

123

Page 14: Boolean operations on multi-region solids for mesh generation

Boolean operation. Finally, after removing entities, a

detection of new regions of the resulting non-manifold

object is performed.

The algorithm is very simple and intuitive, and its

implementation in any B-Rep-based non-manifold system

does not demand much effort. However, the system must

incorporate non-linear primitive intersection, region

detection and point location algorithms to assure the cor-

rect functioning of the Boolean operations algorithm.

Several tests were performed, using manifold and non-

manifold input data and leading to manifold and non-

manifold output data, yet not, respectively. The algorithm

proved to be quite efficient for relatively low-complexity

models. An efficiency analysis is necessary for highly

complex models, i.e., models with a significant number of

high-degree curved primitives, a considerable number of

surface intersections, a considerable number of closed

regions, too many topological vertices of one group located

inside the regions of the other group, and the presence of

surface overlapping.

It is important to mention that the algorithm depends

and relies on the geometric capabilities of the modeler,

since it should treat the geometric intersection problems, as

well as region detection and point location procedures in a

reasonable way.

Acknowledgments The authors would like to thank the Computer

Graphics Technology Group (Tecgraf) and Pontifical Catholic Uni-

versity of Rio de Janeiro (PUC-Rio) for the financial support and for

providing the necessary space and resources used during the devel-

opment of this work.

References

1. Hoffmann CM (1989) Geometric and solid modeling: an intro-

duction. Morgan Kaufmann, San Fransisco

2. Mantyla M (1988) An introduction to solid modeling Computer.

Science Press, Rockville

3. Requicha A (1977) Constructive solid geometry. Technical

Memo 25, University of Rochester, Production Automation

Project

4. Miller JR (1989) Architectural issues in solid modelers. IEEE

Comput Graph Appl 9:72–87

5. Requicha AG, Voelcker HB (1985) Boolean operations in solid

modeling: boundary evaluation and merging algorithms. Proc

IEEE 73:30–44

6. Shapiro V, Vossler DL (1993) Separation for boundary to CSG

conversion. ACM Trans Graph 12:33–55

7. Mantyla M (1986) Boolean operations of 2-manifolds through

vertex neighborhood classification. ACM Trans Graph 5:1–29

8. Gardan Y, Perrin E (1995) An algorithm for reducing 3D Boolean

operations to a 2D problem: concepts and results. Comput Aided

Des 28:277–287

9. Magalhaes ALCDC, Mesquita RC (2000) Exploring inner

boundaries in solid modelers applied to electromagnetic prob-

lems. IEEE Trans Magn 36:1682–1686

10. Sun W, Hu X (2002) Reasoning Boolean operation based mod-

eling for heterogeneous objects. Comput Aided Des 34:481–488

11. Qian X, Dutta D (2003) Heterogeneous object modeling through

direct face neighborhood alteration. Comput Graph 27:943–961

12. Kou XY, Tan ST, Sze WS (2006) Modeling complex heteroge-

neous objects with non-manifold heterogeneous cells. Comput

Aided Des 38:457–474

13. Sen D, Srikanth TK (2008) Efficient computation of volume

fractions for multi-material cell complexes in a grid by slicing.

Comput Geosci 34:754–782

14. Colyer B et al (1997) Project MIDAS: magnet integrated design

and analysis system. IEEE Trans Magn 33:1143–1148

15. Cracker GA, Reinke WF (1991) An editable nonmanifold

boundary representation. IEEE Comput Graph Appl 11:39–51

16. Masuda H (1993) Topological operators and Boolean operations

for complex-based non-manifold geometric models. Comput

Aided Des 25:119–129

17. Gursoz EL, Choi Y, Prinz FB (1991) Boolean set operations on

non-manifold boundary representation objects. Comput Aided

Des 23:33–39

18. Gursoz EL, Choi Y, Prinz FB (1990) Vertex-based representation

of non-manifold boundaries. In: Wozny M, Turner J, Preiss K

(eds) Geometric modeling for product engineering. North-

Holland, Amsterdam, pp 107–130

19. Rossignac JR, O’Connor MA (1989) A dimensional-independent

model for pointsets with internal structures and incomplete

boundaries. Geometric modeling for product engineering. North-

Holland, Amsterdam, pp 145–180

20. Weiler K (1986) Topological structures for geometric modeling.

Dissertation, Rensselaer Polytechnic Institute, Troy, NY

21. Weiler K (1988) The radial-edge structure: a topological repre-

sentation for non-manifold geometric boundary representation.

Geometric modeling for CAD applications. North Holland,

Amsterdam, pp 3–36

22. Lienhardt P (1991) Topological models for boundary represen-

tation: a comparison with n-dimensional generalized maps.

Comput Aided Des 23:59–82

23. Arbab F (1990) Set models and Boolean operations for solids

and assemblies. IEEE Comput Graph Appl 10:76–86. doi:

10.1109/38.62698

24. Cavalcanti PR, Carvalho PCP, Martha LF (1997) Non-manifold

modeling: an approach based on spatial subdivision. Comput

Aided Des 29:209–220

25. Rossignac JR, Requicha AG (1991) Constructive non-regularized

geometry. Comput Aided Des 23:21–32

26. Gardan Y, Minich C, Perrin E (2003) Boolean operations on

feature-based models. J WSCG (Winter School of Computer

Graphics)

27. Keyser JC, Culver T, Foskey M, Krishnan S, Manocha D (2004)

ESOLID—a system for exact boundary evaluation. Comput

Aided Des 36:175–193

28. Shewchuk JR (1997) Adaptive precision floating-point arithmetic

and fast robust geometric predicates. Discrete Comput Geometry

18:305–363

29. Keyser JC (2000) Exact boundary evaluation for curved solids.

Dissertation, University of North Carolina

30. De Berg M, Van Kreveld M, Overmars M, Schwarzkopf O (1997)

Computational geometry: algorithms and applications. Springer,

Berlin

31. Preparata FP, Shamos MI (1990) Computational geometry: an

introduction. Springer, New York

32. Coelho LCG, Gattass M, Figueiredo LH (2000) Intersecting and

trimming parametric meshes on finite-element shells. Int J Numer

Methods Eng 47:777–800

33. Lira WWM, Coelho LCG, Cavalcanti PR, Martha LF (2002) A

modeling methodology for finite element mesh generation of

multi-region models with parametric surfaces. Comput

Graph 26:907–918

238 Engineering with Computers (2012) 28:225–239

123

Page 15: Boolean operations on multi-region solids for mesh generation

34. Miranda ACO, Martha LF (2002) Mesh generation on high-

curvature surfaces based on a background quadtree structure. In:

Proceedings of 11th international meshing roundtable, Ithaca,

pp 333–341

35. Lira WWM, Coelho LCG, Martha LF (2002) Multiple intersec-

tions of finite-element surface meshes. In: Proceedings of 11th

international meshing roundtable, Ithaca, pp 355–363

36. Miranda ACO, Martha LF, Wawrzynek PA, Ingraffea AR (2009)

Surface mesh regeneration considering curvatures. Eng Comput

25:207–219. doi:10.1007/s00366-008-0119-9

37. Cavalcante-Neto JB, Wawrzynek PA, Carvalho MTM, Martha

LF, Ingraffea AR (2001) An algorithm for three-dimensional

mesh generation for arbitrary regions with cracks. Eng Comput

17:75–91

Engineering with Computers (2012) 28:225–239 239

123