Manipulating three-dimensional triangulations

15
Manipulatin@ Three-Dimensional Triangulations Elisabetta Bruzzone Leila De Floriani Enrico Puppo Istituto per la Matematica Applicata Consiglio Nazionale delle Ricerche Via L.B. Alberti, 4 - 16132 Genova (Italy) Phone Number: 39-10-515510 Email Address: [email protected] Abstract The three-dimensional symmetric data structure is a topological model of a three-dimensional triangulation. It is a generalization of the symmetric structure proposed by Woo [Woo85] for describing the boundary of a solid object. In the paper, we present the basic topological elements of a 3D triangulation and their mutual relations. We describe the 3D symmetric structure and present structure accessing algorithms for retrieving those relations which are not explicitly encoded in the structure. Finally, a minimal set of primitive operators for building and manipulating a 3D triangulation are discussed. Such operators are independent of the underlying data structure~ 1. Introduction Object representation plays an important role in a variety of applications, such as computer graphics, computer vision, robotics, computer aided design. Different object models are suitable for different applications. Object representation schemes can be classified into their major categories: boundary representations, constructive models and decomposition models [Man88]. Boundary representations describe an object in terms of the surfaces enclosing it, constructive models (like the CSG tree [ReqSl]) represent an object as a boolean combination of primitive volumetric component. Decomposition models can be further classified into space-based and object-based schemes. The former decompose the space into elementary volumes (usually, cubes) and describe the object in terms of the volume elements which belong to it. An example of a space-based model is the octree [$am84]. Object-based scheme represent an object S as the combination of pair disjoint primitive 3D cells whose union cover S. Usually, tetrahedra are used as basic cells. Such a model object is called a three-dimensional triangulation. Three-dimensional tesselations are extensively used in the finite element method and in computer vision for the object reconstruction problem [DeF87]. Three-dimensional triangulations have several important properties like invariance through rigid transformations, ease of updating, computational efficiency, and suitability for both sparse and dense data [Boi88]. Usually a 3D triangulation is constructed from a set of points in the 3D space or from the boundary of an object and a set of internal points (which are either given or selected by the algorithm). This latter is usually the case when a finite element representation must be produced from a CAD model [BowS1]. Often, the use of a three-dimensional Delaunay triangulation [Boi84] is proposed to provide a global geometric structure encoding the neighborhood relations

Transcript of Manipulating three-dimensional triangulations

Manipulatin@ Three-Dimensional Triangulations

Elisabetta Bruzzone Leila De Floriani

Enrico Puppo

Istituto per la Matematica Applicata Consiglio Nazionale delle Ricerche

Via L.B. Alberti, 4 - 16132 Genova (Italy) Phone Number: 39-10-515510

Email Address: [email protected]

Abstract

The three-dimensional symmetric data structure is a topological model of a three-dimensional triangulation. It is a generalization of the symmetric structure proposed by Woo [Woo85] for describing the boundary of a solid object. In the paper, we present the basic topological elements of a 3D triangulation and their mutual relations. We describe the 3D symmetric structure and present structure accessing algorithms for retrieving those relations which are not explicitly encoded in the structure. Finally, a minimal set of primitive operators for building and manipulating a 3D triangulation are discussed. Such operators are independent of the underlying data structure~

1. Introduction

Object representation plays an important role in a variety of applications, such as computer graphics, computer vision, robotics, computer aided design. Different object models are suitable for different applications. Object representation schemes can be classified into their major categories: boundary representations, constructive models and decomposition models [Man88]. Boundary representations describe an object in terms of the surfaces enclosing it, constructive models (like the CSG tree [ReqSl]) represent an object as a boolean combination of primitive volumetric component. Decomposition models can be further classified into space-based and object-based schemes. The former decompose the space into elementary volumes (usually, cubes) and describe the object in terms of the volume elements which belong to it. An example of a space-based model is the octree [$am84]. Object-based scheme represent an object S as the combination of pair disjoint primitive 3D cells whose union cover S. Usually, tetrahedra are used as basic cells. Such a model object is called a three-dimensional triangulation. Three-dimensional tesselations are extensively used in the finite element method and in computer vision for the object reconstruction problem [DeF87]. Three-dimensional triangulations have several important properties like invariance through rigid transformations, ease of updating, computational efficiency, and suitability for both sparse and dense data [Boi88].

Usually a 3D triangulation is constructed from a set of points in the 3D space or from the boundary of an object and a set of internal points (which are either given or selected by the algorithm). This latter is usually the case when a finite element representation must be produced from a CAD model [BowS1].

Often, the use of a three-dimensional Delaunay triangulation [Boi84] is proposed to provide a global geometric structure encoding the neighborhood relations

340

