Spatial Modelling by Delaunay Networks of Two and

0 downloads 0 Views 3MB Size Report
Delaunay networks in 2 and 3 dimensions. Chapter 2. .... the points that make the most significant contribution to the model. Chapter 5 shows how this ...... lies outside the three planes in ACDE that is adjacent to E, it is not possible to draw EF.
Spatial Modelling by Delaunay NetworksDimensions of Two and Three Dr.Ing. thesis Terje Midtb

February 1993

i

\....... a man shal more prote, in one wike, by gures and chartis, well and properly made, than he shall by the only reding or herying the rules of that science by the space of half a yer at the lest......." Thomas Elyot (1531)

ii

Acknowledgements This volume contains my Dr.Ing. thesis taken at the Norwegian Institute of Technology, University of Trondheim. The work has in its entirety been carried out at the Department of Surveying and Mapping. I want to express my special thanks to Jan Terje Bjrke, Dr.Ing., who has been my scientic supervisor during these studies. He has always been enthusiastic and backed me up during the work. I also wish to thank all those people who have helped me during this work, especially: Rune Aasgaard for his advices in C-programming and for his comments and discussion of my work, ystein Torbjrnsen for intoduction in the subjects of parallel computing, Geir Skeie for the volume routines, Atle Skarstein at the Norwegian Mapping Authorities for the data sets, and all my colleagues at our Department during these enjoyable years. I will also like to thank Arnnn and Lise Hejes foundation for nancial support. Finally, I want to thank my wife, Marit Irene, for supporting me during this work, that took up a lot of evenings and weekends.

Trondheim, February 1993 Terje Midtb

iii

iv

Summary Key words: Delaunay, triangulation, tetrahedrization, terrain modelling This Dr.Ing. thesis has been concentrated on the storage and use of geographical (spatial) data in triangular irregular networks (TIN). An exact description of a plane in space is given by three points. When a surface is divided into small planes, each plane can be represented by three points, each containing x, y and z -coordinates. Connecting these points will make a triangle. One of the great advantages of using triangles in surface modelling, is the possibility of adapting the triangle size to t variation in the terrain surface. There are several known triangulation methods, but from a generalization point of view, a dynamic method for Delaunay triangulation is very promising. This thesis elaborates upon a dynamic method because it enables a point to be added, or removed from a model, depending on the contribution the point makes to the model. It is often super uous to include a data point in the model if this point is situated on, or very close to a present triangular plane. In addition to omitting redundant points in the model, this dynamic way of Delaunay triangulation makes it possible to choose di erent levels of accuracy in the model, and to zoom in and out in the model. When we want high accuracy in the description of the surface, or if we want to make a model of an extensive surface, it is often necessary to work on data sets consisting of a huge number of points. Handling such data sets in one operation requires heavy calculations and extensive computer memory. In my work I have developed algorithms that can tackle large sets of data by dividing the sets into smaller blocks, doing the triangulation, and then merging the blocks. Dividing an area into blocks also means that there is no limitation in the size of the surface model for any practical purpose. Another important feature of this algorithm is the possibility of using parallel computers which give substantial improvements in computing time. Some experiments using the national height data base to test the algorithms are carried out. These experiments have included various types of terrain. A terrain surface represented by a TIN is often referred to as a 2.5 dimensional representation. The thesis has involved work on extending the 2 dimensional methods to 3 dimensions. This means that points in space are v

vi connected in a data structure that is made up of irregular tetrahedra. In Delaunay triangulation no points are situated inside the circumscribing circles of the triangles. In 3 dimensions the circumscribing sphere of each tetrahedron must be \empty". The thesis proposes an edge based data structure which is closely related to the one used for the 2 dimensional TIN model to create the tetrahedral model. Further, I want the construction of the tetrahedral model to be dynamic. During the insertion process it is possible to determine if an attribute of a candidate point can be determined from the enclosing tetrahedron. If this is true, the candidate point is redundant and it is super uous to include it in the model. Actually this results in a \3.5 dimensional" model for spatial data. In addition to the above topics the thesis also shows some methods for the visualization of terrain models stored by TIN structures, and some other qualities of the Delaunay network.

Contents 1 Introduction

1

2 Basic methods and algorithms

5

2.1 Voronoi diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . 5 2.2 Delaunay triangulation . . . . . . . . . . . . . . . . . . . . . . . 6 2.3 Construction of a TIN . . . . . . . . . . . . . . . . . . . . . . . 8 2.3.1 Radial sweep algorithm . . . . . . . . . . . . . . . . . . . 9 2.3.2 Recursive split algorithm . . . . . . . . . . . . . . . . . . 10 2.3.3 Divide-and-conquer algorithm . . . . . . . . . . . . . . . 13 2.3.4 Step-by-step algorithm . . . . . . . . . . . . . . . . . . . 13 2.3.5 Modied hierarchical algorithm . . . . . . . . . . . . . . 14 2.3.6 Incremental algorithm . . . . . . . . . . . . . . . . . . . 16 2.3.7 Incremental delete-and build algorithm . . . . . . . . . . 16 2.4 Discussion of the algorithms . . . . . . . . . . . . . . . . . . . . 18 2.4.1 Running time . . . . . . . . . . . . . . . . . . . . . . . . 18 2.4.2 Stability of the algorithms . . . . . . . . . . . . . . . . . 20 2.4.3 Advantages and disadvantages . . . . . . . . . . . . . . . 20

3 Insertion of points into a Delaunay triangulation

23

3.1 Some denitions . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 3.2 The maximum angle-sum test . . . . . . . . . . . . . . . . . . . 24 vii

CONTENTS

viii

3.2.1 The maximum angle-sum determined by cosine . . . . . 25 3.3 The in uence of the point insertion on surrounding edges . . . . 25 3.3.1 E ects on the three new edges . . . . . . . . . . . . . . . 26 3.3.2 E ects on existing edges . . . . . . . . . . . . . . . . . . 27 3.3.3 Extension of the region in Tn in uenced by an inserted point. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 3.4 In uenced region - empirical investigations . . . . . . . . . . . . 33 3.4.1 Comments on the result . . . . . . . . . . . . . . . . . . 35

4 Data structures and fundamental routines for TINs

39

4.1 Point organization during construction of a TIN . . . . . . . . . 41 4.2 Data structures for TINs . . . . . . . . . . . . . . . . . . . . . . 43 4.2.1 Point based data structure . . . . . . . . . . . . . . . . . 43 4.2.2 Triangle based data structure . . . . . . . . . . . . . . . 43 4.2.3 Edge based data structure . . . . . . . . . . . . . . . . . 44 4.2.4 Discussion of the data structures . . . . . . . . . . . . . 44 4.3 Methods for point insertion . . . . . . . . . . . . . . . . . . . . 47 4.3.1 Succession of the inserted points . . . . . . . . . . . . . . 47 4.3.2 Splitting a triangle . . . . . . . . . . . . . . . . . . . . . 47 4.3.3 Recursive process for edge reorganization . . . . . . . . . 49

5 Quali ed selection of points

51

5.1 Threshold for point inclusion . . . . . . . . . . . . . . . . . . . . 52 5.2 Generalization by point reduction, some experiments . . . . . . 55 5.3 \Zooming" the model . . . . . . . . . . . . . . . . . . . . . . . . 60

6 Removing points from a Delaunay triangulation

63

6.1 Algorithms for point deletion . . . . . . . . . . . . . . . . . . . 63 6.1.1 Basis algorithm . . . . . . . . . . . . . . . . . . . . . . . 64

CONTENTS

ix

6.1.2 Reversion algorithm . . . . . . . . . . . . . . . . . . . . 65 6.1.3 Modied reversion algorithm . . . . . . . . . . . . . . . . 66 6.1.4 Simple reversion algorithm . . . . . . . . . . . . . . . . . 67 6.1.5 Removing points along the boundary of a TIN . . . . . . 67 6.2 Running time of the algorithms . . . . . . . . . . . . . . . . . . 67

7 Merging Delaunay networks

71

7.1 Some denitions . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 7.2 Adjacent networks in uence each other due to the merge . . . . 72 7.2.1 Limitation of the region in uenced by the merge operation. 72 7.3 Merge algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . 73 7.3.1 Delete-and-build algorithm . . . . . . . . . . . . . . . . . 73 7.3.2 Build-and-swap algorithm . . . . . . . . . . . . . . . . . 75 7.3.3 Merge-and-swap algorithm . . . . . . . . . . . . . . . . . 76 7.4 Discussion of the algorithms . . . . . . . . . . . . . . . . . . . . 78 7.4.1 Running time . . . . . . . . . . . . . . . . . . . . . . . . 78 7.4.2 Stability of the algorithms . . . . . . . . . . . . . . . . . 79 7.4.3 Advantages and disadvantages . . . . . . . . . . . . . . . 79 7.5 Merging generalized triangular networks . . . . . . . . . . . . . 80 7.5.1 Generalization along the boundary between two adjacent meshes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80

8 Block-Based management of the surface model

85

8.1 Triangulation in blocks . . . . . . . . . . . . . . . . . . . . . . . 86 8.1.1 Dividing the data set into blocks . . . . . . . . . . . . . 86 8.1.2 Triangulation of the blocks . . . . . . . . . . . . . . . . . 87 8.1.3 Merging the blocks . . . . . . . . . . . . . . . . . . . . . 87 8.1.4 Triangulation in blocks, eciency improvements . . . . . 87

CONTENTS

x

8.1.5 Optimal size of the blocks . . . . . . . . . . . . . . . . . 88 8.2 Triangulation in parallel . . . . . . . . . . . . . . . . . . . . . . 90 8.3 Storage of large TINs on disk . . . . . . . . . . . . . . . . . . . 91 8.3.1 Dividing the TIN into storage blocks . . . . . . . . . . . 93 8.3.2 Addressing the blocks . . . . . . . . . . . . . . . . . . . 94 8.3.3 Comparison of the methods . . . . . . . . . . . . . . . . 96

9 Use of the Delaunay triangulation

97

9.1 Searching path between two points . . . . . . . . . . . . . . . . 98 9.1.1 Moving a step closer . . . . . . . . . . . . . . . . . . . . 98 9.1.2 Algorithms for point search . . . . . . . . . . . . . . . . 99 9.2 Break-lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101 9.3 Visual representation of the TIN . . . . . . . . . . . . . . . . . . 102

10 A Tetrahedral Irregular Network

111

10.1 Geometrical condition for 3D Delaunay/Voronoi networks . . . . 112 10.2 Insertion of points into a Delaunay tetrahedrization . . . . . . . 116 10.3 Data structures for tetrahedral irregular networks . . . . . . . . 119 10.3.1 Double twin-edge structure . . . . . . . . . . . . . . . . . 121 10.3.2 Point handling structure for additional points . . . . . . 122 10.4 Incremental generation of a tetrahedral network . . . . . . . . . 123 10.4.1 Construction of an initial tetrahedron . . . . . . . . . . . 123 10.4.2 Split a tetrahedron . . . . . . . . . . . . . . . . . . . . . 125 10.4.3 Reorganization of edges close to an inserted point . . . . 125 10.4.4 Exceptional cases . . . . . . . . . . . . . . . . . . . . . . 130 10.4.5 Eciency of the algorithm/data structure . . . . . . . . 132 10.4.6 Stability of the algorithm . . . . . . . . . . . . . . . . . 132 10.5 Qualied selection of points . . . . . . . . . . . . . . . . . . . . 133

CONTENTS

xi

10.5.1 Threshold for the point inclusion . . . . . . . . . . . . . 134 10.6 Future work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134 10.6.1 Removing points . . . . . . . . . . . . . . . . . . . . . . 134 10.6.2 Merging tetrahedral networks . . . . . . . . . . . . . . . 135 10.6.3 Extension of the maximum angle-sum criterion . . . . . . 135 10.7 Delaunay/Voronoi diagram of n dimensions . . . . . . . . . . . 136

11 Conclusions

139

Chapter 1 Introduction Modern technology makes it is possible to sample huge amounts of data that describes spatial phenomena. The handling of the data requires ecient methods and data structures. Together with new and powerful computers, sophisticated algorithms and appropriate data structures open the possibilities for solving advanced and complicated problems that earlier were impossible to tacle. Proper methods have a wide range of practical use. During this work I have been involved in subjects such as determination of areas covered by a mobile telephone transmitter, determination of high-water marks in rivers, determination of noise zones along roads, drawing voltage maps, and other, more conventional cartographic tasks. The basis for my modelling is a set of randomly distributed points in 3 dimensional space. The scope of this thesis is limited to the steps of making ecient topological models of the point sets, so that it is possible to manage various operations based on the sampled points. The problems of data collection are omitted from the thesis. Because of my cartographical background, the examples and applications of this thesis will be concentrated on modelling of geographical objects, such as terrain surfaces. Various types of mathematical functions can be used to make models of a surface through the point set. However, for surfaces of a random variation, like terrain surfaces, representation by small plane elements has turned out to be most ecient and usable. Two types of networks are applicable for this purpose the gridded network and the triangular network. Previously gridded models have been the most usual structure, because they are well suited for storage in a matrix and subsequently are well organized for simple computer algorithms. However, the vertices of the grid representation very often have to be constructed by interpolation in the original data set. Consequently some of the information will be lost. On the other hand, the triangular network is dened by edges between the 1

2

CHAPTER 1. INTRODUCTION

original data points. And a triangular plane is an unequivocal description of a plane in space. Delaunay triangulation is denitely the most used triangulation technique for triangular modelling of terrain surfaces. This method is based on achieving a well proportionated triangular geometry between the horizontal projections of the data points. The geometrical conditions focus on nearness between the neighbouring nodes in the network. The nature of terrain surfaces makes them t into a 2 dimensional model. However, generalization of the Delaunay triangulation into three dimensions is required when similar techniques are used for data sets with a wide extension in the third dimension. This leads to the Delaunay tetrahedrization. Triangular models have been used in terrain modelling since the 1970s. However, because of limitation of the computers and the complexity of the TIN data structures, the triangular models have been overshadowed by the gridded models. Today the use of triangular models is increasing, and the dynamic methods open the possibilities for omitting unnecessary data. In 1990 Hel90] outlines how the techniques can be used for adaptive terrain modelling. However, few authors have considered the problem of handling huge amounts of data by segmentation, and the tetrahedrization in 3 dimensions. This thesis presents further developements of ideas and methods from the literature in the following directions: Handling of huge, adaptive models by segmentation Merging TINs Point deletion from TINs Extension of the triangulation to an adaptive tetrahedrization Further, the thesis contributes to a better understanding of the behaviour of Delaunay networks in 2 and 3 dimensions.

Chapter 2. The Delaunay triangulation and its dual, the Voronoi Diagram,

is described. Some historical perspectives are drawn and the geometrical conditions are outlined. The interaction between the Delaunay triangulation and the Voronoi diagram is explained. Seven known algorithms for construction of the Delaunay triangulation are described, and a short discussion of the algorithms is given at the end of the chapter. Chapter 3. The basic mathematical rule for the incremental Delaunay triangulation from Chapter 2 is presented and the edge reorganization that follows the point insertion is discussed in detail. The theorems are stated by studies of geometrical gures. The work in this chapter was decisive for the comprehension of the reorganization process. Finally the chapter shows the results from some practical experiments for determination of the part of the network that is in uenced by the point insertion.

3

Chapter 4. Data structures for the handling of points to insert and for the Triangular Irregular Network (TIN) itself are presented. Three di erent

data structures for TINs are compared. The chapter also includes some particular methods for point insertion and description of a recursive process for the reorganization of invalid edges due to the point insertion. This process is based on the theorems from the previous chapter. Chapter 5. Methods for generalization of the surface by using the incremental algorithm for triangulation are introduced, and various parameters for this operation are explained. This chapter also shows some practical experiments for generalization of various types of terrain and how this feature can be utilized for zooming operations. Chapter 6. Algorithms for point deletion are presented. One known algorithm is described and three new ones based on reorganization of the existing edges are introduced. Some comparisons are done by empirical experiments. Chapter 7. This shows how adjacent TINs in uence each other. A known algorithm for merging network is shown, and two new algorithms based, more or less, on the reorganization of existing edges are introduced. The chapter also includes some special considerations about the merging of generalized networks. Chapter 8. The merge methods open for block-wise triangulation which results in eciency improvements. Division of the area into smaller blocks is also required when huge areas are to be triangulated. Further, the disk storage of TINs divided into blocks is discussed. Chapter 9. This shows some special conditions for the Delaunay triangulation and how these can be utilized. Handling sudden variations in the surface is also discussed. Finally the chapter shows how visual representations can be made from the triangular network by simple methods. Chapter 10. This chapter is concentrated on the 3 dimensional version of the Delaunay triangulation. Geometrical conditions are outlined, data structures are introduced and an incremental algorithm for Delaunay tetrahedrization is presented. All the way direct extensions of the 2 dimensional methods are used. Generalization of the 3 dimensional network is outlined, and some future work is proposed. Some thoughts about the n-dimensional Delaunay network are given towards the end. The thesis is summarized in Chapter 11 which also presents the conclusions. The thesis is based on literature studies, the authors own development work and a lot of programming (and debugging) to support the validity of the algorithms and programs.

4

CHAPTER 1. INTRODUCTION

Chapter 2 Basic methods and algorithms This chapter takes a closer look at two fundamental geometric constructs, the Voronoi diagram and the Delaunay network. These are closely related, and one of them can be extracted from the other. There are several algorithms for the generation of Delaunay networks and Voronoi diagrams. This chapter discusses seven existing algorithms for Delaunay triangulation.

2.1 Voronoi diagrams The Voronoi diagram is named after the mathematician M. G. Voronoi who explored this geometric construction in 1908 Vor08]. However, as early as in 1850 another mathematician, G. L Dirichlet, studied the problem Dir50]. Accordingly the Voronoi diagram is sometimes named Dirichlet tessellation. The Voronoi diagram is one of the most fundamental and useful constructs dened by irregular lattices. As it is a widely-used geometrical construction, the diagram has several names. The construction is utilized in many distinct elds, and is often named after the person who rst used it in a particular eld. Geographical interest in the Voronoi diagram originates from the climatologist A. H. Thiessen. He used the Thiessen polygons to dene regions that surround unevenly distributed weather stations. Data from each weather station could be presented in the enclosing polygon of the station. The polygons are constructed so that \regions be enclosed by a line midway between the station under consideration and surrounding stations" TJ11]. The construction is also known as Wigner-Seitz cells WS33] (metallurgy) or Blum's transform Blu67] (biological shape and visual science). Although there is a broad spectrum of scientic disciplines that include interest in Voronoi diagrams, Aur91] states that three aspects have been emphasized: 1. Their use in modelling natural phenomena. 2. The investigation of their mathematical, in particular, geometrical, combinatorial, and stochastic properties. 5

6

CHAPTER 2. BASIC METHODS AND ALGORITHMS 3. Their computer construction and representation.

As we can see in Figure 2.1 a single Voronoi polygon is dened by the lines that bisect the lines between a centre point and its surrounding points. The bisecting lines and the connection lines are perpendicular to each other. When we use this rule for every point in the area, the area will be completely covered by adjacent polygons. The Voronoi diagram for a set of random distributed points is shown in Figure 2.2. Notice that the polygons on the boundary of the area are \open" because they have no neighbouring points in that direction.

Figure 2.1: Construction of a Voronoi polygon. The polygon is dened by lines that bisect the connection lines between neighbouring points.

Figure 2.2: The Voronoi diagram for a set of arbitrarily distributed points.

2.2 Delaunay triangulation Delaunay triangulation is close related to the Voronoi diagram. The triangulation is named after B. Delaunay, who rst made use of this dual relationship Del34]. If we use the Voronoi diagram as a basis, we can construct the Delaunay triangulation by drawing the lines between the points in adjacent polygons. When the construction is nished we have got a triangular network that covers the whole area. The relationship between the Voronoi diagram

2.2. DELAUNAY TRIANGULATION

7

and the Delaunay network is shown in Figure 2.3. For many purposes we do not need the Voronoi diagram, but we want to make the Delaunay triangulation directly. Actually the generation of a Delaunay network in a computer is simpler than the construction of a Voronoi diagram. The main rule for the Delaunay triangulation can be formulated in the circle criterion:

De nition 1 A Delaunay network in two dimensions consists of non-overlapping triangles where no points in the network are enclosed by the circumscribing circles of any triangle.

If only three points exist on each circle in the mesh, the Delaunay triangulation is unique SBP90]. Nevertheless, it might often be more than three points on the circle. Yet, the mesh is still a Delaunay triangulation, but not a unique one. A Delaunay network and its circumscribing circles are shown in Figure 2.4.a. If we take a closer look at the triangles and their circles, we can see the relationship between the circles and the Voronoi diagram. The circle centres are recognized as the vertices of the Voronoi diagram (Figure 2.4.b). The last observation can be used to make algorithms for the generation of Voronoi diagrams from Delaunay triangulations. The previous section shows three aspects for the exploration of the Voronoi diagram. This thesis covers all these elds for the Delaunay triangulation: 1. Use of Delaunay triangulation in terrain modelling. 2. Mathematical and geometrical conditions for the Delaunay triangulation. 3. Computer construction and representation of the Delaunay triangulation.

Figure 2.3: The relationship between a Voronoi diagram and the Delaunay triangulation.

8

CHAPTER 2. BASIC METHODS AND ALGORITHMS

a

b

Figure 2.4: (a) Delaunay triangles and some of their circumscribing circles. (b) The connection between the circles and the Voronoi diagram.

2.3 Construction of a TIN When a set of arbitrarily distributed data points is connected in a triangular network, this lattice consequently has to be irregular. If we want to make a regular network we usually have to interpolate new points, ordered in a regular pattern. The literature describes various techniques for the construction of a TIN on a computer. This section will describe some algorithms for the generation of a TIN as a structure for surfaces, with emphasis on terrain surfaces. The terrain usually has arbitrary and sudden variation. It is very important to avoid the triangular edges crossing these variations. Consequently short and fat triangles are preferable to long thin ones. Delaunay triangulation is the most common technique for construction of a TIN. When the measured data points are well adapted to the terrain, the mathematical rules for Delaunay triangulation result in a triangular network well proportionated for the terrain surface. Many di erent algorithms that are described in the literature can be used to achieve a Delaunay triangulation. Some of them are outlined in this section: Static triangulation. 1. Radial sweep algorithm. 2. Recursive split algorithm. 3. Divide-and-conquer algorithm. 4. Step-by-step algorithm. 5. Modied hierarchical algorithm. Dynamic triangulation. 1. Incremental algorithm. 2. Incremental delete-and-build algorithm.

2.3. CONSTRUCTION OF A TIN

9

As it is described in the literature, the rst algorithm will not end up in a Delaunay diagram. Yet, by introducing some small improvements, this method meets the circle criterion. The triangulation methods can be divided into two groups, static and dynamic triangulation. Static triangulation means that the triangulation is not valid before every point from the data set is included in the network. There can be no qualied selection of points, and the triangulation usually does not meet the Delaunay criterion until the triangulation is completed. In Dynamic triangulation the geometrical conditions are fullled from the beginning. When a new point is included in the network, the network is reorganized until the circle criterion is met. Consequently, during the triangulation it is possible to select the points that make the most signicant contribution to the model. Chapter 5 shows how this feature can be utilized to make a generalized representation of the terrain surface. Data structures for the TIN might vary a lot from algorithm to algorithm, and will be neglected for the moment, as will the data structure and handling of candidate points. The data structure for the handling of the points before they are inserted in the lattice is essential for the estimation of the running time. Some comments about time consumption are made at the end of the chapter.

2.3.1 Radial sweep algorithm The Radial sweep algorithm was rst published by MW82] and later mentioned by PK90]. The input data has arbitrarily distributed points with x, y and z coordinates. The algorithm is described step by step and is related to the gures: 1. Choose a point near the centroid of the points, and calculate the distance and bearing from this central point to all the other points. The points have to be sorted and ordered by bearing. The radiating line is established from the central point to all the other points (Figure 2.5.a). 2. Neighbouring lines are constructed at the opposite end of the central point. If two points have got identical bearing, their neighbouring line will coincide with the radiating line (Figure 2.5.b). 3. Every point on the boundary is listed in a boundary list. Each of these points is combined with the next two nodes on the list. If these points form a triangle outside the existing network, the triangle is included in the lattice and the boundary list is updated. This procedure goes on until no more triangles can be created. The boundary of the area will now be a convex hull (Figure 2.5.c). 4. The triangulation from step 3 consists of non-overlapping triangles. However, the shapes of the triangles are less satisfactory (long and thin). In

CHAPTER 2. BASIC METHODS AND ALGORITHMS

10

the network, two neighbouring triangles make one quadrilateral. The shortest distance between two opposite vertices in the quadrilateral is chosen as the diagonal to improve the geometry. If the \wrong" diagonal is present, this diagonal is swapped to become the shortest diagonal. The diagonal swapping process is repeated until no more alterations appear (Figure 2.5.d).

a

b

c

d

Figure 2.5: Radial sweep algorithm. (a) Radiating lines from the central point. (b) The radiating lines are connected. (c) The convex hull is covered by triangles. (d) Final result of the triangulation. In fact this algorithm produces an "almost" Delaunay diagram. Section 3.2 shows that the \minimum diagonal rule" does not meet the circle criterion (Denition 1). If we exchange the minimum diagonal rule with the maximum angle-sum rule, described in Section 3.2, we will achieve a Delaunay triangulation.

