An algorithm for discrete booleans with applications to finite element modeling of complex systems

18
An algorithm for discrete booleans with applications to finite element modeling of complex systems B. Kaan Karamete a,n , Saikat Dey b , Eric L. Mestreau a , Romain Aubry a , Felipe A. Bulat-Jara a a Sotera Defense Solutions at US Naval Research Laboratory, 1501 Farm Credit Drive, McLean, VA 22102, USA b US Naval Research Laboratory, Code 7130, 4555 Overlook Ave SW, Washington, DC 20375, USA article info Article history: Received 10 May 2012 Received in revised form 14 January 2013 Accepted 16 January 2013 Available online 11 February 2013 Keywords: Boolean Triangulation Discrete Mesh Sizing sources Remeshing abstract In this paper we describe a robust algorithm for three-dimensional boolean operations between boundary representation objects whose geometry is given by discrete (faceted) data. The algorithm presents a new approach for computing the intersection graph which is critical for robustness. It uses elementary computational-geometry operations such as, facet–segment intersection, point contain- ment in simplices and edge recovery in a plane, to produce high-level boolean operations including union, intersection, difference as well as the imprint of the boundary of one object onto another. We also demonstrate the extension and application of the algorithm to mesh-based volumes. We show the robustness and efficacy of our algorithm by employing it to model complex three-dimensional finite element mesh models such as a complete ship where some of the model components are defined in a CAD-based system while others come from legacy mesh-based facetized representations. Use of our algorithm has enabled automation of modeling of very complex configurations reducing the turn- around time for analyses-ready numerical representations from several months to hours or less. & 2013 Elsevier B.V. All rights reserved. 1. Introduction Engineering analyses and design of any complex system requires one to get an analyzable representation of the system and its environment. This usually involves, at a minimum, the following aspects: 1. A mathematically rigorous representation of the domain geometry usually described as a boundary-representation (BREP) based geometric model which provides an explicit representation of the topological entities that comprise the boundary of an object along with shape, 2. A discrete representation of the domain geometry usually called the mesh model, and 3. Information needed for the analysis/design that are not in the geometric or the mesh model usually referred to as attributes which typically include material properties and the like. A geometry-centric approach where the mesh model and analysis attributes are associated with, and dependent on the geometry model, offers several advantages that include: 1. Robust mesh generation and adaptation due to mathemati- cally rigorous definitions of mesh validity based on concepts of consistency of the mesh model with respect to the geometric model. If the mesh model is not dependent on the geometry model, robust definitions of mesh validity lack and ensuring a valid mesh becomes more expensive. 2. Automated ability to update the information needed by the solvers when geometry is changed. This is not possible in approaches that are mesh-centric where analysis information is attached to the mesh model without any reference to the geometry model associativity. The most productive and straightforward approach to realize a geometry-based analysis and design setup is to use a geometry system 1 that provides accurate boundary-representation-based geometry as well as fully automated algorithms for boolean operations involving complex three-dimensional shapes. This provides for the ability to construct the geometric representa- tion of very complex systems (such as an aircraft or a ship) by combining bottom-up and top-down approaches. The geometry-based approach is tailor-made for workflows where geometry may be created from scratch or sourced entirely from a CAD-based system. However, in many cases the descrip- tion of geometry of the entire system to be analyzed may not exist Contents lists available at SciVerse ScienceDirect journal homepage: www.elsevier.com/locate/finel Finite Elements in Analysis and Design 0168-874X/$ - see front matter & 2013 Elsevier B.V. All rights reserved. http://dx.doi.org/10.1016/j.finel.2013.01.003 n Corresponding author. Tel.: þ1 5182696226. E-mail address: [email protected] (B. Kaan Karamete). 1 Such as a computer-aided-design (CAD) system or geometry kernels that underly a CAD system. Finite Elements in Analysis and Design 68 (2013) 10–27

Transcript of An algorithm for discrete booleans with applications to finite element modeling of complex systems

Page 1: An algorithm for discrete booleans with applications to finite element modeling of complex systems

Finite Elements in Analysis and Design 68 (2013) 10–27

Contents lists available at SciVerse ScienceDirect

Finite Elements in Analysis and Design

0168-87

http://d

n Corr

E-m

journal homepage: www.elsevier.com/locate/finel

An algorithm for discrete booleans with applications to finite elementmodeling of complex systems

B. Kaan Karamete a,n, Saikat Dey b, Eric L. Mestreau a, Romain Aubry a, Felipe A. Bulat-Jara a

a Sotera Defense Solutions at US Naval Research Laboratory, 1501 Farm Credit Drive, McLean, VA 22102, USAb US Naval Research Laboratory, Code 7130, 4555 Overlook Ave SW, Washington, DC 20375, USA

a r t i c l e i n f o

Article history:

Received 10 May 2012

Received in revised form

14 January 2013

Accepted 16 January 2013Available online 11 February 2013

Keywords:

Boolean

Triangulation

Discrete

Mesh

Sizing sources

Remeshing

4X/$ - see front matter & 2013 Elsevier B.V.

x.doi.org/10.1016/j.finel.2013.01.003

esponding author. Tel.: þ1 5182696226.

ail address: [email protected] (

a b s t r a c t

In this paper we describe a robust algorithm for three-dimensional boolean operations between

boundary representation objects whose geometry is given by discrete (faceted) data. The algorithm

presents a new approach for computing the intersection graph which is critical for robustness. It uses

elementary computational-geometry operations such as, facet–segment intersection, point contain-

ment in simplices and edge recovery in a plane, to produce high-level boolean operations including

union, intersection, difference as well as the imprint of the boundary of one object onto another. We also

demonstrate the extension and application of the algorithm to mesh-based volumes. We show the

robustness and efficacy of our algorithm by employing it to model complex three-dimensional finite

element mesh models such as a complete ship where some of the model components are defined in a

CAD-based system while others come from legacy mesh-based facetized representations. Use of our

algorithm has enabled automation of modeling of very complex configurations reducing the turn-

around time for analyses-ready numerical representations from several months to hours or less.

& 2013 Elsevier B.V. All rights reserved.

1. Introduction

Engineering analyses and design of any complex systemrequires one to get an analyzable representation of the systemand its environment. This usually involves, at a minimum, thefollowing aspects:

1.

A mathematically rigorous representation of the domaingeometry usually described as a boundary-representation

(BREP) based geometric model which provides an explicitrepresentation of the topological entities that comprise theboundary of an object along with shape,

2.

A discrete representation of the domain geometry usuallycalled the mesh model, and

3.

Information needed for the analysis/design that are not in thegeometric or the mesh model usually referred to as attributeswhich typically include material properties and the like.

A geometry-centric approach where the mesh model andanalysis attributes are associated with, and dependent on thegeometry model, offers several advantages that include:

All rights reserved.

B. Kaan Karamete).

1.

und

Robust mesh generation and adaptation due to mathemati-cally rigorous definitions of mesh validity based on concepts ofconsistency of the mesh model with respect to the geometricmodel. If the mesh model is not dependent on the geometrymodel, robust definitions of mesh validity lack and ensuring avalid mesh becomes more expensive.

2.

Automated ability to update the information needed by thesolvers when geometry is changed. This is not possible inapproaches that are mesh-centric where analysis informationis attached to the mesh model without any reference to thegeometry model associativity.

The most productive and straightforward approach to realize ageometry-based analysis and design setup is to use a geometrysystem1 that provides accurate boundary-representation-basedgeometry as well as fully automated algorithms for booleanoperations involving complex three-dimensional shapes. Thisprovides for the ability to construct the geometric representa-tion of very complex systems (such as an aircraft or a ship) bycombining bottom-up and top-down approaches.

The geometry-based approach is tailor-made for workflowswhere geometry may be created from scratch or sourced entirelyfrom a CAD-based system. However, in many cases the descrip-tion of geometry of the entire system to be analyzed may not exist

1 Such as a computer-aided-design (CAD) system or geometry kernels that

erly a CAD system.

Page 2: An algorithm for discrete booleans with applications to finite element modeling of complex systems

B. Kaan Karamete et al. / Finite Elements in Analysis and Design 68 (2013) 10–27 11

in a CAD system or is in a form that makes it very tedious andtime consuming to convert it to a CAD system. One example of such acase is when a new system, like a ship, is to be analyzed foroperational effectiveness where the main geometry of the hull andrest of the super structure may come from a CAD-based representa-tion, but many of its component systems, such as a pump, may bereused from older designs for which the only available representationis a simple discrete description of the geometry in the form of a meshor facet-based data. Another example of interest to us involvesmodeling urban environments where the ground geometry may bein discrete data coming from a LIDAR scan which needs to becombined with models of vehicles or buildings that may be comingfrom CAD-based descriptions. In such situations, one can still makethe geometry-centric approach work by producing a boundary-representation geometry for those objects that are available only indiscrete data form. This requires one to derive a topological repre-sentation of the boundary of the object such that the given discretedata represents a consistent discretization of the derived boundarydescription. It also requires one to assign proper shape to the resultingboundary representation. One can achieve this by either,