among the points of the given data set. Intuitively, a Delaunay triangulation T of a set S of points in the k-dimensional Euclidean space is a collection of simplexes tesselating the interior of the convex hull of S in such a way that the vertices of T are the points of S and the circumspheres of such simplices do not contain any point of S inside [DeF87]. Algorithms for computing the n-dimensional Delaunay tesselation of a set of points are discussed in [BowSi,Wat81]. The 3D Delaunay triangulation of the points defining the boundary of an object provides a volumetric representation of the convex hull of the object by a set of tetrahedra. If not all of the given points are on the convex hull, the object boundary can be sculptured by iteratively eliminating external tetrahedra, as described in [Boi84].

Several data structures for describing a triangulation of a set of points in the plane or any partition of the plane [DeF87,Pre85] or of the boundary of a solid object [Ans85,Bau72,Wei85,Woo85] have been proposed in the literature. Such structures store the basic entities defining the tesselation and their mutual relations. Also, basic operators for building and updating a boundary sheme, called the Euler operators, have been defined by several authors [Ans85,Man88,Wei86]. Less attention has been devoted to the problem of describing and manipulating a 3D tesselation. In [Dob87] Dobkin and Laszlo generalize the DCEL data structure used for describing arbitrary planar subdivisions [Pre85] to the case of volume decompositions.

In this paper, we define a data structure for encoding a 3D triangulation, and a set of structure accessing primitives operating on it. The data structure generalizes the symmetric structure [Woo85] to 3D triangular tesselations. Its space complexity is evaluated as well as the time complexity of the structure accessing algorithms which operate on the data structure. A minimally complete set of building and updating primitives, which generalize the Euler operators defined for classical boundary schemes, is defined. Such operators ensure that the topological validity of the object represented by the 3D tesselation is satisfied at each updating.

2. Primitive Topological Elements and Their Mutual Relations

In this section, we define the basic entities of a 3D triangulation and their mutual relations.

Let S denote a set of n distinct points in E3 (n>=4). Assume that the points of S are not coplanar. Let C denote the convex hull of S and D the closed volume bounded by C. A triangulation [Law77] of S is a tessellation of D composed of non-degenerate quasi-disjoint tetrahedra having the vertices at the points of S. The four basic topological elements defining a three-dimensional triangulation of a set of points are tetrahedra, triangles (also called facets), _edges and vertices.

In some applications, the boundary B of the object described by the set S is explicitly specified as a collection of triangles, edges and vertices and is not necessarily convex [Boi84]. In this case, the concept of 3D triangulation of a set S generalizes to that of 3D triangulation of a set S constrained by boundary B. B must define a compact orientable two-manifold surface [Wei86] and must be triangulated. B can be expressed as a tuple B=(FB,EB,VB), where FB, EB and VB denote the facets, edges and vertices forming B. Then, a 3D triangulation TD of set S constrained by B is a set of non-degenerate tetrahedra [ti} satisfying the following properties:

(i) All vertices of each tetrahedron are elements of S (ii) The interiors of the tetrahedra are pairwise disjoint (iii) Each facet is either in FB or is a common facet to two tetrahedra

341

(iv) Each tetrahedron, facet or edge contains no other point of S other its vertices

(v) The facets, edges and vertices of B belong to the triangulation (vi) The union of the [ti} is the volume in E3 enclosed by B

Note that, if B is the boundary of the triangulated convex hull of S, the definition reduces to that of 3D triangulation of a set S.

than

above

In the following, we will call three-dimensional triangulatio n a triangulation of a set of points constrained by a boundary <which can possibly be the boundary polygon of the convex hull of S). A three-dimensional triangulation, denoted TD, can be expressed as a 4-tuple TD=(T,F,E,V) where T,F,E and V denote the collection of the tetrahedra, facets, edges and vertices of TD, respectively. The number of tetrahedra, facet and edges have been evaluated as a function of the number n of the vertices of TD for the case when TD is a 3D Delaunay tesselation. It has been proven [Pre85] that a 3D Voronoi diagram of n points has O(n^2) vertices and edges. Thus, a 3D Delaunay triangulation of n points, which is dual with respect to the Voronoi diagram, contains O(n^2> tetrahedra, O(n^2) facets and O(n) edges. Thus, any relational model of a 3D triangulation will have an O(n^2) space complexity.

Sixteen pairwise ordered adjacency relations can be defined over the four primitive topological elements, as shown in the adjacency schemata depicted in figure i. In this schemata, nodes describe topological elements, while each arrows denotes an ordered relations between pairs of elements. Heavy arrows denote constant relations. The sixteen ordered adjacency relations defined between pairs of elements of a 3D triangulation can be calassified into four categories according to the first element of each ordered pair.

Figure 1

i. Tetrahedron-based relations

1.1 Tetrahedron-Vertex (TV) (see figure 2a) TV(t)={vl,v2,v3,v4}, t in T [vl,v2,v3,v4}: set of vertices of TD belonging to t.

1.2 Tetrahedron-Ed@e (TE) (see figure 2a) TE(t):{el,e2,e3,e4,e5,e6}, t in T {el,e2,e3,e4,e5,e6}: set of edges of TD belonging to t.

1.3 Tetrahedron-Facet (TF) <see figure 2a) TF(t)=[fl,f2,f3,f4}, t in T {f!,f2,f3,f4}: set of facets of TD belonging to t.