2.3.2 Recursive split algorithm This algorithm was rst presented by LR78]. The main purpose of the algorithm is to split the area recursively into smaller and simpler regions. In the end we will have regions that only consist of three points forming a triangle. Point by point the algorithm goes:

2.3. CONSTRUCTION OF A TIN

11

1. The region is split into two sub-regions. It is important to keep the subregions as \circular" as possible. The \circularity" may be determined by measuring the product of the signed distances (dn sn) between the boundary points and the split line (Figure 2.6.a). When the region is split, the boundary between the two sub-regions must be chosen. The points on the zig-zag boundary in Figure 2.6.b are situated closer to the split line than a given threshold (). Q

2. The new sub-regions are recursively divided into new sub-sub-regions until each region consists of only three points. The \root" region now consists of non-overlapping triangles. To administrate the points in the recursive split procedure LR78] uses an algorithm similar to the QuickSort algorithm AHU87]. The recursive split of the region is shown in Figure 2.7. 3. Due to the denition of the boundary between two regions, the algorithm will produce quite a number of poorly-shaped triangles (long and thin). Consequently LR78] names the rst steps in an initial triangulation and adds a new step to make the triangulation more convenient. Each quadrilateral in the triangulation is examined and angles  and  are calculated (Figure 2.8).  is the smallest angle of the original triangles and  is the smallest angle of the possible new triangles. If  <  the new triangles are chosen and the diagonal is swapped. The examination of the quadrilaterals goes on until no more changes appear. LR78] does not mention Delaunay triangulation at all. Still the angle criterion in Figure 2.8 corresponds to the min-max angle criterion explained by Law77], which meets the circle criterion for the Delaunay triangulation. The drawback of the algorithm is that eight angles have to be calculated for each quadrilateral. Section 3.2 shows how the direction of the diagonal can be chosen just by calculation of two angles.

d1

s1

d2

s2 d3

s3

a

b

λ

λ

Figure 2.6: A region is split into two sub-regions. (a) The split line. (b) The chosen boundary line.

CHAPTER 2. BASIC METHODS AND ALGORITHMS

12

a

c

b

d

f

e

Figure 2.7: Recursive split algorithm. (a-d) The region is recursively split until each region is exactly one triangle (the last step is not added to the gure). (e) The result of the initial algorithm. (f) Rened network by the max-min angle criterion.

P2 P3

α β

P1

P4

Figure 2.8: The max-min angle criterion.

2.3. CONSTRUCTION OF A TIN

13

2.3.3 Divide-and-conquer algorithm This algorithm is comparable to the recursive split algorithm. It divides the original data set into disjoint subsets. After obtaining a solution for each of these subsets, it combines the solutions to yield the nal result. This algorithm was rst described by LS80]. An almost identical algorithm is presented by GS85], only the data structure is di erent. Both claim that the running time of the algorithm is O(n log n). 1. As in the recursive split algorithm, the data set is rst divided into two sub-sets. There is no calculation of the \circularity" of the sub-regions, but a division into two data sets that contain an equal number of points. The area is recursively split until each data set consists of a minimum of four points. 2. Triangles are made at the lower level, and the merging of these data sets starts. In the recursive split algorithm a boundary for the sub-region was set during the split operation. In this algorithm the convex hull that circumscribes each data set denes the region. In the recursive process each region is merged together until the whole area is completed (Figure 2.9). The merge algorithm used here is described in detail in Section 7.3.1, where it is named the delete-and-build algorithm.

Figure 2.9: Two triangular networks, enclosed by their convex polygon, are merged together. The dashed edges have to be removed.

2.3.4 Step-by-step algorithm This is perhaps the most common algorithm for Delaunay triangulation. For the construction of a network it starts in one corner of the area, makes an initial triangle edge, and searches for the third point of the triangle. Next, the two new edges become \initial edges", and the building of triangles swells until every data point is connected in the network. Among others, MR80] and Bj91] describe the algorithm.

14

CHAPTER 2. BASIC METHODS AND ALGORITHMS 1. An initial line, named base line, is chosen. No other point should be interior to the circle where the base line is the diameter. This criterion is met by using two end points that are closest neighbours. If possible the base line is situated on or close to the boundary of the area that is going to be triangulated. 2. The Delaunay neighbour of the line has to be found. It is clear that this neighbour, together with the two endpoints of the base line, denes a circle. None of the additional points, together with the endpoints, can dene a circle with less radius. The neighbouring point can be found by calculating the angle  for the candidate points (Figure 2.10). The point which forms the largest  is the Delaunay neighbour of the line. 3. Lines between the new point and the two initial ones are stored as the second and third triangle edge. One triangle is now completed. 4. The two new triangle edges from last step become new base lines for further triangulation. Like this the algorithm successively builds a triangular network for the entire area.

During the triangulation only one side of the base line is searched for the neighbouring point. The other side of the base line represents the triangulated area.

α

α

Boundary for the point searching

Base line

Figure 2.10: Selection of the Delaunay neighbour of a line.

2.3.5 Modied hierarchical algorithm This algorithm is related to the hierarchical structure proposed by FFNP84]. The hierarchical mesh is generated as a preliminary step of the triangulation. Further, Law72]'s local transformations, or edge swaps, are used to achieve a Delaunay triangulation that meets the circle criterion. The method can be seen as a hybrid of the radial sweep algorithm and the incremental algorithm described in the next section. The preliminary triangulation, which is made by point insertion, is rened by edge swaps.

2.3. CONSTRUCTION OF A TIN

15

1. An initial triangular network has to be made. For example this can be one large triangle that encloses every point of the entire area GS85]. In this description I will use the triangular network of the convex hull as an initial network (Figure 2.11.a). 2. The rst point of the interior area is included in the network. The point is connected to its enclosing triangle by three new triangle edges between the included point and the vertices of the triangle (Figure 2.11.b). 3. The interior points that remain are included in the triangular network in a similar way (Figure 2.11.c). 4. We now have a non-overlapping triangular network. Every quadrilateral in the network has to be tested by the maximum angle-sum rule (Figure 3.1). The diagonals of the quadrilaterals have to be swapped until no more changes appear. The maximum angle-sum criterion is then met for all the quadrilaterals (Figure 2.11.d) The last operation might be executed in two steps. First the minimum diagonal criterion is used. The calculation of a distance is less time consuming than the calculation of two angles, and this rst step produces an \almost Delaunay triangulated network". As a last renement the maximum angle-sum check has to be worked out.

a

b

c

d

Figure 2.11: (a) An initial network. (b) Insertion of the rst point. (c) Every point is inserted. (d) The network is reorganized due to the maximum anglesum criterion.

16

CHAPTER 2. BASIC METHODS AND ALGORITHMS

2.3.6 Incremental algorithm Like the divide-and conquer algorithm, explained in an earlier section, this algorithm was presented by LS80] and GS85]. Further, FFP85] used the algorithm for surface approximation. The algorithm uses the swapping approach proposed by Law72] and Law77]. A similar, simpler algorithm of this kind was also proposed by GS77]. The most important di erence between this algorithm, and the ones in the earlier sections, is the possibilities of keeping the triangular network as a Delaunay network during the triangulation process. The \initial value" for the triangulation is a valid Delaunay network (at least one triangle). For each point included in the network, the network will be rearranged until the circle criterion is met for all the triangles in the network. 1. As in the previous algorithm an initial triangular network has to be created. Like in the previous sections the triangular network of the convex hull is used for this purpose (Figure 2.12.a). This network has to meet the maximum angle-sum criterion. The triangulation programs, made in relation with this thesis, have used the circumscribing rectangle, divided into two triangles. 2. The rst point of the interior area is included in the network. The point is connected to its enclosing triangle by three new triangle edges between the point and the vertices of the triangle (Figure 2.12.b). 3. The quadrilaterals, which have got the \old" edges of the enclosing triangle as a diagonal, have to be tested by the maximum angle-sum rule. If they do not meet the criterion, their diagonals are swapped and the new, opposite edges to the inserted point will be examined as diagonals in their quadrilaterals. This recursive examination and swapping procedure is described in detail in Section 3.3. The results of the swapping operations are shown in Figure 2.12.c. 4. The Delaunay network now contains one more point. All the remaining points will be included in the network in exactly the same way (Figure 2.12.d). The great advantage of this algorithm, compared to the previous ones, is the possibility of examination and calculation to determine whether any points make a signicant contribution to the network. A plane is dened by three points only. An inclusion of a fourth point in the plane will not result in any improvements to the surface representation.

2.3.7 Incremental delete-and build algorithm This algorithm is also known as Watson's algorithm for Delaunay triangulation in n-dimensions described by Wat81]. The di erence from the incremental

2.3. CONSTRUCTION OF A TIN

17

a

b

c

d

Figure 2.12: (a) An initial network. (b) Insertion of the rst point. (c) The unconvenient edges are swapped. (d) Final lattice after the last point is included.

18

CHAPTER 2. BASIC METHODS AND ALGORITHMS

algorithm is that no edge swapping is executed during the construction of the network. When a new point is included in the network, every invalid edge is removed and a new mesh is rebuilt in the in uenced area. 1. The Delaunay triangulation that covers the convex hull is used as the initial mesh also for this algorithm (Figure 2.13.a). 2. The enclosing polygon of a point to include is localized. This polygon is described in Section 3.3.3.3 by Figure 3.14. When radius and centre coordinates for the circumscribing circle of each triangle are stored, it is easy to determine the circles that encloses the candidate point. All the triangles, which have got the point inside their circumscribing circles, are removed (Figure 2.13.b). 3. New triangle edges are created inside the current polygon. The new edges connect each of the vertices of the enclosing polygon to the included point (Figure 2.13.c). 4. The new Delaunay triangulation consists of one more point. Figure 2.13.d shows the nal lattice after every point is included in steps 2 and 3. As for the incremental algorithm we have the option of checking if a candidate point makes any contribution to the representation of the model.

2.4 Discussion of the algorithms 2.4.1 Running time As mentioned earlier, the data structure and the point handling structure will be of noticeable signicance for the time consumption of the algorithms. Structures that are suitable for one algorithm may not t another. Besides, triangulation algorithms are rather complex and dicult to estimate. Nevertheless, I will only discuss the algorithms as they are described in this section. n is the number of nodes in the network. Various data structures for TINs are dealt with in detail in Section 4.2. MW82] do not comment on the running time of the radial sweep algorithm. But it is easy to see that sorting of the bearings, in the initial, step requires about n log n operations AHU87]. Further on the edge swap operations, in worst case, seems to have a running time of O(n2). But, as for the other algorithms, worst case is extremely unlikely. LR78] claims, without proof, that the running time of the recursive split algorithm is O(n log n). But LS80] note, without proof, that the running time for the algorithm must be O(n2). For the worst case point distribution

2.4. DISCUSSION OF THE ALGORITHMS

a

b

c

d

19

Figure 2.13: (a) An initial network. (b) The enclosing polygon of the point to include is localized, and the interior edges are removed. (c) New edges are built inside the polygon. (d) Final lattice after the last point is included.

20

CHAPTER 2. BASIC METHODS AND ALGORITHMS

I think the last contention is correct. However, for any practical purpose the time consumption of the algorithm is close to O(n log n). Because of the valid Delaunay triangulation through all the levels in the

divide-and-conquer algorithm, this is a real O(n log n) algorithm.

Searching for neighbouring points is critical for the running time of the

step-by-step algorithm. Searching for points is possible to execute in O(n log n) time. Building of the triangular network itself requires n operations.

The modi ed hierarchical algorithm, the incremental algorithm and the incremental delete-and-build algorithm all have a worst case running time of O(n2). Still, such a complexity requires an unrealistic point distribution. In practical tests, Hel90] has observed a running time of O(n log n) for the incremental algorithm.

2.4.2 Stability of the algorithms This is a rather dicult subject to discuss. To uncover unstabilities of di erent algorithms, it might be necessary to make programs for each algorithm. In my work I have made programs for the step-by-step algorithm, modied hierarchical algorithm and the incremental algorithm. I have also made some routines for the merging step of the divide and conquer algorithm. So far I have found very few unstabilities that are dicult to handle. The incremental algorithm, which I have concentrated on, seems to be very stabile when the circle criterion is met for all the triangles during the triangulation. Even \triangles" with area = 0, which have got circumscribing circles with radius = 1, meet the circle criterion when they are situated on the boundary of the area. This quality makes the triangular mesh very consistent. A closer description of the \zero triangles" is given in Section 4.3.2.1. A typical unstability of the step-by-step algorithm is the occurrence of non-unique triangular meshes. In Figure 2.14 we can see how the wrong point might be chosen as the closest neighbour in a non-unique network. However, like other exceptional cases the problem can be solved by introduction of some extra criteria in the program Bj91].

2.4.3 Advantages and disadvantages In practical use, digital terrain models require the option of handling huge data sets. Consequently, complexity and storage eciency are of great importance. The divide-and-conquer algorithm has favourable running time. The divide process also makes the algorithm suitable for parallel architecture. Parallel processing might also be used for the initial steps of the recursive split, modi ed hierarchical and radial sweep algorithms. Unfortunately the

2.4. DISCUSSION OF THE ALGORITHMS

21

Base line

Chosen neighbour

Figure 2.14: In the step-by-step algorithm the wrong, closest neighbour may be chosen in a non-unique TIN. nal step of these algorithms is the most time consuming. SBP90] also uses a parallel algorithm for a variant of the step-by-step algorithm. The modi ed hierarchical algorithm has the possibilities of a hierarchical storage structure in the initial step. Each triangle is partitioned in three new triangles. Due to this, a triangle tree with three branches can store the triangles. However, the tree structure is rather dicult to maintain during the edge swapping. For the generalization of the surface, by qualied selection of points during the triangulation, the incremental algorithms are unrivalled. The modi ed hierarchical algorithm also o ers a kind of point selection during the initial step, but this selection is based on unconvenient triangles (long and thin). For the other algorithms the ltering of points, before or after the triangulation, has to be provided. Accordingly this increases the time consumption. Some ltering algorithms are discussed in Lee91]. The point selection for the generalization of a TIN is of considerable value in surface modelling. By using the incremental algorithm, redundant points can be avoided in large data sets. Further, the number of computers based on parallel architecture is increasing. A parallel architecture version of the incremental algorithm is outlined in Section 8.2.

22

CHAPTER 2. BASIC METHODS AND ALGORITHMS

Chapter 3 Insertion of points into a Delaunay triangulation This chapter presents a detailed discussion of the reorganization process that is necessary when a new point is included in a network. The point insertion is of vital importance for the incremental algorithm for the construction of a TIN. But the same rules can also be used to update Delaunay triangulations constructed by other methods. The conditions are that the mesh has to meet the circle criterion before the inclusion, and that the data structure can be updated according to the rules. The studies described in this chapter were the rst steps I made to approach the geometry of Delaunay networks. Subsequently I have found some of the tasks (Theorem 2 and 4) shown in this section in Law77] and GS85]. However, this discussion on the geometrical consequences of the point insertion is of major importance for the understanding of the Delaunay network. The theorems explored in this section are also useful concerning the merging of triangular networks and the deletion of points from a TIN. The subjects in this chapter are also dealt with in Mid90].

3.1 Some denitions A circle is dened by the three vertices of a triangle. In this description I will denote the circumscribing circle of a triangle by the three vertices of the triangle (4ABC has for example got the circumscribing circle ABC ). Further, a quadrilateral is denoted by its vertices (e.g. 2ABCD). An arc between two points, A and B, on a circle is denoted as _ AB . The points on the arcs, circles, triangles etc., are always given clockwise. In the examples and gures in this chapter D will be an inserted point in

4BAC .

A valid Delaunay triangulation in two dimensions for a set Sn of n points is denoted as Tn , where n 2 I2. Finally, one or several triangles of Tn is said 23

24CHAPTER 3. INSERTION OF POINTS INTO A DELAUNAY TRIANGULATION to be a segment of Tn .

3.2 The maximum angle-sum test Law77] shows that by using the max-min angle test we will achieve a Delaunay triangulation (Figure 2.8). This section shows that the maximum angle-sum test determines the diagonal of a quadrilateral that is valid in a Delaunay triangulation. The maximum angle-sum test is closely related to the InCirc test in GS85]. D

D B

B

α

α C

C F

F

γ

β E

E

Figure 3.1: The maximum angle-sum test. The connections between angles and diagonals in a quadrilateral.

Theorem 1 In a quadrilateral formed by two adjacent triangles in a Delaunay

triangulation, the diagonal goes between two opposite vertices where the sum of the interior angles is greater or equal to  .

Proof: In Figure 3.1 2BDCE is a segment of Tn . Point E lies inside BDC . Consequently Tn cannot be valid if BC , instead of DE , is selected as the diagonal for the quadrilateral. BC is a diagonal in Tn only if E is located outside BDC . The sides of angle  in D,_intersect BDC in B and C , and _ _ span _CB . Basic geometry says that  = CB 2 . Further, CB + BC = 2 . It is obvious that E will be located on BDC when  +  = . When E moves inside the circle,  +  > , and when E lies outside BDC we have  +  < . The sum of the four interior angles of a quadrilateral are always 2. To meet the circle criterion, the diagonal in a quadrilateral has to go between two opposite vertices where the sum of the interior angles is greater than . In Figure 3.1 ED is the diagonal of 2BDCE . Further, BC is the diagonal of 2BDCF because  +  < . FD is shorter than BC , so it is obvious that the minimum diagonal test in Section 2.3.1 is not in accordance with the circle criterion.}

As an alternative to the angle tests the radius and centre coordinates for each circumscribing circle can be calculated and stored. In Equation 3.1 GS85]

3.3. THE INFLUENCE OF THE POINT INSERTION ON SURROUNDING EDGES25 shows an equivalent form based on the coordinates of the points: xC yC x2C + yC2 1 xD yD x2D + yD2 1 > 0 D(C D B E ) = xB yB x2B + yB2 1 xE yE x2E + yE2 1

(3.1)

3.2.1 The maximum angle-sum determined by cosine It is useful to observe that, in the quadrilaterals of Tn , only the angles of the vertices of the interior diagonal can exceed . This can be utilized to form an algorithm where only the cosine of the inside angles of the quadrilateral determines whether the diagonal is to be swapped. Figure 3.2 shows two α

α β

β

Figure 3.2: The angles are calculated in the \diagonal free" corners. quadrilaterals of Tn. For these and other quadrilaterals we know that 0 0 By investigating the nature of cosine for these angles, it can be concluded that cos  + cos  < 0 when a diagonal has to be swapped. Cosine is calculated by Equation 9.3.

3.3 The inuence of the point insertion on surrounding edges This section describes how insertion of a point, n + 1, interior to Tn, in uences the edges in the triangular network. The point insertion results in Tn+1 . When D is inserted into 4BAC (Figure 3.3), three new edges are constructed. These edges are all valid in Tn+1 . Some of the surrounding edges have to be swapped and located with one end in D. A swapped edge is a member of Tn+1 , and is consequently only swapped once. The conclusions of Figure 3.4 are of major importance for investigation of these and other assertions. The gure shows how circles with a common chord

26CHAPTER 3. INSERTION OF POINTS INTO A DELAUNAY TRIANGULATION A

D B C

Figure 3.3: The orientation of new and swapped edges after D is inserted into 4BAC . The dotted lines show the triangular network before the point insertion. behave. The circle centres move along S 1 ; S 2. Every circle that goes through B and D (endpoints of the chord), and are interior to C 2 on one side of the chord, are exterior to C 2 on the opposite side of the chord.

C1

S1

B

D C2

S2

C

Figure 3.4: Behaviour of a circle set where the circles have a common chord. The centres of every circle are situated on S 1 ; S 2.

3.3.1 E ects on the three new edges When point, D, is inserted into 4BAC , three new edges are constructed to connect D to Tn (Figure 3.3). The original 4BAC is split into three new triangles, 4ADB , 4ACD and 4BDC . The circumscribing circles of these new triangles have to be examined to localize any interior points. It is know from the circle criterion (Denition 1) that no fourth point, disregard D, can be situated inside BAC .

3.3. THE INFLUENCE OF THE POINT INSERTION ON SURROUNDING EDGES27 A

C1 S1 C3

K B

D

C

C2 S2

E

Figure 3.5: A circle, that has BD as a chord, never exceeds C 1 on both sides of BD simultaneously.

Theorem 2 The three new edges, constructed to connect the new point to the triangular network, never change during the edge reorganization that is caused by the insertion of the same point. Proof: It is obvious that all the three quadrilaterals inside BAC are nonconvex. Consequently the new edges are never swapped as the rst step of the reorganization to achieve Tn+1 . Let us have a closer look at the reorganization inside BAC and BDC , here named C 1 and C 2 with centres S 1 and S 2. The point E , that lies inside C 2 but outside C 1, leads to the situation shown in Figure 3.5. Will E , or any other nodes in the network somehow in uence the edge BD? A line from S 2, bisecting the chord BD, intersects B ; S 1 in K . A circle C 3, with radius BK and centre in K , will always be interior to C 1. If the centre of C 3 moves away from S 2 along S 2 ; K , C 3 soon exceeds C 1. But it never simultaneously exceeds C 1 on the opposite side of the chord BD. Due to the circle criterion C 1 has no interior points except D. A circle, going through E with BD as a chord, never exceeds C 1 outside C 2. Consequently no points are enclosed by BDE on E 's opposite side of BD. In a similar way it can be shown that none of the other new edges are to be swapped.}

3.3.2 E ects on existing edges In this section the swapped edge, DE , is studied to establish whether any other points in uence the location of this line.

28CHAPTER 3. INSERTION OF POINTS INTO A DELAUNAY TRIANGULATION A

A

D

D

B

B

C

C

G F E

a

E

b

Figure 3.6: (a) The triangles before any connections to D are executed. BCE is emphasized. (b) The triangles after the reorganization process has started. BCE is shown by a broken line, while BDE and DCE are drawn in bold lines.

Theorem 3 An edge inuenced by an inserted point will always be located with one end in the inserted point.

Proof: The basis for the proof is shown in Figure 3.6.a. The situation described in the gure occurs at the moment D is inserted in Tn. 4BCE is a valid triangle of Tn before D is inserted. The circle that circumscribes 4BCE is shown in Figure 3.6.a. In Tn no points lie inside this circle. According to the maximum angle-sum criterion, the diagonal in 2BDCE is swapped from BC to DE. The diagonal DE is illustrated in Figure 3.6.b. Further, BCE is drawn by a broken line. BDE and DCE are shown by bold lines. BDE and DCE have DE as a common chord. Consequently they behave like the circles in Figure 3.4. BDE is exterior to DCE left to DE , and vice versa DCE is exterior to BDE on the right hand side of DE .

We know that any point that in uences the network is situated outside We also know that such a point lies inside BDE or DCE . Points F and G are examples of such points. F is situated in the zone between BCE and BDE . Because DCE never exceeds BCE in the current zone, DE never will be swapped to CF . Similarly it is obvious that DE never can be swapped to BG.

BCE .

The only additional situation that might in uence DE , is the possibility of swapping DE to FG. Proof 2 can be used to show that such swaps never occur. Figure 3.7 illustrates a situation corresponding to the one in Figure 3.5. In Figure 3.7 the line l bisects ED, and the line between E and the centre of BCE intersects l in K . A circle with K as the centre, and ED as a chord, never exceeds BCE on both sides of ED as long as D lies inside BCE .

3.3. THE INFLUENCE OF THE POINT INSERTION ON SURROUNDING EDGES29 D

C

B

l

G k

F

E

Figure 3.7: A circle, with ED as a chord, never overlaps the two hatched areas simultaneously. It directly follows, by using Figure 3.4, that FDE never exceeds BCE in the zone where G is situated. This proof can be used on any edge in uenced by the inserted point.}

Theorem 4 An edge inuenced by an inserted point is never swapped more than once as the result of the current point insertion.

Proof: From Theorem 3 it is known that every swapped edge is located with one end in the inserted point. If one of these edges is swapped more than once, they turn away from the inserted point. According to Theorem 3 it follows directly that an edge is never swapped more than once.}

An important result of these observations is that in each quadrilateral only the edges opposite to the inserted point have to be examined. These edges have to be checked by the maximum angle-sum test on their enclosing quadrilaterals. The last observation is of great value when we want to make ecient algorithms.

3.3.3 Extension of the region in Tn inuenced by an inserted point. Various authors claim that the insertion of a point into Tn is a rather local process, without showing how local it is. The size of the area, in uenced by an inserted point, depends very much on the distribution of the points in Tn. This section discusses the extension of the in uenced area, and how the point distribution in uences the extension. The term distribution means distribution in the xy-plane.

30CHAPTER 3. INSERTION OF POINTS INTO A DELAUNAY TRIANGULATION D C

B

α G F E

β H

Figure 3.8: The point H , outside BDC , is not a Delaunay neighbour of D.

3.3.3.1 Upper limitation. Theorem 5 The area inuenced by an inserted point never exceeds the cir-

cumscribing circles of the three new, initial, triangles formed when the old triangle is split. Proof: Figure 3.1 shows that the edges adjacent to the inserted point, D, are never in uenced by any points that lie outside BDC . In Figure 3.8 edges DE , DF and DG are swapped as the result of the insertion of D. Theorem 4 has shown that BD and DC never change. Accordingly  never exceeds 6 BDC . H is a Delaunay neighbour of D only if  +  > . But if 6 BDC +  >  , H has to be situated inside BDC . And because  < 6 BDC it is obvious that H can never be a Delaunay neighbour when H lies outside BDC . Figure 3.9 shows the regions where possible Delaunay neighbours are situated. No edges outside the hatched area are in uenced by the inserted point, D, in 4BAC .}