Fig. 1. Data flow models depicting the CAD-based and discrete-data based

pipelines. The downstream workflows/applications and algorithms work seamlessly

1. irrespective of the data source.

bou

Reconstructing the geometry of the discretely defined objectentirely in a CAD-system or kernel.

2.

Reconstructing only the topology of boundary representationand utilizing the shape information derived from the discrete(mesh) data.

One way to realize the first approach is to use an interpolation to

define the shape of the new object in the geometry system. Thisincurs errors in the shape and is hard to automate for completelyunstructured or irregular data. An alternative is to simply take eachmesh entity in the mesh-based description and recreate it as-is in aCAD-based system [1]. This can be entirely automated, but has twomain issues; first, it can end up creating too many entities in thegeometric model and second, it can produce many small topologicalfeatures on the boundary of the model that then degrade the qualityof the resulting mesh. For these reasons, the second approach is anattractive alternative from the standpoint of providing quick turn-around time for users when faced with complex model data indiscrete form as well as fitting into the geometry-(BREP)-basedapproach in a seamless manner as depicted in Fig. 1. One challengefor the second approach is a robust ability to do boolean operationson the boundary representation objects described with discrete(mesh) data. The format of the input surfaces is either triangular orquadrilateral mesh faces.

Our main focus in this paper is implementing a robust algorithmto perform discrete boolean operations between two BREP objects. Inparticular, the following boolean operations are considered:

Union Given two BREPS, A and B, the result of a union is the BREPC ¼ A [ B that contains the set of points that belong to theclosure2 of either A or B. Our implementation supports, boththe regularized (manifold) and non-regularized (non-mani-fold) cases as depicted in Fig. 2(b, c).

Difference Given two BREPS, A and B, the result of a difference isthe BREP C ¼ A\B that contains the set of points thatbelong to the closure A but not interior to B as depictedin Fig. 2(d).

Intersection Given two BREPS, A and B, the result of an intersec-tion is the BREP C ¼ A \ B that contains the set of pointsthat belong to the closure of both A and B as depicted inFig. 2(e).

2 Closure denotes the set of points strictly in the interior as well as on the

ndary of an object.

In addition, we also implement the imprint operation whichmodifies only the boundary topology of one BREP for thoseportions where it intersects with the boundary of another BREPas depicted in Fig. 2(f). For a more complete description of point-set boolean operations used in geometric modeling, one may referto [2]. We also show examples employing these algorithms torealize complex modeling workflows including surface andvolume meshing of the resulting model, as well as, managementof any attribute(s) assigned to the original objects.

The rest of the paper is organized as follows: Section 2 defines thetopological hierarchy that describes our boundary representationscheme as well as the automated building of boundary topology ofthe input discrete geometry objects (depicted by the box (A) in Fig. 1).Section 3 gives an outline of the algorithm including the main stepsinvolved; computing the intersection of the boundary of the inputobjects is described in Section 4; Section 5 presents the determinationand topological recovery of the coherent boundary triangulations onthe input objects that account for the boundary intersections; Section6 describes the actual evaluation of the discrete-boolean operationsutilizing the boundary intersection information. Section 7 describesthe remeshing of the resulting boundary representation based onlocal mesh modification operations starting from the input discretiza-tion. In addition, it describes updating the boundary representationbased on the final mesh to reflect a consistent association of the finalmesh with the resulting boundary representation of the geometry. Italso handles the propagation and update of attribute informationassociated with the original input objects. Section 8 describes theability to handle input descriptions that include volume entities andmixed dimension discretizations. Section 9 gives results of theapplication of the presented algorithm to several examples involvingfinite element modeling of complex systems and Section 10 con-cludes with a summary of future work.

2. Preliminaries

2.1. Boundary representation building

Since most input discrete data do not originate from ageometry model with a consistent representation of its bound-ary-topology, we process the discrete geometry input to constructa boundary-representation of a geometric model that corresponds

Page 3: An algorithm for discrete booleans with applications to finite element modeling of complex systems

Fig. 2. Point-set boolean operations: (a) input BREPS with results for (b) regularized union, (c) non-regularized union, (d) difference, (e) intersection and (f) imprint. Note

that the result in (c) has three regions and is non-manifold when used with three-dimensional solid objects.

Fig. 3. The intersection graph for facets from two BREPS A (thin solid lines) and B

(broken lines) is defined by two vertex-connected edge-chains fv1 ,v2 ,v3g (thick

lines) and fv4 ,v4g (no edge).

B. Kaan Karamete et al. / Finite Elements in Analysis and Design 68 (2013) 10–2712

to the given discrete data. This process is called the discrete

geometry building (DGB) and relies on topological boundaryfeature extraction based on angle thresholds.

The process of building the boundary representation of a geo-metric model for the input data also creates the classification of themesh entities (vertices, edges, faces and regions) on appropriateentities of the resulting geometric model. For example, a mesh of acube would result in eight geometrical vertices, twelve geometricaledges and six geometrical faces. This is more than just surfacewalking and grouping mesh entities because the complete one-level-up-and-down inter-entity adjacencies are also computed. Whilenot the focus of this paper, this is critical in two ways. First, it enablesus to have a consistent definition of validity when performing localmesh modification operations [3,4], and second, it enables us tohandle attribute specification based on a boundary representation, akey part of our technical approach. Our approach relies on using thetopological data model described in [5,6] and is depicted in Fig. 4.

2.2. Intersection graphs

The discrete boolean operations rely on a critical topologicalconcept called the intersection-graph [7]. It is a graph consisting of achain of edges connected by shared vertices. It is a discrete repre-sentation of the intersection-set of the boundary of the two inputobjects. Fig. 3 depicts intersection graph examples; note that in somespecial cases the graph may have just a vertex and no (null) edges.

The main algorithm for discrete booleans will be explained basedon a simple case consisting of two intersecting cylindrical objects asdepicted in Fig. 5. The discrete data (mesh) for the two objects is usedby the discrete geometry builder algorithm to create the topology ofthe boundary representation for each object. The resulting boundaryrepresentations along with its support mesh entities are illustrated inFig. 6. The statistics of the boundary topology for the boundaryrepresentations are listed in Fig. 6(b, c); the number of geometricmodel entities created are dependent on the angle thresholds usedand, in general, the number of entities in the geometric model is lessthan those in the input discrete representation. The main steps of thealgorithm are discussed next.

3. Main steps

Discrete boolean operations require the classification of por-tions of boundaries of the two input objects as inside, outside and

common with respect to each other so that various booleanoperations could be performed by using simple point-set logic.This requires computation of the intersection graph between theboundaries of the two objects. One key requirement is that theintersection graph must be unique and identical for both inputobjects. This is needed for two reasons. First, it ensures the properdetection of common volumes between the input BREPs; second,it enables the merging of the input (intersecting) BREPs such thatthe result is topologically consistent. This is because edges onboth BREPs corresponding to the same end vertex intersectionlocations can be merged as long as the intersection graph isuniquely matching. Merging of edge pairs results in one con-nected, conformal BREP out of the two intersecting BREPs. There-fore, the first goal is to design an efficient algorithm to creatematching intersection graphs on both BREPs. To this end, thereare two major approaches:

a.

Explicit creation of intersection-graph ring-topologies (incre-mental approach) [8,9],

b.

Implicit creation of intersection-graph ring-topologies (globalapproach) [10,11].

Forming matching edge-pairs requires edge and face splits oneach input BREP. Use of one of the two approaches above is

Page 4: An algorithm for discrete booleans with applications to finite element modeling of complex systems

Fig. 4. Data Model: Geometric entities have one-level-up-and-down adjacencies. A geometrical model may be composed of a set of BREPs. A number of mesh models can

be associated with the same geometry model. Mesh entities can be defined on geometrical entities based on the classification rule, e.g., a mesh face can be classified on a

geometry face or a geometry region but not on a geometry edge. It is possible to create many different mesh views based on mesh inter-entity adjacency relations.

Moreover, partial adjacencies are also possible by the use of scopes, e.g., the definition of a mesh face from a set of mesh vertices classified on a geometrical face will also

implicitly create mesh edges if mesh face to mesh edge adjacencies are also requested if the scope of mesh edges are also set at least at GFace level; if the scope of mesh

edges are set at GEdge level, then partial adjacency from mesh faces to mesh edges are created, i.e., only edges classified on geometric edges will appear in mesh faces’

mesh edge inter-adjacency list.

Fig. 5. The input is two inter penetrating BREPS. (a) The transparent top view,

(b) Hidden line perspective view of the two cylinder BREPs.

B. Kaan Karamete et al. / Finite Elements in Analysis and Design 68 (2013) 10–27 13

required to compute the intersection graph where the splits are tobe made. The approach in [8,9] favors the deduction of theintersection graph chains in an explicit manner in which theintersections are performed starting from a seed facet–segment ina walking pattern by visiting the facets and segments always inthe immediate neighborhood of previously computed intersectionset. This is an incremental process that eventually forms theconnected chain(s). The order in which the facets and segments(walk) are visited is also the order in which the split operationsare performed. This ensures that the splits create matching edge-pair chains for the subsequent edge merging operation. However,

as the authors state, the explicit formation of the intersectiongraph rings is prone to algorithmic and numerical issues, parti-cularly, for when the mesh/facet sizes for the input BREPs differsignificantly.

A representative case is illustrated in Fig. 7 when one large meshface/facet intersects many facets with the other BREP and theresulting intersection points may be part(s) of two or more rings(chains) of the to-be-extracted intersection graph. In the incrementalapproach, one has to be very careful to keep the parallel-history ofwalking on each of these potential chain-paths to decipher theconnected rings of the common intersection graph.

We have developed a new and novel implicit approach tocomputing the matching intersection graphs that addressedlimitations with the explicit approach and is more robust. Implicitformation of the intersection graph requires compiling of rela-tional information between intersecting facets of the two BREPsusing unordered facet–segment intersections and localizations.The face–face intersections are computed similar to [10] and [11].

Specific steps of the overall discrete boolean algorithm, usingthe implicit method for matching intersection graph, are itemizedbelow.

1.

Find intersections between BREP1 edges and BREP2 faces. 2. Find intersections between BREP2 edges and BREP1 faces. 3. Localize intersection points on intersected edges and faces.
Page 5: An algorithm for discrete booleans with applications to finite element modeling of complex systems

B. Kaan Karamete et al. / Finite Elements in Analysis and Design 68 (2013) 10–2714

4.

Fig. 6topo

and

with

Edge

mesh

assoc

geom

3 fro

Fig.appr

exec

side

Create a relational table between faces of BREP1 and BREP2based on intersection data.

5.

Resolve the relational table for each face to create sets ofintersection point pairs (intersection graph edges).

6.

Triangulate each face in such a way that the entire intersec-tion graph edge set per face is preserved.

BREP1 Face2

BREP2 Face5

Edge5

. Discrete geometry builder (DGB) builds the association between geometric

logies and mesh entities. (a) Discrete geometry faces, namely, Face 2 of BREP1

Face 5 of BREP2 are intersecting. (b) The discrete geometry topological tree

one-level-up-and-down inter-topology adjacencies are shown. Note that

5 is used twice by Face 5 as it is a seam. (c) The number of different level

entities are classified against the discrete topology, e.g., 4 mesh vertices are

iated with 4 geometric vertices, a total of 92 mesh edges are classified on 6

etrical edges, and 924 mesh faces are classified on 6 geometrical faces,

m each BREP.

7. The conceptual layout of two intersecting facet sets on two penetrating BREPs

oach: (a) The parallel formation of two distinct chains, that are tied to the same

ution simultaneously, (b) the ambiguity to distinguish between one or two chain fo

of the facet being intersected will result in the modification of the intersection se

7.

. Rob

face

rmat

t on

Make sure that all intersection graph face edges are recovered.

8. Edges on both sides must be conformal, create an edge and

vertex map on both sides due to (7). This is the conformalintersection graph of BREP1 and BREP2.

9.

Categorize faces on BREP1 that are outside and inside of BREP2. 10. Categorize faces on BREP2 that are outside and inside of BREP1. 11. Remove respective categorized faces based on the specified

boolean operation.

12. Merge edges of BREP1 with the edges of BREP2 specified in

the edge map. Merge Brep1 with Brep2.

13. Remove all geometrical classifications. 14. Rebuild the discrete geometric topology based on angle

thresholds, i.e., re-classify the mesh.

15. Transfer of user attributes to new geometrical topologies. 16. Locally remesh to improve quality around the intersection graph.

Steps 1–5 will be explained in Section 4, steps 6–8 in Section 5,steps 9–12 in Section 6, and steps 13–16 in Section 7.

4. Computing intersection between discrete boundaryrepresentations

To create the intersection graph between two input objects,BREP1 and BREP2, it is necessary to compute the facet–segmentintersections between

i.

the edges of BREP1 and the faces of BREP2, and ii. the edges of BREP2 and the faces of BREP1, consecutively as

seen in Fig. 10.

To compute above intersections efficiently, we build twospecial octrees [12] using an adaptive subdivision scheme basedon the number of facets stored inside each terminal octant.Firstly, we detect intersected geometry faces between the two

ustness issues with creating matching intersection graph using the explicit

t on one BREP, requires complex algorithm to keep the intersection history

ions due to the same facet being involved in intersections, (c) the split on one

the other side which would require the upper chain to be recomputed.

Page 6: An algorithm for discrete booleans with applications to finite element modeling of complex systems

B. Kaan Karamete et al. / Finite Elements in Analysis and Design 68 (2013) 10–27 15

BREPs using fast bounding-box intersections. Note that geometryfaces are clustered set of mesh faces based on some geometricalpredicates such as facet normal deviations and analysis attributes.Secondly, the facets (mesh faces) classified on intersected geo-metry faces of BREP1 are inserted into the first octree. A secondoctree is generated identically by repeating the same insertionprocess for BREP2 faces. These two octrees store potentiallyintersecting sets of mesh faces based on bounding boxes.

The intersection of an edge of BREP1 against the faces of BREP2in item (i) above, is computed in the following manner:

a.

Figplan

sati

par

The

equ

Identify potentially intersecting BREP2 faces using the bound-ing box of BREP1 edge on the tree generated using BREP2faces, then

b.

Fig. 9. Entity localization and containment check for the intersection point p

inside the face f for splits. First the distance from p to corner vertices is checked

against the tolerance E to decide if p is localized on one of the face vertices vi. Then

the distance from p to each edge ei is computed using the barycentric areas Ai. If Ai

is less than zero then p is outside of f. If only one Ai is less than the edge relative Etolerance then p is localized on ei. Otherwise, p is deemed to be localized on f.

Compute true (‘‘go-through’’) intersection(s) using facet–seg-ment intersections for the faces identified by the bounding-box test.

Facet–segment intersection algorithm has been studied bymany researchers [8,9,13–15] and briefly summarized here inFig. 8. Having found the intersection point between the plane ofthe facet and the edge segment, it is necessary to check if thepoint of intersection is contained within the bounded triangularface entity. A barycentric face containment check is used for thispurpose where the barycentric areas are computed form eachedge to the point of intersection. If any of these sub-barycentricareas is less than zero then the intersection point is outside of theface. Otherwise, the intersection point corresponding to the facetentity and the sub-entity where the intersection point lies on theother BREP is localized and recorded (see Fig. 9).

All possible facet–segment intersections are computedbetween BREP1 faces and BREP2 edges and vice versa as depictedin items (i) and (ii) above. Constructing this raw intersectionrecord between the two BREPs is illustrated in Fig. 10. This rawintersection record is not readily useful since splits at theselocations would subsequently destroy the entities in the records.Additionally, splits independently performed on each BREP do notguarantee that the results will have matching conformal edgechains between intersection point pairs. This is because there isno implicit information on how these intersection points connect

. 8. Computing the ‘‘go-through’’ intersection location p between a triangular

e v0 ,v1 ,v2 and a segment p0 ,p1. If the plane–segment intersection condition is

sfied, i.e., the segment end vertices lie on opposite sides of the plane, the scalar

ameter t is computed by inserting the line equation into the plane equation.

coordinates of intersection point p can then be computed via the line

ation.

with each other in this raw form. Therefore, a different form ofdata structure is required such that the splits would not bedestructive to the information in the records and reflect howthe intersection points connect with each other to create match-ing conformal edge chains on both BREPs. To this end, a relationaldata structure based on faces on both BREPs is constructed. This isdescribed in Section 4.1.

4.1. Face-to-face relational multi-map generation

In the raw intersection data, each intersection point belongingto a BREP is associated with a face of the same BREP and alocalized mesh sub-entity of the other BREP (Fig. 11a, b). The sub-entity field of this raw intersection record is replaced by as manyrecords as there are adjacent faces to the localized sub-entity. Theinter-entity adjacencies are used to multiply the data records sothat all possible face to face relations over each intersection pointcould be generated as depicted in Fig. 11(c). Next step involvesextraction of intersection points that share the same face pairsfrom the modified records. This is achieved by inverting the tablein Fig. 11(c). The result is a multi-keyed look-up table (multi-map) from paired faces to each intersection point and depictedin Fig. 11(d).

4.2. Resolving of relational face maps

A more useful form to deduce intersection graph edges is torelate a set of intersection point pairs within each face. To thisend, intersection point pairs are composed from identical facepairs appearing in the multi-map. For each face of the face pair inthe multi-map, the algorithm searches through the multi-map topick points that have the same second face. For instance, thesearch for face F3 in Fig. 11(d), starts searching from the firstrecord to extract points that have the identical second face to F3through the depth of multi-map. This search algorithm first finds

Page 7: An algorithm for discrete booleans with applications to finite element modeling of complex systems

Fig. 10. Illustration of constructing the intersection record for booleans on a small portion of the inter-penetrating B-reps, BREP1 and BREP2. (a) Two intersecting facets of

BREP1 and BREP2. (b) Edges of BREP2, E52 and E50 intersecting with the facets of BREP1, F1 and F2, respectively. (c) Edges of BREP1, E67 intersecting with the facet of

BREP2, F3. (d) Intersection vertices of BREP1, 1, 2, 3 and BREP2, 10 , 20 , 30 . (e) The raw intersection record on BREP1 and BREP2 are tabulated as the pairs of intersection

points and mesh entities that intersections occur on both BREPs.

Fig. 11. Face intersection map (FIM) generation algorithm: (a) The facet–segment intersections between the two BREPs. (b) The result of intersections: a set of facet entity

on BREP1, intersection sub-entity on BREP2 for intersection points 1, 2 and facet entity on BREP2 with intersected sub-entity on BREP1 for point 3. (c) Intersected sub-

entities are related to the faces using entity-to-face adjacency, e.g., E67 is adjacent to F1 and F2. (d) face-to-face pairwise relational intersection multi-map is generated; for

each intersection point, corresponding face pairs are extracted using the inverse of previous form. (e) From the multi-map, a set of intersection point pairs is deduced for

each face. (f) This FIM constitutes the intersection graph edge data for each mesh face with coinciding intersection nodes between 1�10 ,2�20 and 3�30 on BREP1 and

BREP2, respectively.

B. Kaan Karamete et al. / Finite Elements in Analysis and Design 68 (2013) 10–2716

Page 8: An algorithm for discrete booleans with applications to finite element modeling of complex systems

B. Kaan Karamete et al. / Finite Elements in Analysis and Design 68 (2013) 10–27 17

two intersection points, (1, 3), corresponding to F1 as identicalface pair component. Similarly, the search further continues toextract another two points, (3, 2), corresponding to F2 as identicalface pair to F3. The resulting form is simply called Face Intersec-tion Map (FIM) and depicted in Fig. 11(e). The visual representa-tion of FIM is illustrated on two BREP1 faces F1 and F2 and oneBREP2 face F3 as a set of connected edges in Fig. 11(f).

4.3. Degeneracy and singularity resolution

The face–segment intersection tests, whose equations arepictorially given in Fig. 8 and 9 may result in a situation thatthe segment is just touching on the face or going through one ofits vertices. Our goal is to create matching entities on both BREPsfor these cases. The latter one is addressed trivially that the entityat which the intersection happens is found to be one of the facetvertices by the containment checks, and inserted into FIMaccordingly. The former case, in which the segment touches onthe face, results in one vertex that is not connected to anyintersection graph edge. The intersection graph in this case isthe vertex itself. This is reflected and tagged in FIM specially.Consequently, the split of the face and the split of the intersectingsegment edge at the vertex location recovers the intersectiongraph vertex on both BREPs identically.

In this section, the facet–segment intersections are discussedfor ‘‘go-through’’ cases. However, if the facet and the segment lieon the same plane, i.e., the plane of the facet, then extra measureshave to be taken. We have experimented the resolution proposedby Aftosmis [10] by using ‘‘virtual perturbation algorithms’’, butconcluded to address the issue more concretely as an improve-ment to our algorithm in a future article.

5. Triangulating faces

Face-intersection-map (FIM) is constructed per face, i.e., it isthe imprint of the one BREP onto the other one over each face. Thetask at hand is to insert the vertex-pair sets of FIM into each faceand ensure the edges per vertex pair are recovered after the splits.

F1

1 3

3

2

1’ 3’ 2’

F3 F2

1 3

3

2

1’ 3’ 2’

Fig. 12. Triangulate each face independently in FIM splitting the face at each of the inte

BREP2 face F3. (b) Face and edge splits are performed within F1, F2 and F3 on nodes 1�1

is ensured by edge recovery within each face based on FIM.

This is the piecewise definition of intersection graph between thetwo BREPs. The special case of only one vertex touching a meshface requires the recovery of the vertex which is trivially satisfiedby the split operation. For all other cases, the insertion of the twovertices of the vertex-pair does not guarantee that there would bean edge between the vertices as depicted in Fig. 13. The strategyof sorting the vertex-pairs such that the vertex pairs forms anordered chain increases the chances of having the edges betweeneach vertex pair after the splits. The split of vertices can happenon an existing edge or a face. The original face in which theintersection map vertex pairs are tabulated can be defined as themaster face to indicate that the following vertex splits and edgerecovery manipulations would be contained within the closure ofthis master face. The split operation of the very first vertex in thechain requires the master face to be deleted from the mesh datastructure. However, retaining this face has algorithmic merits inlimiting the operations within the convex boundary of the masterface until all vertex splits are performed. The number of new facesafter each split operation will not be many. Therefore, thedecision of finding if an edge or face split has to be performedat the vertex location are carried by containment checks on all ofthe newly created faces inside the master face. Again, barycentricface containment check is used to localize the entity for splits.

First, the distance from the intersection point, i.e., the vertexcoordinate of one the vertex-pairs to each face’s corner vertex ischecked against a tolerance to decide if vertex is localized on oneof the face vertices. Then the distance from the vertex to eachface-edge is computed using the barycentric areas. If any of theseareas is less than zero then the vertex is outside of the face whichis generally not the situation for the master face due to the natureof the FIM construction process. However, it may happen after thefirst split as there will be more faces due to the prior splits insidethe master face. In such a case, we move to the next adjacent faceof the edge whose area coordinate is negative, and start localizingthe vertex within the next adjacent face [16]. If only onebarycentric area is less than the edge relative tolerance, thenthe vertex is localized on the corresponding face edge. Otherwise,the vertex is deemed to be localized on the face topologyitself. The implementation details of the containment check and

1 3 2

rsection point pairs: (a) The intersection graph edges on BREP1 faces F1 and F2 and0 ,2�20 and 3�30 . (c) Splits should create matching edges on BREP1 and BREP2, this

Page 9: An algorithm for discrete booleans with applications to finite element modeling of complex systems

B. Kaan Karamete et al. / Finite Elements in Analysis and Design 68 (2013) 10–2718

localization of the split entity is very important and has hugeimpact on the robustness of the entire algorithm as this opera-tion is computationally inexact. The localization algorithm forsplits and face containment check are summarized and illustratedin Fig. 9.

Having localized the split entity for the vertex in the set ofvertex pairs which are already sorted in a loop sense, the nextprocedure is to actually split the entity at the vertex coordinateand update the set of faces due to the split operation for therepeat of the localization process to the next vertex in the loopingpairs (see Fig. 12).

5.1. Edge recovery

It is possible after the splits that some edges for insertedvertex pairs are missing. The ordering of the splits lowers thelikelihood of missing edges. However, there is no simple splitorder that will guarantee having the edges between each vertexpair. Therefore, a more sophisticated algorithm incorporatingexplicit edge-recovery is needed to ensure an edge exist betweeneach vertex pair in FIM. The edge recovery procedure on planarmesh faces is a guaranteed operation using random edge swaps[17]. The edge recovery algorithm is explained extensively in [18].The recovery of missing edges is not a limiting issue due to thefact that all splits happen on the planar geometry of the originalmaster face. A possible scenario in which there are two edges

Fig. 13. The edge recovery between each vertex pair in FIM. (a) The set of vertex pairs r

FIM. (b) After the splits, two edges are missing depicted as dashed lines. (c) The miss

master face.

Fig. 14. The intersection graph edges on both BREPs are conformal and one-to-one matc

in FIM for each face. (b) The imprint of BREP1 onto BREP2 in terms of a set of mesh e

missing is shown in Fig. 13. The edge recovery algorithm isapplied after the splits for each face appearing in FIM.

5.2. Creation of conformal edge vertex pairs

There is a corresponding vertex for each intersection point onBREP1 and BREP2. The edges recovered by splits on the faceboundaries are simply the pairwise connections between thesevertices specified in FIM. The algorithm forming face-to-facerelations in terms of vertex pairs in FIM ensures havingmatching edges. Therefore, it is a straightforward process tomatch edges on both sides by using the vertex look-up table onthe intersection records. The merging of two BREPs is possibleat this stage due to the fact that both BREPs have conformalone-to-one matching edges along their intersection graph. Thesetwo matching intersection graphs or imprints of BREP1 ontoBREP2 and vice versa is shown in Fig. 14. Boolean operationsmay require retention and/or deletion of certain portions ofBREP boundaries. The BREPs are kept separate to make categor-ization of faces as needed by a specific boolean operation.Therefore, merging or stitching of BREPs into one BREP isdelayed until after categorization and deletion of faces asspecified by each boolean operation. The categorization of facesto carry out a specific boolean operation will be discussed nextin Section 6.

eflecting the signature of the intersection graph edges in a mesh face appearing in

ing edges are recovered by the random swaps inside the planar boundary of the

hing. (a) The imprint of BREP2 onto BREP1 in terms of a set of mesh edges specified

dges specified in FIM for each face.

Page 10: An algorithm for discrete booleans with applications to finite element modeling of complex systems

B. Kaan Karamete et al. / Finite Elements in Analysis and Design 68 (2013) 10–27 19

6. Realizing boolean operations

Due to the faceted nature of the input object boundaries, theboolean operations can be realized using set-operation rules onfacet-sets of each BREP. The compilation of boundary portions ofthe two BREPs as inside, outside and common against each otheris required to apply these rules. Therefore, the boundary qualifi-cation as to which portions are contained or common against theother BREP require categorization of BREP faces. There are a totalof four different face types to reflect all possible combinations fortwo containment states, i.e., inside and outside for two BREPs;

Fig. 16. Table for boolean operations and corresponding face tags. The deletion of

faces tagged as shown in the second column as combinations of 10, 11, 20, 21 from

the merged BREP results in the configurations corresponding to various boolean

operations between BREP1 and BREP2 such as mesh implant, union, difference,

Figboo

edg

face

the

sign

BRE

BRE

reg

BREP1 faces inside of BREP2

intersect, imprint and non-regularized union operation as depicted in the first � BREP1 faces outside of BREP2 column. � BREP2 faces outside of BREP1

BREP2 faces inside of BREP1

6.1. Categorization of faces

Faces are categorized by tagging them with four integer valuescorresponding to the four distinct types itemized above. Thecategorization is a simple surface-walking algorithm over edge-connected faces starting from one of the intersection-graph edgeson any BREP. The initiating intersection graph edge shown inFig. 15 is the edge connecting vertices V2 and V3. Note that thereis also a pair of corresponding vertices on BREP2 for V2 and V3and a corresponding edge since BREPs are not yet merged. Face F4on BREP2 has a consistent orientation with respect to the region it

. 15. Faces of BREP1 and BREP2 are categorized in four classes to carry out the

lean operations. (a) A cut-out mesh section which has the intersection graph

e passing through V2 and V3, three faces F1, F2 and F3 from BREP1 and three

s F4, F5, and F6 from BREP2. (b) The categorization is carried out by tagging

faces. To tag F2 as a face of BREP1 outside of BREP2, one needs to check the

of the box product for the volume of the fictitious tetrahedron between F4 of

P2 and the vertex V4 of BREP1 to be positive with the assumption that the

P faces are oriented such that the face normals are showing outside of the

ion(s) of the BREP.

is enclosing. Therefore, if the convention is such that the normalof the face is oriented outwards of the region it is enclosing thenthe box product of its oriented vertices and the opposite vertex ofone of the adjacent faces on BREP1, say F2, will indicate if F2 islocated outside or inside of BREP2 as depicted in Fig. 15. F2 is thentagged accordingly, for example, a positive box product valuedepicts that it is a BREP1 face outside of BREP2.

The search continues with the tagged face of F2 and walks tothe adjacent faces through its edges. The adjacent faces are taggedwith the same tag until another intersection edge is crossed. Thesearch then switches the tag to the opposite of that of the walkedface. For instance, F3 is tagged as inside of BREP2 when crossedfrom F2 whose tag is outside of BREP2. The search processcontinues on both BREPs until all faces are tagged.

6.2. Employing boolean operation: deletion of faces

There is a direct relationship between the face tags and aspecific boolean operation. For instance, the boolean operation tounion both BREPs would require for removing BREP1 faces insideBREP2 and BREP2 faces inside BREP1. This is equivalent of sayingfaces with corresponding tags, i.e., 11 and 21 should be deletedfor the boolean union operation. The table showing which set offace tags should be deleted for a particular boolean operation isillustrated in Fig. 16. Note that for a non-regularized union, nofaces are deleted.

6.3. Merging of the input BREPs

The final step of the discrete boolean algorithm is to stitch thetwo BREPs along their matching intersection graph edges. BothBREPs are already evaluated and modified by deleting therequired faces for a specific boolean operation as explained inSection 6.2. The mesh data structure is modified to change theownership of all mesh entities from BREP1 and BREP2 to a newBREP id. Also the inter-entity adjacencies are modified accordingto the topological vertex and edge merging on the mesh datastructure. In the low level topological vertex and edge mergingoperation implemented in the mesh data structure, the meshedges of BREP1 on the intersection graph is replaced by thecorresponding BREP2 edges using the edge map. The final resultsare illustrated for the two inter-penetrating cylinder BREPs inFig. 17 for every boolean operation.

7. Remeshing

The mesh quality of the BREP resulting from the boolean isusually degraded due to the edge and face splits of the boolean

Page 11: An algorithm for discrete booleans with applications to finite element modeling of complex systems

Fig. 17. Boolean results on two intersecting cylinder BREPs: (a) The two inter-penetrating BREPs. The results of boolean operations: (b) Imprint (non-regular union),

(c) Union, (d) Subtract BREP2 from BREP1, (e) Subtract BREP1 from BREP2, (f) Intersect.

Fig. 18. Copying the attributes over to the intersection booleaned BREP: (a) The

frustum and sphere BREPs have user attributes A1, A2 and A3 defined on three

geometry faces. (b) Intersection of these two BREPs preserves the attributes by re-

attaching them onto the newly created geometrical entities as a result of the DGB

process performed after the boolean operation.

B. Kaan Karamete et al. / Finite Elements in Analysis and Design 68 (2013) 10–2720

algorithm. Splits cause high vertex valence (vertex to edgeconnection number) and needle like sliver mesh face formationsaround the intersection graph as shown in Fig. 14. There havebeen several strategies proposed in improving the mesh qualityafter the booleans [13,15]. Explicit creation of intersection graphring topologies (incremental approach) is advocated by thesestudies. Redistribution of the nodes around the intersection graphrings to create a uniform sized mesh was common in both ofthese approaches. Meshing strategy was to remove the faceslocally around the intersection graph and fill the gap by anadvancing front algorithm. Although this is a very fast way togenerate quality meshes, the size of the gap is a concern since thegeometry needs to be redefined in the gap area. If there is a hugediscrepancy in the geometry of boundary edges defining the gaparea, respecting the input geometry becomes highly susceptible.To eliminate such concerns, we have devised a remeshingapproach using local mesh modifications which ensures recoveryof the input discrete geometry as there is no gap formation.The mesh is modified incrementally by edge splits/swaps andcollapses and vertex relocations that are defined over existingmesh topology by respecting the geometry of the mesh. Ourremeshing strategy is similar to the works of [19] and [20]regarding the use of local edge splits/swaps and collapses. How-ever, the former employs these operations over the parametrized2D domain, and the latter uses an advancing front algorithm in 3D.

7.1. Rebuilding discrete geometry

After remeshing, the discrete geometry topology is no longer arepresentative of geometry of the mesh; portions of the meshmay have been deleted (subtraction), carved out (intersections),or merged (union). Therefore, mesh needs to be reclassified byrunning the discrete geometry building DGB process (see Section1) one more time to account for the change in the mesh topologyimpacted by the boolean operation. The mesh is disassociatedfrom its discrete model first and then using the same anglethresholds and geometrical predicates, the DGB process is re-runagain over the booleaned mesh topology. The new geometrical

entities are defined within the context of the BREP of the booleanas shown in Fig. 18(b).

7.2. Attribute management

The input meshes may have already had the user attributesassociated with them. These include analysis-relevant data suchas material properties, and boundary conditions. All such attri-butes are associated with the geometric model and not directly onthe mesh by design. This is a key towards having a geometry-based analysis representation [5,6]. Therefore it is critical toensure that any attribution data is not lost due to the booleans.As a result, before running the DGB process, a temporary look-upstorage, a map for each user attribute corresponding to a set ofclassified mesh entities, is generated. After the DGB process, thedata is attached back onto the new geometrical entities associatedwith the mesh entities defined in the temporary map. This issimilar to the attribution management approaches implementedby CAD-systems [21–24] to handle topology modifying operations

Page 12: An algorithm for discrete booleans with applications to finite element modeling of complex systems

B. Kaan Karamete et al. / Finite Elements in Analysis and Design 68 (2013) 10–27 21

such as the booleans. In such kernel implementations, the choices oftransferring an attribute onto the new topologies, are often enum-erated as options to the attribution itself- whether to keep or deleteattributes from older component topologies. In other words, attri-butes are defined with their transfer option information so that theywould be handled by the geometry modification operations accord-ingly. In our implementation, we have opted to transfer all attributesfrom both BREPs to the new BREP topologies as they are provided.A sample case depicting the transfer of attributes for the booleanintersection operation is shown in Fig. 18.

7.3. Assigning mesh sizes

The edge and face splits of the boolean algorithm alter thesizing field of the input mesh. To improve the mesh quality, anyremeshing strategy would need to have smoothly varying sizingfield. We have opted to have the sizing implemented independentfrom meshing due to the following reasons:

FigSrci

of f

bin

User has complete control of the sizing process.

� There is no heuristics implicit to the meshers in terms of

mesh sizes.

� Unbiased comparison of mesh quality can be done using

different meshers.

� Experimenting on different sizing proxy implementations can

be done efficiently without having to modify any meshing code.

There have been many studies on mesh sizing approaches inthe literature [25–31]. In many of these studies, background gridsare used to encode a size distribution in space. They support a sizedistribution which is interpolated to provide the size value oftenby means of call-backs from the meshers. In the pioneering worksof [32] and [26], boundary spacings are used to interpolate themesh sizes. These are computed for each boundary vertex byaveraging the lengths of the adjacent boundary edges. Edgemeshing (sampling) followed by the triangulation of the domainusing only the boundary vertices, enables computation of sizes bybarycentric interpolation within each triangle (tetrahedron in 3D).

. 19. Calculating mesh sizes using sources: (a) Linear and higher order spherical, seg

to the point P where the mesh size is requested. The mesh size from Srci is then calcu

. (c) The final mesh size at point P is calculated from the contributions of all the sou

stores only a subset of the sources that will be effective to the size computation in

However, smoothness of the sizing field is not guaranteed and thesampling of the interior surface shape variations is also harder toaccommodate with this formulation. Sampling of the geometry,driven by the user specified sizing parameters and storing thesesampled sizes in an octree is another background grid alternative[33,34,27]. The smoothness of the sizing field is satisfied byforcing the octree refinement with 2:1 ratio everywhere in thetree. A problem with this approach is the inability to resolve sizesdifferent than factors of two. There were also remedies to tacklethis problem by scaling the entire octree. However, this extrarefinement of the octree to satisfy 2:1 ratio and accurate sizeinterpolation becomes another concern in terms of its largememory footprint that needs to be stored during the entiremeshing cycle. Querying the size at a spatial location by themesher has to be a very fast procedure as this is needed a lotduring any meshing process. Therefore, the speed of queryingsizes becomes another concern and a significant factor in theoverall meshing time. Some researchers use auxiliary data struc-tures such as uniform bins to aid the binary search time spent inthe octree [20], and some use modified octree structures akin tomeshes with octant adjacencies to retrieve data more quicklythan logarithmic rate of the binary search [33]. None of theseapproaches are perfect but there is no solution without somelimitation either. The advantages and drawbacks of various meshsizing approaches have been explained in detail by the surveypapers [28,29]. We have adopted a sizing implementation usingsources [27,30,31]. In our implementation, user mesh sizingparameters, namely, global size, local sizes attached on geome-trical entities, curvature refinement over curved surfaces, mini-mum number of edges on each geometrical edge with allowedminimum size, are all translated into generation of point, segmentand triangular sources with constant and linearly varyingstrengths. The final mesh size is calculated from the contributionsof all the sources. The minimum size prevails. The domain isdivided into regular bins and each bin stores only a subset of thesources that will be effective to the size computation inside eachbin’s bounding box to speed up the process as depicted in Fig. 19.This source based sizing implementation will be referred to assizing-proxy in the next Section 7.4.

mented and triangular sources. (b) The closest point C is computed on each source

lated using the formula Sizei ¼ SþDnðf�1Þwith the geometrical progression factor

rces. The minimum size prevails. The domain is divided into regular bins and each

side its bounding box to speed up the process of computing sizes.

Page 13: An algorithm for discrete booleans with applications to finite element modeling of complex systems

P

Pnew

B. Kaan Karamete et al. / Finite Elements in Analysis and Design 68 (2013) 10–2722

7.4. Local mesh modifications

Remeshing algorithm is implemented using local mesh modifica-tions in 3D space. Remeshing may be limited to the immediate zoneof the intersection graph of the booleans, thereby not affecting themesh outside of the impact zone of the edge/face splits. This approachis efficient due to its local nature, however, figuring out how far theremeshing will be performed moving out from the intersection graphrings is not always easy. Therefore, remeshing algorithm can have itsinput either in terms of a set of mesh face layers around theintersection graph or the entire mesh of the BREP. Regardless of thischoice, details of local mesh modification operations used in surfaceremeshing algorithm will be the same.

A source based mesh-sizing proxy provides a smooth sizingfield for the remesher as explained in Section 7.3. Remesher thenqueries the sizing proxy for the target size at the mid location ofeach mesh edge. An edge split or collapse operation is performeddepending on the comparison of the edge’s length versus thetarget size from the proxy as shown in Fig. 20. The goal is to adapt

Fig. 20. Remeshing using local mesh modifications: (a) Mesh size at point P is

queried from the sizing proxy at the mid of each mesh edge whose length is L.

(b) If the length of the edge L is less than the required size then edge is collapsed.

(c) If the edge length L is more than twice the required size, then edge is split at its

mid location. (d) Opposite edges to the newly split vertex is checked if an edge

swap would improve mesh quality. (e) The split vertex is smoothed locally using

either the CVT or the constrained Laplacian schemes.

Fig. 21. Local mesh quality optimization by edge swaps: (a) The opposite edges to

each vertex is checked if a swap of the edge would improve surrounding mesh face

quality by maximizing the minimum internal angles aj to bj . (c) After the swap of

the edge, new opposite edges to the vertex is pushed back into the list of edges to

check for subsequent swap operations.

the actual local mesh size to the target size of the proxy’s smoothsizing field. The edge splits are followed by the swaps of theopposite edges to the split vertex. The swap of the oppositeedge is only realized if it minimizes the maximum face anglescompared to the angles before the swap as shown in Fig. 21.Minimizing the maximum angles or maximizing the minimum

Ai Ai

Ci Ci

Pnew= (Ai Ci) / (Ai)

Fig. 22. Local mesh quality optimization by vertex smoothing: (a) The location of

point P is moved to Pnew due to smoothing of the vertex at P using either

constrained Laplacian or CVT schemes. (b) Laplacian scheme: The new location

Pnew is computed by area averaging the centroids of its surrounding mesh faces.

(c) CVT scheme: The new location Pnew is computed by nearest neighbor area

averaging of the center of circumcenters of its surrounding faces.

Fig. 23. The results of remeshing of boolean unioned of two penetrating cylinder

BREPs. (a) Mesh of the boolean-unioned BREP. (b) Local remeshing applied around

the intersection graph of unioning operation to improve mesh quality.

(c) Remeshing applied globally to the BREP using the intersection graph local

mesh size as segment sources. (d) Remeshing using uniform mesh size over the

unioned BREP.

Page 14: An algorithm for discrete booleans with applications to finite element modeling of complex systems

B. Kaan Karamete et al. / Finite Elements in Analysis and Design 68 (2013) 10–27 23

angles is the weak Delaunay-property argument for surfacemeshes [35,36]. Satisfying this weak Delaunay property is usedto accomplish the main goal of improving the mesh quality.Finally, a vertex smoothing scheme is used to pre-condition themesh topology for further swaps and splits. The idea in vertexsmoothing is to relocate the vertex such that the worst qualityface surrounding the vertex is improved. To this end, the newlocation is computed either by constrained Laplacian or centroidalvoronoi tessellation (CVT) [37] schemes as shown in Fig. 22.

The mesh of the BREP resulting from a boolean can be improvedin different ways:

Figreg

inte

tria

to f

ens

Remesh in the vicinity of the intersection graph across anumber of mesh face layers.

� Remesh the entire BREP using the mesh spacing of the

intersection graph dictated as segment sources.

� Mesh the entire BREP with a uniform size or with any user

sizing input using either remesher or any other availablesurface mesher.

The intersection graph mesh spacing is expected to be finerthan the original size of the mesh. This local fine spacing can berespected by translating the fine sizes as segment sources withconstant strength computed as the equal division of the totalgeometry edge length by the number of mesh edges due to splits.This natural way of generating segment sources in sizing proxyenables the remeshing algorithm to improve quality while main-taining smooth transition from the fine resolution of the inter-section graph zone. The results from various remeshing optionsare depicted in Fig. 23.

. 24. Simple-Convex-Triangulation (SCT) steps: (a) A face adjacent to a mesh

ion in intersection set. (b) Intersection edges. (c) Split of the face that keeps

rsection edges. (d) Hexahedral mesh region adjacent to the face. (e) Convex

ngulation of the faces of the mesh region constrained by edge splits connecting

ace centers. (f) Faces being triangulated are connected to regions’s center to

ure a valid mesh.

8. Volume meshes

The algorithm for discrete booleans can be extended to covervolume meshes. One or both BREPs can have volume meshes.Hence, a set of faces appearing in FIM may be adjacent to meshregions (tetrahedral or hexahedral). These adjacent mesh regionsneed to be conformally modified when the face and edge splitsare performed over the faces of FIM on geometry surfaces.Otherwise, the mesh becomes invalid and disconnected from itsvolume elements. Therefore, the main task is to match intersec-tion graph edges while maintaining valid volume meshes. Asimilar problem has already been studied [18] for a differentpurpose of matching cavity boundaries adjacent to incompletevolume meshes. In the present case, we are trying to match theboundary of the mesh region to one or more of its faces appearingin FIM subject to edge and face splits. However, it is not necessaryto modify the boolean algorithm until after the creation ofmatching intersection graph edges explained in Section 4.

The boundary matching algorithm is defined as Simple ConvexTriangulation (SCT) and depicted in Fig. 24. In SCT, there is anordered manner of splitting of mesh region topologies by allowingthe creation of non-conformal mesh entities temporarily. Anexample mesh face listed in FIM is split at the intersectionlocations of BREP1 and BREP2 as shown in Fig. 24(c). Convextriangulation is defined as an atomic operation connecting cornervertices of a topology (face/region) to a vertex created at itscentroid. First, we need to make faces of the hexahedron con-formal by applying convex triangulation for its faces. For example,one edge of the FIM face, is also adjacent to another interior sideface of the hexahedron. The side interior face is ‘‘convex-triangu-lated’’ by connecting its corner vertices and the intersectionvertex on the edge to the face centroid as depicted in Fig. 24(e).Next step is to apply the ‘‘convex-triangulation’’ to the region ofthe hexahedron itself by connecting all the corner and convextriangulation vertices of its faces to its centroid as depicted inFig. 24(f). Finally, we have accomplished creation of conformalmesh region(s) with one or more of its face boundaries on theintersection graph. The rest of the boolean algorithm is identical.The only caveat is that when deleting the faces we also need tocategorize the volume mesh regions and delete them in the samemanner as depicted in Fig. 16.

9. Complex geometric operations and applicationto engineering design and analysis

Boolean operations are indispensable asset in a geometricmodeling framework. It is not possible to create complex shapeswithout the ability to apply boolean operations over primitiveshapes. The basic boolean algorithm is designed to operate on two

Fig. 25. The result of discrete boolean unite applied to equally spaced tori around

a circle. (a) Eight (8) disjoint tori, (b) Result of non-regular unioning followed by

remeshing.

Page 15: An algorithm for discrete booleans with applications to finite element modeling of complex systems

Fig. 26. Non-regular unioning of three BREPs. (a) Three penetrating BREPs: a sphere, a torus and a corner sheet. (b) Internal details after non-regular boolean operation.

(c) Remeshing of the booleaned BREP using boundary edges as segment sources. (d) Using a frontal mesher with the same sizing.

Fig. 27. Boolean algorithm applied on BREPs with different mesh scales. (a) Three cylinder BREPs intersecting a box BREP with almost comparable sizing. (b) The result of

boolean unite of all BREPs. (c) Bottom face of the box mesh after boolean. (d) Bottom face of the box mesh remeshed using the boundary segments as sources. (e) Three

cylinder BREPs with same mesh size and a box BREP with a much coarser mesh size. (f) The result of unioning of all BREPs. (g) The bottom face of the cube after boolean

operation. (d) Meshing the bottom face using a frontal approach with a uniform size and segment sources created around holes.

B. Kaan Karamete et al. / Finite Elements in Analysis and Design 68 (2013) 10–2724

Page 16: An algorithm for discrete booleans with applications to finite element modeling of complex systems

Fig. 29. Input data courtesy of Naval Air Systems Command, Pax-River: Three air

vehicle part BREPs are stitched to each other using boolean unite. (a) A conceptual

engine, wing and aircraft body BREPs gathered into the same geometry model.

(b) The boolean algorithm unite applied over three BREPs consecutively. (d) The

detail of the mesh on the aircraft body shows the result of boolean algorithm.

B. Kaan Karamete et al. / Finite Elements in Analysis and Design 68 (2013) 10–27 25

BREPs in this study. Nonetheless, it is straightforward to deal withmodels with multiple BREPs. Complex geometries can be createdby the successive applications of booleans over more than twoBREPs as depicted in Fig. 25. The resultant BREP at the end of eachboolean operation, can be exploded into disjoint parts in terms ofnew BREPs to make the next boolean operation possible. The finalstitched BREP from eight disjoint BREPs, in this example, iscreated by applying the boolean operation seven times betweentwo BREPs consecutively, one BREP from the previous booleanand the BREP of an original torus as shown in Fig. 25(b).

Booleans can also be applied on sheet or solid BREPs. Themixture of sheet and solid BREPs is also possible as depicted inFig. 26 in which the non-regularized union between a solidsphere, a solid torus and a rectangular sheet-elbow BREP isrealized. The mesh quality due to the splits at the intersectionof these three (3) BREPs is vastly improved by remeshing depictedin Fig. 26(c). Boundary edge spacing along the intersection graphis distributed evenly in terms of segment sources to providesmooth sizing for the remesher. The same sizing proxy is used fora frontal meshing strategy for quality comparisons withouthaving to change any meshing code as shown in Fig. 26(d).

The effect of different input mesh scales on the booleanalgorithm is depicted in Fig. 27 in which three slender cylinderBREPs are boolean unioned with a cube BREP of two significantlydifferent mesh sizes. The algorithm is robust in dealing withdifferent mesh scales in the input. Similar to previous tests, theintersection graph of the boolean result is used to create evenlydistributed boundary spacing in terms of segment sources forremeshing. However, the choice is completely optional whetherto create boundary spacing in the sizing proxy or remesh withoutit. The differences in mesh quality between the two differentmeshers can be compared as shown in Fig. 27(d) and (h).

A realistic example of an application of interest to the militaryis depicted in Fig. 28 in which a component BREP representing agun-system is implanted over the deck of a ship BREP. The gun-component is moved to an appropriate location over the deck as

Fig. 28. Input data courtesy of Naval Surface Warfare Center, Carderock Division: The

component and ship BREPs. (b) The gun BREP is moved to the location that will be inst

after implanting. (e) The close-up mesh after remeshing of the stitched BREPs.

shown in Fig. 28(b). The two BREPs are then implanted andremeshed as depicted in Fig. 28(b) and in a close up in Fig. 28(e).Optionally, the implant can also be performed without impactingthe mesh outside of the boolean intersection zone. The remeshingoption that only modifies and improves the mesh around a fewlayers in the immediate vicinity of the intersection zone of the

implant of gun component mesh into the discrete ship mesh: (a) The individual

alled onto the ship deck. (c) The two BREPs are implanted. (d) The close-up mesh

Page 17: An algorithm for discrete booleans with applications to finite element modeling of complex systems

Fig. 30. An automobile BREP is stitched with the floor of the wind tunnel mesh. (a) Automobile is moved to the middle of the floor. (b) The boolean algorithm unite applied

to stitch the automobile tires over the floor of the wind tunnel. (c) The imprint of the flooring over the automobile tires. (d) Remeshing applied to improve mesh quality

using the boundary spacing as segment sources for smooth mesh sizing around the imprint of the tires with the floor. (e) Zoom-out of the mesh around the imprint zone.

B. Kaan Karamete et al. / Finite Elements in Analysis and Design 68 (2013) 10–2726

two BREPs is obviously the least intrusive in terms of preservingthe input mesh topology as shown in Fig. 28(d).

Another real-world example in aviation research is depicted inFig. 29 demonstrating two boolean union operations for three(3) BREPs between a gas turbine engine with its pylon to a wingfollowed by another union with the aircraft body. The detail of themesh and the result of the union between the aircraft body andthe wing section is shown in Fig. 29(c). Similar to the aviationexample, an automobile BREP is stitched to the floor of the windtunnel. The remeshing greatly improves the mesh quality asdepicted in Fig. 30(d, e).

10. Closing remarks

The ability to apply various boolean operations to createcomplex shapes from simpler forms is a valuable asset and akey component for any modeling suite for engineering analysisand design. In this paper, we have devised and demonstrated arobust algorithm to perform discrete booleans on solid or sheetBREPs with differing input mesh scales. The algorithm is alsocapable of preserving user attributes by associating them with thenewly created booleaned topologies efficiently. It is implementedin Cþþ as part of a geometry, mesh and attribution modelingplatform called ‘‘Capstone’’.

We point our several future enhancements to the process ofdiscrete boolean algorithm, including improved remeshing usinglocal re-parametrization, more flexible attribute managementinstead of migrating all attributes, and rebuilding the discretegeometry locally. Remeshing with local parametric projectionsmay help improving the mesh quality for two reasons: moreaccurate projections to the original BREP topologies, and, a moreprecise computation for CVT which is not a well-defined schemeover 3D surface meshes. More options in attribute migration fromoperand BREPs over to the resultant BREP is also required similarto CAD operations which will increase the user control over theattribute transfer mechanism. Globally rebuilding the geometry

topology is a safe and robust solution to create new BREPtopologies, however, it is not the most efficient resolution. Amore efficient approach could be to run DGB locally only withinthe closure of the original topologies impacted by the booleanoperation. Finally, an important and necessary improvement is avolume remeshing algorithm using local modification to increasethe mesh quality after SCT for volume and mixed dimensionmeshes.

Acknowledgments

This work was funded by the DoD High Performance Comput-ing and Modernization Program (HPCMP) as part of the Computa-tional Research & Engineering Acquisition Tools and Environment(CREATE) Meshing and Geometry (MG) Project.

References

[1] S. Owen, D.R. White, Mesh-based geometry: a systematic approach toconstructing geometry from a finite element mesh, in: Tenth InternationalMeshing Roundtable, 2001, pp. 83–96.

[2] M. Mantlya, An Introduction to Solid Modeling, Computer Science Press,1988.

[3] W.J. Schroeder, M.S. Shephard, On rigorous conditions for automaticallygenerated finite element meshes, in: J. Turner, J. Pegna, M. Wozny (Eds.),Product Modeling for Computer-Aided Design and Manufacturing, 1991,pp. 267–281.

[4] S. Dey, M.S. Shephard, M.K. Georges, Elimination of the adverse effects ofsmall model features by the local modification of automatically generatedmeshes, Eng. Comput. 13 (1997) 134–152.

[5] B.K. Karamete, Design and implementation of a new topological datastructure: double link topology structure (DLTS), in: Eleventh U.S. NationalCongress on Computational Mechanics, Minnesota, MN, 2011.

[6] M.W. Beall, M.S. Shephard, A general topology-based mesh data structure, Int.J. Numer. Methods Eng. 40 (19) (1997) 1573–1596.

[7] J. Corney, 3d Modeling Using the Acis Kernel and Toolkit, 1st edn., John Wiley,1997.

[8] S.H. Lo, W.X. Wang, A fast robust algorithm for the intersection of triangu-lated surfaces, Eng. Comput. 20 (2004) 11–21.

[9] S.H. Lo, W.X. Wang, Finite element mesh generation over intersecting curvedsurfaces by tracing of neighbours, Eng. Comput. 41 (2005) 351–370.

Page 18: An algorithm for discrete booleans with applications to finite element modeling of complex systems

B. Kaan Karamete et al. / Finite Elements in Analysis and Design 68 (2013) 10–27 27

[10] M. Aftosmis, M.J. Berger, J.E. Melton, Robust and efficient cartesian meshgeneration for component-based geometry, AIAA J. 36-6 (1998) 952–960.

[11] O. Devilers, P. Guigue, Faster Triangle–Triangle Intersection Tests, TechnicalReport. 4488, INRIA, 2002.

[12] H. Samet, Design and Analysis of Spatial Data Structures, Addison Wesley,1990.

[13] A.A. Shostko, R. Lohner, W.C. Sandberg, Surface triangulation over intersect-ing geometries, Int. J. Numer. Methods Eng. 44 (1999) 1359–1376.

[14] K. Guo, L.C. Zhang, C. Wang, S.H. Huang, Boolean operations of STL modelsbased on loop detection, Int. J. Adv. Manuf. Technol. 33 (2007) 627–633.

[15] S.H. Lo, Automatic mesh generation over intersecting surfaces, Int. J. Numer.Methods Eng. 38 (1995) 943–954.

[16] B.K. Karamete, R.V. Garimella, M.S. Shephard, Recovery of an arbitrary edgeon an existing surface mesh using local mesh modifications, Int. J. Numer.Methods Eng. 50 (2001) 1389–1409.

[17] P. George, F. Hecht, E. Saltel, Automatic mesh generator with specifiedboundaries, Comput. Methods Appl. Mech. Eng. 92 (1991) 269–288.

[18] B.K. Karamete, M.W. Beal, M.S. Shephard, Triangulation of arbitrary polyhe-dra to support automatic mesh generators, Int. J. Numer. Methods Eng. 49(2000) 167–191.

[19] J. Remacle, C. Geuzaine, G. Comp �ere, E. Marchandise, High quality surfaceremeshing using harmonic maps, Int. J. Numer. Methods Eng. 83 (4) (2010)403–425.

[20] R. Aubry, G. Houzeaux, M. Vazquez, A surface remeshing approach, Int. J.Numer. Methods Eng. 85 (12) (2011) 1475–1498.

[21] C. Spatial, 3D InterOp Data Exchange, URL /http://www.spatial.com/3d-interoperabilityS, 2011.

[22] S.P. Siemens, Parasolid interoperability, URL /http://www.plm.automation.siemens.comS, 2011.

[23] C. PTC, Interoperability for Pro/ENGINEER, URL /http://www.ptc.comS,2011.

[24] SMLIB, Data Translators, URL /http://www.smlib.comS, 2011.

[25] N. Weatherill, M. Marchant, O. Hassan, D. Marcum, Grid adaptation using adistribution of sources applied to inviscid compressible flow simulations, Int.J. Numer. Methods Fluids 19 (1994) 739–764.

[26] J. Peraire, J. Peiro, K. Morgan, Adaptive remeshing for three-dimensionalcompressible flow computations, J. Comput. Phys. 103 (1992) 269–285.

[27] R. Lohner, Applied Computational Fluid Dynamics Techniques: An Introduc-tion Based on Finite Element Methods, 2nd edn., Wiley, 2008.

[28] S.J. Owen, S. Saigal, Neighborhood-based element sizing control for finiteelement surface meshing, in: Sixth International Meshing Roundtable, 1997,pp. 143–154.

[29] S. Owen, S. Saigal, Surface mesh sizing control, Int. J. Numer. Methods Eng. 47(2000) 497–511.

[30] A. Cunha, S. Canann, S. Saigal, Automatic boundary sizing for 2D and 3Dmeshes, in: AMD Trends in Unstructured Mesh Generation, ASME 220, 1997,pp. 65–72.

[31] W. Quadros, V. Vyas, M. Brewer, S. Owen, K. Shimada, A computationalframework for generating sizing function in assembly meshing, in: Four-teenth International Meshing Roundtable, 2005, pp. 55–73.

[32] N. Weatherill, O. Hassan, Efficient three dimensional Delaunay triangulationwith automatic point creation and imposed boundary constraints, Int. J.Numer. Methods Eng. 37 (1994) 2005–2039.

[33] M. Shephard, M. Georges, Automatic three-dimensional mesh generation bythe finite octree technique, Int. J. Numer. Methods Eng. 32 (1991) 709–749.

[34] R. Aubry, K. Karamete, E. Mestreau, F. Bulat-Jara, S. Dey, R. Lohner, Geodesics-based surface reparametrization, in: 50th AIAA, pp. 1258–2012.

[35] S. Sloan, A fast algorithm for generating constrained Delaunay triangulations,Comput. Struct. 47 (3) (1993) 441–450.

[36] H. de Cougny, Parallel Unstructured Distributed Three Dimensional MeshGeneration, Ph.D. Thesis, Mechanical Engineering, Aeronautical Engineeringand Mechanics, Rensselear Polytechnic Institute, Scientific ComputationResearch Center, Troy NY, 1998.

[37] Q. Du, M. Gunzburger, Grid generation and optimization based on centroidalvoronoi tessellations, Appl. Math. Comput. 133 (2002) 591–607.