19
INTERNATIONAL JOURNAL FOR NUMERICAL METHODS IN ENGINEERING, VOL. 29, 37--55 (1990) A COMBINED OCTREE/DELAUNAY METHOD FOR FULLY AUTOMATIC 3-D MESH GENERATION W. J. SCHROEDER GE Corporate Research & Dewlopment, P.O. Box 8, Schenectady, New York 12301. U.S.A. M. S SHEPIIARD Rensselaer Polytechnic Institute. Troy. New York, U.S.A. SUMMARY Fully automatic three-dimensional mesh generation is a fundamental requirement for automating the numerical solution of partial differential equations. Two techniques in particular-the octree and Delaunay approaches-have been used towards this end. A method that combines both approaches to fully automatic mesh generation is presented here. The resulting algorithm provides the linear growth rate and divide-and- conquer approach of the octree method with the simplicity and optimal properties of the Delaunay triangulation. INTRODUCTION The advent of geometric modelling systems and adaptive methods has made the automation of the numerical solution of partial differential equations a theoretica1 possibility. A fundamental requirement of such a system is the ability to automatically generate a computational mesh. Although two-dimensional mesh generation is now widely a ~ a i l a b l e , ’ . ~ . ~ three-dimensional mesh generation algorithms sufferfrom a lack of robustness and/or differing levels of automation, often requiring manual intervention at various points. Two techniques in particular have been used to automatically generate three-dimensional computational meshes: the octree” l9 and Delaunay appro ache^.^ In the octree approach, the geometric model is spatially decomposed according to user-specified mesh control parameters associated with the various topological entities in the model. This procedure, called tree building, results in a set of terminal octants, each of which contains some subset of the original geometry. Generally, the octant geometry is much less complex than that of the original geometry. and is consequently easier to mesh. Elements may be generated in the terminal octants by any method or combination of methods, but each must generate compatible, valid mesh elements. Current approaches use both templates as well as element removal schemes. Consequently, the octree approach itself is not an element generation technique; rather, it serves to simplify the geometry for an associated element generation scheme. Furthermore, the rich data structure of the octrec provides a high degree of local control over the meshing process, resulting in an O(e) asymptotic growth rate, where e is the number of elements generated in the model. Delaunay approaches are based on generating n-dimensional simplexes satisfying the proper- ties of the Delaunay triangulation from an initial distribution of points. The greatest advantage of these techniques is their simplicity, both in concept and implementation. Delaunay methods also 0029-598 1/90/010037-19W9.50 (c> 1990 by John Wiley & Sons, Ltd. Received 20 October 1988 Revised 12 May 1989

A combined octree/delaunay method for fully automatic 3-D mesh generation

Embed Size (px)

Citation preview

Page 1: A combined octree/delaunay method for fully automatic 3-D mesh generation

INTERNATIONAL JOURNAL FOR NUMERICAL METHODS I N ENGINEERING, VOL. 29, 37--55 (1990)

A COMBINED OCTREE/DELAUNAY METHOD FOR FULLY AUTOMATIC 3-D MESH GENERATION

W. J. SCHROEDER

G E Corporate Research & Dewlopment, P.O. Box 8, Schenectady, New York 12301. U.S.A.

M. S SHEPIIARD

Rensselaer Polytechnic Institute. Troy. New York, U.S.A.

SUMMARY Fully automatic three-dimensional mesh generation is a fundamental requirement for automating the numerical solution of partial differential equations. Two techniques in particular-the octree and Delaunay approaches-have been used towards this end. A method that combines both approaches to fully automatic mesh generation is presented here. The resulting algorithm provides the linear growth rate and divide-and- conquer approach of the octree method with the simplicity and optimal properties of the Delaunay triangulation.

INTRODUCTION

The advent of geometric modelling systems and adaptive methods has made the automation of the numerical solution of partial differential equations a theoretica1 possibility. A fundamental requirement of such a system is the ability to automatically generate a computational mesh. Although two-dimensional mesh generation is now widely a~a i l ab le , ’ .~ .~ three-dimensional mesh generation algorithms suffer from a lack of robustness and/or differing levels of automation, often requiring manual intervention at various points. Two techniques in particular have been used to automatically generate three-dimensional computational meshes: the octree” l9 and Delaunay appro ache^.^

In the octree approach, the geometric model is spatially decomposed according to user-specified mesh control parameters associated with the various topological entities in the model. This procedure, called tree building, results in a set of terminal octants, each of which contains some subset of the original geometry. Generally, the octant geometry is much less complex than that of the original geometry. and is consequently easier to mesh. Elements may be generated in the terminal octants by any method or combination of methods, but each must generate compatible, valid mesh elements. Current approaches use both templates as well as element removal schemes. Consequently, the octree approach itself is not an element generation technique; rather, it serves to simplify the geometry for an associated element generation scheme. Furthermore, the rich data structure of the octrec provides a high degree of local control over the meshing process, resulting in an O ( e ) asymptotic growth rate, where e is the number of elements generated in the model.

Delaunay approaches are based on generating n-dimensional simplexes satisfying the proper- ties of the Delaunay triangulation from an initial distribution of points. The greatest advantage of these techniques is their simplicity, both in concept and implementation. Delaunay methods also

0029-598 1/90/010037-19W9.50 (c> 1990 by John Wiley & Sons, Ltd.

Received 20 October 1988 Revised 12 May 1989

Page 2: A combined octree/delaunay method for fully automatic 3-D mesh generation

38 W. J. SCHROEDER AND M. S. SHEPHARD

provide meshes with desirable attributes: in two dimensions it can be shown that the Delaunay triangulation provides the maximum-minimum angle as compared to any other possible triangul- ations.' The major difficulty is to develop the points automatically within and on the boundary of the geometric model. The points must be generated in such a way as to avoid numerical difficulties, while producing a valid computational mesh compatible with the geometric representation of the object. Further requirements of controlling mesh density and associating the various entities of the mesh with the geometry also pose difficulties.

The method presented here is a combination of both the octree and Delaunay approaches to fully automatic three-dimensional mesh generation. The basic concept is to use an octree building procedure to generate octant geometries that can then be tetrahedronized using Watson's Delaunay algorithm.16 The combined approach provides the spatial addressibility, localized mesh control, linear growth rate and geometric simplification features of the octree technique, while simultaneously taking advantage of the simplicity and optimal properties of the Delaunay methods. The major difficulty in this approach is maintaining compatibility between octants, and therefore the mesh, as the octants are individually triangulated.

The remainder of the article is divided into five sections. In the first section, a brief description of the geometric model. is given. This defines the domain of mesh generation. The following two sections briefly summarize the octree and Delaunay approaches, with some extensions made to Delaunay-based mesh generation. The combined algorithm is presented in the fourth section, along with the necessary conditions for providing octant compatibility. In the last two sections, results and conclusions are presented.

GEOMETRIC REPRESENTATION

A geometric model 9, is a representation of an object in terms of its geometry, G, topology, T, and associated attributes, A:

9 = { A , G , T } ( 1 )

Geometry is the actual mathematical representation of a point, curve, and/or surface in terms of shape and location in space. Topology, on the other hand, is the adjacency relationship of various geometric entities to one another. 1 7 * As an abstraction, topology forms a convenient framework for the manipulation and association of attributes to 9. Attributes are qualifying or descriptive information of T (e.g., colour, boundary conditions, mesh density). In this sense, geometry is an attribute of topology as well, but because of its importance to %', geometry merits special consideration.

The topological domain, T, is the set consisting of the topological elements vertices, V, edges, E , faces, F, and (finite) volume enclosing regions, R , related to one another in an ordered, hierarchical manner. For example, R is composed of an ordered set of faces, and a particular face F is composed on an ordered list of edges. The topological elements do not self-intersect, and may form models of non-manifold topology. Hence the resulting computational mesh may include any combination of one-, two- or three-dimensional elements.

For the purpose of fully automatic mesh generation, the details of representation of G is not important (e.g. constructive solid geometry versus boundary representation) as long as a necessary set of geometric interrogation operators is available. The information required from A is typically the specification of mesh density throughout T. These may be assigned as an approximate element size to a particular topological entity, or possibly generated automatically based on the geometric representation and analysis requirements.

Page 3: A combined octree/delaunay method for fully automatic 3-D mesh generation

A COMBINED OCTREEDELAUNAY METHOD 39

OCTREE APPROACH TO 3-D MESH GENERATION

The octrce approach is based on approximating a geometric model, 9, as the union of a finite set of cells (in three dimensions, octants) of various sizes. The relationship of the octants to one another is in the form of an n-dimensional binary tree.l2 Each octant maintains information about neighbouring octants as well as its relationship to 9 (Figure 1). Enough information is available within each octant to build an unambiguous geometric representation, that is then transmitted to the element generation procedure. Elements are then generated on an octant-by-octant basis, and the quality of the mesh further improved by a smoothing technique. The four basic steps of thc octrec approach are described in the following sections.

Tree building

The objective of tree building is to determine the interaction of Y with the octree representation. This interaction is defined in terms of the geometric intersection of each octant and the classification (e.g. IN, OUT, ON) of the various octant features against 9. Furthermore, the kvel of the octree is controlled by the mesh density information associated with the various topological elements of the model, and by enforcing a maximum 2: 1 ratio in size between neighbouring octants. A most effective way of achieving this is to use a recursive, top-down approach to tree building’. l o as summarized below.

1. (Initialize.) Given a geometry, 9, with associated mesh density attributes, place 9 strictly within a bounding cube (i.e., root octant). Classify root octant faces as outside. Associate Q with root octant.

2. (Sub-divide.) Sub-divide the octant into eight child octants by passing three bisecting planes, three interior bisecting octant edges and eighteen face bisecting octant edges through parent octant. Intersect all model edges E in parent octant with three bisecting planes. Intersect all model faces F in parent octant with bisecting octant edges. Associate geometry in child octants with appropriate child. Classify octants and octant features as in, out or on.

3. (Eruluute mesh size.) For each octant, compare mesh density information with level of octant. If mesh size is less than octant size, sub-divide octant (go to step (2)). Otherwise, evaluate mesh size in next octant.

4. (Perform 2 ; 1.) Allow no more than one level difference between neighbouring octants. Sub- divide as necessary to achieve this.

Geometry representation

At the conclusion of tree building, the information available in each octant is developed into a complete (octant) geometric representation. For example, edges resulting from model face/octant

Figure 1. An octree decomposition of a block shown in (a) and the associated data structure represented.in (b)

Page 4: A combined octree/delaunay method for fully automatic 3-D mesh generation

40 W. J. SCHROEDER AND M. S. SHEPHARD

face intersection are constructed, and loop information is built. Depending on the requirements of the element generation procedure, the level of detail of the geometric representation may vary, but enough information is available in each octant to provide any level of detail.

Element generation

Once the geometric representation is built for every octant, elements are generated on an octant-by-octant basis. Simple octants (usually fully interior to 9) may be meshed using template matching, while more complex octants (usually on the boundary of 9) require a general element generation procedure. While element removal procedures have been used in the past, in this paper the novel approach of coupling Delaunay triangulation and octree geometry decomposition is proposed.

Smoothing

At the conclusion of element generation, the overall quality of the mesh can be improved using a smoothing procedure. The basic idea is to reposition the nodes while preserving the topology of the mesh. Laplacian smoothing is one common method for smoothing a mesh.

DELAUNAY METHODS FOR AUTOMATIC 3-D MESH GENERATION

A computational mesh can be considered a triangulation of a point set P as described by Lawson.' '

Definition 1. Given a set P of M unique points in n-dimensional space, an n-dimensional triangulation Y is the set of N non-degenerate n-dimensional simplexes, sl

5" = {s;,s;, . . . , S k } (2) with the ,following properties:

I . All uertices of each sf E P . 2 . For each i # j , interior (s;) n interior (sr) = $3. 3. The convex hull, %, of F" is given by % = vr= sl. 4 , The ( n - 1 )-dimensional faces of s; are either on the boundary of% and used by precisely one sr,

or in the interior of % and used by precisely two sl.

A Delaunay triangulation is a particular triangulation that has the additional property of hypersphere containment.

Dejinition 2. If .F" o f a point set P is such that the bounding hypersphere defined by the n + I points ofany s; contains no other points o fP , then that triangulation is a Delaunay triangulation 3;. In two dimensions, .F;, is formed by a collection of triangles, and in three dimensions F; is composed of tetrahedra. For purely random data S; is unique, but for many real point sets, more than n + 1 points of P often lie on the same hypersphere. Such so called degenerate cases may be resolved by judiciously choosing a triangulation that satisfies the properties of Definition 1.

Wutson's algorithm

One method of forming the Delaunay triangulation of the point set P is Watson's a lg~r i thm.~ . '' The basic approach, as shown in Figure 2, is based on incremental point insertion into a pre- existing Delaunay triangulation.

Page 5: A combined octree/delaunay method for fully automatic 3-D mesh generation

A COMBINED OCTREEDELAUNAY METHOD 41

cl Element Dektlon dl Flnal Mesh

Figure 2. Watson’s algorithm

Watson’s algorithm begins by introducing points p b and forming a Delaunay triangulation that bounds the point set P. A point pi is selected from Pand’inserted into the triangulation. Those$ of .T 7, whose bounding hyperspheres contain the point are then deleted. This forms an n- dimensional insertion polyhedron bounded by ( n - 1)-dimensional simplexical faces. The ;I points of each face and pi define a single s:, connecting each face to pi forming a new triangulation 3 7 , . Once all the points have been inserted into the triangulation, the simplexes connected to points Pb may be removed, as these are outside the convex hull V.

Watson’s algorithm, although conceptually straightforward, suffers from time complexity O(M4/3).16 Other algorithms for generating Delaunay triangulations have been proposed2*’-’ that improve this performance significantly. However, as a method for automatic mesh genera- tion, there are a number of difficulties characteristic of the Delaunay triangulation itself. First, generating the point set P is quite difficult for arbitrarily complex geometric models. Secondly, improper resolution of the degenerate case can yield an invalid mesh. This situation is further exacerbated by performing computation with finite precision arithmetic. Thirdly, because the triangulation is generated based o’n point data alone, the resulting mesh may be incompatible with 8. Hence higher-dimensional topological information must be incorporated into an algorithm that generates T;,. The firsf of the three problems, generating the point set P, is a natural outcome ofthe octree decomposition of 9. The two’other difficulties mentioned above are discussed in the following subsections.

Rrsolriny the dryeneratr case

When more than n + 1 points of the point set P lie on the bounding hypcrsphere, r l , of an n- dimensional simplex, s: (within the resolution of numerical calculation), the’ degenerate case occurs. Resolving degeneracies requires a consistent decision as to which c: a particular point should be considered insideor outside of. Although in two dimensions the decision can be made arbitrarily, in three or more dimensions the choice must bc made in such a way as to satisfy the conditions of Definition 1.

In practice. the judgement as to whether a point pi is inside a particular c: of radius r and circumcentre x, can be made based on a tolerance factor c:

piec: when IIpi - x, 11 < (1 --E)r (3) Choosing I: > 0 is tantamount to classifying pi outside of all degenerate c: (Figure 3), while choosing e<O classifies pi inside of all degenerate c:. Generally, E is taken c > O for convenience: it

Page 6: A combined octree/delaunay method for fully automatic 3-D mesh generation

42 W. J. SCHROEDER AND M. S. SHEPHARD

A

(a) EvaluaUon of "ln/out" (b) F M Mangulatlon

Figure 3. Using the 'in/out' hypersphere to classifv mints with respect to bounding hypersphere

minimizes the deletion of simplexes and provides a simple mechanism to control mesh triangulation by point ordering, as will be described shortly. A typical value for c is 0.001.

The parameter E effectively defines an approximate 'in/out' hypersphere, E l , of different radius from the true hypersphere cl . By using E l instead of c;, the result is that the triangulation may not satisfy the Delaunay property of hypersphere containment (Definition 2). But even if E = 0, the effect of numerical calculation errors is to compute E; rather than the correct c;. Therefore, in order to produce a valid mesh, methods must be created that account for computation with the perturbed hypersphere E;.

Point convexity

Three problems can arise when computing with E l . First, the resulting triangulation may not be a Delaunay triangulation within the tolerance E. In terms of generating a computational mesh, as long as the triangulation satisfies the properties of Definition 1 and the element quality is acceptable, this situation is not of concern.

Secondly, a point pi very close to point pj, where pi is incorporated into S; prior to pi, may not be inside any E l , and therefore not participate in the triangulation (Figure 4). It may be necessary to reduce the size of E or to determine the sl that pi is located within. Another approach is to use this as a mechanism for discarding poorly distributed points since such points will lead to poorly shaped elements when E 4 r.

Thirdly, and of most concern, using E l rather than c; may result in a triangulation with structural inconsistencies. For example, in Figure 5 the point PEE: but p$Et. If T, is deleted to form the insertion polygon, then the resulting mesh will overlap TI. Similarly, sl with zero volume or that overlap can be generated even when E = 0 due to finite precision arithmetic.

Structural inconsistencies are created because the mesh does not globally satisfy the Delaunay property of hypersphere containment. Watson's algorithm depends on these properties to generate an insertion polygon that will generate a valid mesh. The insertion polygon must be star- shaped,13 or more specifically, satisfy the condition of point conoexity.

Dejinition 3. An n-dimensional polyhedron withfacesi, for i = 1, . . . , n f , is strictly point convex to the point p when the inward pointing normal to each polygonal face, ni, satisjes the condition of point convexity (Figure 6):

n,.(p - xi) > 0 (4)

where xi is an arbitrary point on facefi.

connecting p with each When the insertion polygon is strictly point convex, creating n-dimensional simplexes by

produces a structurally consistent mesh.

Page 7: A combined octree/delaunay method for fully automatic 3-D mesh generation

A COMBINED OnREEDELAUNAY METHOD 43

Figure 4. A point not inside any 'in/out' hypersphere. The point will not participate in the triangulation

Figure 5. The generation of a mesh with structural inconsistencies

Figure 6. An insertion polygon that is strictly point convex

Point coFvexity checking is readily added to Watson's algorithm to prevent structural inconsistency. As each point is insetted into the triangulation to create the insertion polygon, the condition for point convexity is enforced.. In parrarticu1ar;when

n , . ( p - x i ) < S ( 5 )

where 6 > 0 (with norms 11 ni# = )I p - x i 11 = 1; a typical value of 6 is 0.02), the point convexity condition is not satisfied. When a face ff is not strictly point convex, the simplex it i s connected to is deleted, forming a new insertion polygon. The added faces are again evaluated fof point convexity

Page 8: A combined octree/delaunay method for fully automatic 3-D mesh generation

44 W. J. SCHROEDER AND M. S. SHEPHARD

and the process is repeated. In some cases, deleting the simplexes results in disconnecting a previously inserted point from the triangulation. The point may then be placed in the insertion queue for later processing, thereby dynamically reordering the insertion of points. The result of this procedure is to create an insertion polygon that is strictly point convex, thereby generating a valid mesh.

If the condition of equation (5) can not be satisfied even when dynamically reordering points, then the distribution of points is such that only poorly formed simplexes can be created. In this ease, either 6 must be reduced, the points repositioned, or more points added to form better shaped simplexes. When used in conjunction with the octree method, the octree is refined to add the additional points.

Point ordering

As described previously, using the parameter E as defined in equation (3) results in a method to resolve the degenerate case. I t also provides a mechanism to control a Delaunay triangulation with degenerate points.

For a point set P with no degenerate points, 3: is unique. However, degeneracies introduce non-uniqueness into the triangulation. But if the resolution of the degenerate case can be controlled, then T:, is unique for any P . One such method is to order the insertion of points into Watson’s algorithm.

For example, in Figure 7 nine points are arranged in a regular lattice-work to form multiple degeneracies. In each figure, the points are inserted into Watson’s algorithm as numbered. If a particular point is degenerate, then by using E > 0 the point is classified either inside or outside the L‘; of the appropriate simplexes. From the figure, i t is quite apparent that by varying the order of point injection, the location of the degenerate topology can be explicitly controlled.

Classijctition ot7d compatibility

A valid computational mesh must be topologically compatible and geometrically similar to the originating geometric model, !F. Topological compatibility is a requirement that the mesh topology and 7are congruent, while geometric similarity is a requirement that the mesh geometry is an acceptable approximation to G . Both requirements together will, in the limit of mesh refinement, produce a mesh that matches the geometric model exactly. Because the Delaunay triangulation is based solely on the location of the points of P , higher order topological information does not affect the resulting computational mesh. Hence the Delaunay triangulation of ccrtain geometric models with particular distributions of points will produce a mesh that is incompatible with the model topology.

For example. the Y;, is always incompatible with concave objects, as the convex hull of points is triangulated. In many cases. however. the problem elements are entirely within the concave features and may be removed using ‘in/out‘ testing or equivalent information. A more serious condition of incompatibility occurs when topological holes exist in the mesh as compared to the model topology. For example, in Figure 8 the triangles T, and T2 cannot be removed without producing a mesh that is topologically incompatible with the model edge E .

A method for resolving topological incompatibility has been outlined in Reference 14. The method begins by first classifying the various mesh entities against the computational mesh (e.g. mesh edges are classified on model edges, faces or regions). When a topological entity is not continuously discretized by the mesh entities of equivalent topological order, then a ropological kole exists. The topological holes, once recognized, can be stitched closed by the incremental

Page 9: A combined octree/delaunay method for fully automatic 3-D mesh generation

A COMBINED 0CTREE:DELAUNAY METHOD 45

7 lm;

3 6 2

lC)

Figure 7. Ordering of points to control triangulation

P (bl Id

Figure 8. Meshing the geometric model (a) results in the topologlcally incompatible computational mesh (b) that IS resolved by introducing the stitch point (c)

addition of points to the Delaunay triangulation. For example, the addition of point p in Figure 8 will produce a topologically compatible mesh. The points can be generated by various means: one approach is to intersect the boundary of the n-dimensional polyhedra formed by the sr connected to a point on the boundary of the topological hole (Figure 9). The process is repeated until all mesh entities are successfully classified and mesh continuity is satisfied.

The addition of classification and compatibility checking to Delaunay triangulation results in a modified algorithm that will produce topologically compatible meshes. However, classification and compatibility checking requires that a complete geometric representation is available.

Page 10: A combined octree/delaunay method for fully automatic 3-D mesh generation

46 W. J. SCHROEDER AND M. S. SHEPHARD

Stltch point

Figure 9. Generating a stich point by intersecting point polygon with model geometry

OCTANT ELEMENT GENERATION USING DELAUNAY TRIANGULATION

Generally speaking, the quadtree/octree procedures in themselves are not methods for generating computational meshes. Rather, each is a method of sub-dividing a geometry into spatially addressable cells. It is only when coupled with a particular mesh generation algorithm that numerical grids can be generated.

In the past the quadtree/octree approaches to mesh generation have used element generation schemes based on template matching and element removal.'. l9 This paper proposes a method based on the modified Delaunay triangulation algorithm described previously.

There arc two fundamental approaches to coupling the Delaunay triangulation with quad- tree/octree spatial decomposition. The first is to generate a point set P from the tree decomposi- tion, followed by Delaunay triangulation over the entire P . The second is to form the Delaunay triangulation on an octant-by-octant basis, followed by assembly of the octant mesh into a global triangulation.

As described previously, triangulating the entire set P has a greater than linear time ~omplexity.~. ' Furthermore, the various Delaunay triangulation algorithms will fail if the point distribution is poor enough to form numerically poor tetrahedra. The primary advantage to this approach, however, is the relative independence of the tree building and triangulation procedures, thereby minimizing the complexity of data communication.

Forming the Delaunay triangulation on an octant-by-octant basis results in an algorithm of linear time complexity. Error trapping and recovery is also localized within the tree structure. When meshing difficulties are encountered, the tree can be refined locally, thereby reducing the overall complexity in a particular octant. Triangulating on an octant-by-octant basis also provides the ability to use pre-defined' templates to create octant meshes. The difficulty of this approach is that the compatibility of the mesh must be maintained between octants. Octant compatibility can be maintained in two ways: either implicitly by controlling octant face triangulation, or explicitly, by performing merging between neighbouring octant meshes.

Maintaining octant compatibility explicitly requires an effective scheme for merging three- dimensional Delaunay triangulations. The difficulty here is to first identify those simplexes to be merged, and t hcn form a triangulation that resolves the degenerate case in all dimensions. The primary advantage of this approach is that the resulting mesh is globally a Delaunay triangul- ation. In addition, the octant geometric representation does not need to be built, although mesh classification and compatibility checking must be still be performed against the model boundary.

Octant compatibility may also be maintained by triangulating the boundaries of neighbouring octants in an identical fashion. The resulting implicit control of octant compatibility is easier to implement than the explicit octant merging approach. The relative independence of the meshing procedure between octants also provides a simple way of paralleling the triangulation procedure. The resulting mesh, however, may not be (globally) a Delaunay triangulation. Furthermore, a complete geometric representation must be built within each octant so that local classification and compatibility checking can be performed.

Page 11: A combined octree/delaunay method for fully automatic 3-D mesh generation

A COMBINED OCTKEEDELAUNAY METHOD 47

Octant triangulation

The combined octree/Delaunay algorithm described by this paper is based on the three step process of (1 ) tree building, (2) element generation and (3) smoothing. In particular, element generation proceeds by visiting each octant one at a time, forming a Delaunay triangulation of the octant. Mesh compatibility is insured by ordering the points, thus guaranteeing a unique triangulation across octant boundaries. Octant neighbours will always have the same edge/face triangulation, and will therefore be compatible.

Each octant is triangulated using Watson’s algorithm with point convexity and topological compatibility checking. The point set P that is triangulated consists of all points associated with the octant. These points may be octree vertices, vertices from the intersection of the octree with the geometry or vertices added to the octant to maintain topological compatibility.

A detailed discussion of these ideas follows.

Insuring octant compatibility

To insure octant compatibility, the one- and two-dimensional triangulations corresponding to the octant edges and faces must be identical between neighbouring octants. Degenerate points on the face of an octant, or points interior but close to the surface of an octant, may disrupt the boundary triangulations of the octant, thereby causing octant incompatibility (Figure 10).

Octant incompatibility due to two-dimensional degeneracies on octant faces is prevented by ordering the points. Ordering the octant points forms a unique Delaunay triangulation that guarantees compatibility. Although many ordering schemes are possible, the goal of each is to generate a unique triangulation on the octant boundary, so that neighbouring octants form a compatible mesh.

An ordering scheme that has proved to be quite successful is based on assigning a feature numbcr to every point in a given octant. The feature number is dependent on the location of a

(b)

Figure 10. Incompatible (a) and compatible (b) octant neighbours

Page 12: A combined octree/delaunay method for fully automatic 3-D mesh generation

48 W. J. SCHROEDER AND M. S . SHEPHARD

point with respect to octant geometry. Figure 1 1 shows the feature numbering system for octant vertices, edges and faces, taking into account the potential 2: 1 ratio across octant boundaries. Once feature numbers are assigned, a simple set of rules is used to order the injection of the points into Watson's Delaunay triangulation algorithm.

The rules for ordering points in an octant are dependent on the octant number and the feature number. The octant number, as illustrated in Figure 12, indicates the location of a child octant with respect to its parent. The rules consist of an ordered list of feature numbers as defined by Figure 11 . Point insertion into the triangulation is determined by traversing the ordered feature list and placing any point(s) associated with that feature into the insertion queue. If more than one point is associated with a particular octant feature (e.g. two intersection points on an octant edge), i t is assumed that these vertices are introduced into neighbouring octants in the same order. In many cases there are no points associated with an octant feature because that feature is classified 'outside' the model geometry. Therefore points associated with that particular octant feature are not placed in the insertion queue. The rules for ordering points associated with octant features are shown below for octant number 0.

1. Points on octant corner vertices with vertex feature numbers (0, 5, 3, 6, 1, 4, 2, 7). 2. Points on octant 2 : 1 edge vertices with vertex feature numbers { 9, 10, 13, 14,17, 18,8, 11, 12,

15, 16, 19).

Vertex Numbers Edge Numbers 2 10 3

13

, I

?--" 4 :

Face Numbers

Y

Figure I 1 Octant feature numbers

Page 13: A combined octree/delaunay method for fully automatic 3-D mesh generation

A COMBINED OCTREE/DELAUNAY METHOD 49

3. 4.

5. 6. 7. 8.

The

Figure 12. Octant numbers

Points on octant 2: 1 face vertices with vertex feature numbers {20, 21, 22, 23, 24, 25). Points on octant 2: 1 edges (2: 1 edges will lie on one of the six octant faces) with face feature numbers { 0, 1,2,3,4,5}. When more than one 2: 1 octant edge point is present on an octant face, the points are ordered by referring to the ordering rules of the neighbouring octants. Points on octant edges with edge feature numbers { 1, 2, 5, 6, 9, 10, 0, 3, 4, 7, 8, 11 }. Points on octant faces with face feqture numbers { 0, 1, 2, 3, 4, 5 } Points interior to the octant (i.e., not on the octant boundary). Points added from neighbouring octants to resolve a topological incompatibility.

, ,. ,

points added to the insertion queue from rules (l), (2) and (3) above are always inside the model geometry and correspond directly with octant features. Points addressed by rules (4), (5) and (6) are always due to intersection of the octant features with the model geometry. Model vertices that are inside an octant are added according to rule (7). Points added to the insertion queue from rule (8) are termed attribute meshing points and are created as part of the classification and compatibility checking procedures to resolve topological incompatibility (as will be described shortly).

There are many possible ordering rules for maintaining octant compatibility, none of which are necessarily superior to any other. The particular ordering rules described here have been designed to generate a pattern of alternating diagonals, as shown in Figures 7(a) and lqb). The alternating diagonals generally improve the quality of the numerical solution. The diagonal switching requires different rules for each octant, which have been omitted for brevity. However, by generating alternating diagonals and maintaining octant compatibility, the other rules can be easily derived.

To illustrate these rules, consider the example shown in Figure 13, where an octant (octant number 0) intersects the boundary of a geometry. Here, rule (1) yields points labelled { 1, 2, 3,4}, rule (2) yields points { 5, 61, rule (3) yields point { 7)., rule (4) yields points { 8, 9}, rule (5) yields points{ 10, 11, 12, 13},rule(6)yieldspoints{ 14, 15,16}andrule(7)yieldspoint {17}.Rule(8)does not contribute any points as there are no attribute meshing vertices present. Note that rule (4) generated the order { 8,9} because, in this example, the neighbour octant's (octant number 0) rules generates this order.

Many of the octants fully interior to '3 are meshed using templates. These templates are created by using the ordering scheme described here, and then computer code is automaticaUy generated

Page 14: A combined octree/delaunay method for fully automatic 3-D mesh generation

50 W. J. SCHROEDER AND M . S. SHEPHARD

Figure 13. Point injection for octant number 0 based on ordering rules

to construct the triangulation directly. Hence templates are computationally efficient and always compatible with octant neighbours.

Octant incompatibility due to two-dimensional degeneracies on octant faces is resolved by ordering points. A more serious case of octant incompatibility occurs when interior points are close enough to the boundary of the octant to affect the one- and two-dimensional triangulation of the octant edges and faces, respectively. In this situation, the triangulation of neighbouring octants is no longer completely independent, and requires communication between octant neighbours. There are two aspects of interior point incompatibility which must be addressed: (1) minimizing the occurrence of, and ( 2 ) devising a method for resolving interior point compatibility.

Interior point incompatibility occurs when an octant interior point is within the c‘: of tetrahedra ‘exterior’ to the octant (i.e. those connected to the bounding point set pb) . By minimizing the penetration distance, D, of the exterior E? into the octant, the interior point incompatibility can be greatly reduced. In general, D is a function of the location of the bounding points Pb and the position of points on the boundary of the octant. A measure of the penetration distance can be obtained, however, by creating a particular bounding triangulation CTb. The r b forms the initial triangulation in Watson’s algorithm, and is defined as follows.

De$nition 4 . Given a octant ofdimension 21, the initial bounding octant triangulation, F b , is dejned by the vertices o f a regular octahedron, p ! , i = 1, . . . , 6, each vertex being positioned at a height h > 21 ocer the centre of each of the six octant,faces. The p : form an initial Delaunay triangulation consisting of four tetrahedra that completely bound the octant points. (Figure 14). The condition on the height, h > 21, is required to insure that Fb bounds the octant points, and is derived from the geometry of the octant and regular octahedron.

An approximate measure of maximum penetration distance into an octant D,,, can be computed when an octant face triangulation is formed from the four corner vertices of the face (Figure 15). Using simple geometric relationships, the non-dimensionalized maximum penetration distance of a circumsphere into the octant, D,,,/l, is given by

where h is the height of the vertices p k above the appropriate octant faces, and I is the half-length of the octant. Referring to equation (6), by setting h & 21, interior point incompatibility can be greatly

Page 15: A combined octree/delaunay method for fully automatic 3-D mesh generation

A COMBINED OCTREEJDELAUNAY METHOD 51

Figure 14. The initial bounding triangulation situated around an octant. The four tetrahedra form a regular octahedron

?

C 6 (a1 (b)

Figure 15. Penetration distance into octant

reduced. Unfortunately, this results in a triangulation with numerically poor tetrahedra, and referring to Figure 4, some points within the octant will not participate in the triangulation. In practice, h is taken h 2 41 so that the maximum penetration is about 25 per cent of the octant width. Therefore, interior point compatibility will occur occasionally, and must be resolved through communication with neighbouring octants.

Identifying interior point incompatibility is a natural outcome of the compatibility and classification procedures described previously. As part of the octree procedure, octant geometry is unambiguously represented. In the process of resolving topological incompatibility, if points are added (as point p in Figure 8) on the boundary of an octant, then an interior point incompatibility is present. The added point p, previously defined as an attribute meshing vertex, is passed to all the appropriate neighbouring octants. (Each octant must maintain an ordered list of attribute vertices.) If the affected octants have been previously triangulated, they are retriangulated with the new point; otherwise, the triangulation proceeds normally with the added point.

Octant subdivision for point convexity

As each octant is triangulated using Watson’s algorithm with point convexity checking, occasionally the condition of equation ( 5 ) can not be satisfied. As described previously, the insertion algorithm is modified to insure point convexity by deleting selected simplexes. However,

Page 16: A combined octree/delaunay method for fully automatic 3-D mesh generation

52 W. 1. SCHROEDER AND M. S. SHEPHARD

because the points are ordered on the oounuary of the octant, dynamic point reordering is not permitted. If reordering were permitted, the triangulation on the face of the octant would no longer be uniquc, possibly forming an incompatible mesh across octant boundaries.

In this case the octant is subdivided one additional level. The result is to simplify the geometry in the children octants, effectively adding points to the Delaunay triangulation. Octant subdivision may be repcatcd as often as necessary to produce a valid mesh. The limits to this process are only the available memory and precision of the computer.

Octant element generation

The generation of elements occurs on an octant-by-octant basis. I t is assumed that a complete geometric representation of the octant is available to the octant element generator. Octants that are interior to $9 can be meshed using templates. Boundary octants, or octants without matching templates, are meshed using the procedure described below.

1 .

2.

3.

4.

5 .

6.

The

(Identity points.) Points inside and on the boundary of thc octant are identified for participation in the octant triangulation. (Order points.) Rased on octant number and point feature numbers, the points are ordered (Figure 13) to insure octant compatibility. (Initialize) triangulation.) The initial bounding triangulation, 9,, is formed according to the dimension and location of the octant. (:Modj/iecl W'ut,son'.s u/gorithm.) Point insertion with point convexity checking is performed. Degencracics are resolved using the 'inlout' circumsphere test. If point convexity can not satisfied, the octant is refined and the octant element generation process is repeated for its child octants. (Cl~is .s i f ic .ut iorzi 'Conipa~i~~~ft~ cliecking.) The resulting mesh is classified against the geometric modcl, !$. Mesh compatibility checking is pcrformed and incompatibilities arc resolved. If points arc addcd to the boundary of an octant (interior point incompatibility), this point is communicated to thc appropriate octant neighbours. (Store mcsh.) The mesh topology and geometry is stored in the appropriate data structures.

RESULTS

octant clement generation scheme has been used to generate meshes for many geometric models. Figure 16 shows the resulting octant mesh for two boundary octants in a solid model. Note that the mesh is compatible betwecn neighbours. In Figure 17 an octant mesh for a shell model is shown. The octant is located with respect to the geometry as depicted in Figure 17(a),

L - - ,

Match Faces

Figure 16. Example solid model meshes for two neighbouring octants

Page 17: A combined octree/delaunay method for fully automatic 3-D mesh generation

A COMBINED OCTREEIDELAUNAY METHOD 53

resulting in the octant geometry of 17(b). In the resulting triangulation, shown in Figure 17(c), the open points have been added to the octant during classification and compatibility checking to resolve topological incompatibilities. Because the points are added on the boundary of the octant, they are communicated to the appropriate neighbour.

Once elements are generated in each octant, the meshing process is complete. A mesh for the geometry Wine Glass is shown in Figure 18. This computational mesh consists entirely of two- dimensional shell elements. Another complete mesh for the geometry Bracker is shown in Figure 19, which contains 2651 tetrahedral elements. The web area of the model has been refined slightly to show the element transitioning capability of the system. In each of these examples, the geometric representation is based on planar geometry.

(C)

Figure 17. An example shell octant mesh. The open points have been added to the mesh to resolve topological incompatibility

Figure 18. The shell model Wine Gluss

Page 18: A combined octree/delaunay method for fully automatic 3-D mesh generation

54 W. J . SCHROEDER A N D M. S. SHEPHARD

Figure 19. The solid model Bracket

CONCLUSIONS

The combined octree/Delaunay method is a robust and efficient algorithm for fully automatic mesh generation. I t combines the strengths of the octree approach: ability to control mesh density, mesh transitioning, spatial addressibility of octants and O( e ) time complexity with those of the Delaunay triangulation: a simple, algorithmic approach to elcmcnt generation. In particular, forming the Delaunay triangulation on an octant-by-octant basis simplifies element generation, and provides a means to resolve meshing difficulties.

This paper has also provided novel extensions to Watson’s triangulation algorithm. Thc concept of point convexity provides a technique for insuring a valid, non-overlapping mesh. Ordering of points is a method of controlling the degenerate case. And finally, classification and compatibility checking guarantees a numerical grid which is compatible with the originating geometry.

ACKNOWLEDGEMENT

We would like to express our appreciation to the GE Corporate Research & Development Center for supporting much of this work.

REFERENCES

I . P. L. Baehmann, S . L. Wittchen, M. S. Shephard and M. A. Yerry, ‘Robust geometrically based automatic two-

2. A. Bowyer, ‘Computing Dirichlet tessellations,’ Comp. .I., 24, 162-166 (1981). 3. J. C. Cavendish, ‘Automatic triangulation of arbitrary planar domains for the finite element method,’ 1nf . j . numer.

4. J. C. Cavendish, D. A. Field and W. H. Frey, ‘An approach to automatic three-dimensional mesh generation,’ Inr. j .

5. R. A. Dwyer, ‘A simple divide-and-conquer algorithm for constructing Delaunay triangulations in O(nloglog n )

6. P. J. Green and R. Sibson, ‘Computing Dirichlet tessellations in the plane,’ Comp. J . , 21, 168-173 (1978). 7. L. J. Guibas and J. Stolfi, ‘Primitives for the manipulation of general subdivisions and the computation of Voronoi

dimensional mesh generation,’ Inr. j . numer. methods eng., 24, 1043-1078 (1987).

methods eng., 8, 619497 ( 1 974).

numer. meihods eng., 21, 329-347 (1985).

expected time’, ACM O-X979I-194-6/86/0600/0276, 1986.

diagrams,’ ACM Trans. Graphics, 4, 74-123 (1985).

Page 19: A combined octree/delaunay method for fully automatic 3-D mesh generation

A COMBINED OCTREE,DELAUNAY METHOD 55

8. B. Joe and R. B. Simpson. ’Triangular meshes for regions on complicated shapes’, Int . j. numer. methods eriy.. 23,

9. A. Kela, ‘Exact octree approximations from solid models: Their derivation and application in finite element mesh

10. A. Kela. ‘Hierarchical octree approximation Tor BRep based geometric models’, Comp. Aided Des., Submitted for

1 I . C. L. Lawson, ‘Properties of ti-dimensional triangulations’, Comp. Aided Geortietric Des.. 3, 131-246, (1986). 12. D. J. Meagher. ‘Octrec encoding: A new technique for the representation, manipulation, and display ofarbitrary three-

dimensional objects by computer’, Technical Report If L-TR-80- / //, Image Processing Laboratory, Rensselaer Polytechnic Inst., Troy. NY. 1980.

751 -778 (1986).

generation’, Submitted for publication.

publication.

13. F. P. Preparata and M. I. Shamos. Compurarional Geometry, An Introduction, Springer-Verlag, New York, 1985. 14. W. J. Schroeder and M. S. Shephard. ‘Geometry-based fully automatic mesh generation and the Delaunay

IS. R. Sibson, ‘Locally equiangular triangulations’, Camp. J., 21, 243 -245 (1978). 16. D. F. Watson, ‘Computing the n-dimensional Delaunay tessellation with applications to Voronoi polytopes’, Comp. J.,

17. K. Weiler, ‘Edge based data structures for solid modeling in curved-surface environments’. I E E Camp. Graphics

18. K. Weiler, ‘Topological structures for geometric modelling’, Ph.D. Thesis, Rensselaer Polytechnic Institute, Aug.

19. M. A. Yerry and M. S. Shcphard, ‘Automatic mesh generation for three-dimensional solids’, Conip. Sfruct., 20,21 I--223

triangulation’, f n r . j. numer. methods eny., 26, 2503-2515 (1988).

24, 167-172 (1981).

Applic.., 5. 2 1 4 0 ( 1985).

1986, CICG. TR86032.

(1985).