3.3.3.2 Stepwise decrease in the inuenced region Theorem 6 Possible Delaunay neighbours of the inserted point are situated

interior to the circumscribing circles of the current triangles which have the inserted point as a vertex.

Proof: In Figure 3.10.a, point E is connected to the new point D. Section 3.2 has already shown that point F has to be situated inside BCE to be a Delaunay neighbour of D. It is easy to see from Figure 3.4 that BDE is interior to BDC on the lower side of the chord BD. Equally DCE is interior to BDC in the current area of edge swapping. This means that _ BE and _ EC denote a new, upper limitation for the area in uenced by the

3.3. THE INFLUENCE OF THE POINT INSERTION ON SURROUNDING EDGES31 A

D C

B

Figure 3.9: Only edges that are interior to the hatched area may be in uenced by an inserted point, D, in 4BAC . insertion of D. Figure 3.10.b shows how upper limitation is shrunk when D is connected to its Delaunay neighbours.} A

A

D

D B

B

C

C

G F

E

a

E

b

Figure 3.10: (a) Circles BDE and DCE denote a new upper limitation where possible Delaunay neighbours are situated. (b) The swapping area is shrunk for each point connected to D. First limitation:_BC . Second limitation:_BE and _EC . Third limitation:_BF , _FE and _EC . Fourth limitation:_BG, _ GF , _ FE and _ EC . How much the \swapping area" is shrunk for each connected point, depends on the distribution of the points. The area decreases rather fast in Figure 3.10.b, while the point distribution of Figure 3.11 results in small changes

32CHAPTER 3. INSERTION OF POINTS INTO A DELAUNAY TRIANGULATION D B

C E F

H

G

I

Figure 3.11: Point distribution that results in small changes in the swapping area. for each point connected to D. It is important to notice that the last point scattering that is described is rather uncommon in a uniformly distributed data set. On the other hand, it occurs more often in data sets that produce many long, thin triangles in the nal Delaunay network. The Delaunay triangulation of points along contour lines is a typical example. There is usually a high density of points along the contour lines, while no points lie in the space between these lines. This situation leads to many long, thin triangles between the contours. Figure 3.12 shows a triangular network based on points that are sampled along contour lines.

Figure 3.12: A TIN made of points sampled along contour lines.

3.3.3.3 An exact limitation of the inuenced region This section shows how to exactly localize the triangles that are in uenced by the insertion of D. The calculation can be done before D is inserted.

3.4. INFLUENCED REGION - EMPIRICAL INVESTIGATIONS

33

A

D B

C

F G

E

Figure 3.13: G is a Delaunay neighbour of D, if D is interior to FEG.

Theorem 7 All triangles of Tn , which have the inserted point interior to their

circumscribing circles, are inuenced by the point insertion.

Proof: In Figure 3.13 we know that G is interior to DFE if G is a Delaunay neighbour of D. It is also easy to see that DEF and FEG have got a common chord, FE . As long as G is interior to DEF , DEF is interior to FEG above FE . Consequently, D is interior to FEG as long as G is a current Delaunay neighbour of D. If G lies outside DEF , D will lie outside FEG. Equally it is possible to show that every triangle, containing D interior to its circumscribing circle, is in uenced by the insertion of D.}

When the triangles in uenced by D are determined, they can be deleted. The enclosing polygon of D in Tn+1 shown in Figure 3.14 is the result of this deletion. This polygon indicates the limitation of the in uenced region. The dotted edges are identical to the edges swapped during the point insertion of D.

3.4 Inuenced region - empirical investigations Figures 3.10 and 3.11 show that the point scattering is decisive for how local the spreading of the edge reorganization will be. This section gives some examples of the edge reorganization in an area where the points are uniformly distributed. The experiments were carried out both with randomly distributed points and a data set consisting of points in a grid. The results shown in Table 3.1 are the average of 15 data sets of 1000 randomly distributed points. The gridded point set consists of 1024 points. The construction of an initial triangular network is essential for the incremental algorithm. A new point can only be included in a valid Delaunay

34CHAPTER 3. INSERTION OF POINTS INTO A DELAUNAY TRIANGULATION

A

D B

C

Figure 3.14: The enclosing polygon of D in Tn+1.

Type 1

Type 2

Type 3

Type 4

Figure 3.15: Four congurations for the false corner points.

3.4. INFLUENCED REGION - EMPIRICAL INVESTIGATIONS

35

triangulation. A simple and ecient way of making this network is to construct one or two large triangles that enclose the current area. It is often necessary to make \false vertices" or \false corner points" for the initial network. One of the tasks of this experiment was to examine how the locations of these vertices of the initial network in uence the triangulation. Figure 3.15 shows how the area we want to triangulate is covered by a rectangle divided into two triangles. The gure shows various congurations of the initial rectangle. The hatched area describes the distribution of the points in the data set. The distance from the data set to the false corner points is a function of the size of the area we want to triangulate. The max values in Tables 3.1 and 3.2 are the largest coordinate di erences in the x or y directions. To study the edge swaps it is

Level 1 Level 2 Level 3 Level 4 Level 5

Figure 3.16: Levels in proportion to the enclosing triangle of the inserted point. advantageous to dene levels in proportion to the enclosing triangle of the inserted point. These levels are shown in Figure 3.16. The edges of the enclosing triangle become level 1 and the edges of the adjacent triangles become level 2 etc.

3.4.1 Comments on the result Table 3.1 deals with the randomly distributed data, while Table 3.2 refers to the gridded data. It is important to notice that even if the false points have various sites, the major part of the triangulation is identical for the four congurations. The di erences that appear in Tables 3.1 and 3.2 are mainly caused by variations in the edge swapping along the boundary of the area. False type 1 points are situated very close to the triangulated area. Consequently many long, thin triangles are formed along the boundary. In accordance with Figure 3.11 this situation leads to many edge swaps. This e ect is distinctive especially for the gridded data set. Still, too distant vertices of the initial network also result in long, thin triangles. Accordingly it seems advantageous to keep the false

36CHAPTER 3. INSERTION OF POINTS INTO A DELAUNAY TRIANGULATION points at a certain distance from the data set to avoid too much edge swapping along the boundary. It is interesting to notice from the tables that the average number of swapped edges, due to an inserted point, is about 3 for the randomly distributed data set. The number is a little bit lower for the gridded data.

3.4. INFLUENCED REGION - EMPIRICAL INVESTIGATIONS

37

15 data sets of 1000 randomly distributed points Distance = 1

Distance = max/2 Distance = max/2 Distance = max

Average number of edge swaps

3042

3009

3004

3024

Minimum number of edge swaps

2950

2932

2924

2941

Maximum number of edge swaps

3117

3078

3112

3100

Highest level of edge swaps

8

6

7

8

Aver. max edge swaps per point.

9.9

9.5

8.8

9.0

61.7 28.2 7.4 1.9 0.6 0.2 0.04 0.01

63.0 28.7 6.8 1.3 0.3 0.03

62.9 28.6 7.1 1.2 0.1 0.02 0.007

62.8 28.5 7.2 1.3 0.2 0.01 0.007 0.003

Edge swaps at various levels (%) Level 1 Level 2 Level 3 Level 4 Level 5 Level 6 Level 7 Level 8

Table 3.1: Randomly distributed data set.

1024 points in a grid Distance = 1

Distance = max/2 Distance = max/2 Distance = max

2642

2362

2378

2356

9

5

7

5

Max edge swaps for a point insertion

13

8

8

10

Edge swaps at various levels (%) Level 1 Level 2 Level 3 Level 4 Level 5 Level 6 Level 7 Level 8 Level 9

62.2 22.8 7.2 3.0 2.0 1.6 0.9 0.3 0.04

Average number of edge swaps Highest level of edge swaps

69.9 22.5 6.2 1.3 0.1

Table 3.2: Gridded data set.

69.5 23.7 5.5 0.9 0.3 0.08 0.04

68.8 23.9 5.7 1.4 0.2

38CHAPTER 3. INSERTION OF POINTS INTO A DELAUNAY TRIANGULATION

Chapter 4 Data structures and fundamental routines for TINs In the past, regular gridded models have been the most used representation for terrain surfaces. This is because the gridded models are based on a very simple data structure. We can say that the gridded surface model is a model which ts the data structure. On the contrary the TIN data structure is made to t the surface model. The grid model is a set of points connected by vectors of xed length and direction, while, in the triangular model, the length and direction of the connection vectors are both variable. Because of the xed vectors, the height values in the grid model can be stored in a matrix. When the size and direction of the xed vectors are known, the x- and y-values can be calculated for each z-value. (In some special grid models the length of the connection vector may be partly variable (multiplied with a constant). In the triangular model, information about the connection vector is implicit in the data structure. This chapter concentrates on di erent data structures for TIN models. It is important to be aware of the triangulation algorithm that is going to be used when the data structure is chosen. It is also useful to know what type of information the surface model is to include, and what the model is to do. The data storage of a TIN can be divided into three levels. Points Edges Triangles A triangle is formed by three edges and an edge is dened by two endpoints. Various combinations of the connection between these three types of elements form the data structure for a TIN. However, it is not advantageous that the data structure grows large and heavy because of many connections between the 39

40CHAPTER 4. DATA STRUCTURES AND FUNDAMENTAL ROUTINES FOR TINS elements. The following is a list of geometrical and topological information in a TIN data structure:

Point Geometrical information: x, y and z coordinates Topological information: Pointers to adjacent edges Pointers to adjacent triangles Pointers to surrounding points Qualitative information Edge Geometrical information: Coordinates of the endpoints / pointers to the endpoints Topological information: Pointers to adjacent edges Pointers to adjacent triangles Qualitative informations (e.g. gradient of the edge,   ) Triangle Geometrical information: Coordinates of the vertices / pointers to the vertices the triangle Topological information: Pointers to the edges of the triangle Pointers to adjacent triangles Qualitative information (e.g radius of the circumscribing circle, terrain type,     ) The pointers can either be direct addresses in memory or indexes in an array (indirectly addressing). The following sections show examples of the various data structures by using indexes, while I have used direct addressing in my TIN program. Little information is required for a simple denition of a triangular network. Points that have got information about neighbouring points form a data structure for the TIN. However, a model based on a simple structure like this is unconvenient for further operations. Most operations would be very time consuming. An adequate surface model needs to store more information concerning the neighbourship between the elements. In a dynamic TIN model, and TIN models where edges are supposed to be swapped, it is important that

4.1. POINT ORGANIZATION DURING CONSTRUCTION OF A TIN 41 the data structure is easily updated. Consequently it is best that there is a minimum of redundant pointers. The more pointers in the data structure, the more pointers to update. A lot of pointers between the element is also storage consuming. Generally we can say it is desirable to keep the relationship between the elements to a minimum. Still, the data structure should be made as ecient as possible. The amount of qualitative information depends on what the surface model is going to be used for.

4.1 Point organization during construction of a TIN Data sets for terrain surfaces very often consist of large amounts of points. Consequently it is important to use an ecient point handling structure during construction of the TIN. The running time of the triangulation algorithms actually to a large degree depends on the point handling structure. Bj88] proposes a quad-three based data structure for the initial point handling. The quad-three is used as an ecient search structure to localize the nearest neighbour of the base line in the step-by-step algorithm (Section 2.3.4). MR80], who uses a similar algorithm for the triangulation, has chosen a kind of grid representation for the initial data structure. In the divide-and-conquer algorithm (Section 2.3.3) the points are located in a list which is recursively split into sublists during the triangulation. In the incremental algorithm (Section 2.3.6), LS80] uses a grid based data structure, while GS85] localizes the surrounding triangle of the current point by searching in the existing triangular mesh. The points are organized in a list sorted by bearings in the radial sweep algorithm (Section 2.3.1). For my TIN programs I have chosen a method proposed by Hel90]. In this method the triangular network itself represents the storage structure for the points in the data set. Consequently the initial network has to cover the entire area. A typical initial network is the circumscribing rectangle of the data set, divided into two triangles (Figure 4.1). The points are sorted and subordinated to their respective triangle by determination of the sign in Equation 4.3. To avoid unnecessary data storage the point table itself is used as storage structure during the triangulation. In addition to the coordinates, a pointer to the next point in the list is given for each point. When new points are included in the mesh, the \next pointers" is the only part of the point list to update. When a point is removed from the mesh it is easy to reverse the updating of the point list. In this way the points are alway stored in a list which is connected to the enclosing triangle. The organization of the point list is demonstrated in Figure 4.1.

42CHAPTER 4. DATA STRUCTURES AND FUNDAMENTAL ROUTINES FOR TINS

2 3

1

9 7 8

4

Point x,y,z Next # 1 2 2 3 3 4 4 0 5 6 6 7 7 8 8 9 9 0

5

6

2 3 1 9 7 8

4

5

6

2 3 1 9 7 8

4

6

Point x,y,z Next # 1 0 2 0 3 4 4 0 5 6 6 7 7 8 8 9 9 0

Point x,y,z Next # 1 0 2 0 3 7 4 5 5 6 6 0 7 8 8 9 9 0

5

Figure 4.1: Organization of the point list during point insertion.

4.2. DATA STRUCTURES FOR TINS

43

4.2 Data structures for TINs This section gives a closer description of some data structures for TINs.

4.2.1 Point based data structure The simplest data structure for a TIN consists of the points and their neighbourship only. For each point in the triangular mesh a list of Delaunay neighbours is given. The number of Delaunay neighbours is di erent for each point. Consequently, the length of the neighbour lists will be variable. The average number of Delaunay neighbours for a randomly distributed point set is approximately six (Section 3.4).

4.2.2 Triangle based data structure A triangle based data structure based on three tables is described in Bj88]. A point table containing x, y and z coordinates, an edge table with pointers to the endpoints and adjacent triangles of the edges, and a triangle table consisting of pointers to the edges that dene the current triangle. Figure 4.2 shows a simple triangular mesh. Indexes of the edges, points and triangles are indicated in the mesh. The tables show the data structure for the current mesh. In this data F 8

B 2

E

4 3

T2

T1

5

T3 6

A Point #

9

T4

1

C First Sec. point point

7

D

Edge #

First ∆

Sec. ∆

A

1

T1

0

A

C

T1

1

2

3

B

2

T1

0

A

B

T2

3

4

5

C

3

T1

T2

B

C

T3

5

6

7

D

4

T2

T4

B

E

T4

4

8

9

E

5

T2

T3

C

E

F

6

T3

0

C

D

7

T3

0

D

E

8

T4

0

B

F

9

T4

0

E

F

x,y,z

Triang. First Sec. Third edge edge edge #

Figure 4.2: Triangle based data structure. structure the neighbourship between edges is represented by the triangle table. The structure was developed for the step-by-step algorithm (Section 2.3.4).

44CHAPTER 4. DATA STRUCTURES AND FUNDAMENTAL ROUTINES FOR TINS Gau90] has made use of a triangle based structure for triangulation by an incremental method. For each triangle he stores pointers to the vertices of the current triangle (always 3), and pointers to adjacent triangles (0 - 3). There is also a pointer to the list of points that lie inside each triangle. Organization of the point lists are similar to the one that is shown in Figure 4.1. An edge table is super uous in this structure.

4.2.3 Edge based data structure In an edge based data structure all information about the triangle is implicit in the edge table. Consequently no triangle table is required. This section concentrates on the twin-edge (dual-edge) structure proposed by Hel90]. Neighbourship in the model is given only in the edge table. A pointer to the endpoint and a pointer to the next edge in the triangle is stored for each edge. Further a pointer to the twin-edge is stored. The twin edge is geometrically identical with the current edge, but it points at the opposite endpoint. In addition there is a pointer from each edge to the point list belonging to the triangle. The pointers of the twin-edge structure are outlined in Figure 4.3.

Pointer to endpoint

Info

Pointer to next edge Pointer to twin edge

Info Pointer to attribute

Info Info

Figure 4.3: Principles for the twin-edge structure. In the twin-edge structure a single \edge record" is a part of only one triangle. A triangle is formed by three separate edges. To make the twin-edge structure comparable to the triangle based structure, the triangular mesh from Figure 4.2 is shown for the twin-edge structure in Figure 4.4.

4.2.4 Discussion of the data structures When data structures are chosen, the following has to be taken into consideration: The maximum number of points to handle

4.2. DATA STRUCTURES FOR TINS

45 F

11

B

Point #

x,y,z Next

E

10 6

2

A

12

3

4

9

5 7 8

1

D

C Edge #

Point Next

Twin

A

1

A

2

0

B

2

B

3

0

C

3

C

1

4

D

4

B

6

3

E

5

C

4

7

F

6

E

5

10

7

E

9

5

8

C

7

0

9 10

D B

8 11

0 6

11

F

12

0

12

E

10

0

Info

Figure 4.4: Edge based data structure. The available memory in the computer The type of operations to execute on the model Any special tasks the model should handle The type of algorithm for the triangulation If the TIN is to be updated When the maximum number of points is decided, it is important to know the purposes of the surface model. Generally it is desirable to make surface models where the number of points is no limitation. However, for special purposes the possible number of points may be limited. In such a case it is unnecessary to maintain a strict limitation for the volume of the data structure. In a computer the available memory always is a limitation. Memory size of course depends on the computer, but it will always be a limitation. Consequently it is best to keep the data structure as compact as possible. Even if the structure is compact it is important that execution of standard operations (for example searching specic points) can be handled in a fast and ecient way. It is also possible to enlarge the data structure in the e ort to solve some more specic tasks (generating contour lines, handling break-lines etc.).

46CHAPTER 4. DATA STRUCTURES AND FUNDAMENTAL ROUTINES FOR TINS The triangulation algorithm and the possibilities of updating the model are related to some degree. Dynamic triangulation requires the pos-

sibilities of consecutive updating during the triangulation process. In an \updatable" model it is desirable to maintain as few redundant data as possible. When redundant data occur, the same corrections have to be carried out more than once.

If we take a closer look at the structures described in Figures 4.2 and 4.4 we can see that the triangle based structure contains some redundant data. The edges of a triangle can be determined without the use of the triangle table, but both the edge table and the triangle table have to be changed when the mesh is updated. This property makes a structure like this less suitable for dynamic triangulation. Still, the neighbourship between edges and triangles is well dened and makes the structure suitable for drawing contours etc. The storage requirement for the structures referred to is shown in Table 4.1. An integer value and a pointer is both set to be 4 bytes. The point list is left out from the evaluation. When it is desirable to keep the data storage to a

Data structure from Gau90] 24 bytes Data structure from Bj88] 36 bytes Data structure from Hel90] 36 bytes Table 4.1: Data storage per triangle.

minimum it is obvious that Gau90]'s data structure is preferable. However, in a dynamic triangulation it is extremely important to keep the structure easy and surveyable. The problem is comparable to normalization of relational databases. Generally it is desirable to avoid too many attributes to each key value. Data storage for the twin-edge structure can be reduced to 24 bytes per triangle when the structure is organized in such a way that the two twin edges are grouped in pairs. Then the twin pointer can be left out from the structure. There is no additional triangle structure when using the twin-edge structure. Consequently a pointer to the point list is required for each edge. In Gau90] there is one pointer to the point list for each triangle. 8 pointers have to be updated as a result of an edge swapping in Hel90]'s structure. Only edges of the two triangles which form the enclosing quadrilateral of the diagonal are in uenced. In Gau90]'s structure 8 pointers have to be updated and 4 triangles are in uenced by the edge swapping. When a new point is inserted, Hel90]'s algorithm leads to less corrections on the existing structure. Consequently updating operations are less time consuming. Handling of sudden variations in the surface is an important feature in terrain modelling. An edge based structure is better suited to handle break lines. Only an attribute that tells if the edge is a part of a break line is required.

4.3. METHODS FOR POINT INSERTION

47

4.3 Methods for point insertion Point insertion is a fundamental operation of the incremental algorithm (Section 2.3.6). While Section 3.3 discusses the geometrical conditions for edge swapping, this section describes some algorithms, methods and special features related to the insertion.

4.3.1 Succession of the inserted points Before any points are inserted in the mesh, the edges of the two initial triangles are stored in the edge list. There is to be a pointer from the edges to the point lists of the triangles (Figures 4.1 and 4.4). If every point from the data set is to be included in the mesh, the succession of the inserted points has little in uence on the nal result. A unique network will always be equal in spite of succession of the inserted points. On the other hand the succession may in uence the time consumption to some degree. Because of the built-in point handling structure, it is advantageous to split the large triangles early in the process. However, any calculations for the determination of the most favourable split point take time. In my program the edge table decides the succession of the points to insert. The rst edge of a triangle that encloses additional points is chosen. When a point is inserted, the algorithm moves on to the next edge. The localization of the next point to insert is very fast by this random method, and practical experiments show that the insertion spreads over the triangulated area quite fast. Chapter 5 discusses further constrains for the point selection and the succession of the point insertion.

4.3.2 Splitting a triangle When a point is included in the mesh, six new edges (3 couple of twin edges) are constructed inside the enclosing triangle (Figure 4.5). This means that the old triangle is split into three new ones. The next-pointers of the old triangle edges are the only part of the existing mesh that have to be updated.

Figure 4.5: Six new edges are included in the data structure when a triangle is split.

48CHAPTER 4. DATA STRUCTURES AND FUNDAMENTAL ROUTINES FOR TINS

4.3.2.1 Zero triangles Occasionally the inserted point may coincide with an existing triangle edge. GS85] proposes to handle this as an exceptional case. He deletes the present edge, and connects the inserted point to the four vertices of the enclosing quadrilateral. Still, when we use the maximum angle-sum criterion, it is unnecessary to handle this occurrence di erently from the other insertion. The triangle is split into three new triangles, where the vertices of one of them lie on a line. These vertices dene a triangle of no area. This kind of triangle is denoted a \zero triangle". A zero triangle inside a Delaunay mesh always A

A

E

β

α

C

C E

D

D B

B

Figure 4.6: A \zero triangle" caused by insertion of E . AB will always be swapped because  =  and  > 0. (AB and AE /EB are separated in the gure to emphasize the operation). disappears during the reorganization process caused by the point insertion. In Figure 4.6 we can see a segment of the mesh when E falls on an edge.  = , and as long as no points have identical positions in the x-y plane, we know that  +  > . Consequently AB is swapped to ED by the reorganization process. Duplicate points are easily determined by comparison of the point to insert and the vertices of its enclosing triangle. Inside the triangular mesh zero triangles disappear during the triangulation. Still zero triangles may exist on the boundary of the triangulated area. The circumscribing circles of such triangles have r = 1. But the mesh is still a Delaunay network, because outside the triangulated area there are no additional points interior to these circles. Zero triangles, or other triangles with large circumscribing circles along the boundary, are useful when we want to merge two meshes without any inclusion or deletion of edges/triangles (Section 7.3.3).

4.3.2.2 Reorganization of the point handling structure Section 4.1 describes how points are stored as attributes to the triangles during the triangulation. Because the point lists are frequently updated, it is necessary to optimize the reorganization. When the diagonal in a quadrilateral is swapped, it is necessary to determine which of the \new" triangles the points are interior to (Figure 4.7). Our task is to nd on which side of the diagonal each point is situated. By using Equation 4.1 the distance point-line is

4.3. METHODS FOR POINT INSERTION

49

B

D

-

+ C

A

Figure 4.7: Points interior to a quadrilateral where the diagonal is swapped. The points are sorted by the diagonal AB . calculated.

d = axp+2by +2 c a +b The coecients are given by the determinant

(4.1)

xi yi 1 xA yA 1 xB yB 1

(4.2)

so that

a = yA ; yB

b = xB ; xA

c = xAyB ; yAxB

When we only need to determine on which side of the line the point is, it is adequate to only look at the numerator of Equation 4.1. More precisely we have to nd the sign of Equation 4.3.

si = axi + byi + c

(i = 1 2 :: n)

(4.3)

n is the number of points interior to the quadrilateral of the swapped diagonal. A point lies to the right of the line AB if si is positive. Further, the point lies on the line if si = 0, and to the left if si is negative. Equation 4.3 is also used when a triangle is split. Figure 4.8 outlines how the points are subordinated to the new triangles during a three-step operation. The same equation is also useful when we want to determine if a point lies inside a triangle. When the current point lies on the right hand side of the three triangle edges, the point is situated inside the triangle.

4.3.3 Recursive process for edge reorganization Section 3.3 shows that insertion of a new point usually results in some swapped edges. Every quadrilateral that is adjacent to the inserted point has to be tested by the maximum angle-sum rule. If the diagonal is swapped, two new adjacent quadrilaterals appear and must be tested. The problem can be formulated short and precise by a recursive procedure:

50CHAPTER 4. DATA STRUCTURES AND FUNDAMENTAL ROUTINES FOR TINS A

A

A

D

D

D

C

B

(a)

C

B

C

(b)

B

(c)

Figure 4.8: Point handling when the triangle is split. (a) The points are sorted by DA. (b) The points are sorted by DC . Points inside 4ADC are determined. (c) The points are sorted by DB . Points inside 4ADB and 4CDB are determined. reorganize(diagonal) Comment: reorganize(..) manage the reorganization of the edges.

Variables:

*diagonal

Comment: The diagonal of the quadrilateral to check.

*edge1, *edge2

Comment: The diagonals of the quadrilateral to check if diagonal is swapped