1.4 Tetrahedron-Tetrahedron (TT) (see figure 2b) TT(t)=[tl,t2,t3,t:}, t in T [tl,t2,t3,t:}: set of tetrahedra of TD sharing a facet with t. A tetrahedron ti, i=i,...,4, is empty if t does nOt share facet fi with any

tetrahedron of TD, i.e., fi is on the boundary.

Note: The four sequences defined above are consistent. For instance, vertices vl, v2, v3 belong to fl, vl, v2, v4 belong to f2, v2, v3, v4 belong to f3 and v3, vl, v4 belong to f4 <see f~gure 2a).

342

f3 t v4 /e6 y:J-

vl el I " v2 fl

f2

v3

t3

t

//

t2 /

(a) (b)

Figure 2

2. Facet-based relations

2.1 Facet-Vertex (FV) (see figure 3a) FV(f)=[vl,v2,v3], f in F [vl,v2,v3]: sequence of vertices of TD bounding f (in counterclockwise order).

2.2 Facet-Edge (FE) (see figure 3a) FE(f)=[el,e2,e3], f in F [el,e2,e3]: sequence of edges of TD bounding f (in counterclockwise order).

2.3 Facet-Facet (FF) (see figure 3b) FF(f)=[{fll,f21),{f12,f22),{f13,f23}], f in F [{fli,f21),{f12,f22},{f13,f23}]: sequence of facet pairs sharing an edge with f. {fli,f2i}: unordered pair of facets of TD preceding and following f along edge ei and belonging to tl and t2 respectively, where ei denotes the i-th edge bounding f and tl and t2 the two tetrahedra sharing f (when t2 is empty, then FF(f)=[fll,fl2,fl3]). The facet pairs sequence is ordered according to the ccw order of the edges around f.

2.4 Facet-Tetrabedron (FT) (see figure 3b) FT(f)=[tl,t2}, f in F [tl,t2): unordered pair of tetrahedra of TD sharing f (t2 is empty if f belong only to one tetrahedron).

vl

tl

f13

/ \ \x

j ~2 ..- • / .~ /

g23 f22

(a) (b)

Figure 3

343

3. Edge-based relations

3.1 Ed@e-Vertex (EV) (see figure 4a) EV(e)=[vl,v2}, e in E [vl,v2): unordered pair of vertices of TD which are extreme vertices of

edge e. 3.2 Edge-Edge (EE) (see figure 4a)

EE(e)=[[el,e2,...,er],[el',e2',...er']}, e in E {[el,eZ, .... er],[el',eZ' .... er']]: unordered pair of sets of edges of TD