if ((checkquadrilateral(diagonal)) == 1) Comment: Checkquadrilateral(..) performs

the maximum angle-sum test edge1 = diagonal!twin!next edge2 = diagonal!twin!next!next swapdiagonal(diagonal) Comment: Swapdiagonal(..) swaps the diagonal. reorganize(edge1) reorganize(edge2)

A recursive procedure is usually short and well arranged compared to a not recursive procedure for the same problem. But memory allocation for the variables is less predictable. Consequently the incremental triangulation program was tested by both a recursive and a non-recursive procedure. In the nonrecursive procedure the current edges had to be stored by a separate list. The test showed no signicant di erence in running time between the two procedures. This is because of the limited spreading of the edge swapping. For each inserted point, approximately three edges are swapped (Section 3.4). Accordingly we will not get an inappropriate large stack in the recursive procedure.

Chapter 5 Qualied selection of points One of the real advantages of using the TIN data structure as the point handling structure for candidate points, is the capability of making the qualied selection of points. When points that lie inside a triangle are stored as attributes to the triangle, no extra time is spent to localize those points. A triangle formed by three points represents an exact description of a plane in space. When candidate points that lie inside the horizontal projection of the triangle fall in the triangle plane, these points will make no contribution to the model. Example: When a sea surface is represented by a grid model a lot of redundant data are stored. In the TIN model the surface is represented by large triangles \rooted" on the shore.}

It is possible to extend this algorithm to ignore \almost redundant" points as well. This means that a point may not be included in the triangular mesh if it lies close to one of the triangles. Consequently it is possible to establish surface models of various accuracies. The accuracy is set by a predened threshold value for point inclusion. Cartographic generalization consists of several sub-processes according to Aas92] and SM89] among others. The qualied selection of points is in fact a simplication, which probably is the most important sub-process. However, the qualied selection of points is not primarily used for cartographic simplication, rather to simplify the surface model. I have consequently chosen to refer to the process as the generalization of the surface model. In Section 5.2 the feature is used for the generalization of contour maps when the scale is getting small.

When a generalized surface model is required, it is an advantage that the selected points give the best possible description of the surface. During the insertion process in the incremental algorithm, a split point is chosen from the points that are enclosed by the present triangle. Usually the most distant point in each triangle makes the most signicant contribution to the model, and is consequently chosen as the split point (Figure 5.1). After the triangle is split and surrounding edges are reorganized, every triangle that is in uenced by the 51

CHAPTER 5. QUALIFIED SELECTION OF POINTS

52

C C

A A B B

Figure 5.1: The most distant point from the triangular plane becomes split point. reorganization will have a new split point. When all the points lie closer to the triangle than the predened threshold, , no more points will be included inside that triangle. The triangulation for the entity area is terminated when every point, that is not included in the network, is closer to a triangle than . The triangles to split can be chosen in random succession. This is simple, ecient, and experiments show that the results are quite good. The terrain models shown in Section 5.2 is generated by this method. However, the surface models do not necessarily become identical when one data set is processed two times with altering the point succession. But the variation is small and the precision of the surface model will still be the same. It is possible to avoid this \problem" by selecting the triangle to split in a more sophisticated way. During the triangulation we can, for example, always split the triangle which have the most distant point. Then variations caused by di erent point succession only occur when we have to choose between two (or more) triangles with equal distance to the most distant point.

5.1 Threshold for point inclusion The threshold for point inclusion depends on the problem to be solved and will vary in type and size. Figure 5.2 shows a typical threshold, p . Every point that is closer to their enclosing triangle than p will not be included in the mesh. The threshold in Figure 5.2 is designed for the perpendicular distance from point Q(xQ yQ zQ) to the triangular plane, 4ABC , calculated by Equation 5.1 distp = axQp+ 2byQ +2 czQ2+ d (5.1) a +b +c where

a b c d

= = = =

yA (zB ; zC ) + yB (zC ; zA) + yC (zA ; zB ) xA (zC ; zB ) + xB (zA ; zC ) + xC (zB ; zA) xA (yB ; yC ) + xB (yC ; yA) + xC (yA ; yB ) xA (yC zB ; yB zC ) + xB (yAzC ; yC zA) + xC (yB zA ; yAzB )

5.1. THRESHOLD FOR POINT INCLUSION

53

C

λ

C Q

Q A

λ

C Q

λ

λ

A B

A B

B

Figure 5.2: (a) Threshold value, p, for the perpendicular distance. (b) A cut through the triangle. (c) Region inside the threshold value. When we are searching for the most distant point from a triangle, it is less time consuming to only compare the numerators of Equation 5.1. The denominator is equal for all points enclosed by a triangle. Consequently the split point is determined by Equation 5.2. sp = max j axi + byi + czi + d j (i = 1 2 :: n) (5.2) n is the number of points enclosed by the horizontal projection of 4ABC . A C

λ

Q

Q

C

C

Q

λ

λ

λ

A A B

A B

B

Figure 5.3: (a) Threshold value, v , for the vertical distance. (b) A cut through the triangle. (c) Region inside the threshold value. closely related method is to look at the vertical distance between the point and triangle plane. Figure 5.3 outlines the threshold value, v , for the vertical distance. The point related to sv of Equation 5.2 is chosen as split point when we use the vertical distance. (5.3) sv = max j zi + d + byci + axi j (i = 1 2 :: n)(ci 6= 0) i A common feature of both methods is that it is indi erent which side of the triangle the most distant point is situated. A point above the triangle represents a peak while a point below represents a trough. For certain tasks it may be advantageous to keep separate threshold values for each side of the triangle. The threshold value can also depend on where the point lies in the model. Some areas may be more important than others and we will have:  = f (xglobal yglobal) (5.4) Similarly the threshold sometimes might depend on the z value:  = f (zglobal) (5.5)

CHAPTER 5. QUALIFIED SELECTION OF POINTS

54

Example: For maritime charts it is important to include all peaks that can be dangerous for navigation. Consequently the threshold value above the triangles are very important and should be rather small, maybe even zero. Bellow the triangles, size of  is of minor importance and can be much greater. For certain areas, for example through a fairway, it might be interesting to maintain a higher level of accuracy. In that case the threshold is set by Equation 5.4. Further, maritime charts have to keep a higher level of detail in shallow waters. The threshold is consequently set by Equation 5.5 where  grows when the depth is deeper.}

In many cases it is best to include extremal points for the surface in the model, even if these points are closer to a triangle than the predened threshold. This means local maximum and minimum points in the z-direction. To be sure that such points are included in the mesh, all points below the lowest z-value or above the highest z-value in the triangle are included in the network. Figure 5.4 shows a cut through a triangle and the areas that are C

A B

Figure 5.4: A cut through the threshold zone for p and v when extremal points are included. inside the threshold. During the triangulation it is also possible to include an extremal point rather than the most distant point. However, when using the threshold zone in Figure 5.4 it is necessary to check the inclination and orientation of the adjacent triangles. This is because there will not be an extremal point between two subsequent triangles in the same slope. The situation is outlined in Figure 5.5.

a

b

Figure 5.5: The threshold zone for extremal points should only be used in case a.

5.2. GENERALIZATION BY POINT REDUCTION, SOME EXPERIMENTS55 As Equations 5.4 and 5.5 indicate a global variation of , Equation 5.6 denotes a local variation of the threshold.

 = f (xlocal ylocal zlocal)

(5.6)

It means that the threshold value depends on where the candidate point is situated compared to the three vertices of the triangle. But such variations in  make a more time consuming triangulation. Figure 5.6 shows a cut through a triangle and its \threshold zone" when Equation 5.6 is used. C

A B

Figure 5.6: A cut through a triangle when  = f (xlocal ylocal zlocal). This section shows a few, important parameters for generalization of a surface by the qualied selection of points. It is important to choose the parameter that is best suited for the problem we want to solve. A program that includes this feature should have options for various types and sizes of this and other parameters.

5.2 Generalization by point reduction, some experiments The incremental Delaunay triangulation can, together with the qualied selection of points, be utilized to construct a generalized terrain model. The level of the generalization in these experiments is controlled by the size of the threshold value, p, from Figure 5.2. During triangulation the most distant point of each triangle is included in the network, until every additional point lies within the threshold. The data sets are selected from the 100m by 100m (grid) height data base managed by the Norwegian mapping authorities, and the generalization experiments were carried out for various terrain types of Norway. First I will show how the generalization feature works for two di erent types of terrain. Figure 5.7 is a terrain model, using a triangular irregular network that covers a at area at Lten in the eastern part of Norway. The second example (Figure 5.8) is from Jotunheimen (Galdhpiggen), one of the most mountainous areas in Norway. To get a visual impression of the generalization e ect, contour maps of the terrain model are shown. The threshold value and the number of points in the TIN are given in the gures. Height variations are

CHAPTER 5. QUALIFIED SELECTION OF POINTS

56

distinct for the examples. Consequently I have chosen a contour interval of 100 m for Lten and 400 m for Jotunheimen. The gures clearly show how the main terrain characterization remains during the generalization process. For general views over the terrain, or rough models for calculations, these generalized TINs are very ecient. The feature may also be used to generalize contour maps. Still, it may be necessary to remove small details (small peaks etc.). The gures show that the reduction in the number of points is most distinct in the at area. However, the main characterization of the terrain remains during the generalization. Even when p = 200m in the Lten area, and the TIN model is represented by 0.02% of the original data set, the contour map tells us something about the main variation of the terrain. The point reduction in the Jotunheimen area is less than for Lten. However, with a threshold value of 50 metres, 94.3% of the data points are excluded from the model. Still very few changes can be found in the contour map in scale 1:1000000. Even the map generated from 2.1% of the original data is remarkably similar to the map that is based on all the 56481 points. Figure 5.9 shows the point reduction for Lten and Jotunheimen as functions of the threshold value. We can clearly see how the point reduction di ers for the two areas. When  = 5m the Lten model is generated from 12% of the original points, while 62% of the points are necessary to represent Jotunheimen. Similar experiments were also carried out for other parts of Norway that cover terrains of various characterization. Table 5.1 lists the areas and their characterization. The e ect of the generalization is shown in Figures 5.10 and NAME OF AREA

TERRAIN CHARACTERIZATION

Harstad

Coastal area in nothern Norway. Mountainous landscape with large areas of open sea.

Jotunheimen

The largest mountain mass in Norway. High and partly steep mountains

Løten

Flat agricultural landscape in the eastern part of Norway

Stiipanav’zi

Mountain plateau . Flat area.

Tynset

Large, wide valleys and gentle, wide mountains.

Volda

Alpine landscape broken by narrow fjords.

Voss

Partly steep mountains broken by wide and narrow valleys.

Table 5.1: Terrain characterization. 5.11. The gures clearly show how at areas become more generalized for low

5.2. GENERALIZATION BY POINT REDUCTION, SOME EXPERIMENTS57

:0 λ Points : 56481 (100%)

: 50 λ Points : 149 (0.3%)

: 100 λ Points : 47 (0.1%)

: 200 λ Points : 13 (0.02%)

Figure 5.7: TIN model and its corresponding contour map for Lten, scale 1:1000000. Threshold, , and the number of points included in the TIN, are indicated in the gure.

:0 λ Points : 56481 (100%)

λ

: 50

Points : 3227 (5.7%)

: 100 λ Points : 1201 (2.1%)

: 200 λ Points : 401 (0.7%)

Figure 5.8: TIN model and its corresponding contour map for Jotunheimen, scale 1:1000000. Threshold, , and the number of points included in the TIN, are indicated in the gure.

CHAPTER 5. QUALIFIED SELECTION OF POINTS

58 Points of total data set (%) 100 90 80

Galdhøpiggen 70

Løten

60 50 40 30 20 10

50

100

150

200

Threshold in m ( λp)

Figure 5.9: Point reduction. Experimental results. threshold values. In the Harstad area 58% of the points are redundant. This is because a large part of the data set represents the surface of the sea. This surface is possible to describe by few, large triangles. For the other areas, 14% - 24% of the data set are redundant. In the previous experiments the areas are triangulated in one operation for each threshold value. I have named this the \standard generalization". The generalization feature was also tried with two other parameters in the triangulation program: The area is divided into 25 blocks during the triangulation. The model is \zoomed" in a stepwise manner. Figure 5.11 shows the experimental results for the area of Voss. The method where the area was divided into blocks is left out from the gure because the result was very close to the standard generalization. Stepwise generalization means that the area rst is triangulated by a large threshold value. Then the threshold value is shrunk stepwise, and the triangular network is rened for each step. This kind of generalization shows a better result than the standard generalization. The method actually localizes 2% more redundant data than the results from standard generalization. This is because the model is better adapted to the terrain during the triangulation and the point insertion is better distributed over the whole area.

5.2. GENERALIZATION BY POINT REDUCTION, SOME EXPERIMENTS59 Points of total data set (%) 100 90 80

Stiipanav’zi 70

Tynset Harstad

60

Volda

50 40 30 20 10

50

100

200

150

Threshold in m ( λp)

Figure 5.10: Point reduction. Experimental results. Points of total data set (%) 100 90 80 70

Voss, standard generalization Voss, stepwise generalization (zoom)

60 50 40 30 20 10

50

100

150

200

Threshold in m ( λp)

Figure 5.11: Point reduction. Experimental results.

60

CHAPTER 5. QUALIFIED SELECTION OF POINTS

5.3 \Zooming" the model During the triangulation of certain areas, the incremental triangulation can be stopped at various levels of accuracy. In the beginning of the triangulation  is set very large, such that a few triangles describe the area. From this rough model we can localize certain areas where a higher level of precision is desired. For these areas a smaller threshold is given and the triangulation continues. By this way we can \zoom" in the terrain model. If we need to zoom out again, it is convenient to store the distances from the included points to their triangles. This distance can be stored as an attribute to the point. The distance tells us what contribution a point makes to the model. When we are zooming out, the points are removed from the network according to the distance. No extra calculations are required to localize the points to delete. Without any \history" from the triangulation, zooming out will be much more time consuming. This because it is necessary to localize the enclosing Delaunay triangle of the point. Figure 5.12 shows an example of the zooming operations in a TIN. As with the generalization examples, the 100m by 100m height data base is the basis for this zooming. A contour map of the model is drawn to visualize the zoom. A heavily generalized model covering Voss is generated and shown in scale 1:1000000. From this rough model it is possible to select certain areas that we want to have a closer look at. A new , equidistance and scale is chosen, and a new more detailed model can be constructed. The resolution of the data points that represents the surface is decisive for how much the model can be zoomed in. For large surfaces of high resolution, the amount of data will grow very large. When the same data set is to be used for triangulation more than once, it will be convenient to classify the points after the contribution the points gives to the model. The rst time the area is triangulated the points will be submitted to their respective classes. Example: The points are sorted due to how close the points that are included lie with regard to the enclosing triangle. Table 5.2 shows an example for how the data set can be divided into classes of contribution. For a new triangulation of the same area, the points to be included can be selected by their class. For a triangulation with an accuracy of Class 1, none of the points in higher classes have to be considered. In the same way it is easy to zoom out by removing every point from one or more classes.}

Class 1: distp > 20m Class 2: 20m distp > 10m Class 3: 10m distp > 0m Class 4: distp = 0m Table 5.2: Classes of contribution

5.3. \ZOOMING" THE MODEL

λ Equi.

= 50m = 200m

Scale = 1:1000000

λ Equi.

= 20m = 50m

Scale = 1:200000

61

λ Equi.

= 10m = 20m

Scale = 1:50000

Figure 5.12: Zooming the model.

λ Equi.

= 1m = 10m

Scale = 1:25000

62

CHAPTER 5. QUALIFIED SELECTION OF POINTS

Chapter 6 Removing points from a Delaunay triangulation The deletion of points is an important feature of a program system that handles triangular meshes. Nevertheless, many existing triangulation programs do not support this feature. The insertion of points into triangular meshes has been well studied, while the problem of removing points has been given less attention according to Hel90] . Static triangulation methods usually rebuild the complete network when there are any changes in the data set, insertion or deletion.

6.1 Algorithms for point deletion The only algorithm for point deletion I am aware of is one that is brie y described by Hel90]. I have named this the basis algorithm, and it is described in detail in Section 6.1.1. This thesis also introduces two variants of the basis algorithm where no edges are removed, but are swapped according to the constrains from the basis algorithm. These algorithms are named the reversion algorithm and the modied reversion algorithm. This section also introduces the simple reversion algorithm, where only the maximum angle-sum criterion (Theorem 1) is used to achieve the valid geometry. When a point is inserted into a Delaunay network, we know from Theorem 3 that the edges in uenced by the insertion will be located with one end in the inserted point. These edges stretch out like spokes to an enclosing polygon. As Figure 6.3 shows, this is not necessarily a convex polygon. Still the triangular structure of a Delaunay mesh usually results in a gure that is pretty close to a convex polygon. Because the mesh that lies outside the polygon is untouched by the point insertion, it is obvious that deletion of the same point will have no in uence on this mesh. 63

64CHAPTER 6. REMOVING POINTS FROM A DELAUNAY TRIANGULATION

6.1.1 Basis algorithm This algorithm forms the basis for some of the algorithms that are introduced below. Tn+1 is the triangular mesh before any point is deleted and Tn is the result of the deletion.

a

b

c

Figure 6.1: (a) Every edge inside the enclosing polygon is deleted. (b) The smallest circle along the polygon is chosen. (c) The missing edge of the triangle is constructed interdependent to the circle. 1. The enclosing polygon of the current point is found and its interior triangles are removed (Figure 6.1.a). 2. Two consecutive edges along the polygon form a triangle. The circumscribing circle is calculated for each consecutive pair of edges (Figure 6.1.b). 3. The triangle, corresponding to the smallest circle, is a part of Tn. The triangle is stored and the polygon is adjusted. New circumscribing circles have to be calculated for the new part of the polygon. The smallest circle of the new polygon is chosen (Figure 6.1.c). 4. Steps 1 - 3 are repeated until the mesh that lies inside the polygon is complete. Some special considerations have to be taken for interior angles in the polygon that are greater than . This problem is discussed in Section 6.1.2. It is easy to see that the smallest circle along the polygon does not contain any other points of the same polygon. This is because if the circle covers one of the other points, it is possible to make a smaller circle. The same constraint prevails for each of the shrunken polygons during the process. The last polygon will be a single triangle. The nal network meets the circle criterion for Delaunay triangulation because none of the smallest circles during the operation cover any of the other points in the network.

6.1. ALGORITHMS FOR POINT DELETION

65

6.1.2 Reversion algorithm The purpose of this algorithm is to make an inverse version of the incremental algorithm, described in Section 2.3.6 and closely investigated in Chapter 3. During the insertion, three new edges are added to the network and there is a local adjustment of the in uenced edges. Though I rst tried to reverse the whole insertion process, closer investigation revealed that it was impossible to use any variant of the maximum angle-sum criterion for this problem. It is not possible to determine the succession of the diagonal swaps after a point is included in the network. Consequently, every possible circle along the enclosing polygon has to be calculated. When the smallest circle is localized, the edge that goes from the corresponding vertex of the polygon to the removed point is swapped. The diameters of the circumscribing circles can easy be calculated by using the formula d = sina   62 0 ] (6.1) where a is an edge in the triangle, and  is the facing angle of a. Point by point the algorithm goes:

a

b

c

Figure 6.2: (a) The smallest circle along the polygon is chosen. (b) The edge corresponding to the circle is swapped. A new smallest circle is determined. (c) When the polygon consists of three edges only, every edge inside the this triangle is deleted. 1. The enclosing polygon of the point we want to remove is located. 2. A list is established consisting of the diameters of the circumscribing circles along the polygon. The smallest circle is chosen from the list (Figure 6.2.a). 3. The edge between the current vertex and the point to remove is swapped (Figure 6.2.b). 4. When the edge is swapped a new polygon is formed. The circumscribing circles corresponding to the new part of the polygon are calculated. 5. Steps 1 - 4 are repeated until only three edges remain inside the polygon (Figure 6.2.c). These edges are deleted to achieve Tn .

66CHAPTER 6. REMOVING POINTS FROM A DELAUNAY TRIANGULATION The algorithm seems simple, but there are a couple of exceptional cases to handle: The polygon is not necessarily a convex polygon. If an inside angle in a vertex of the polygon is greater than , a triangle made of the two edges adjacent to the vertex lies outside the polygon. It is important to avoid any of the interior edges being swapped for this vertex (Figure 6.3.a), otherwise we will get an invalid \spaghetti structure". When a point is inserted into Tn , it is connected to the enclosing triangle by three new edges. In the reversion algorithm these three edges should be the last ones to delete. Consequently, the initial triangle from the point insertion has to be identical with the nal polygon where three interior edges are to be deleted. Some special considerations have to be taken to prevent the initial triangle from being \cut o " early in the reversed swapping. A resulting triangle which encloses the removed point and corresponds to the smallest circle of the list cannot lead to any diagonal swap (Figure 6.3.b). The triangle is marked, and the swapping continues in the vertex corresponding to the next smallest circle.

a

b

Figure 6.3: (a) An edge can never be swapped when its adjacent angle in the polygon is greater than . (b) An edge can never be swapped if the removed point lies interior to the resulting triangle.

6.1.3 Modied reversion algorithm The combination of the exceptional cases described in Section 6.1.2 is somewhat complicated to program consistent routines for. In the modied reversion algorithm the second point in the \exceptional case list" is overlooked. Consequently when a triangle encloses the removed point early in the operation, no special considerations are taken. The point deletion results in a triangular mesh that is interior to the polygon, but this is most likely to be a mesh that does not meet the circle criterion. Nevertheless, the mesh consists of non-overlapping triangles and the maximum angle-sum test is used for the quadrilaterals that are interior to the polygon. Tn is the nal result when the edges are swapped according to this test.

6.2. RUNNING TIME OF THE ALGORITHMS

67

6.1.4 Simple reversion algorithm The simplest way of removing a point is to swap all the edges away from the central point (Figure 6.4). We only need to be sure that no edges adjacent to a concave angle are swapped. When only three edges remain inside the polygon, these edges are deleted. After this initial step is completed, the maximum angle-sum test is used for the quadrilaterals that lie inside the original polygon. The testing and swapping terminates in Tn . Because the initial triangulation is \less Delaunay" than the one in Section 6.1.3, some more edge swaps have to be executed.

Figure 6.4: The edges are swapped with no respect to the circle criterion. The three last interior edges are deleted.

6.1.5 Removing points along the boundary of a TIN The algorithms described in the previous sections remove points that lie inside a triangular mesh. With some modications the algorithms are also suitable for points on the boundary of the mesh. It is possible to use similar rules for the \half polygon" that partly encloses the point we want to remove. In Figure 6.5 the reversion algorithm is executed for a boundary point. An important di erence from the earlier algorithms is that only two edges are deleted at the end of the process. If a removed point is convex to the total mesh, these two edges lie outside the mesh (Figure 6.5.c). On the contrary, these edges will lie inside a triangle when the point is concave to the total mesh (Figure 6.5.b). When the \half polygon" is totally concave to the point (Figure 6.6), the point and its adjacent edges can be removed directly, without any edge swaps.

6.2 Running time of the algorithms Hel90] claims that the basis algorithm has a running time of O(n log n), where n is the number of points along the polygon. This running time is bounded by performance of the circle-size list. Because the reversion algorithm consists of similar calculations, the running time will also be similar. The modied and simple reversion algorithms are more dicult to estimate due to

68CHAPTER 6. REMOVING POINTS FROM A DELAUNAY TRIANGULATION

a

b

c

Figure 6.5: (a) The \half polygon". (b) The two last edges are deleted when the point lies concave to the triangulated area. (c) The two last edges are deleted when the point lies convex to the triangulated area.

Figure 6.6: A corner point and all adjacent edges are deleted.

6.2. RUNNING TIME OF THE ALGORITHMS

69

the edge swapping. Rather few edges are swapped in the modied algorithm. Consequently the running time is close to O(n log n). For the simple algorithm, \the worst case" running time is O(n2). Still, this only occurs for an extreme point distribution. Section 3.4.1 showed that the average number of edges starting in a point is approximately six. When n is a small value, the running time of an algorithm is of less importance. Because of less testing and calculations an O(n2) algorithm may be better suited than an O(n log n) algorithm for a small n AHU87]. The behaviour of the running times is sketched in Figure 6.7. This means that a running time of O(n2) can be reasonable for the simple reversion algorithm. 2

O(n) Time

O(nlogn)

n

Figure 6.7: Time consumption when n is small. Some time-tests were run on a Sparc Station to demonstrate the performance of the various algorithms. 50000 points were removed from a triangular mesh consisting of 67721 points by the three algorithms shown in Table 6.1. The succession of the removed points was almost equal for the three algorithms. Some minor variations occur because the meshes are no unique Delaunay networks. Table 6.1 shows the average time used per 1000 points. As we can Reversion algorithm 2.28s Modied algorithm 2.52s Simple algorithm 1.44s Table 6.1: Average time used per 1000 points when 50000 points are removed. Point storage is not updated. see, the O(n2) algorithm has the best result. (This result was ironical, because while the rst two algorithms demanded a lot of time for the programming and debugging work, the simple algorithm was constructed in less than one hour.) However, like the triangulation algorithms in Chapter 2, the storage structure for additional points has considerable in uence on the time consumption. Section 4.1 explains how the triangular network itself is used as a storage structure. In Table 6.1 this storage structure is neglected. If the removed points are stored for each triangles, the quantity of points subordinated to each triangle becomes rather large when many points are removed. The storage structure

70CHAPTER 6. REMOVING POINTS FROM A DELAUNAY TRIANGULATION has to be reorganized simultaneously with the edge swapping. Though the algorithms based on most edge swapping will become more time consuming, the storage of the removed points will often be super uous. An impression of how much the point storage in uences the time consumption is given in Table 6.2. This table presents the results of a similar experiment to the one in Table 6.1. Reversion algorithm 2.66s Modied algorithm 2.88s Simple algorithm 2.74s Table 6.2: Average time per 1000 points when 50000 points are removed. Point storage is updated. As expected, the simple algorithm is more time consuming when the point storage is updated. But it is surprisingly close to the reversion algorithm, though the number of points subordinated to each triangle was rather large at the end of the process. This result made me decide upon the following strategy: to mainly use the simple algorithm for the deletion of points, and consider the use of the reversion algorithm when there are a huge number of points subordinated to each triangle.

Chapter 7 Merging Delaunay networks Routines for merging Delaunay triangulations are very useful for large surface models. Such routines make it possible to handle a single part of the model and subsequently merge it to other parts. Working on smaller parts is more surveyable and easier to handle. Chapter 8 will show how the merge routines are utilized for some purposes, while this chapter takes a closer look at the geometry of the networks when two Delaunay triangulations are merged. It is very interesting to know how adjacent networks in uence each other during the merge operation. The chapter also describes some merge methods and discusses their algorithms. The deleteand-build algorithm was introduced by LS80], while the other algorithms are rst proposed in this thesis. In networks where redundant and \almost redundant" points are omitted (Chapter 5), some special considerations have to be taken for the boundary areas. One of the merge algorithms is extended to handle this situation.

7.1 Some denitions In the examples of this chapter, two adjacent meshes, TL to the left and TR to the right, are merged to become T . If there are l points in TL and m points in TR , T consists of l + m = n points. Further, a triangle is a member of TR (TL ) if its three vertices are members of TR's (TL's) data set, and no other points in the network are enclosed by the circumscribing circle of the triangle. 71

72

CHAPTER 7. MERGING DELAUNAY NETWORKS

7.2 Adjacent networks inuence each other due to the merge When two separate triangular networks are merged, it is likely that some changes will occur in the boundary area between the two meshes. These changes depend on the point distribution along the boundary, and how the areas are triangulated. Several long, thin triangles along the boundary of the mesh have to be removed, for example when the triangulation is bounded by its convex hull (Figure 7.1).

Figure 7.1: Long and thin triangles often occur along the boundary when the triangulation is bounded by its convex hull.

7.2.1 Limitation of the region inuenced by the merge operation. The basis for the merge is formed by two adjacent triangular meshes that meet the circle criterion (Denition 1). When the process is completed, the resulting network also has to be in accordance with the circle criterion. This section describes TR's in uence on TL. However, TL in uences TR in a similar way.

Theorem 8 Assume two nonoverlapping triangulations, TL and TR, and their

merge, T . Triangles of TL , which have circumscribing circles that enclose at least one point of TR , are not members of T .

Proof: The situation is comparable to the determination of the swapping area in Section 3.3.3.3. Any test for the circle criterion fails if a triangle along the boundary has got points that are interior to its circumscribing circle (Figure 7.2). It is obvious that only the triangles of TR and TL which meet the circle criterion in T , also become triangles of T .}

7.3. MERGE ALGORITHMS

73

Figure 7.2: Triangles which have points of the neighbouring mesh interior to their circumscribing circles are invalid in T .

Figure 7.3: The boundaries of the triangles that remain in T are emphasized. Figure 7.3 shows the boundaries of the meshes in TR and TL that are valid in T . The gure also shows how point scattering in uences the triangles in the boundary area. The boundaries in Figure 7.3 are comparable to the polygon in Figure 3.14. The invalid triangles of TR and TL can be removed from the meshes before any merging is done, or these triangles can be reorganized to t T.

7.3 Merge algorithms 7.3.1 Delete-and-build algorithm This algorithm was introduced by LS80] as a part of their divide-and-conquer algorithm. An equal algorithm has also been discussed by GS85]. I have chosen the name, \delete-and-build merge", to distinguish between di erent

74

CHAPTER 7. MERGING DELAUNAY NETWORKS

Figure 7.4: Upper and lower common tangent for two triangular meshes. merge algorithms. The name refers to the necessity of deleting some triangle edges along the boundary of the triangulations before new edges tie the meshes together. LS80]'s algorithm is based on TR and TL's outward boundaries being convex hulls. Still, it is possible to make similar procedures even if the boundaries not are convex, but it is more dicult to locate the upper and lower tangent (Figure 7.4). Point by point the algorithm for merging TL and TR goes: 1. Lower and upper common tangents for TL and TR are found (Figure 7.6). The lower tangent, between L0 and R0, is set to be the base line for further merging operations.

Figure 7.5: The \bubble" swells from the base line until it reaches a point. 2. The next step is to nd the closest neighbour of this base line. GS85] describes the search for the closest point as a bubble rising from the base line (Figure 7.5). The rst point reached by this bubble is the Delaunay neighbour of the base line. As we can see, some of the triangles along the boundaries have to be removed because the current triangles of TL and TR have points of their opposite mesh that are interior to their circumscribing circles. A temporary edge between R0 and L1 is added to manage this (Figure 7.6). Diagonal L0L1 remains if  +    in the quadrilateral L0R0L1L2. If not, edge L0L1 is removed and L2 becomes L1 for a new test. The test procedure is terminated when  +   . An equal process must be accomplished for the quadrilateral L0R0R2R1.

7.3. MERGE ALGORITHMS

75

L1 R1 L2

α

R2 β R0

L0

Figure 7.6: If  +  >  L0L1 is removed from the triangular network. 3. When the invalid edges are removed, the correct diagonal of the quadrilateral L0R0R1L1 is chosen (Figure 7.7.a). This diagonal becomes the new base line for further merging operations along the boundary.

R1

R2 L1 L2 R0

a

L0

b

Figure 7.7: (a) The valid diagonal of L0R0R1L1 is stored. (b) The merge process is completed. New edges in T are emphasized. 4. Steps 1 - 3 are repeated until upper common tangent is reached (Figure 7.7.b). The algorithm is comparable to the step-by-step algorithm from Section 2.3.4. The closest neighbour is localized and connected to the network. Still, the search process is much simpler because the number of candidate points is limited and the points are easy to localize in the existing triangular meshes.

7.3.2 Build-and-swap algorithm This algorithm is comparable to the previous one, with one exception. In the delete-and-build algorithm some edges are removed from the data structure,

CHAPTER 7. MERGING DELAUNAY NETWORKS

76

and new edges are included. This section proposes an algorithm where new edges are included but no edges are removed. The invalid edges are swapped to t the new triangular mesh. L1

L1 R1

L0

R1

α

β R0

a

L0

R0

b

Figure 7.8: (a) The valid diagonal of L0R0R1L1 is constructed. (b) Adjacent edges of the constructed edge are swapped. 1. The upper and lower common tangents are constructed. 2. The valid diagonal of the quadrilateral L0R0R1L1 is located and constructed. Further, the new part of the network has to be tested and, if necessary, updated. In Figure 7.8.a L0L1 is tested as a diagonal in its enclosing quadrilateral. The diagonal is swapped if  +  > . For each swapped edge, the four edges of its enclosing quadrilateral have to be tested as diagonals in their respective quadrilaterals. 3. In Figure 7.8.b the mesh is updated and R0L1 from Figure 7.8.a becomes L0R0 and represents the new base line for the merging operations to proceed from. 4. The process terminates at an upper common tangent. The nal network is equal to the one shown in Figure 7.7.b. A variant of this algorithm is to include all the new edges in the mesh before any of the \old" edges are swapped. The new edges then have to be stored in a temporary list.

7.3.3 Merge-and-swap algorithm This section introduces an algorithm that is somewhat di erent from the two previous ones. While the delete-and-build and build-and-swap algorithms include new edges during the merging process, this algorithm only reorganizes existing edges. This is possible because the edges on the boundary of TL and TR are kept identical. These edges should cover the whole boundary between

7.3. MERGE ALGORITHMS

77

and TR. When two equal edges are melted together, there is reorganization of the invalid edges along the boundary. It is important to keep the triangular meshes 100% in accordance with the circle criterion to make this kind of merge operation possible. Consequently every point along the boundary is a vertex of a triangle, even if it lies on the boundary edge. In that case, the three vertices of the triangle lie on a line and represent a triangle with area = 0. This phenomena is discussed in more detail in Section 4.3.2.1. TL

A

A

B

A

B

B

a

b

c

d

Figure 7.9: (a). Two meshes with a common edge are triangulated separately. (b) The identical edges are melted together. (c) The rst edge is swapped and its enclosing edges have to be tested. (d) The nal mesh. Swapped edges are emphasized. 1. The boundary between two adjacent triangular meshes is dened by a line connecting two points. These points have to be part of both the adjacent networks. The connecting line between the points forms an edge which is identical for the two meshes (Figure 7.9.a). 2. After each mesh is triangulated, the two identical edges are \melted together" to become one edge. This is a simple operation when using the twin edge structure described in Section 4.2.3. The identical edges are simply set to be twin edges of each other (Figure 7.9.b).

78

CHAPTER 7. MERGING DELAUNAY NETWORKS 3. The boundary edge and its enclosing quadrilateral are inputs for the maximum angle-sum test. The diagonal of this initial quadrilateral probably has to be swapped. When it is swapped, the edges of the quadrilateral and their enclosing quadrilaterals are inputs for a new test (Figure 7.9.c). 4. Step 3 is repeated recursively until no more edge swaps are demanded by the maximum angle-sum test (Figure 7.9.d).

As we can see, only edges from the initial meshes are members of the resulting triangular mesh. Yet, some of these edges have a di erent location. The validity of this result can be shown by a small example. The example uses Equation 7.1 where n is the number of nodes, b of which are on the boundary GS85]. Number of triangular facets = 2n ; b ; 2 (7.1) Example: Two triangular meshes, consisting of 350 points each, are to be merged. In this example, 4 points are situated on the boundary of each network. The resulting network has 6 points on the boundary (Figure 7.10).

Figure 7.10: The nal mesh has 6 points on the boundary. Number of triangles in the meshes before they are merged: 2  (2  350 ; 4 ; 2) = 1404 Number of triangles in the nal mesh: 2  700 ; 6 ; 2 = 1404 }

Evidently the number of triangles, and thus the number of triangle edges, is constant during the merge operation.

7.4 Discussion of the algorithms 7.4.1 Running time As with the triangulation routines, the running time of the merge process is somewhat dicult to estimate. The point distribution has a decisive in uence on the running time.

7.4. DISCUSSION OF THE ALGORITHMS

79

LS80] shows that the running time for the divide-and-conquer algorithm is about O(n log n). This complexity is partly bounded by the running time for the delete-and-build merge. The running time of the algorithm depends on the searching routines for the localization of neighbouring points. The closest neighbour of the baseline can easily be found from the existing triangular networks. Building new edges between two meshes is an O(n) operation. In the build-and-swap algorithm invalid edges are swapped after new edges are introduced. The swapped edges are identical with the deleted edges from the delete-and-build algorithm. I estimate that the process of deleting and building new edges is slightly more time consuming than updating the existing ones, because the existing edges keep their location in memory. On the other hand, it will sometimes occur that an edge is swapped more than once by the build-and-swap algorithm. Still, this is not a large problem, because usually only a few edges are swapped due to the insertion of an new edge. Compared to the two other algorithms, the merge-and-swap algorithm only swaps edges in lieu of building new ones. The worst case running time of this algorithm is O(n2), but as in the incremental triangulation algorithm, O(n2 ) never occurs for any practical purpose. If we keep n small, an O(n2 ) algorithm is fast because of less testing and less handling of exceptional cases (Figure 6.7).

7.4.2 Stability of the algorithms The simple algorithms are often the most stabile. The merge-and-swap algorithm is very simple. Only a few program lines are necessary as a supplement to the existing triangulation routines. Procedures for the delete-and-build and build-and-swap algorithms are much more complex and several exceptional cases have to be handled. Very rare situations are dicult to predict, so it is important to run the procedures through an extensive testing program.

7.4.3 Advantages and disadvantages It is important that a merge algorithm is both time ecient and stabile. Further, the merging of generalized triangular networks is of considerable interest since when generalized meshes are merged, a lot of additional points appear in the triangles along the boundaries. A merging routine should consequently be able to handle these additional points. In the delete-and-build algorithm an extra data structure has to be constructed to handle interior points of the deleted triangles along the boundary. When new edges are constructed, the interior points of the new triangles are extracted from this additional data structure.

80

CHAPTER 7. MERGING DELAUNAY NETWORKS

In the merge-and-swap algorithm additional points are stored in lists which are attributes to the triangles (Section 4.1). The structure for the point storage is updated for each swapped edge and is intact during the merging process. Consequently the operations become heavier when the number of additional points in the boundary area is large. The same point handling structure can be used in the build-and-swap algorithm if all additional points are interior to the meshes before these are merged. If additional points lie in the zone between two meshes, an extra point handling structure will have to be used. In my triangulation program I have used the merge-and-swap algorithm because of its stability and the possibilities it gives for handling additional points. Section 8.1 shows how large areas are divided into smaller blocks, triangulated and nally merged. A combination of the incremental triangulation algorithm and the merge-and-swap algorithm is most e cient when the area is divided into quite small blocks. I would consider using the build-and-swap algorithm to merge very large blocks, because this algorithm is more time e cient when there is a long boundary between two meshes.

7.5 Merging generalized triangular networks Chapter 5 discusses how a terrain surface is generalized by disregarding certain points. Will it be possible to merge the generalized triangular meshes TL and TR ? The meshes are genuine Delaunay triangulations and can consequently be merged by using the algorithms from Section 7.3. But, when TL and TR are generalized meshes, it is advantageous that T gets the same level of generalization. Accordingly the generalization has to be taken care of in the area in uenced by the merging process. Though it is possible to use any of the three merging methods for this task, this section only concentrates on the merge-and-swap algorithm.

7.5.1 Generalization along the boundary between two adjacent meshes When TL and TR are merged, a certain number of triangle edges are reorganized in the boundary area. Points that lie inside the in uenced triangles will consequently be at new distances to the planes dened by their enclosing triangles. If any point exceeds the predened threshold (Chapter 5), this point is to be included in the mesh. Accordingly every triangle that is in uenced by the merging operation has to be examined to localize possible splitting points. The opposite case might also appear. When networks are merged, some points along the boundary may cause very poor contribution to the surface model represented by T . It is possible to test and, if required, remove such points.

7.5. MERGING GENERALIZED TRIANGULAR NETWORKS

81

But this kind of operation is time consuming and has to be weighted against the disadvantages of keeping the points. The network will not be less accurate if these points remain. Probably it is more accurate in the boundary area. The main disadvantage of keeping them is their requirement for computer resources. Consequently, the data model becomes slightly larger. In the present merge algorithm, points that probably are redundant in T are removed from TL and TR before these are merged. False point

Figure 7.11: Triangles which are adjacent to a false point should not enclose any additional points. When two meshes are merged by the merge-and-swap algorithm, two of the points exist in both of the networks. These points denote the endpoints of the boundary edge between the meshes. For many purposes it is advantageous to keep this boundary parallel to the coordinate axis (Section 8.1.1). Consequently false corner points of TL and TR may have to be constructed. Because the z-values are unknown for the false points, they can have no in uence at the calculation for the generalization. Consequently, every point along the boundary of the area is included in the mesh, so that no additional points lie inside adjacent triangles of the false points (Figure 7.11). The result is a generalized network with an \ungeneralized boundary area". 1. In Figure 7.12.a, TL and TR are generalized meshes that are going to be merged. The meshes are quite generalized to emphasize the various steps of the algorithm. 2. It is obvious that several points close to the boundary of TL and TR will be redundant in T . Therefore, every neighbouring point of the false points is removed from the network before any merging operation starts (Figure 7.12.b). 3. TL and TR are merged by the merge-and-swap algorithm (Figure 7.12.c). 4. Points that lie inside the triangles that are in uenced by the merge operation are candidate points in a re-triangulation. Points that are further from the triangle planes than the predened threshold are subsequently included in the mesh again (Figure 7.12.d). Algorithms from Section 6.1 are used for point deletion. The removed points are stored as attributes to their enclosing triangles according to Section 4.1. The false points have no mission inside the mesh, and are not stored

82

a

CHAPTER 7. MERGING DELAUNAY NETWORKS

b Data point False point

c

d

Figure 7.12: (a) Two generalized meshes triangulated separately. (b) Neighbouring points to the false points are removed from the net. (c) The meshes are merged. (d) The in uenced triangles are re-triangulated. as attributes to any triangle. Genuine corner points on the other hand, are handled in the same way as boundary points. These corner points, which are members of the original data set, are part of the mesh by virtue of their x, y and z values. When several meshes are merged, some of the genuine corner points will be situated inside the resulting mesh. Consequently it is necessary to check if these corner points are redundant. Some few points that make a poor contribution to the model might remain in the resulting mesh in spite of the steps that are taken to maintain the generalization in the boundary areas. Still, the number of such points is very small, and there is no benet from testing more points for redundancy. Figure 7.13 shows a practical example where some boundary points are temporary removed from the blocks of triangular network before these are merged. Figure 7.14 shows the same area triangulated in one operation. The nal triangulations of the two methods are not identical, but we can see how the triangle density is similar for the various parts of the area.

7.5. MERGING GENERALIZED TRIANGULAR NETWORKS

Each block is triangulated separately

The blocks are merged

83

Boundary points are removed

The boundary area is retriangulated

Figure 7.13: Points along the boundary of generalized networks are temporary removed before the blocks are merged.

84

CHAPTER 7. MERGING DELAUNAY NETWORKS

Figure 7.14: The area of the previous gure triangulated in one operation.

Chapter 8 Block-Based management of the surface model Particularly for terrain surfaces, data sets for surface modelling very often consist of a huge number of points. When the surface model is used for a practical purpose, only parts of the set may be necessary for computer processing. If there are proper routines for merging triangular meshes, this means that we can handle data sets with an endless number of points. When the requested calculations are completed in certain areas, this part of the network is removed from the computer memory. New areas can then be merged to the network and the surface model will behave like a seamless model. It also means that large data sets can be handled by small computers, where memory is a serious limitation. Working in smaller areas separately is also much faster than handling large, heavy models in one operation. The generalization feature depends on an ecient data structure for handling additional points. When these points are stored in lists that are subordinated to the triangles, no extra calculations have to be executed to locate the points that lie inside the triangles. But this makes the incremental algorithm run slower when a huge number of points lie inside each triangle. It is slower especially in the beginning, when the area is covered by large triangles. If the area is partitioned into smaller blocks, the triangulation is much faster despite the blocks having to be merged at the end of the process. Further, when there are large areas to triangulate, it is necessary to \swap" computer memory to the disk. Thus it is advantageous to partition the area into blocks, where the data for each block is localized together in memory. The \partitioning method" is also useful for triangulation on parallel computers where the data blocks can be triangulated simultaneously in di erent processors.

85

86CHAPTER 8. BLOCK-BASED MANAGEMENT OF THE SURFACE MODEL

8.1 Triangulation in blocks Large problems usually become simpler and can be handled more eciently when they are split into smaller problems. This is also true for triangulation programs. This section shows how the model can be divided into submodels, triangulated and then merged. Some e ects of the method are discussed.

8.1.1 Dividing the data set into blocks The basis for the triangulation is a set of points which is situated on the surface we want to describe. Each point consists of a position in the 3 dimensional space. In addition there can be some qualitative data for the points, but this section will only concentrate on the handling of the spatial coordinates.

a

b

c

Figure 8.1: Methods for subdivision of the data set. Before doing the block-based triangulation, the data set has to be divided into smaller subsets. The data set can be divided into a predened block pattern, or the size and shape of the blocks can be determined from the point scattering. Figure 8.1 shows various methods for the division of the data set. In Figure 8.1.a the data set is divided into predened blocks. The partitioning is fast because the boundaries between the blocks are parallel to the coordinate axis. The method is well suited for uniformly distributed data sets, but when the point scattering di ers over the area, some of the blocks might be empty. Figure 8.1.b shows a block conguration that is better adapted to this situation. The blocks are split by a point quadtree method Sam84]. If there are too many points inside a block, this is split into 4 new ones. The split point is given from the point scattering so that each sub-block is composed of an equal number of points. Using a k-d tree may be an even better method for this subdivision. A simpler way of managing the problem, is to use a region quadtree method where the blocks are split into equally-sized sub-blocks. The partitioning process is terminated when no blocks exceed the maximum number of points. But this last method can also result in some empty or almost empty blocks. The merge-and-swap algorithm requires well dened boundaries between the blocks. Consequently it might be necessary to include \false corner points"

8.1. TRIANGULATION IN BLOCKS

87

in the blocks, especially for the data set in a random point distribution. The false points are removed from the triangulation after the blocks are merged. Figure 8.1.c shows how the data set can be divided into blocks where the corner points are members of the data set. It is advantageous to construct the block boundaries along break-lines (Section 9.2) when information concerning sudden variation in the surface is given from the data set. No reorganization of edges is required when two adjacent blocks that share this \natural boundary" are merged. The determination of corner points, and especially the sorting of points over lines that are not parallel to the coordinate axis, will be more time consuming for this kind of block partitioning.

8.1.2 Triangulation of the blocks The triangulation of each block is discussed in detail in Chapter 2. On conventional computers the blocks are triangulated in sequence, while they can be triangulated in parallel on multiprocessor computers (Section 8.2). It is also possible to do the parallel triangulation by distributing the data set on several computers that are connected in a network.

8.1.3 Merging the blocks After each block is triangulated, they are merged one by one until a continuous network covers the area. Any false corner points have to be removed after the blocks are merged. The boundary area has to be handled as indicated in Section 7.5 when a generalized network is constructed in a block set that includes false points.

8.1.4 Triangulation in blocks, eciency improvements The theoretical worst case behaviour of the incremental algorithm is O(n2) while practical tests show a running time of O(n log n). But the importance of the running time for the triangulation part will decrease when the point set is divided into sub-sets and n becomes smaller. When a lot of blocks is generated, the in uence of the \merge running time" grows. However, the situation from Figure 6.7 is still valid, which means that O(n2) algorithms can be convenient when n is small. The beginning of Section 8.1 claims that triangulation in blocks is more ecient. Some experiments have been carried out to test this contention. Gridded data points were used as the basis for the experiments, and areas of various sizes were triangulated both in one operation and by the block method. The incremental algorithm is used for generation of the network while the merge-and-swap algorithm is used for the merge operations. Figure 8.2

88CHAPTER 8. BLOCK-BASED MANAGEMENT OF THE SURFACE MODEL t (s)

1500

4Mb, no partitioning 1000

20Mb, no partitioning 4 and 20Mb, partitioning into blocks of about 80 points

500

50000

100000

150000 Number of points in the model

Figure 8.2: Time consumption from some experiments. shows the time used for triangulation on a SUN Sparc Station. The test is performed for both 4 MB and 20 MB memory in the computer. The data set is partitioned into blocks of about 80 points when the block method is used. We can observe from the diagram that triangulation on the 4 MB computer becomes very time consuming when there are a large number of points. The main reason for this is that a lot of disk swapping occurs when the whole area is triangulated in one operation. When the area is partitioned into blocks that t the memory better, the disk swapping is dramatically reduced and the increase in eciency in terms of time is considerable. The corresponding di erence is less on the 20 MB computer. This is because most of the model is kept resident in memory. Some of the di erence between the partitioning/no partitioning curve, is a result of many points inside large triangles at the beginning of the one-block triangulation. A lot of calculations have to be executed to keep the additional point structure intact (Section 4.3.2.2). If the triangulation process was separated from the additional point handling structure, the triangulation itself would have about linear running time for practical cases.

8.1.5 Optimal size of the blocks Experiments were also carried out to determine the optimal block size when the incremental triangulation algorithm was used together with the mergeand-swap algorithm. Figure 8.3 di erentiates between the time used for the triangulation of the blocks and the time required for the merge operation. The data set in this experiment was 3969 gridded points. With this small data set no disk swapping occurs. The experiment, which was run on a 20 MB Sparc Station, shows that the curves cross each other when the blocks consist of about 5 points each. It is also interesting to observe that this will be about the optimal block size when the two curves are added. But in addition we need some routines for the administration of the dividing and merging processes. So the experimental results from this program, as it runs at the moment, gives an optimal block size of about 15 - 40 points for the total process (Figure 8.4).

8.1. TRIANGULATION IN BLOCKS

89

Triangulate blocks + merge blocks t (s)

Triangulate blocks Merge blocks

6 5 4 3 2 1 100

200

300

400

500

5000

Number of points per block

Figure 8.3: Time consumption from some experiments. Triangulation and merging separated. These administration routines can be improved, so that the optimal block size will decrease. t (s)

25

20

15 40 80 20 60 100

1000

2000

3000

4000

16000

Number of points per block

Figure 8.4: Computing time as a function of block size. Test results when 16129 points are triangulated. The experiments were also done with data sets of randomly distributed points. The shape of the curves turned out to be similar to the ones shown in Figures 8.3 and 8.4. Still, the triangulation of a random point set takes more time than the corresponding triangulation of the gridded data. When the area is triangulated as one block, the time used for the gridded data set was 88% of the time used for the random data. This is in accordance with the results from Section 3.4 which show that the triangulation of a gridded point set gives 87% of the edge swaps that appear when the points are randomly distributed. When we use optimal block size, the time consumption is reduced to about