sharing a vertex with e. [el,e2,...,er]: sequence of edges of TD (ordered counterclockwise) sharing vertex vl with e and bounding the facets sharing e. [el',e2',...er']: sequence of edges of TD (ordered counterclockwise) sharing v2 with e and bounding the facets sharing e.

3.3 Edge-Facet (EF) (see figure 4b) EF(e)=[fl,f2, .... fr], e in E [fl,f2,...,fr]: sequence of facets of TD sharing edge e (in counterclockwise order).

3.4 Ed~e-Tetrahedron (ET) (see figure 4b) ET(e)=[tl,t2 ..... ts], e in E [tl,t2,...,ts]: sequence of tetrahedra of TD sharing edge e (in counterclockwise order).

fr-l t~

\ ~x xx

(a) (b)

Figure 4

4. Vertex-based relations

4.1 Vertex-Vertex (VV) (see figure 5a) VV(v)=[vl,v2 ..... vp}, v in V {vl,v2,...,vp}: set of vertices of TD which are extreme vertices edges incident on v.

4.2 Vertex-Edge (VE) (see figure 5a) VE(v)=(el,e2 ..... ep}, v in V (el,e2,...,ep}: set of edges of TD incident on vertex v.

4.3 Vertex-Facet (VF) (see figure 5b) VF(v)={fl,f2 ..... fq), v in V [fl,f2,...,fq): set of facets of TD sharing a vertex with v.

4.4 Vertex-Tetrahedron (VT) (see figure 5b) VT(v)=[tl,t2, .... th), v in V

(tl,t2,...,th): set of tetrahedra of TD sharing a vertex with v°

of the

The previous sixteen relations can be classified into constant and variable relations depending on the number of elements involved in the second term of the relation. All tetrahedron- and facet-based relations are constant, while the

344

edge- and vertex-based relations, with the exception of the EV one, are variable.

v3 fq-2

vp-i tl

(a) (b)

Figure 5

The topology of a three-dimensional triangulation is completely and unambiguously represented by the four primitive topological elements (T,F,E,V) together with a suitable subset R' of the set R of the sixteen adjacency relations. The relations in R' must be sufficient to describe TD unambiguously. In other words, it must be possible to retrieve from (T,F,E,V) and R' all relations in R-R' without any error or ambiguity. The VE is an example of a relation which is individually sufficient to describe a 3D tesselation unambiguously [Wei86].

Since encoding too many relations increases the storage cost of the resulting data structure (which will have in any case a quadratic space complexity), it is important to identify minimal subsets of relations which are capable of providing a sufficient topological description of the tesselation and ensuring the efficiency of the basic structure accessing algorithms.

3. Th_~eThree-Dimensional Symmetri c Data Structure

In this section, we present a generalization to the 3D triangulation of the s!nm~etric data structure which is used in geometric modeling to describe subdivisions of the boundary of a solid object into faces, edges and vertices [Woo85]. The complexity of the data structure is evaluated in terms of the cost of storing the adjacency relations encoded and of the time complexity of the basic structure accessing algorithms which retrieve those relations which are not explicitly encoded into the data structure.

The three-dimensional symmetric data structure encodes the four primitives elements and six relations, namely TF, FE, EV, VE, EF and FT, as described by the adjacency schemata in figure 6. The structure is called symmetric since each relation is stored together with its inverse one.

345

v .c > E

I, F

Figure 6

type

triangulation = record tlist:^tetrahedron; flist:^facet; elist:^edge; vlist:^vertex

end

tetrahedron = record nexttetrahedron: ^tetrahedron; mark: boolean; facets: arra Z [0..3] of ^facet

(*Tetrahedron-Facet relation*) end;

facet = record nextfacet: ^facet; mark: boolean; tetrahedra: array [0..1] of ^tetrahedron;

(*Facet-Tetrahedron relation*) edges: array [0..2] of ^edge; (*Facet-Edge relation*) orientation: array [0..2] of boolean

end; edge = record

nextedge: ^edge; vertices: array [0..i] o_ff ̂vertex; (*Edge-Vertex relation*) facets: ^facetlist (*Edge-facet relation*)

en_~d; vertex = record

nextvertex: ^vertex; x,y,z: real; edges: ^edgelist (*Vertex-Edge relation*)

en__dd;

facetlist = record nextfacet: ^facetlist; facet: ^facet

end; edgelist = record

nextedge: ^edgelist; edge: ^edge

end;

Figure 7

Figure 7 describes the 3D symmetric structure as a collection of Pascal record type declarations. Primitive elements of the triangulation are stored in four linked lists, corresponding to the four classes of elements. Head pointers of these lists are contained in the fields of the record of type triangulation. For each element in the triangulation, a record of the appropriate type exist in

346

the corresponding list. Such a record contains, besides a pointer to the next record in the list, some pointers storing the relations from that element to the other elements in the triangulation. Note that the four constant relations, TF, FT, FE, and EV (denoted by heavy arrows in figure 6), are encoded directly using arrays in the description of the records of type tetrahedron, facet and edge respectively. Encoding the two variable relations (EF and VE) requires two additional linked lists, implemented through records of type facelist and edgelist.

Some boolean fields are added to speed up the structure accessing algorithms described in the next section. The field orientation is used to retrieve the ccw order of the vertices along a facet f. An element of such an array, which corresponds to an edge e joining vertices vl and v2, assumes the value true when the corresponding edge e appears on the facet f as (vl,v2), the value false when e appears as (v2,vl) on f. Mark fields are used by some structure accessing algorithms (see next section). By taking into account that (i) a facet belongs to the list of the facets associated with its three bounding edges and (ii) an edge belongs to the list of the edges of its two extreme vertices, the storage cost of the symmetric data structure is given by the following expression

5t+12f+8e+2n (3.1) where t, f, e and n denote the number of tetrahedra, facets, edges and vertices of the 3D triangulation. Note that the storage space required for geometrical information or for the boolean fields has not been counted.

The remaining ten adjacency relations not explicitly stored into the structure can be expressed as combination of the six basic ones as described below. Such relations are classified according to their first term.

1. Tetrahedron-based relations TT=TF+FT TE=TF+FE TV=TF+FE+EV

2. Face-based relations FF=FT+TF+(FE) FV=FE+EV

3. Edge-based relations ET=EF+FT EE=EF+FE+(EV)

4. Vertex-based relations VT=VE+EF+FT VF=VE+EF VV=VE+EV

Note that tetrahedron- and facet-based relations are combination of constant relations, while the remaining ones are variable relations. Because of our definition of the Edge-Edge relation we need also EV relation to distinguish between the two lists forming EE(e). The same is true for the use of the FE relation in the FF one.

For instance, extracting the Tetrahedron-Edge relation, which means retrieving all the edges which bound a given tetrahedron t requires combining the Tetrahedron-Facet and the Facet-Edge relations, i.e., retrieving the facets bounding t and the bounding edges of each facet. Extracting, for example, the Edge-Tetrahedron relation can be done by concatenating the Edge-Facet and the Facet-Tetrahedron relations. In other words, the tetrahedra of TD sharing a given edge e are obtained by considering the facets of TD sharing e and the tetrahedra sharing each facet. The output size is thus the number of tetrahedra sharing e.

4. Structure Accessing Algorithms

In this section, we describe the algorithms which compute the relations which are not stored in the three-dimensional symmetric data structure classified as in the previous section. We will use the following primitive functions and

347

procedures for manipulating a sorted list L [Aho83] (for some relations the order of the list is not meaningful):

- CREATE EMPTY LIST(L): creates an an empty list L. - IS AN ELEMENT(L,x): returns the value true if x is an element of list L; the

value false otherwise. - IS_LAST_ELEMENT(L,x): returns the value true if x is the last element of list

L; the value false otherwise. - FIRST ELEMENT(L): returns the first element of list L. - NEXT(L,x): returns the element following x in L (it returns EOL(L), i.e., the

end of list, if x is the last element of L). - INSERT_LIST(L,x): inserts element x at the end of list L.

and the following boolean functions and procedures operating on the data structures storing the 3D triangulation:

- EQUAL(x,y): returns the value true if element x is equal to element y; the value false otherwise (x,y must be both elements of the same type, i.e., tetrahedra, facets, edges or vertices).

- MARK(x): marks element x as visited (it is used only for tetrahedra and facets).

- IS_MARKED(x): returns the value true if element x has been visited, the value false otherwise.

- RESETMARKS: reset marked elements of triangulation. - IS_EMPTY(t>: returns the value true if tetrahedron t is empty; the value

false otherwise.

Procedure Tetrahedron Vertex (t,Lv); (* t: tetrahedron of TD;

Lv: list of the vertices belonging to t, i.e. TV(t) *) begin

let TF(t)=(fl,f2,f3,f4}; (*TF(t): set of the facets of t*) Facet_Vertex(fl,Lv); (* returns in Lv of the vertices bounding fl*) Facet_Vertex(f2,Lv'); let Lv'=[vl,v2,v3]; for i:=l to 3 do

if not IS AN ELEMENT(Lv,vi) then INSERT LIST(Lv,vi) end. (*TetrahedronVertex*)

Procedure Tetrahedron_Edge (t,Le); (* t: tetrahedron of TD;

Le: list of the edges of TD belonging to t, i.e. TE(t) *) begin

CREATE EMPTY LIST(Le); le___~t TF~t)=(fl,f2,f3,f4}; (*TF(t): set of the facets of t*) fo__~r i:=l to 3 do begin

le_~t FE(fi)=[el,e2,e3]; (*FE(fi): sequence of the edges bounding fi*) for j:=l to 3 do

if not IS AN ELEMENT(Le,ej) then INSERT LIST(Le,ej) end (*for i*)

end. (*TetrahedronEdge*)

Procedure Tetrahedron_Tetrahedron (t,Lt); (* t: tetrahedron of TD;

Lt: list of the tetrahedra adjacent to t along a facet, according order of the facets along the boundary of t, i.e. TT(t) *)

be@in CREATE EMPTY LIST(Lt); let TF~t)=[fl, f2,f3,f4]; (*TF(t): set of the facets of t*) for i:=l to 4 do beqin

le__~t FT(fi)={tl,t2}; (*FT(fi): pair of tetrahedra sharing facet fi*) if EQUAL(tl,t)

to the

348

end °

then INSERT_LIST(Lt,t2) else INSERT_LIST(Lt,tl)

end (*for*) (*Tehrahedron_Tetrahedron*)

Procedure Facet Vertex (f,Lv); (* f: facet of a tetrahedron of TD;

Lv: sorted list FV(f) of the vertices bounding f *) begin

CREATE EMPTY LIST(Lv); let FE~f)=[eY, e2,e3]; (*FE(f): sequence of the edges bounding f in ccw order*) let EV(el)={vl,v2}; (*EV(el): extreme vertices of el*) if I5 CCW(vl,v2,f) (* IS CCW(vl,v2,f) is a local boolean function that returns the value true iff v2 follows vl according to the ccw order of the edges bounding f *)