90CHAPTER 8. BLOCK-BASED MANAGEMENT OF THE SURFACE MODEL 63% and 75% of the one block triangulation for the gridded and random point sets respectively. It is important to emphasize that the optimal block sizes found in this section refer to the triangulation when no generalization is introduced. As it is sought to maintain the same level of generalization in the boundary areas, merging these blocks becomes more time consuming when the number of blocks grows. The running time of this operation depends on the corner points. The block method will be ecient for generalized networks when points from the data set are used as corner points in the blocks. In addition to the optimal block size for triangulation, there is another optimal block size that ts the computer memory. When the blocks are well adapted to the memory less disk swaps are performed by the computer. The size of these blocks depends on the computer conguration and di ers from one computer to another. Using blocks that are adapted to the memory will also be more ecient for block triangulation of generalized models, even if false corner points are used.

8.2 Triangulation in parallel The block method is of course a lot more ecient if we use a parallel computer. When the data set is split into sub-sets by a quadtree method, these subsets are each assigned to their own processor for further splitting. An even better method for splitting the data set is to use an adaptive k-d tree method Sam84]. It is important to balance the tree when it is split Mid87]. The k-d tree can be better balanced than the quadtree. The triangulation starts when each block consists of a convenient number of points. After the blocks are triangulated separately in di erent processors, two and two blocks are merged, also in parallel. Figure 8.5 outlines how hierarchical parallel triangulation can be executed. Triangulation of each block.

Triangulated area

Point set

Partitioning into blocks depending on number of processors and the point distribution.

Two blocks merged together in each processor.

Further merging.

Figure 8.5: Triangulation in parallel I. The parallelization results in a more adequate running time for the total triangulation process. The running time of the triangulation and merging

8.3. STORAGE OF LARGE TINS ON DISK

91

algorithm depends very much on the point scattering, while the changes in the running time from serial to parallel algorithms are more plain. When Ct is the running time for triangulating one block, and Cm is the running time for the p merging, O(n + Cpt2 + Cm (1 ; 2; log p)) will be the running time of the parallel triangulation in Figure 8.5 ( oys]). p is the number of processors and n is the number of points in the entire data set. The rst component represents the partitioning of the data set, the second component is the running time of triangulating the blocks in parallel, while the last component represents the merge operations. Another way of triangulation in parallel is scheduled in Figure 8.6. The data set is divided into blocks like in Figure 8.1, and one processor distributes the blocks for triangulation on the other processors. The primary processor provides that the other processors are employed in an ecient way. P1

P2

P3

P4

P5

Pp

Figure 8.6: Triangulation in parallel II.

8.3 Storage of large TINs on disk For many purposes it is advantageous to store the TIN structure itself on disk. This is specially the case when fast access to a huge model is essential. A large model is hard to handle, and it will be necessary to divide the TIN into smaller units before it is stored on the disk. Only parts of the TIN need to be loaded into the computer memory for future processing and calculations. The size of the TIN storage blocks may depend on: The capacity of the computer The shape of the surface The purpose of the model It is important to notice that the TIN storage blocks likely di er from the optimal blocks in the block triangulation (Section 8.1.5). When the model is generalized very few triangles may represent a large area, even when a lot of data points are sampled in this area. Consequently, the TIN storage blocks

92CHAPTER 8. BLOCK-BASED MANAGEMENT OF THE SURFACE MODEL become smaller for a broken surface. When no generalization is imposed, the number of triangles is given directly from the number of points in the data set. Still it is most likely that the TIN storage blocks are larger than the TIN blocks for triangulation so that they form sub-models that are suitable for computer memory and well shaped for the tasks we are going to solve. Disk

Triangulation and merging of blocks

Partitioning the data set into blocks depending on point distribution and density.

Partitioning the TIN into blocks depending on triangle distribution and density.

Figure 8.7: Blocks during triangulation and blocks for disk storage. Figure 8.7 shows how the number of points determines the block size during the triangulation, and how the number of triangles can determine the block size for disk storage. In this example the TIN blocks for triangulation are divided into four new blocks when the number of points, np, exceeds the maximum number, Np, for each block. Similarly the TIN storage blocks are split when n4 > N4. It is of course possible to change N4 for certain areas. It is obvious that nationwide terrain models of high resolution consume a lot of disk space. A possible method is to store a generalized TIN model where additional points are listed for each triangle. When we need certain areas of higher resolution, it is possible to rene the network for the required blocks. This method makes it possible to store TIN structures for large areas, avoiding too much data being stored on the disk. Further, it is faster to make a TIN of high resolution than if the TIN has to be constructed from the beginning. Example: In coastal areas ships need information about the bottom of the sea. Together with an accurate navigation system, a digital terrain model of the sea oor is an important part of a modern sea map system. Figure 8.8 shows a ship under way while TIN storage blocks representing the bottom of the sea, are loaded into the computer's memory on the ship. The TIN storage blocks are for example rough networks which are rened when there are shallow waters in front of the ship. When the ship has passed a TIN storage block, the computer memory allocated to this block is released, and a new block can be included ahead of the ship.}

A huge number of additional points may be subordinated to the triangles when rough TINs are stored on disk. For at areas these points are rarely used and it is not a good idea to store them together with the triangles. Consequently it can be convenient to have an extra point handling structure for

Figure 8.8: Use of TIN blocks. certain purposes, especially when the sample method produces a lot of points. A combined method can also be convenient. If the additional points are divided into classes like in Section 5.3, some of the classes (the most used ones) can be stored together with the triangles, while points of the highest and least used resolution can be kept in an extra data structure. This data structure stays unread on disk until it is requested by high resolution modelling.

8.3.1 Dividing the TIN into storage blocks This section discusses some strategies for partitioning the triangular irregular network that is to be stored on disk.

8.3.1.1 Delete edges The rst method splits the TIN simply by deleting the edges that are crossed by a boundary line. Figure 8.9.a shows the original network, while Figure 8.9.b shows the two separated blocks when the triangle edges crossed by the dashed boundary line are removed. When these blocks are read from disk and are to be merged again, it is necessary to rebuild the edges along the boundary. The blocks can be merged by using the delete-and-build or the build-and-swap

94CHAPTER 8. BLOCK-BASED MANAGEMENT OF THE SURFACE MODEL algorithms. Still, if the blocks are not updated, the boundary zone will also be unchanged. Consequently no deletion or swapping is required and the networks are merged by only building new edges.

b

a

Figure 8.9: Deleting boundary edges.

8.3.1.2 Split edges The second method divides the TIN by splitting the triangle edges along the boundary line. Figure 8.10 shows that every boundary edge is split and will be represented in both blocks. The twin-edge data structure (Section 4.2.3) is well suited to this kind of split. It is only necessary to separate the twin edges along the boundary from each other. When the blocks are to be merged again the identical twin edges are connected to each other, or in other words, we can use the merge-and-swap algorithm. Edge swapping only occurs if one or both of the merged blocks are updated when they are separate.

Figure 8.10: Splitting boundary edges.

8.3.2 Addressing the blocks A well arranged addressing system has to be introduced to store blocks in an ecient and systematic way. The TIN can be partitioned into storage blocks, for instance, by a quadtree method. The number of triangles in certain areas decides how many levels the quadtree will get. Bj92] describes how the Morton index, together with a level value, gives the position code for a block

8.3. STORAGE OF LARGE TINS ON DISK

95

in a quad-tree. By using Morton indexes a 2 dimensional quadtree structure is transformed into a set of 1 dimensional key values. Figure 8.11 shows how 200

220

210

230

000

320 322 100

120

300 321 323

110 112

330 332 130

111 113

310 331 333

Figure 8.11: Global address. the TIN storage blocks from Figure 8.7 are addressed. The addressing area is bounded by a square even when the surface model is shaped otherwise. In such a case there will be some \empty blocks" in the addressing area. The Morton index, together with a local address for the edges in a block, forms a global address (Figure 8.12). The global address is a prerequisite to keep information about neighbour relationships between every triangle in the entire model. Global edge index Mortonindex for quadtree block

Local edge index

Figure 8.12: Complete address.

8.3.2.1 Block addressing All the edges need a unique address in the model. Nevertheless the Morton index will be equal for every edge in a given block. To avoid too much data being stored, the Morton index can be kept in the heading of each block only. In addition parameters for the corner points can be given in the heading. Figures 8.9 and 8.10 indicate that the global addresses are only given for the blocks. When the blocks are read from disk, the local edge address and the Morton index from the heading together dene a new unique address in computer memory.

8.3.2.2 Edge addressing Figure 8.13 schedules a TIN that is sub-divided by the split edge method, where every edge has been given information about its site in the global network. As the gure shows, the boundary edges have pointers to their twin edges in the adjacent block.

96CHAPTER 8. BLOCK-BASED MANAGEMENT OF THE SURFACE MODEL

Figure 8.13: Edge addressing.

8.3.3 Comparison of the methods The block addressing method requires less space for the address. The local address is only stored for each edge, while the global address is stored once for each block. The variant where edges along the boundary are deleted, is less convenient when we want to keep the additional point handling structure intact. No extra calculations have to be executed when two networks stored by the edge addressing method are merged. The triangle edges can be loaded directly into the computer memory. Still, this method requires more disk space for the storage of the addresses. The block addressing method requires the construction of new boundary edges, or the redenition of boundary edge pointers, from the given corner parameters. It is best to keep intact triangles along the boundary for both methods. This will make it possible to update one block, by including more points, independently of the neighbouring blocks. When such blocks are merged again, triangles along the boundary, which do not t the circle criterion, have to be reorganized. The reorganization of the boundary area may be executed when we need to use the blocks, or as a batch job after the blocks are updated. By using the delete edge method, the updating of the boundary area becomes very cumbersome.

Chapter 9 Use of the Delaunay triangulation Like the Voronoi diagram, Delaunay triangulation is a fundamental and very useful geometrical construction dened by irregular lattices. The geometrical conditions for Delaunay triangulation can be used in various areas of application. This chapter demonstrates some advantages of using TINs for various calculations and visual representations of the model. Hence two algorithms for a short search path between two points in the TIN is proposed. A terrain model represented by a 2D TIN has some limitations because the terrain is projected in the horizontal plane. Section 9.2 outlines these problems. PS85] describes some tasks where the Delaunay/Voronoi diagram is the basis for solving a problem. For one thing PS85] shows that the \all nearest neighbour problem" can be solved in linear time out from the Delaunay triangulation. They also show how the Voronoi diagram is used to localize the Euclidean Minimum Spanning Tree (EMST) for a set of points. The EMST is a tree of minimum total length whose nodes are the points in the data set. This tree will be a part of the Delaunay triangulation (Figure 9.1).

Figure 9.1: The EMST is a part of the Delaunay triangulation.

97

98

CHAPTER 9. USE OF THE DELAUNAY TRIANGULATION

9.1 Searching path between two points For many problems it is necessary to move from one point to another in the triangular mesh. Accordingly it is interesting to locate a short way between the two points. As far as I know this subject has found less attention in the literature. Consequently this section introduces some theory and algorithms for moving between two points in a TIN.

9.1.1 Moving a step closer One method is to move step by step to nd the path between two points. For each step we move in a Delaunay triangulation, we reach a point which is closer to the point we are searching for.

Theorem 9 Assume a node, D, in the triangulation Tn , and that the boundary of Tn is the convex hull of the data set. Any other points in Tn than D is a vertex in a triangle in which one of the two other vertices lies closer to, or is equal to D. B β

A

D α C

Figure 9.2: A triangle where the angle in A spans D. Proof: Figure 9.2 shows a triangle, 4ABC , and its circumscribing circle, ABC . Figure 9.2 also shows 4BDC . 4ABC represents any triangle from the mesh where D is spanned by the angle in the starting point (A). Any node of Tn is a vertex in a triangle like this. For these triangles, either BD or CD is shorter than AD. In 2ABDC we know that  +   (Theorem 1). Consequently either  or  (or both) is greater than or equal to =2. In Figure 9.3 a segment of Figure 9.2 is shown for  =2. It is known from standard trigonometry that b2 = a2 + e2 ; 2ae cos  (cosine rule). This equation can here be written as b2 = a2 + e2 + 2aej cos  j (9.1) since ( 2    ) From Equation 9.1 it is easy to establish that b > a if e > 0.}

9.1. SEARCHING PATH BETWEEN TWO POINTS

99

B β

e

a

A

D

b

Figure 9.3: A segment of the previous gure. D

B C A

Figure 9.4: D does not need to be a neighbouring node of the initial triangle. It is important to notice that D not necessarily is a neighbouring node of B and C . (Figure 9.4) shows that either 6 ABD or 6 DCA is greater than =2 because D is outside ABC .

9.1.2 Algorithms for point search This section describes two algorithms, the direction search and the distance search, for localization of a short path between two nodes in a Delaunay triangulation.

9.1.2.1 Direction search 2 1 A

3

D

4

Figure 9.5: The direction to the searched point lies between directions 3 and 4. 1. The direction (angle) to the searched point is calculated. Further, directions from the initial point to the neighbour points are calculated.

100

CHAPTER 9. USE OF THE DELAUNAY TRIANGULATION

2. When the two directions that span the direction to the searched point are localized, further calculation is super uous. 3. The point opposite to the initial point at one of the \neighbouring direction lines" is chosen as the next initial point. 4. The routine repeats itself until the searched point is reached.

9.1.2.2 Distance search d2 d1 A

d3

D d4

Figure 9.6: d3 is the shortest distance from a neighbouring node to the searched point. 1. Distances from the initial point to its neighbouring nodes are calculated. From Theorem 9 it is known that at least one of the neighbouring points lies closer to, or is equal the searched point. 2. The neighbouring node that is closest to the searched point is chosen as the next initial point. 3. The routine repeats itself until the searched point is reached. When the distances from the points around the initial point are calculated successively, the calculations may be terminated when the distance has reached a \minimum" and starts growing again.

9.1.2.3 Additional comments The rst algorithm may be a little bit unstable because of the calculation of the angles. The second algorithm is more consistent because the calculation of the distances is unequivocal. A combination of the two algorithms may also be a convenient solution. If the searched point is not a node in Tn, it might be interesting to localize its enclosing triangle. The distance algorithm is used to nd the nearest neighbour of the current point. If the closest neighbour is not a vertex of the enclosing triangle, the triangle is localized by determination of the triangle edges crossed by the straight line between the closest neighbour and the searched point.

9.2. BREAK-LINES

101

9.2 Break-lines Delaunay triangulation is well suited for storage of models of continuous surfaces. However, in a terrain model sudden variations sometimes occur (precipices etc.). A plain Delaunay triangulation in 2 dimensions will not detect such variations. When information about the discontinuities is given in the data set, this information can be included in the model as break-lines, before or after the triangulation. Hel90] describes an algorithm where break-lines are inserted in the TIN after the triangulation. This insertion leads to some reorganization of the existing network. The nal lattice will not meet the circle criterion any more, but contains certain areas of long and thin triangles. Figure 9.7 em-

Figure 9.7: The break-lines in uence at the mesh. phasizes a break-line and the polygon that encloses the mesh in uenced by the break-line. As I see it, it will be preferable to include the break-lines early in the triangulation process. Then fewer triangle edges have to be updated. In the further triangulation the break-lines become a limitation for the spreading of the edge swapping after a point is inserted. Consequently less edge swaps will appear. In modelling by Delaunay triangulation the surface is rst projected on the horizontal plane and subsequently the best geometry for the triangles is achieved. However, triangles that are well shaped in the horizontal projection can become worse shaped when they are projected on the surface in steep areas. Figure 9.8 shows these e ects when an equilateral triangle representing a steep area is projected on the horizontal plane. Some recent literature describes how this can be utilized for better surface modelling. However, this feature needs further exploration concerning algorithms for terrain models and running time for these. The break-lines can be seen in connection with the last feature. Breaklines are introduced to make better models in steep areas. The long and thin triangles in Figure 9.8 may be well shaped when they are projected on the terrain surface. Systematic, but less signicant information can also be taken care of by break-lines if it is desirable. Figure 9.9 shows contour lines for a terrain surface that includes a couple of minor ridges. They have both the same height, but

102

CHAPTER 9. USE OF THE DELAUNAY TRIANGULATION Horizontal projection of the triangular plane

Triangular plane projected on a steep terrain

Figure 9.8: A triangle on a steep surface and its horizontal projection. one of them has a larger extension and may be more important to maintain in the model. One or more break-lines along such details can make the model better suited for certain purposes.

Figure 9.9: Terrain including a long and a short ridge.

9.3 Visual representation of the TIN The triangular mesh itself is primarily a data structure that represents the surface. However, because the TIN is well adapted to the surface, it can be used to visualize the surface and special surface characteristics. This section shows how traditional cartographic theory for terrain representation, together with the TIN, can be used as a basis for the automatic construction of maps of topographic and thematic character.

Triangular Irregular Network. An area close to Volda is used to demonstrate the various methods. Figure 9.11 shows the triangular network of the area. The 100m by 100m height data base for Norway is a basis for the model. In Figure 9.11 a threshold value of 10 m is used during the triangulation. The original data set consists of 56481 points, while the triangular network in this model is based on 19694 points. In the triangular model we can distinguish between at and mountainous areas. The large at areas that are covered by large triangles represent the sea, and we can clearly see the contour of the fjords in the TIN map. Contour lines. A contour map for the area is shown in Figure 9.12. The

contour lines are constructed directly from the TIN model by linear interpolation. No line smoothing is executed and no special consideration is taken. The

9.3. VISUAL REPRESENTATION OF THE TIN

103

contour map is probably the most common way of representing the topography. However, this map is not a 3D visualization of the terrain, but a user will get a 3D interpretation of the terrain by using his own experience and the topology of the terrain. Imh65] gives a good example for 3D visualization by various maps of a cone, and the contour map of this gives no 3D interpretation.

Shading. Analytical shading is a better way of making a 3D picture. Shad-

ing is based on the principle that the lighting of a 3 dimensional form will result in varying amounts of illumination of the varying slopes. The direction from which the light comes makes a signicant di erence. Traditional cartographic theory claims that a light source in the northwest (upper left) corner of the model will make the best 3D picture. The inclination of the light source should be about 45. RSM78]shows some work where Yoe71] performed the shading by calculation of the average inclination and orientation of small rectangular segments. By using triangular elements, the inclination and orientation are given by the normal vector of the plane. The normal vector is simply found by calculation of the cross product between two vectors in the plane. Figure 9.10 shows the triangle and the normal vector. n

a

b

Figure 9.10: The normal vector of a triangular plane.

~n = ~a ~b (9.2) where ~n is the normal vector and ~a and ~b are edges of the triangle. We also need a vector, ~l, that points at the light source. ~l = (1 ;1 1) is a convenient value when the light source is situated in the northwest corner. The grey values of the triangles will be proportional to the angle between ~n and ~l (Equation 9.3). Figure 9.13 shows the Volda area when this method is used. The height values in the model are multiplied by three to emphasize the visual comprehension of the terrain. ~ cos = ~n  ~l (9.3) j~njjlj It is important to notice that this method only shades the surface of the model according to its inclination and orientation. Large objects will not throw shadows on other parts of the area. Slope model. Figure 9.14 shows a shaded TIN when ~l = (0 0 1). That means a light source situated in zenith. The map shows the slope of the terrain. The horizontal areas are white while the grey value is increasing when the terrain is getting steeper. It is interesting to notice the systematic pattern of parallel lines in two directions. This is obviously an error in the 100m

104

CHAPTER 9. USE OF THE DELAUNAY TRIANGULATION

by 100m height data base for Norway. According to the Norwegian Mapping Authorities this error must have been introduced during the transformation from a grid of geographical coordinates to the metric grid of 100m by 100m.

Level map. Figure 9.15 shows a level map for the Volda area. The height

values are divided into 6 classes of di erent grey values. In Figure 9.15 the grey value increases with height. A method where the gray value decreases with height is of the same standing according to Imh65]. By the last method the white for heights can be connected with ice on the tops of the mountains. The boundaries between the levels are rather jagged because the average heights of the triangles x the grey values for the complete triangles. The boundaries would have been smoother and looked better if they were generated by an interpolation in the model. A similar map, where no classication was included, gave a much more fuzzy impression of the terrain. Figure 9.15 shows the height values when they are classied and plotted on the map in the x-y plane. However, the z value can represent variables of various nature as pollution, temperature, precipitation etc. According to Ber81] and his visual variables, the best \seeing map" is drawn when variables representing the largest value get the highest grey value. If Figure 9.15 was describing pollution, it would have been most reasonable to believe that the darkest areas represented the highest concentration of pollution. This are only a few examples about how we by using the TIN can make simple methods to make cartographic presentations of the sampled data. The model representation by plane, triangular facets is well suited for simple calculations. For many purposes the operations can be executed separately on each triangular plane.

9.3. VISUAL REPRESENTATION OF THE TIN

Figure 9.11: TIN model for of Volda area.

105

106

CHAPTER 9. USE OF THE DELAUNAY TRIANGULATION

Figure 9.12: Contour map of the Volda area.

9.3. VISUAL REPRESENTATION OF THE TIN

Figure 9.13: Shade model of the Volda area.

107

108

CHAPTER 9. USE OF THE DELAUNAY TRIANGULATION

Figure 9.14: Slope model of the Volda area.

9.3. VISUAL REPRESENTATION OF THE TIN

0m

0m-255m

255m-510m

510m-765m

109

765m-1020m

Figure 9.15: Level map of the Volda area.

1020m-1275m

110

CHAPTER 9. USE OF THE DELAUNAY TRIANGULATION

Chapter 10 A Tetrahedral Irregular Network In digital terrain modelling we talk about 2.5 dimensional models. This means terrain models where coordinates for three dimensions (x, y and z) are used for the construction of a TIN. However a TIN is always projected on the x, y plane. As overhangs are seldom in terrain surfaces, the 2.5 dimensional model is ecient and well suited for terrain representation. In comparison, a real 3dimensional model for handling terrain surfaces, which often consists of large data sets, probably will be too heavy and inecient. There are still a lot of other elds where a 3D representation is necessary. Underground deposits, for example, are dicult to describe by a 2.5D model. An irregular triangular network in 3D is actually a network that consists of tetrahedra, and EPW86] writes that 3D tetrahedrization is central to a number of applications in numerical computing and in solid modelling. The solution of partial di erential equations by the nite element method and the structural analysis of complex physical solids require the decomposition of a given spatial domain into elementary cells. In their simplest form these cells are tetrahedra. Fie86], FS91], SS88] and SS90] use Delaunay tetrahedrization for the decomposition of solids into nite element meshes for analysis by the Finite Element Method. Here it is important to divide the solids into equal sized tetrahedra. Vertices of the elements are consequently chosen during the tetrahedrization. Delaunay tetrahedrization is used because it is able to create well proportioned elements. Bak89] partitions solids into tetrahedra in the attempt to study turbulent air ows around aircraft. He also refers to the use of tetrahedral models in electromagnetic problems. The Delaunay tetrahedrizations dual, 3D Voronoi diagrams, are useful for many distinct problems. Wat81] refers to the use of 3D Voronoi diagrams in approximation of the interface network in polycrystalline materials. Zan90] uses Voronoi diagrams in the modelling of dynamic expansions of celestial bodies and simulation of SN explosions in active astrophysical space. KV92] shows some interesting examples where time is the third dimension. He applies this technique to study how two situations, described by two data sets, change between times T1 and 111

112

CHAPTER 10. A TETRAHEDRAL IRREGULAR NETWORK

T2. Compared to the 2D Delaunay triangulation, less work is related to Delaunay tetrahedrization in 3D space. Though there are numerous algorithms for triangulation, 3D tetrahedrization algorithms have been given less attention. Wat81] describes an algorithm for the computation of the n-dimensional Delaunay tessellation. When a point is inserted into a Delaunay tetrahedrizated network, certain tetrahedra of the old network have to be changed. Wat81]'s algorithm localizes the enclosing polyhedron of these tetrahedra. When invalid tetrahedra are removed, a new network, including the inserted point, is constructed inside the polyhedron. Fie86] and KG91] show an implementation of this algorithm. KG91] also proposes another algorithm which is closely related to Wat81]'s algorithm. Law72] presents a 2D algorithm where an initial, nonoverlapping triangular network is rened to become a Delaunay triangulation during a set of local transformations (edge swaps). Despite some problems, this method is extended to 3D by Joe89]. The method is later rened, and ES92] presents an algorithm where points are added to the network in an incremental manner. This chapter considers the incremental method for Delaunay tetrahedrization in more detail. In Section 10.1 the geometrical conditions are explored and compared with their 2D version, while the geometrical consequences of the point insertion are discussed in Section 10.2. A data structure for the ecient handling of tetrahedral networks naturally becomes more complicated than in 2D networks. Section 10.3 proposes an edge-based data structure which is well arranged and is ecient for the local reorganization of the network (point insertion/deletion etc.). A recursive incremental algorithm for adaptive tetrahedrization is presented in Section 10.4. This section also refers to how the algorithm handles colinear and coplanar points in a consistent way. The 3D incremental method also allows the qualied selection of points for \3.5D" models in Section 10.5. Future work on the 3D incremental algorithm is proposed in Section 10.6. This includes the handling of huge 3D data sets. Some ideas are also made about n-dimensional Delaunay networks.

10.1 Geometrical condition for 3D Delaunay/Voronoi networks The geometry is described by a tetrahedral irregular network Tn constructed from a given set Sn of n points in 3D space. It is obvious that 3D Voronoi/Delaunay diagrams are more complex and some more dicult to handle than the 2D model. In 2D, simple gures can be drawn to demonstrate the geometry and mathematical rules. A gure on the screen is also very useful when the purpose is to localize errors in a program code. In 3D it is necessary to handle more complex data structures with less graphical support.

10.1. GEOMETRICAL CONDITION FOR 3D DELAUNAY/VORONOI NETWORKS113 A 2D Voronoi polygon is shown in Figure 2.1. The polygon is dened by lines that bisect connection lines between neighbouring points. In 3D the central point is surrounded by a convex polyhedron dened by planes which are limited by a surrounding polygon. These planes correspond to the line segments of a Voronoi polygon. Each plane bisects the line between two neighbouring points of Sn . In the same way as the Voronoi diagram covers the complete area in 2D, a diagram of Voronoi polyhedra will ll the 3D space. The Delaunay diagram is dened by the connection lines between neighbouring points in the Voronoi diagram. When Delaunay triangulation is extended to 3 dimensions, this results in Delaunay tetrahedrization. As three points are necessary to describe a plane in space, at least 4 points describe a volume element in space. The most elementary volume element is a tetrahedron, which is given by 4 points. In 2 dimensions there are no vertices from the network situated inside the circumscribing circle of any triangle. The corresponding situation in 3 dimensions is named the sphere criterion:

De nition 2 A Delaunay network in three dimensions consists of non-overlapping tetrahedra where no points in the network are enclosed by the circumscribing spheres of the tetrahedra.

Figure 10.1 lists the most important geometrical conditions of 2D triangulation together with their 3D versions. The sphere criterion enables an irregular tetrahedral network, Tn , to be constructed on the basis of the points in Sn . The tetrahedrization is still more dicult to handle than triangulation. In 2D four points dene a quadrilateral which can be divided into triangles in two ways (Figure 10.2). Law85] describes two additional gures dened by four points (Figure 10.3), but in my opinion these are only exceptional cases of the quadrilaterals shown in Figure 10.2. The main point is that a quadrilateral can be split into exactly two triangles. That means it is possible to predict the number of triangles that covers an area (Equation 7.1). In 3 dimensions ve points dene a hexahedron. This hexahedron can be divideded into tetrahedra. But, as we can see in Figure 10.4, it can be split into two or three tetrahedra. Consequently it is impossible to predict the number of tetrahedra in the Delaunay tetrahedrization of Sn . The number of tetrahedra not only depends on n, but also on distribution of the points. As an example Fie86] shows that a cube can be decomposed into ve or six tetrahedra and still meet the sphere criterion (Figure 10.5).

114

CHAPTER 10. A TETRAHEDRAL IRREGULAR NETWORK Geometrical conditions

2D

3D

Voronoi diagram of

Voroni diagram of

polygons

polyhedra

Delaunay network of triangles

Delaunay network of tetrahedra

Circle criterion

Sphere criterion

Figure 10.1: Geometrical conditions for Voronoi/Delaunay diagrams in 2 and 3 dimensions.

Figure 10.2: Two possible ways of dividing a quadrilateral into two triangles. B

B

D

A

D

C

A

C

Figure 10.3: Exceptional cases of the previous gure.

10.1. GEOMETRICAL CONDITION FOR 3D DELAUNAY/VORONOI NETWORKS115

B

B

E

A

(a)

E

D

D

A

C

(b)

C

Figure 10.4: (a) Hexahedron ABCDE divideded into two tetrahedra ABCE and BCDE . (b) Hexahedron ABCDE divideded into three tetrahedra ACDE , ABDE and ABCD.

Figure 10.5: Two possible ways of dividing a cube into tetrahedra.

116

CHAPTER 10. A TETRAHEDRAL IRREGULAR NETWORK

10.2 Insertion of points into a Delaunay tetrahedrization Section 3.3 gives an elaborate discussion on how invalid edges are handled when a new point is inserted into the triangular network. To get a complete extension of the incremental triangulation to an incremental tetrahedrization, it is necessary to nd the 3D version of the edge swapping. Intuitively, swapping of triangle planes should be the corresponding operation. However, the 3D swapping is more complicated. When a plane is \swapped", two planes are either removed from or added to the network. Thus, it is more precise to look at the operation as the connection of an inserted points to surrounding points. In 2D the number of edges during the connection process is constant. Consequently existing invalid edges are swapped to meet the circle criterion. The 2D swapping process can be divided into two steps: 1. Remove the invalid edge from a quadrilateral 2. Insert the valid edge in a quadrilateral An invalid edge has no endpoint in the inserted point, but both endpoints are in an neighbouring node of the inserted point. On the other hand, an inserted, valid edge, always has an endpoint in the inserted point. In 2D it is possible to execute these steps in one operation. The second step always depends on the rst one. In 3D new edges usually are inserted in the network before any invalid edge is removed. As a matter of fact, points may be inserted, and new edges constructed, without any invalid edges appearing. The gures in Section 3.3 show how edges are swapped, and which edges that are candidates for the swap operation. In 3D it is more dicult to make proofs for the corresponding conditions. Still, it is obvious that an inserted point is an endpoint (vertex) of every inserted edge. This fact is conrmed by Wat81]. He actually founds his algorithm on this condition. It is more dicult to detect the planes that are candidates for swapping. The basis for my program is that the behaviour of the 3D plane swap is similar to the edge swap in 2D. Some test routines were made to perform controls of the algorithm. Fie86] writes that a reliable indication of proper execution is to check that the total volume of the new tetrahedra equals the volume of the initial tetrahedron. Still, the volume test only tells if the space is subdivided into non-overlapping tetrahedra, not if the tetrahedra meet the sphere criterion (Denition 2). Consequently, a test routine that determines whether any point of the network is inside the circumscribing spheres of each tetrahedron is required. A negative answer from this routine means that the sphere criterion is met, and accordingly we have got a Delaunay network. Some routines for checking that the pointers in the data structure were properly updated was run together with the test routines for volume and sphere. In

10.2. INSERTION OF POINTS INTO A DELAUNAY TETRAHEDRIZATION117 Section 3.3 Theorems 3- 7 show how an inserted point in uences the existing network. This section will draw some parallels, make some assertions, and propose some theorems about the reorganization of edges close to an inserted point in a tetrahedral network. The assertions are discussed in the remarks which are no formal proofs. Still, the validity of the assertions are conrmed by the use in my incremental tetrahedrization program.

De nition 3 A tetrahedron is formed by four triangular planes. The inside of each plane is the side where the central point of the tetrahedron lies.

De nition 4 A sphere is named by the four vertices of the tetrahedron it circumscribes.

Assertion 1 The four new edges, constructed for connecting the inserted point

to the tetrahedral network, never changes during reorganization of surrounding edges caused by insertion of the same point. Remarks: This assertion corresponds to Theorem 2 for triangulation. Because a new, inserted edge obviously dos not o end any edge, I will concentrate on proving that none of the four new edges are removed. It is necessary to be aware of the 3D variant of the circle set shown in Figure 3.4 to proof this theorem. In 3D the chord BD corresponds to a circumscribing circle of a triangle, and the circle set corresponds to a set of spheres. A sphere S 1 which encloses a sphere S 2 on one side of the circle, is enclosed by S 2 on the other side of the circle. In future description this is refered to as the sphere set rule. In Figure 10.12 we have a circumscribing sphere of the initial tetrahedron, ABCD. Further, each new tetrahedron has a circumscribing sphere. It is easy to see, by the sphere set rule, that the spheres of the four new tetrahedra exceed the initial sphere outside the initial tetrahedron only. In Figure 10.6 a cut through the tetrahedron in Figure 10.12 is shown. In the gure both spheres ACDE and ABDE enclose point F outside sphere ABCD. This situation leads to deletion of AD. Inside sphere ABCD this situation never occurs, because due to the sphere criterion no additional points are enclosed by sphere ABCD.}

Assertion 2 Any new edge, formed as the result of an inserted point, will be located with one end in the inserted point.

Remarks: This is not a formal proof, but parallels can be drawn to Theorem 3, where every swapped edge has an endpoint in the inserted point. In Figure 10.13.a E is the inserted point, and ACDE is one of the four new tetrahedra. Tetrahedron ACDF is adjacent to the tetrahedra of the inserted point. The only possible additional connection, is an edge between E and F . If F lies outside the three planes in ACDE that is adjacent to E , it is not possible to draw EF . When F still is interior to sphere ACDE , such a situation leads to the removal of either AD CD or AC .}

118

CHAPTER 10. A TETRAHEDRAL IRREGULAR NETWORK C

E A-D

B

F

Figure 10.6: A cut through the tetrahedron ABCD.

Assertion 3 Any new edge, formed as a result of an inserted point, will not be deleted as a consequence of the same point insertion.

Remarks: In Assertion 1 it is shown how the new edges formed by the point insertion not are deleted. The assertion states that an edge, that is candidate for deletion, has both its endpoints in neighbouring nodes (Delaunay neighbours) of the inserted point.}

Theorem 10 The space inuenced by an inserted point never exceeds the circumscribing spheres of the four new tetrahedra, formed by the inserted point.

Proof: When the point F in Figure 10.13.a lies inside the sphere ACDE , the spheres CDEF ACEF and ADEF will be interior to sphere ACDE on F 's side of the circles CDE ACE and ADE (sphere set rule). As long as F is inside the three planes, the new spheres of the tetrahedra, formed by connection of F to E , always are inside the previous sphere in the current space. This situation is directly comparable with the situation in Figure 3.10. If F lies outside plane ADE , for example, sphere ADEF exceeds sphere ACDE outside this plane. But sphere ADEF never exceeds sphere ABDE in the current space.}

Theorem 11 Every tetrahedron of Tn , which has the inserted point interior to its circumscribing sphere, is inuenced by the insertion.

Proof: The denition for Delaunay tetrahedrization signies that no point can be interior to the circumscribing sphere of any tetrahedron in the network. Consequently a tetrahedron that does not meet the sphere criterion, has to be changed.}

10.3. DATA STRUCTURES FOR TETRAHEDRAL IRREGULAR NETWORKS119 Theorem 11 is essential for Watsons' delete-and-build algorithm, where every invalid tetrahedron is removed from the mesh before the valid tetrahedra are constructed.

10.3 Data structures for tetrahedral irregular networks Chapter 4 discusses some data structures for 2D triangulation. The data storage is separated in three levels points, edges and triangles. In a 3D model the fourth level, tetrahedra, is introduced. Section 4.2 recommends edge based or triangle based structures. For the 3D model it is also possible to use a tetrahedron based data structure. It is of course possible to use many di erent data structures for a 3D Delaunay network. However, my triangulation program uses an edge based data structure (Section 4.2.3) which is to be extended to a 3D version. Two possible ways for this extension are discussed: In 2D new edges are constructed and some edges are swapped when a point is included. Corresponding, triangle planes are constructed and swapped due to the point insertion in 3D. The triangle plane can be understood as the 3D version of an edge. Thus a possible extension of the twin-edge structure is a twin-triangle structure. The edges are still used as basis elements in the network. However, the twin-edge structure needs some additional information to describe a structure in 3D space. This fact leads to the double twin-edge structure. Figure 10.7 gives a survey of the twin structures in 2 and 3 dimensions.

10.3.0.4 Twin-triangle structure This data structure uses triangles as basis elements. A triangular plane in the 3D network either denotes a boundary between two adjacent tetrahedra, or a boundary to the \outside world". Each tetrahedron is formed by four distinct triangular planes. The triangular planes that lie between two neighbouring tetrahedra are congruent twin-triangles (Figure 10.8) that point at each other. Each triangle has to have pointers to its three neighbouring triangles in the tetrahedron. In addition the triangular plane needs pointers to its vertices. To keep information about the tetrahedron (interior points, parameters for the circumscribing sphere etc.), the triangles also need pointers to their respective tetrahedron in a list of tetrahedra. In the 2D structure, a pointer to the next edge in a triangle is unique. There is only one next edge, and edge!next!next!next always is the edge itself. A triangular plane has got three neighbours, which are impossible to search through by an unique row

120

CHAPTER 10. A TETRAHEDRAL IRREGULAR NETWORK

Data structure 3D

2D

out

Twin-edge structure in

Double twin-edge structure

Twin-triangle stucture

Point list as an attribute Point list as an attribute to the triangle

to the tetrahedron

Figure 10.7: Twin data structures in 2 and 3 dimensions.

Tetrahedron info

Figure 10.8: Pointers in the twin-triangle structure.

10.3. DATA STRUCTURES FOR TETRAHEDRAL IRREGULAR NETWORKS121 of pointers, and return to the initial plane. In other words one cannot \walk through" the four triangular planes of a tetrahedron, and end up in the rst one by writing plane!next!next!next!next. Consequently a structure of triangular planes will be ambiguous and inconsistent, and less suitable to be used as a dynamic data structure.

10.3.1 Double twin-edge structure Pointer to end point

Pointer to next edge

Pointer to twin edge in the same tetrahedron (in twin)

Pointer to twin edge in the adjacent tetrahedron (out twin) Pointer to attribute

C

C

in twin pointers

E

E out twin pointers

D

D A

B A B

Figure 10.9: Pointers of the double twin-edge. In/out twin pointers are shown separately for edge DE . It is necessary to use a dynamic data structure, where local reorganization of the network is ecient in terms of time, to handle an incremental algorithm. For this purpose this thesis introduces a 3D version of the twin-edge structure. In the twin-edge structure each edge has pointers to the endpoint, the next edge in the triangle, the point list of the triangles and a twin edge which is a part of the neighbouring triangle. For extension to 3D, only a small improvement is necessary. The edges need two twin pointers one to the twin edge of the same tetrahedron, and the other pointer to the twin edge in the adjacent tetrahedron. Figure 10.9 shows the pointers in the double twin-edge data structure. One great advantage of this structure is the fact that the complete model is only formed by double twin-edges. Procedures for moving around in the model, and performing various calculations, are very consistent. As each tetrahedron consists of 12 edges, it is advantageous to give the edges pointers to a list of tetrahedra information. The three elements in the double twin-edge data structure are consequently: Point Edge Tetrahedron

122

CHAPTER 10. A TETRAHEDRAL IRREGULAR NETWORK

Figure 10.10 shows the relations between edges, points and tetrahedra in the model by the use of indexes. B

11

10

D

B

B

B

E

12

B A

A

6

2

D

15

5

D

D

3

E

13

E

1

4 14

C

C

C

C

D 8 7

E 9

C Point #

x,y,z Next

Edge #

Point Next

In twin

Out twin

Tetra

Tetra Spher. Point para. list #

A

1

D

2

x

4

1

1

B

2

B

3

x

6

1

2

C

3

C

1

x

5

1

D

4

C

5

7

1

2

E

5

B

6

13

3

2

6

D

4

10

2

2

7

D

8

4

0

2

8

E

9

12

0

2

9 10

C B

7 11

14 6

0 0

2 2

11 12

E D

12 10

15 8

0 0

2 2

13 14 15

C E B

14 15 13

5 9 11

0 0 0

2 2 2

Figure 10.10: The double twin-edge structure showed by indexes.

10.3.2 Point handling structure for additional points The organization and storage of points to include in the network are critical for the running time of the algorithm. When the tetrahedrization includes qualied point selection, it is important to have an ecient method for the determination of the interior points of a tetrahedron. A point handling structure which is identical to the one used for the triangulation in Section 4.1 is suitable for this purpose. A list of points is subordinated to each tetrahedron. When the point lists are reorganized, it is necessary to calculate on which side of a triangular plane the points are situated. The distance from a point to a triangular plane is calculated by Equation 5.1. Because we only need to determine on which side the point lies and not the distance, it is more ecient to look at the sign of s in Equation 10.1 only.

si = axi + byi + czi + d

(i = 1 2 :: n)

(10.1)

10.4. INCREMENTAL GENERATION OF A TETRAHEDRAL NETWORK123 n is the number of points inside the hexahedron that encloses triangle BCE (Figure 10.4.a). The point lies to the left of BCE if si > 0, it lies on BCE if si = 0, and it lies to the right of BCE if si < 0.

10.4 Incremental generation of a tetrahedral network In my work I have concentrated on making a 3D version of the incremental algorithm for Delaunay triangulation. Further, I have used a dynamic data structure where the additional points are stored in lists as attributes to the enclosing tetrahedra. In this structure no search for the enclosing tetrahedron is necessary, and it is possible to eciently calculate if additional points make any contribution to the data model. In other words, we have got an adaptive data model where it is possible to choose the level of accuracy. This feature is the subject of Section 10.5. Before the incremental tetrahedrization starts, an initial network has to be constructed. This \network" may for example be a large tetrahedron enclosing every point in the 3D space. This tetrahedron becomes a base for further division into smaller tetrahedra. The algorithm can be brie y formulated as: 1. Construct a circumscribing tetrahedron for the point set. 2. Insert a point into the mesh by: (a) Splitting the points circumscribing tetrahedron into four new tetrahedra (Figure 10.12). (b) Reorganizing triangle planes close to the inserted point, until every tetrahedra meets the sphere criterion The circumscribing sphere of the tetrahedron having the inserted point as a vertex, is examined. No opposite point of an adjacent tetrahedron can lie inside this sphere. 3. After the invalid triangle planes are swapped, the mesh becomes a Delaunay network again, and the remaining points can be included in the network by step 2. The following sections will have a closer look at di erent steps of this algorithm. Figure 10.11 places the most important features of the triangulation algorithm together with their 3 dimensional versions.

10.4.1 Construction of an initial tetrahedron Construction of the tetrahedron which encloses all the points is a trivial operation. The maximum and minimum coordinates of the data set are needed,

124

CHAPTER 10. A TETRAHEDRAL IRREGULAR NETWORK

Important parts of the algorithm

2D

3D

Insertion of a point.

Insertion of a point The old triangle is

inserted point

split into three new ones.

The old tetrahedron is split into four new ones.

Swapping invalid edges

Swapping invalid planes inserted point

inserted point

Planes to check

Edges to check

inserted point

Maximum angle sum rule

r

Calculation of the sphere’s radius and centre coordinates

Figure 10.11: Special features of the incremental triangulation and tetrahedrization algorithms.

10.4. INCREMENTAL GENERATION OF A TETRAHEDRAL NETWORK125 and the circumscribing sphere for the point set can be calculated. There is a simple connection between the sphere and its circumscribing tetrahedron.

10.4.2 Split a tetrahedron During the tetrahedrization a new point that is to be included in the tetrahedral network has to be connected to the four vertices of the enclosing tetrahedron. Consequently, the old tetrahedron is divided into four new tetrahedra, each formed by 3 new and 1 old triangular planes (Figure 10.12). C

D

E

A B

Figure 10.12: Point E is connected to tetrahedron ABCD by AE BE CE and DE , and splits the old tetrahedron into the tetrahedra ACDE , ABDE , ABCE and BCDE . Because each triangular plane consists of three edges, 36 new double twinedges are added to the data structure. The point is included in the mesh by updating the pointers of every edge in the four current tetrahedra. When the pointers have become valid, it is important to reorganize the point handling structure in such a way that every additional point is subordinated to its enclosing tetrahedron. The points will be sorted by the six new planes in a six step operation related to the sorting in Figure 4.8. Finally the radius and centre coordinates for the circumscribing sphere of each new tetrahedron are calculated and stored.

10.4.3 Reorganization of edges close to an inserted point Switching between the two stages of dividing of a hexahedron into tetrahedra (Figure 10.4) is decisive for a dynamic tetrahedrization algorithm. I will therefore discuss these particular steps in more detail. To keep the 3D reorganization process comparable with the 2D version, I will, up to a point, denote the edge insertion/removement as \plane swapping".

CHAPTER 10. A TETRAHEDRAL IRREGULAR NETWORK

126

C

C

F

F

C

F

E

D

F D

A

D

E

A

E

E

B A

(a)

(b)

Figure 10.13: (a) E is connected to F by a new edge, and the hexahedron ACDEF is subdivided into three tetrahedra ACEF CDEF and ADEF (b).

10.4.3.1 Insertion of a new edge The insertion of an edge is identical with swapping from 2 to 3 tetrahedra inside the hexahedron, shortly denoted the 2-3 swap. In Figure 10.13, E is a newly inserted point. The 2-3 swap occurs when F is inside sphere ACDE , and inside plane ACE ADE and CDE . When EF is created, triangular plane ACD is swapped to become, for example, DEF . In addition the planes CEF and AEF are created.

Theorem 12 The circumscribing spheres of the three new tetrahedra will never

enclose the fth point of the hexahedron when a new edge is inserted inside a hexahedron.

Proof: In Figure 10.13 F is connected to E , because sphere ACDE encloses F . Due to the sphere set rule, the new sphere, CDEF is interior to sphere ACDE inside plane CDE . While A also lies inside this plane, and on sphere ACDE , A is never enclosed by sphere CDEF . Similarly it can be showed that D lies outside sphere ACEF , and C lies outside sphere ADEF .}

For each new edge the data structure is updated and the radius and central coordinates for the new spheres are calculated and stored. Handling of the point lists after a new edge is inserted is comparable to the situation in Figure 4.8. The only di erence is that the points are sorted by planes (Equation 10.1) instead of edges.

10.4.3.2 Removing an invalid edge This operation may also be named the 3-2 swap (swapping from 3 to 2 tetrahedra). Figure 10.14 shows a situation where a 3-2 swap occurs. Point F lies

10.4. INCREMENTAL GENERATION OF A TETRAHEDRAL NETWORK127 C

D

C

D

C F

E

F F

E

E A

A (a)

(b)

Figure 10.14: Edge AD is deleted and the hexahedra turns into two tetrahedra ACEF and CDEF (b). inside the planes ACE and CDE , while it lies outside plane ADE . Further, a connection between E and F already exists. Still, point F may be interior to sphere ACDE . To handle this situation, edge AD is deleted, or in other words a 3-2 swap is executed. Triangular plane ACD is swapped to become plane CEF , while plane ADF and plane ADE are removed. The hexahedron nally consists of the tetrahedra ACEF and CDEF . As a last step, new sphere parameters are calculated, and the lists of additional points are sorted by plane CEF .

10.4.3.3 Recursive process for edge reorganization A recursive procedure can be made to handle the reorganization of the edges when a point is included into the mesh. A tetrahedron, which has got the inserted point as a vertex, also has got a face (triangular plane) opposite to the inserted point. The recursive routine is based on the fact that a possible Delaunay neighbour of the inserted point, is the fourth vertex of the tetrahedron sharing this face. When the program code says: checkhexahedron (plane), it checks if the enclosing hexahedron of plane is valid. In the pseudo code plane is represented by one of the three edges that forms plane. The recursive reorganization routine is called by the routine where the point is inserted in the network: insertpoint(edge1, inpoint) Comment: insertpoint(..) inserts a new point in the network.

Variables:

*edge1...*edge4

Comment: One edge for each triangle plane of

*inpoint f

the enclosing tetrahedron.

Comment: The inserted point.

edge2 = edge1!intwin edge3 = edge1!next!next!intwin edge4 = edge1!next!intwin!next if (inpoint != (any vertex of the enclosing tetrahedron))

CHAPTER 10. A TETRAHEDRAL IRREGULAR NETWORK

128

Comment: Duplicate points are dropped.

splittetra(edge1, inpoint) Comment: Splits the old tetrahedron into four new ones. reorganize(edge1) reorganize(edge2) reorganize(edge3) reorganize(edge4)

g

C F

C

D

D F

E

E

A A

Figure 10.15: When E is a newly inserted point, and an edge is inserted/removed, the next possible Delaunay neighbour lies in the adjacent tetrahedra outside the hatched planes. The pseudo code for insertpoint shows that the recursive routine is called once for each of the triangular planes of the old tetrahedron. Figure 10.15 shows the interior planes of the hexahedra that are checked during swap operations. The pseudo code for the recursive routine is gured: reorganize(edge-of-plane) Comment: Manages the reorganization of invalid edges.

Variables: *edge-of-plane Comment: Represents the current, opposite plane to *edge1...*edge3

inpoint.

Comment: The new opposite plane, after a swap is

swaptype f

executed.

Comment: Type of swap (3-2, 2-3?).

swaptype = checkhexahedron(edge-of-plane) Comment: Determines if the neighbour is inside the sphere, and the type of swap. if (swaptype) edge1 = edge-of-plane!outtwin!intwin edge2 = edge-of-plane!outtwin!next!intwin edge3 = edge-of-plane!outtwin!next!next!intwin

10.4. INCREMENTAL GENERATION OF A TETRAHEDRAL NETWORK129

case swaptype = 1:

swap2-3(edge-of-plane) Comment: An edge is inserted. reorganize(edge1) reorganize(edge2) reorganize(edge3) case swaptype = 2: swap3-2(edge-of-plane) Comment: First opposite edge is deleted. case swaptype = 3: swap3-2(edge-of-plane!next) Comment: Second opposite edge is de-

leted.

g

case swaptype = 4:

swap3-2(edge-of-plane!next!next) Comment: Third opposite edge is deleted. reorganize(edge2) reorganize(edge3) if (swaptype == 5) delete-0-tetra(edge-of-plane) Comment: A 0-tetrahedron is deleted.