then begin INSERT_LIST(Lv,vl); INSERT_LIST(Lv,v2)

end (*then*) e l§e begin

INSERT_LIST(Lv,v2); INSERT_LIST(Lv,vl)

end; (*else*) le___tt EV(e2)={v3,v4}; if EQUAL(v3,vl) o__[r EQUAL(v3,v2)

then INSERT_LIST(Lv,v4) else INSERT_LIST(Lv,v3)

end. (*Facet_Vertex*)

Procedure Facet Facet (f,Lf); (* f: facet of a tetradedron of TD;

Lf: sorted list FF(f) of the facets pairs which are adjacent to f *) begin

CREATE EMPTY LIST(Lf); let FT~f)=[tl,t2}; (*FT(f>: pair of tetrahedra sharing facet f*) let FE(f>=[el,e2,e3]; (*FE{f): sequence of the edges bounding f*) for i:=l to 3 do begin

fli:=ADJACENT_FACET(tl,f,ei); (*ADJACENT_FACET(tl,f,ei) returns that facet of tl (<>f) which edge ei with f. This function uses relation TF*) if 15 EMPTY(t2)

then INSERT_LIST(Lf,fli) else begin

f2i:=ADJACENT_FACET(t2,f,ei); INSERT_LIST(Lf,(fli,f2i))

end (*else*) end (*for*)

end. (*Facet_Facet*}

shares

The number of operations performed in each of the above procedures is constant.

Procedure Edge_Edge(e,Le); (* e: edge of a tetradedron of TD;

Le: list EE(e) of the edges which are adjacent to e *) be@in

CREATE EM~Y LIST(LeI>; CREATE~EMPTY~LIST(Le2); Lf:=EF(e); (*EF<e): sequence of the facets sharing e*) let EV(e)={vl,v2}; (*EV(e): extreme vertices of e*) f:=FIRST ELEMENT(Lf); while f<>EOL(Lf) do be@in

349

end.

Le':=FE(f); (*FE(f): sequence of the edges bounding facet f*) eI:=ADJACENT_EDGE(Le',e,vl); (*ADJACENT_EDGE(Le',e,v) returns that edge e' (<>e) in the list of the edge Le' bounding a given facet f which has v as an extreme vertex. This function uses relation EV*) e2:=ADJACENT EDGE(Le',e,v2}; INSERT_LIST(Lel,el); INSERT LIST(Le2,e2); f:=NEXT(Lf,f)

end; (*while f<>EOF(Lf)*) Le:=(Lel,Le2} (*Edge_Edge*)

Procedure Edge Tetrahedron (e,Lt); (* e: edge of a tetrahedron of TD;

Lt: sorted list ET(e) of tetrahedra sharing e *) begin

CREATE EMPTY_LIST(Lt); Lf:=EF?e); (*EF(e): sequence of the facets sharing e*) f:=FIRST ELEMENT(Lf); le__~t FT(fT={tl,t2}; (*FT(f): pair of tetrahedra sharing facet f*) if IS EMPTY(t2) (*we assume that, if f is on the boundary, t2 is always the tetrahedron*)

the~ INSERT_LIST(Lt,tl) else if IS CCW(tl,t2,e> (*IS CCW(tl,t2,e) is a local boolean function that returns true, iff t2 follows tl around e in ccw*)

then begin INSERT LIST(Lt,tl); INSERT_LIST(Lt,t2)

end (*then*) else begin

INSERT_LIST(Lt,t2); INSERT_LIST(Lt,tl)

end; (*else*) f:=NEXT(Lf,f); while f<>EOL(Lf) do begin

let FT(f)=(tl,t2}; if IS LAST_ELEMENT(Lt,tl)

then if not IS_EMPTY(t2) then INSERT LIST(Lt,t2) else INSERT_LIST(Lt,tl);

f:=NEXT(Lf,f) end (*while*)

end. (*Edge_Tetrahedron*)

empty

the value

The worst time complexity of procedures Edge_Edge and Edge_Tetrahedron is linear in the number of the facets sharing edge e.

Procedure vertex vertex (v,Lv); (* v: vertex of a tetrahedron of TD;

Lv: list VV(v) of other extreme vertices of the edges incident on v *) begin

CREATE EMPTY_LIST(Lv); Le:=VE[v); (*VE(v): set of the edges incident on v*) e:=FIRST ELEMENT(Le); while e<>EOL(Le)d_~o begin

let EV(e)=[vl,v2}; (*EV(e): extreme vertices of e*) if EQUAL(vl,v) then INSERT_LIST(Lv,v2) else INSERT_LIST(Lv,vl); e:=NEXT(Le,e)

end (*while*) end. (*Vertex Vertex*)

350

The worst time complexity of procedure Vertex_Vertex is linear in the number the edges incident on vertex v.

of

Procedure vertex Facet (v,Lf); (* v: vertex of a tetrahedron of TD;

Lf: list VF(v) of the facets sharing v *) be~in

CREATE EMPTY_LIST(Lf); Le:=VE?v); (*VE(v): set of the edges incident on v*) e:=FIRST_ELEMENT(Le); while e<>EOL(Le) do be~! D

Lf':=EF(e); (*EF(e): sequence of the facets sharing e*) f:=FIRST ELEMENT(Lf'); while f<~EOL(Lf') do begin

if not IS MARKED(f) then be~in

INSERT_LIST(Lf,f); MARK(f)

end; (*then*) f:=NEXT(Lf',f)

end; (*while f<>EOL(Lf')*) e:=NEXT(Le,e)

en__dd; (*while e<>EOL(Le)*) RESET_MARKS;

en__dd. (*VertexFacet*)

The worst time complexity of procedure Vertex Facet is linear in the number of the facets incident on vertex v. Each of such facets is examined exactly two times since it appears in the EF list of its two bounding edges incident on v.

Procedure Vertex Tetrahedron (v,Lt); (* v: vertex of a tetrahedron of TD;

Lt: list VT(v) of the tetrahedra sharing v *) begin

CREATE EMPTY_LIST(Lt); Le:=VE~v); (*VE(v): set of the edges incident on v*) e:=FIRST ELEMENT(Le); while e<>EOL(Le) do begin

Edge_Tetrahedron(e,Lt'); (* returns in Lt' of the tratrahedra sharing e *) t:=FIRST ELEMENT(Lt'); while t<~EOL(Lt') do begin

if not IS MARKED(t) then begin

INSERT_LIST(Lt,t); MARK(t)

end; (*then*) t:=NEXT(Lt',t)

endd; (*while t<>EOL(Lt')*) e:=NEXT(Le,e)

end; (*while e<>EOL(Le)*) RESET_MARKS;

end. (*Vertex_Tetrahedron*)

By applying the same arguments as for procedure VertexFacet, we can prove that the worst time complexity of procedure Vertex_Tetrahedron is linear in the number of tetrahedra sharing vertex v.

Extracting the previous ten relations from the symmetric structure requires a constant number of operations for any constant relation or a number of operations which is linear in the size of the output for any variable relation.

351

Thus, no relation requires a number of operations which is linear in the total number of tetrahedra, facets, edges or vertices in TD. In this sense, the time complexity of the data structure can be considered optimal since no structure accessing algorithm requires searching the entire data structure. If we eliminate, for instance, the Edge-Vertex relation from the data structure, then retrieving the Edge-Vertex relation (as well as the TV, FV, VV and EV ones) would require examining all the vertices of TD and for each vertex scanning the list of the edges incident on it. The process of retrieving the EV relation would have a complexity which is linear in the total number of vertices and edges of TD.

5. A Minimal Set of Manipulation Primitives

In this section, we define a minimally complete set of primitive operators to build and modify a three-dimensional triangulation. Such operators, that we call Euler operators ensure that the topological validity condition expressed by Euler-Poincare formula in the form given below [Gre67] is always satisfied at each step of the triangulation updating process.

For convenience, we consider the case in which a 3D triangulation consists of several connected components. Each of such components, that we call a volume, is a maximal connected set of tetrahedra. If we denote by v the number of volumes in a 3D triangulation, Euler-Poincare formula becomes

n-e+f-t=v (5.1) The topological validity of a 3D triangulation can be checked by applying formula (5.1). To avoid performing a validity check of a 3D triangulation after each updating, it is convenient to decompose each modification of the triangulation into a sequence of simple atomic steps provided by Euler operators. It can be proven that all valid 3D triangulations consisting of one or more volumes with no holes can be created with a finite sequence of Euler operators, and, conversely, given a 3D triangulation, there exists a finite sequence of operators that completely destroy the triangulation.

By analogy with the case of boundary models [Man88], every 4-tuple of mutually independent operators can be proven to be theoretically sufficient for describing all 3D tesselations satisfying formula (5.1). The set of the primitive operators selected is listed below with an informal description of their effect on the 3D triangulation. Only changes in topological entities are described regardless of any geometric information.

1. Constructive Operators

i. MAKE VOLUME VERTEX MVV(vm,v): creates a new volume vm by inserting a vertex v.

2. MAKE EDGE VERTEX MEV(vm,w,e,v>: adds a new edge e having one end-point at an existing vertex w and the other one at a new vertex v to volume vm.

3. MAKE_EDGEFACET MEF(vm,el,e2,f,e): adds a new facet f bounded by the two existing edges el and e2 and by a new edge e to volume vm.

4. MAKE FACET TETRAHEDRON MFT(vm, fl,f2,f3,t,f): adds a new tetrahedron t bounded by the three existing facets fl, f2, f3 and by the new facet f to volume vm.

2. Inverse Qperators

i. KILL_VOLUME_VERTEX KVV(vm,v) : eliminates a volume vm consisting of a single vertex v.

352

2. KILL EDGE VERTEX KEV(~,e,v>: eliminates edge e and one of its extreme vertices v from volume vm.

3. KILL EDGE FACET KEF(vm, e,f>: eliminates an edge e and one of the facets f bounded by e from volume vm.

4. KILL FACET TETRAHEDRON KFT(vm, f,t~ eliminates a facet f and one of the tetrahedron t bounded by f from volume vm.

Figure 8 shows an example illustrating the use of the above operators to construct a simple 3D triangulation.

t l

t 2

f2

f3 vl /

":2" - . ,°

I v 5 f5

MVV(vm,vl) MEV(vm,el,vl,v2) MEV(vm, e2,vl,v3) MEV(vm,e3,vl,v4) MEF(vm, el,e2,fl, e4) MEF(vm, e2,e3,f2,e5) MEF(vm,e3,el,f3,e6) MFT(vm,fl,f2,f3,tl,f4) MEV(vm, e7,v2,v5) MEF(vm,e4,e7,f5,eS) MEF(vm,e5,e8,f6,e9) MFT(vm, f4,fS,f6,t2,f7)

Figure 8

6. Concluding Remarks

The problem of defining a data structure for storing a three-dimensional triangulation has been considered. The 3D symmetric data structure, which stores the form basic topology elements of a 3D tesselation and six ordered adjacency relations, has been defined. We have shown that extracting the ten relations which are not explicitly stored in the structure requires a constant number of operations for any constant relation (namely tetrahedron- and facet-based relations> or a number of operations which is linear in the output size for any variable relation.

A mutual set of primitive operators for building and manipulating a 3D tesselation has been defined. Such operators are independent of the data structure used to store the 3D tesselation and ensure the topological integrity of the tesselation. In other words, the use of such operators ensures that always 3D tesselations of objects bounded by compact oriented two-manifold surfaces and without holes are created at each step of the construction process. The minimality of such operators can be proven by considerations similar to those used by Mantyla [Man88] for proving the minimality of sets of Euler operators defined for boundary models.

Future work involves the investigation of generalizations of the DCEL data structure [Pre85] defined for planar sudivisions or of the modified winged-edge

structure [DeF87] defined for two-dimensional triangulations, and comparisons with the 3D symmetric data structure proposed here.

353

Ackowledgement

The authors are grateful to Jean Daniel Boissonnat for suggesting the problem.

[Aho83]

[AnsS5]

[Bau72]

[Boi84]

[Boi88]

[Bow81]

[DeF8?]

[Dob87]

[Gre67]

[Law77]

[Man88]

[Pre85]

[Req81]

[sam84]

[WarS1]

[Wei85]

[Wei86]

[Woo85]

References

Aho, A.F., Hopcroft, J.E., Ullman, J.D., Data Structure and Algorithms, Addison Wesley Publ.,Reading, Ma., 1983. Ansaldi S0, De Floriani L., Falcidieno B., Geometric Modeling of Solid Object by Using a Face Adjacency Graph Representation, Computer Graphics, 19, 3, 1985, pp. 131-139. Baumgardt, M.G., Winged-Edge Polyhedron Representation, Tech. Rep. CS-320, Stanford University, 1972. Boissonnat, J.D., Geometric Structures for Three-Dimensional Shape Representation, ACM Trans. on Graphics, 3, 4, pp.266-286. Boissonnat, J.D., Faugeras, O.D., Le Bras-Mehlman, E., Representing Stereo Data with Delaunay Triangulation, Proceedin~ IEEE Robotics and Automation r Philadelphiaf April 1988. Bowyer, A., Computing Dirichlet Tesselations, The Compute r Journal, 27, 2, pp.165-171. De Floriani, L., Surface Representations Based on Triangular Grids, The Visual Computer, 3, 1987, pp.27-50. Dobkin, D.P., Laszlo, M.J., Primitives for the Manipulation of Three-Dimensional Subdivisions, Proc. ACM Conferenceon Computational Geometry, Waterloo, 1987, pp.86-99. Greenberg, M.J., Lectures on Algebraic Topology, W.A. Benjamin, Inc., New York, 1967. Lawson, C.L., Software for C1 Surface Interpolation, Mathematical Software III edited by J.R. Rice, Academic Press Inc., 1977, pp. 161-164. Mantyla, M., An Introduction to Solid Modelin@, Computer Science press, 1988. Preparata, F.P., Shamos, M.I., Co~utational Geometry: an Introduction, Springer Verlag, 1985. Requicha, A.A.G., Representation of Rigid Solids: Theory, Methods ans Systems, Computing Surveys, 12, 4, 1981, pp. 437-464. Samet, H., The Quadtree and Related Hierarchical Data Steructures, Computing Surveys, 16, 2, 1984, pp. 198-260. Watson, D.F., Computing the n-dimensional Delaunay Tesselation with Applications to Voronoi Polytopes, Th___ee Computer Journal, 24, 1981, pp.167-171. Weiler, K., Edge-based Data Structures for Solid Modeling in Curved-surface Environments, IEEE Compute r Graphcs and A_]pp!ications, 5, i, 1985, pp.21-40. Weiler, K., Topological Structures for Geometric Modeling, Ph.D. Thesis, Rensselaer Polytecnic Institute, Troy (NY), August 1986. Woo, T.C., A Combinatorial Analysis of Boundary Data Structure Schemata, IEEE Computer Graphics and Applications, 5, 3, 1985, pp.19-27.