The choice of swaptype = 2, 3 or 4 depends on which plane the neighbour point is outside. The point lies outside plane ADE in Figure 10.14. An experiment for inclusion of 1000 randomly distributed points shows that an average of 10.1 edges are inserted, and 6.6 edges are deleted for each point insertion. But the average number of deleted and inserted edges is smaller in the beginning. This will in uence at the total average for 1000 points. When including 5000 points in the model, an average of 11.2 inserted and 7.6 deleted edges per point insertion was observed. Exceptional cases

2D

3D

Triangle with area = 0

Tetrahedron with volume = 0

Point on point

Point on point

Point on line

Point on line Point on plane

Figure 10.16: Exceptional cases in 2D and 3D.

130

CHAPTER 10. A TETRAHEDRAL IRREGULAR NETWORK

10.4.4 Exceptional cases The operations that are previously described handle the most common situations in the tetrahedrization. Still, it is necessary to make the program resistant for some exceptional cases that occur. Three typical situations that cause problems are shown in Figure 10.16: 1. Duplicate points. 2. Three colinear points. 3. Four coplanar points. These situations appear especially in data sets where the points are measured in grids. Law85] shows di erent congurations of ve distinct non-coplanar points in 3D space. He handles points that are situated on edges/planes as separate cases. In my work I have tried to generalize the standard routines, so that these special point congurations do not need to be handled separately. Section 4.3.2.1 shows how \zero triangles", which are triangles dened by three colinear points, are utilized to make a consistent algorithm. In a similar way it is possible to make use of \zero tetrahedra" during the tetrahedrization process. Zero tetrahedra here means tetrahedra made of four coplanar points. Such tetrahedra have got volume = 0, hence the name. When three colinear or four coplanar points appear, zero tetrahedra are formed inside the network. During the reorganization process these tetrahedra disappear because of their innite radius, unless they are situated on the boundary of the tetrahedrizated space.

10.4.4.1 Duplicate points In 2D duplicate points occur when the x and y values for two points are equal. There is a constraint for the 2.5D triangulation, which says that there can be only one z value for each point. In 3D points are also separated in the z direction. Still there might be duplicate points representing a di erent 4'th variable (e.g. temperature). 4 dimensional triangulation is necessary to separate these points. In the 3D tetrahedrization program duplicate points are simply dropped.

10.4.4.2 Three colinear points Figure 10.17 shows the tetrahedron ABCD, where the inserted point E lies on edge CD. ABCD is still divided into four new tetrahedra, but two of them,

10.4. INCREMENTAL GENERATION OF A TETRAHEDRAL NETWORK131 C

E B D

A

Figure 10.17:

ACDE and BCDE , are zero tetrahedra. Because the zero tetrahedra's circumscribing spheres have got radius = 1, E will be connected to the fourth point of ADEC s adjacent tetrahedron outside ABCD. E will in fact be connected to neighbouring points, and 2-3 swaps occur, until two zero tetrahedra become adjacent. Then both zero tetrahedra are deleted. This deletion process removes edge CD, and the Delaunay network becomes valid again.

10.4.4.3 Four coplanar points C

E B D

A

Figure 10.18: In Figure 10.18 the points A C D and the inserted point, E , are coplanar. Consequently, the tetrahedron ACDE is a zero tetrahedron. If there is an adjacent tetrahedron of ACDE outside ABCD, a new edge will connect E to the adjacent tetrahedron's fourth point. In other words a 2-3 swap is executed. Plane ACD is swapped and the zero tetrahedron disappears. Correspondingly, if A C D and E in Figure 10.14 are coplanar, edge AD has to be removed. Like for the triangulation and zero triangles, zero tetrahedra may remain along the boundary of the tetrahedrizated space. But because no points lie outside the current space, every tetrahedron still meets the sphere criterion. Deletion of zero triangles along the boundary is a simple operation if it is necessary for further use of the data structure.

132

CHAPTER 10. A TETRAHEDRAL IRREGULAR NETWORK

10.4.5 Eciency of the algorithm/data structure Like the 2D incremental algorithm the incremental tetrahedrization will have a worst case running time of O(n2), where n is the number of included points. This running time is, like for the 2D version, very unlikely to happen. In practice the running time will be close to O(n log n) for a uniformly distributed data set. As for other triangulation and tetrahedrization algorithms the data structure and handling of candidate points are vital for the running time of the algorithm. If we exclude the point handling, the incremental algorithm itself has about linear running time for a random distribution of points. Figure 10.19 shows the time consumption for some random data sets (the handling of additional points is included). The algorithm is close to linear complexity because the point handling is less dominating for such small numbers of points (up to 5000 points). In Figure 10.19 the complete data sets were included in the network. t(s) 60 50 40 30 20 10

1000

2000

3000

4000

5000

Number of points

Figure 10.19: Time consumption for the incremental tetrahedrization. Experimental results. When the tetrahedral network has to handle large amounts of additional data points in the structure itself, a lot of time will be spent sorting the additional points due to each \plane swap". Figure 10.20 shows the time consumption for the processing of large data sets where only parts of them were included in the network. The number of included points is given in the gure. This gure shows clearly how the amount of additional points in uence the time consumption. In huge data sets, where most of the points are expected to be redundant, it might be necessary to keep the additional points in a separate data structure.

10.4.6 Stability of the algorithm The tetrahedrization program is tested for data sets where up to 5000 points are included in the network. For larger data sets the memory handling in the

10.5. QUALIFIED SELECTION OF POINTS t(s) 120 110

133

90000 points in the data set 30000 points in the data set 5000 points in the data set

100 90 80 70 60 50 40 30 20 10

1000

2000

3000

4000

5000

Number of points included in the network

Figure 10.20: Time consumption for the incremental tetrahedrization. Experimental results. program has to be improved. Both the volume test and a test for the sphere criterion are executed successfully. Because the incremental algorithm requires a valid Delaunay triangulation for insertion of a point, the program will crash if the geometry turns invalid.

10.5 Qualied selection of points Chapter 5 describes how qualied point selection reduces the amount of data in a logical way. Using an incremental tetrahedrization and a convenient point handling structure, this feature can be extended to 3 dimensions. The result is an adaptive data data modelling by tetrahedral irregular networks. Example: A lot of temperature measurements have been sampled for a sea area. If the sampling of data is easy, a great part of the measurements are probably redundant. For each sample x, y, depth and temperature are measured. A tetrahedral data structure may be generated to store the information. If the temperature of some samples inside a tetrahedron can be calculated from the four vertices of the tetrahedron, it is not necessary to store these samples in our data structure.}

134

CHAPTER 10. A TETRAHEDRAL IRREGULAR NETWORK

10.5.1 Threshold for the point inclusion It is of course possible to split the tetrahedron in the point which makes the most signicant contribution to the model. Like in the triangulation (Equations 5.1 and 5.2) we can indicate a threshold value for the inclusion of the point. The contribution of the point is determined by Equation 10.2. When dist4D = 0 the point makes no contribution to the model. dist4D = axip+ 2byi +2 czi +2 dvi 2+ e (10.2) a +b +c +d The coecients are given by Equation 10.3.

xi xA xB xC xD

yi yA yB yC yD

zi zA zB zC zD

vi vA vB vC vD

1 1 1 1 1

(10.3)

The size and type of 3D will depend on the problem to solve and the accuracy of the given data set. In a large data set, with a considerable part of redundant or \almost redundant" data, this feature may be very useful. It is also possible in 3D to construct generalized models of tetrahedral networks. These networks can be rened by using a smaller 3D , or in other words, by zooming the \3.5 dimensional" model.

10.6 Future work This chapter concentrates on the generation of Delaunay tetrahedrizated networks by an incremental method. The method depends on the possibility of including new points in the network. The deletion of points from the network should consequently be another important feature of a dynamic tetrahedrization program. Further, when the data set becomes huge, routines for merging 3D networks are required.

10.6.1 Removing points When a point is removed from the network, every tetrahedron which has the point as a vertex has to be removed. The empty polyhedron then has to be lled by new tetrahedra. The basis algorithm for point deletion in 2D (Section 6.1.1) can be generalized to 3D: 1. The circumscribing polyhedron of the current point is found, and its interior tetrahedra are removed.

10.6. FUTURE WORK

135

2. Three consecutive triangles along the polyhedron form a tetrahedron. The circumscribing sphere is calculated for each consecutive set of triangles. 3. The tetrahedron corresponding to the smallest sphere is part of Tn. This tetrahedron is stored, and the polyhedron is adjusted. New circumscribing spheres have to be calculated for the new part of the polyhedron, and a new smallest sphere will appear. 4. This procedure continues until the mesh interior to the polyhedra is complete. Three more algorithms for point deletion in 2D are presented in Chapter 6. To some degree all of them depend on edge swapping to achieve a proper Delaunay triangulation. The extension of these algorithms to 3D has to be investigated in more detail.

10.6.2 Merging tetrahedral networks As for 2D, it is possible to divide the space into smaller blocks, and execute the tetrahedrization for each block. To make the entity space meet the sphere criterion, it is necessary to merge the blocks. A simple merging routine may consist of: 1. Delete the tetrahedra along the boundary which have circumscribing spheres that enclose points in the neighbouring block. 2. Construct the network in the boundary space by searching for the Delaunay neighbours of the tetrahedra in the adjacent network. Two other 2D merging algorithms from Chapter 7 depend, as some point deletion routines, on the validity of \edge swapping". When a new point is inserted into the mesh, only opposite planes of the inserted point is candidates for swapping (Figure 10.15). In the deletion and merging operations, every plane of the surrounding hexahedron of the invalid plane may be in uenced. Consequently all six planes of the hexahedron have to be checked in the recursive procedure. This kind of swapping needs further exploration.

10.6.3 Extension of the maximum angle-sum criterion In Section 2.3.2 the max-min angle property is explained, and in Section 3.2 the validity of the maximum angle-sum rule is established. FS91] writes that a three dimensional analogue of the max-min angle property is unknown. Several other authors also claim that this analogue is unknown. In my work I

136

CHAPTER 10. A TETRAHEDRAL IRREGULAR NETWORK

did some experiments to nd a 3D version of the maximum angle-sum rule. For one thing I calculated the angles of the circumscribing cones of two adjacent tetrahedra, but without any success. The fact that edges are both added to and deleted from the network independently, makes it very dicult to determine a 3D maximum angle-sum rule, if this is possible at all.

10.7 Delaunay/Voronoi diagram of sions

n

dimen-

This thesis concentrates on algorithms for 2 and 3 dimensional Delaunay networks. Still, a natural question is what about Delaunay networks of higher dimensions? The problem is in some degree described in the literature. Law85] writes about the properties of n dimensional triangulation, while Wat81] and AB83] concentrate on making algorithms for n dimensional Delaunay/Voronoi network generation. SS88] also touches on the problem. The basis for 2 and 3 dimensional Delaunay networks are the circle and the sphere criteria. In n dimensions the tetrahedron, or 3-simplex, becomes an n-simplex. Likewise, the n + 1 vertices of each n-simplex lie on the (n ; 1) dimensional surface of an n dimensional hypersphere. Just like the centres of the triangles circumscribing circles are vertices of the 2D Voronoi polygon, the centres of the hyperspheres are vertices of the dual n dimensional Voronoi tessellation. The Voronoi diagram divides the n dimensional space into convex polytopes which bisect the edges of the n dimensional Delaunay network. This thesis shows that 3D tetrahedrization is somewhat more dicult than 2D triangulation. It is likely to believe that triangulation in higher dimensions is even more complicated. Still Law85] claims that a set of n + 2 points in n-space consists of at most two di erent triangulations by n-dimensional simplices. Example: A hexahedron may be divided into two or three tetrahedra. But there is only one way of partitioning it into two tetrahedra, and only one way of partitioning it into three tetrahedra.}

In 2D the geometry is given by the circle criterion, and in 3D it is given by the sphere criterion. In n dimensions there is a corresponding hypersphere criterion:

De nition 5 A Delaunay network in n dimensions consists of non-overlapping

n-simplices where no points in the network are enclosed by the circumscribing hyperspheres of the n-simplices. Wat81]'s algorithm in Section 2.3.7 is also given for n dimensions:

10.7. DELAUNAY/VORONOI DIAGRAM OF N DIMENSIONS

137

1. Construct the initial n-simplex which encloses every point. 2. For each point to insert: (a) Find the enclosing n-simplex. (b) Find every n-simplex where the circumscribing hypersphere encloses the inserted point. (c) Remove these n-simplexes. The inserted point is now inside an almost convex polytope. (d) Construct edges between the vertices of the polytope and the inserted point. The new edges, together with the polytope, describe a set of new n-simplexes. Chapter 5 and Section 10.5 discussed the possibilities for adaptive data modelling. This quality is also possible to convert to n dimensions by introducing nD as a threshold value. A point is not included in the network when the (n + 1)'th variable is redundant or almost redundant in an n dimensional network. Example: A Delaunay network is constructed from sampled data in a sea area. The 4D network is based on x, y, depth and temperature. A fth variable, density, may also be measured for each point. But it is still not necessary to include points where the density may be calculated, from the network, for a certain x, y, depth and temperature value.}

This chapter has shown that the the methods used for incremental Delaunay triangulation and qualied selection of points can be extended to 3 dimensions. By using the incremental Delaunay tetrahedrization it is possible to make adaptive models of 4 dimensional data. The method can be extended into higher dimensions, but the structure will become quite complex and it is maybe dicult to see any practical use of this at the moment.

138

CHAPTER 10. A TETRAHEDRAL IRREGULAR NETWORK

Chapter 11 Conclusions The intention of this thesis was to expand knowledge about the geometry, algorithms and the use of the Delaunay network as a spatial model. The interest in ecient algorithms for the modelling of terrain surfaces is increasing, and the Delaunay triangulation is well suited for this due to its geometrical conditions. There are several methods for Delaunay triangulation. This thesis outlines seven of them. For further exploration the incremental algorithm was chosen because of its openings for dynamic point insertion. This is decisive for an ecient generalization of the model by qualied selection of points. When a point is included in the TIN, some of the existing edges have to be reorganized in e ort to attain the proper Delaunay geometry again. The studies of the point insertion establish the contention that the point insertion is a rather local process. Better knowledge about the geometrical dependencies makes it possible to produce more ecient algorithms for the edge reorganization process. A well organized data structure for the handling of points to insert in the network is decisive for the incremental method. When the TIN itself is used for this structure, interior points of each triangle are localized very fast. However, when there is a huge number of super uous points, a separate data structure for these points is recommended. For the TIN itself an edge based data structure is chosen. This because the edge structure is surveyable, easy to update and because the edges are the most important basis elements in both 2 and 3 dimensions. When using the incremental algorithm, a qualied selection of points can be introduced. By this method it is possible to make simple surveyable models where only the distinctive surface characterizations remain. It is shown how models of higher resolutions can be generated by the renement of the simpler model. For generalization of a gridded data set it is clear that there is a considerable reduction of points representing the model, especially for land 139

140

CHAPTER 11. CONCLUSIONS

areas which are at. In the dynamic model it is also important to emphasize the removal of points from the network. This thesis introduces three new algorithms for point removal, where the simplest one turns out to be the most ecient. As for the point deletion, the two new merge algorithms are based on the recursive edge reorganization from the incremental algorithm. It is necessary to the divide the areas into smaller blocks when the areas are huge. A seamless handling of these blocks depends on ecient merging routines. The triangulation in blocks is also more ecient because of the complexity of the incremental algorithm. The optimal block size concerning this was surprisingly small. Another positive e ect of the block method that was discovered during the experiments, was the eciency improvements in the disk swapping caused by limitation in the computer memory. Division into blocks also facilitates more ecient triangulation on parallel computers. The nature of the Delaunay triangulation can be utilized for various tasks, like, for example, the determination of the minimum spanning tree between a set of points and a simple localization of a fast searching path between two points in the network. Further, TIN can be used to easily make various visual representations of the surface. The thesis outlines how the qualities of the incremental Delaunay triangulation can be transfered to 3 dimensions. As for the triangulation, a recursive reorganization of the edges is central for the incremental Delaunay tetrahedrization. The edge swapping is more complicated, but comparable. Only a small extension in the edge based data structure results in the double twin-edge structure that is well suited for the tetrahedral network. In 2 dimensions the handling of triangles with no area makes the algorithms more consistent. Equally the tetrahedrization algorithms can handle tetrahedra of no volume. Adaptive modelling by qualied selection of points is an important feature also for the tetrahedral model. Even so, this point selection needs more exploration and has to be tested for real data sets.

Bibliography Aas92]

Rune Aasgaard. Automated Cartographic Generalization, with Emphasis on Real-time Applications. PhD thesis, Department of Surveying and Mapping, Norwegian Institute of Technology, University of Trondheim, September 1992. AB83] David Avis and Binay K. Bhattacharya. Algorithms for computing d-dimentional Voronoi diagrams and their duals. Advances in Computing Research, 1:159{180, 1983. AHU87] Alfred V. Aho, John E. Hopcroft, and Je rey D. Ullman. Data Structures and Algorithms. Addison-Wesley Publishing Company, April 1987. Aur91] Franz Aurenhammer. Voronoi diagrams - a survey of a fundamental geometric data structure. ACM Computing Surveys, 23(3):345{406, 1991. Bak89] Timothy J. Baker. Automatic mesh generation for complex threedimensional regions using a constrained Delaunay triangulation. Engineering with Computers, 5:161{175, 1989. Ber81] Jackues Bertin. Graphics and Graphic Information Processing. Walter de Gruyter, Berlin, New York, 1981. ISBN 2-11-008868-1. Bj88] J. T. Bjrke. Quadtrees and triangulation in digital elevation models. In International Archives of Photogrammetry and Remote Sensing, pages 38{44. International Society for Photogrammetry and Remote Sensing, Committee of the 16th International Congress of ISPRS, 1988. Vol 27, part B4, Commision IV. Bj91] Jan Terje Bjrke. Digital Kartogra. Department of Surveying and Mapping, Norwegian Institute of Technology, University of Trondheim, 1991. Part three. Bj92] Jan Terje Bjrke. Digital Kartogra. Department of Surveying and Mapping, Norwegian Institute of Technology, University of Trondheim, 1992. Blu67] H. Blum. A transformation for extracting new descriptors of shape. In Proceedings of the Symposium on Models for the Perception of Speech and Visual Form, pages 362{380, 1967. 141

142

BIBLIOGRAPHY

Del34]

B. Delaunay. Sur la sphere vide. Bulletin of Academy of Sciences of the USSR, pages 793{800, 1934. Dir50] G. L. Dirichlet. U$ ber die reduction der positiven quadratischen formen mit drei unbestimmten ganzen zalen. J. Reine u. Angew. Math., 40:209{227, 1850. EPW86] H. Edelsbrunner, F.P. Preparata, and D.B. West. Tetrahedrizing point sets in three dimensions. Technical Report UIUCDCS-R-861310, Department of Computer Science, University of Illinois, 1304 W.Springeld Avenue, URBANA, Il 61801, December 1986. ES92]

H. Edelsbrunner and N.R. Shah. Incremental topological ipping works for regular triangulations. In Proceedings of the Eighth Annual Symposium on Computational Geometry, pages 43{52, June 1992.

FFNP84] Leila De Floriani, Bianca Falcidieno, George Nagy, and Caterina Pienovi. A hierarchical structure for surface approximation. Comput. & Graphics, 8(2):183{183, 1984. FFP85] L. De Floriani, B Falcidieno, and C. Pienovi. Delaunay-based representation of surfaces dened over arbitarily shaped domains. Computer Vision, Graphics, and Image Processing, 32:127{140, 1985. Fie86] FS91]

David A. Field. Implementing Watson's algorithm in three dimensions. In Proc. ACM Symp. Computional Geometry, pages 246{259, 1986. David A. Field and Warren D. Smith. Graded tetrahedral nite element meshes. International Journal for Numerical Methods in Engineering, 31(3):413{425, 1991.

Gau90] Arne Gaustad. Generalisering av 2.5d-geograske ater. Master's thesis, Department of Surveying and Mapping, Norwegian Institute of Technology, University of Trondheim, 7034 TRONDHEIM, December 1990. GS77] P.J. Green and R. Sibson. Computing dirichlet tessellations in the plane. The Computer Journal, 21(2):168{173, 1977. GS85] Hel90] Imh65]

Leonidas Guibas and Jorge Stol. Primitives for the manipulation of general subdivisions and the computation of Voronoi diagrams. ACM Transactions on Graphics, 4(2):74{123, 1985. Martin Heller. Triangulation algorithms for adaptive terrain modeling. In Proceedings of the 4th International Symposium on Spatial Data Handling, pages 163{174, July 1990. Eduard Imhof. Kartographische Gel andedarstellung. Walter de Gruyter & co, 1965.

BIBLIOGRAPHY

143

Joe89]

Barry Joe. Three-dimensional triangulations from local transformations. Siam Journal on Scientic and Statistical Computing, 10(4):718{741, 1989.

KG91]

S. Kanaganathan and N.B. Goldstein. Comparison of four-point adding algorithms for Delaunay-type three-dimensional mesh generators. IEEE Transactions on Magnetics, 27(3):3444{3451, 1991.

KV92]

Menno-Jan Kraak and Edward Verbree. Tetrahedrons and animated maps in 2d and 3d space. In Proceedings of the 5th International Symposium on Spatial Data Handling, pages 63{71, August 1992.

Law72]

Charles L. Lawson. Transforming triangulations. Discrete Math., 3:365{372, 1972.

Law77] C.L. Lawson. Software for c1 surface interpolation. In J. Rice, editor, Mathematical Software III, pages 161{194. Academic Press, New York, 1977. Law85] Lee91]

LR78] LS80] Mid87] Mid90]

MR80]

C.L. Lawson. Some properties of n-dimensional triangulation. External Report, JPL Publication 85-42, National Aeronautics and Space Administration, June 1985. Jay Lee. Comparison of existing methods for building triangular irregular network of terrain from grid digital elevation models. International Journal of Geographical Information Systems, 5(3):267{ 285, 1991. B.A. Lewis and J.S. Robinson. Triangulation of planar regions with applications. The Computer Journal, 21(4):324{332, 1978. D.T. Lee and B.J. Schachter. Two algorithms for constructing a Delaunay triangulation. International Journal of Computer and Information Sciences, 9(3):219{242, 1980. Terje Midtb. Digitale terrengmodellar. Master's thesis, Department of Surveying and Mapping, Norwegian Institute of Technology, University of Trondheim, Desember 1987. Terje Midtb. Spreiing av diagonalskifte ved innsetjing av eit punkt i eit Delaunay triangulert nettverk. Internal report, Department of Surveying and Mapping, Norwegian Institute of Technology, University of Trondheim, December 1990. Michael J. McCullagh and Charles G. Ross. Delaunay triangulation of a random data set for isarithmic mapping. The Cartographic Journal, 17(2):93{99, 1980.

MW82] A. Mirante and N. Weingarten. The radial sweep algorithm for constructing triangulated irregular networks. IEEE Computer Graphics and Applications, 2(3):11{21, 1982.

144 oys] PK90] PS85] RSM78] Sam84] SBP90]

SM89]

SS88]

SS90] TJ11] Vor08] Wat81] WS33] Yoe71]

BIBLIOGRAPHY Private communication with ystein Torbjrnsen,Department of Computer Science, Norwegian Institute of Technology. G. Petrie and T.J.M Kennie. Terrain Modelling in Surveying and Civil Engineering. Whittles Publishing in association with Thomas Telford Ltd, 1990. Franco P. Preparata and Michael Ian Shamos. Computational Geometry, an Introduction. Springer-Verlag, 1985. Arthur Robinson, Randall Sale, and Joel Morrison. Elements of Cartography. John Wiley & sons, 4 edition, 1978. Hanan Samet. The quadtree and related hierarchical data structures. Computing Surveys, 16(2):187{260, 1984. Sanjeev Saxena, P.C.P. Bhatt, and V.C. Prasad. Ecient vlsi parallel algorithm for delaunay triangulation on orthogonal tree network in two and three dimensions. IEEE Transactions on Computers, 39(3):400{404, 1990. K.S. Shea and R.B McMaster. Cartographic generalization in a digital environment: When and how to generalize. In Proceedings AUTOCARTO 9, Ninth International Symposium on Computer Assisted Cartography, pages 56{67, 1989. W.J. Schroeder and M.S. Shephard. Geometry-based fully automatic mesh generation and the Delaunay triangulation. International Journal for Numerical Methods in Engineering, 26:2503{ 2515, 1988. W.J. Schroeder and M.S. Shephard. A combined octree/Delaunay method for fully automatic 3-d mesh generation. International Journal for Numerical Methods in Engineering, 29:37{55, 1990. A.J. Thiessen and J.C.Alter. Precipitation averages for large areas. Monthly Weather Review, 39:1082{1084, 1911. M. G. Voronoi. Nouvelles applications des parametres continus a la theorie des formes quadratiques. J. Reine u. Angew. Math., 134:198{287, 1908. D.F. Watson. Computing the n-dimensional Delaunay tessellation with application to Voronoi polytopes. The Computer Journal, 24(2):167{172, 1981. E. Wigner and F. Seitz. On the construction of metallic sodium. Phys. Review, 43:804{810, 1933. P. Yoeli. An experimental electronic system for contours into hillshaded relief. In International Yearbook of Cartography, pages 111{ 114. Kirschbaum Verlag, 1971.

BIBLIOGRAPHY Zan90]

145

L. Zaninetti. Dynamical Voronoi tessellation, ii. the threedimensional case. Astronomy and Astrophysics, 233(1):293{300, 1990.

Suggest Documents