Download as a PDF

20 downloads 338180 Views 2MB Size Report
Department of Computer Science and Engineering ... and its most time consuming part is accelerated by the space subdivision ..... Angle's intervals in degrees.
Space Subdivision for the Adaptive Edge Spinning Polygonization MARTIN CERMAK1, VACLAV SKALA Department of Computer Science and Engineering University of West Bohemia in Pilsen Univerzitni 8, 306 14 Plzen CZECH REPUBLIC

Abstract: - This paper presents a speed-up of the adaptive approach for polygonization of implicit surfaces. The original algorithm generates well-shaped triangular mesh with respect to a given approximation error. Our modification accelerates the method significantly and therefore, use for more complex object is much easier now. The algorithm is based on the surface tracking scheme and its most time consuming part is accelerated by the space subdivision technique. Our approach is compared with the original regarding to speed and to quality of polygonal mesh generated as well. Key-Words: - polygonization, edge spinning, acceleration, space subdivision, implicit surfaces

1 Introduction Implicit surfaces seem to be one of the most appealing concepts for building complex shapes and surfaces. They have become widely used in several applications in computer graphics and visualization. An implicit surface is mathematically defined as a set of points x in space that satisfy the equation f(x) = 0. Thus, implicit surfaces visualization typically consists of finding the zero set of f, which may be performed either by polygonizing the surface or by direct ray tracing. There are two different definitions of implicit surfaces. The first one [3], [4] defines an implicit object as f(x) < 0 and the second one, F-rep [13], [15], [16], [17] defines it as f(x) ≥ 0. These inequalities describe a half space in E3 and an object defined by these inequalities is usually called solid (or volume). If f is an arbitrary procedural method (i.e. a ‘black box’ function that evaluates x) then the geometric properties of the surface can be deduced only through numerical evaluation of the function. The value of f is often a measure of distance between x and the surface. The measure is Euclidean if it is ordinary (physical) distance. For an algebraic surface, f measures the algebraic distance. Existing polygonization techniques may be classified into several categories. Spatial sampling techniques (exhaustive enumeration of a given region) that regularly or adaptively sample the space to find the cells that straddle the implicit surface [2], [3], [5]. Surface tracking approaches (also known as continuation methods) iteratively create a triangulation from a seed element by marching along the surface [1], [3], [11], [12], [14], [18].

1

Surface fitting techniques progressively adapt and deform an initial mesh to converge to the implicit surface, [15]. Particle systems (physically based techniques) start from initial positions in space and seek their equilibrium positions, i.e. positions where a potential function | f | is minimal – on an implicit surface, [9], [10]. The desired polygonal approximation is then obtained by computing the Delaunay triangulation associated with the points.

2 Data structures A triangular mesh generated by the Edge spinning algorithm is kept in winding edges data structure and the resulting mesh is complete with neighborhood among triangles. During polygonization, edges lying on a triangulation border are contained in the active edges list (AEL) and they are called active edges. Each point of an active edge has two pointers to its left and right active edge (active edges are oriented, so, left and right directions are in active edges’ orientation).

3 Edge spinning principle The algorithm is based on the surface tracking scheme and therefore, there are several limitations. A starting point must be determined and only one separated implicit surface can by polygonized for such point. Several disjoint surfaces can be polygonized from a starting point for each of them. The method is described in detail in [7]. The whole algorithm consists of the following steps.

Supported by the Ministry of Education of the Czech Republic - project MSM 235200002

1. Initialization of polygonization: a. Locate a starting point p0 on a surface and create the first triangle T0. b. Insert edges (e0,e1,e2) of the first triangle T0 into the active edges list. 2. Polygonize the first active edge e from the active edges list. 3. Update the AEL; remove the currently polygonized active edge/s and insert the new generated active edge/s at the end of the list. 4. If the AEL is not empty return to step 2.

In the adaptive approach the distance test has to be performed among the new triangle (its bounding sphere) and the active edges.

The first steps of the algorithm are illustrated in Fig. 1.

Fig. 2. Overlapping triangles. If an active edge crosses the extended bounding sphere of the new triangle, the triangle will not be created and the situation is solved for example as in Fig. 3, see [7] for more details.

Fig. 1. Beginning of polygonization. At the beginning of polygonization, the algorithm has to know the maximal size of triangles that is represented by the constant: - LODmax – the maximal length of triangles’ edges, i.e. maximal level of detail; note that the constant is given by a user. The algorithm generates triangles according to this criterion and to the local surface curvature estimation as well, [6].

4 Distance test The Edge spinning algorithm marches over the surface of an implicit object. This principle is known as a surface tracking scheme (also known as a continuation scheme). Surface tracking approaches have a common problem with a detection of a global overlap. New triangles must not cross the others generated before. For non-adaptive approaches, there is enough to perform the distance test among the new point pnew and points of active edges. If the distance is less then some limit then the algorithm solves this situation, detailed description see in [8]. In an adaptive approach, triangles of different size are created and the test among points is not good enough. In the case illustrated in Fig. 2 is seen that the new triangle would cross another one generated before although no active edges’ point lies inside of the extended bounding sphere of the new triangle.

Fig. 3. Solution of overlapping triangles. The distance test is performed before creating of each triangle and its time complexity is O(N), where N is a number of active edges. For complex objects, this variable grows up and polygonization speed strongly depends on it.

5 Space subdivision technique Advantageous solution is dividing of space into subspaces (sub-areas). Then, the active edge that probably crosses the new triangle, must incident to the same subarea like the new triangle (centre of its bounding sphere) or to the closest neighborhood. In our approach, we define a polygonization area that is divided into (MxMxM) sub-areas, where M is a number of divisions in one axis. Note that the given polygonization area should contain the whole implicit object.

During polygonization, the algorithm only tests active edges which incident to adjacent sub-areas. The time complexity is O(K) in this case, where K is a number of active edges incident with the adjacent sub-areas and K LODmax. This is the only condition. In order to use the space subdivision technique, the data structures introduced above have to be slightly extended. Each active edge’s point should contain the index of subarea in which lies and each sub-area should have its own dynamically allocated list of points located inside. The sub-areas are implemented as an array and each of them has its unique index.

Jack Morph

3,50 Spped-up

Fig. 4. A triangulation border during polygonization of a sphere object and visualization of space subdivisions (10x10x10).

Genus

4,00

Tap

3,00 2,50 2,00 1,50 1,00 10

16

24

40

63

100

M

Fig. 7. Comparison of speed-up according to number of division used.

Fig. 5. Implicit objects used in the experiment.

5117

4386

3525

3245

3084

2,39

2,53

2,95

3,67

3,99

4,20

2. t[ms] 13439 1 ν

5438

4816

4437

4066

3715

3556

2,47

2,79

3,03

3,31

3,62

3,78

3. t[ms] 12178 1 ν

5408

5377

5448

4907

3996

3495

2,25

2,26

2,24

2,48

3,05

3,48

4. t[ms] 30143 22042 21721 21200 21000 20990 20689 1 1,37 1,39 1,42 1,44 1,44 1,46 ν

Table 1. Measured values of the computing time and speed-up from the experiment; 1. Genus, 2. Jack, 3. Morph and 4. Tap object. The value ν represents the speed-up that has been computed by the following simple formula. ν=

t NA , tM

where tNA is the computing time without using the space subdivision and tM is the computing time achieved with space subdivision technique according to values in Table 1, i.e. M = 10, 16, 24, 40, 63, 100. Space subdivision technique has no effect to quality of polygonal mesh generated. For all space divisions used, a number of triangles and vertices generated has been the same. The measured values are in Table 2.

Triangles Vertices Angle criterion E_length criterion

Genus 90166 45079 0,757 0,851

Jack Morph Tap 85344 74706 90968 42674 37355 45486 0,787 0,8 0,73 0,869 0,875 0,829

Table 2. Number of triangles and vertices generated in our experiment. The value Angle criterion in Table 2 means the criterion of the ratio of the smallest angle to the largest angle in a triangle and the value E_length criterion means the criterion of the ratio of the shortest edge to the longest edge of a triangle. These values show the quality of resulting triangles generated. The histogram in Fig. 8 illustrates the triangulation quality as well. It can be seen that the Edge spinning

110-120

5417

100-110

1. t[ms] 12938 1 ν

90-100

100

80-90

63

70-80

40

60-70

24

50-60

16

40-50

10

30-40

NA

50,00 45,00 40,00 35,00 30,00 25,00 20,00 15,00 10,00 5,00 0,00 20-30

M

method generates about 80% triangles with angles in interval degrees. For the visual comparison, see Appendix A.

Number of angles [%]

The next tests of the accelerated approach have been made on several objects illustrated in Fig. 5. The results in Fig. 7 show that the total speed-up depends on a given implicit object. For simple implicit functions, the distance test is the main part of the computing time and therefore, the speed-up is higher. For complex objects such as the Tap, calling the function is the most time consuming and acceleration in distance test part is not so significant. Table 1 contains exact values from the experiment.

Angle 's inte rvals in de gre e s

Fig. 8. Histogram of triangles shape quality for the Edge spinning, algorithm; generated according to values in Table 2, the Genus object.

7 Conclusion In this paper, we have presented the new fast modification of the adaptive Edge spinning algorithm for polygonization of implicit surfaces. Experimental results proved that the selection of subset of candidate points by the space subdivision scheme is an effective way for this type of geometric algorithms. The Edge spinning algorithm generates a well-shaped triangular mesh that is not influenced by the acceleration and the polygonization speed has been significantly increased. Acknowledgement: The authors of this paper would like to thank to all who contributed to development of this approach, especially to colleagues MSc. and PhD. students at the University of West Bohemia in Plzen. References: [1] Akkouche, S., Galin, E.: Adaptive Implicit Surface Polygonization using Marching Triangles, Computer Graphic Forum, 20(2): 67-80, 2001. [2] Allgower, E.L., Gnutzmann, S.: An algorithm for piecewise linear approximation of implicitly defined two-dimensional surfaces. SIAM Journal of Numerical Analysis, 24, 452-469, April 1987. [3] Bloomenthal, J.: Graphics Gems IV, Academic Press, 1994. [4] Bloomenthal, J.: Skeletal Design of Natural Forms, Ph.D. Thesis, 1995. [5] Bloomenthal, J., Bajaj, Ch., Blinn, J., CaniGascuel, M-P., Rockwood, A., Wyvill, B.,

Wyvill, G.: Introduction to implicit surfaces, Morgan Kaufmann, 1997. [6] Cermak,M., Skala,V. Surface Curvature Estimation for Edge Spinning Algorithm. International Conference on Computational Science ICCS 2004, Krakow, Poland, 2004. [7] Cermak,M., Skala,V. Adaptive Edge Spinning Algorithm for Polygonization of Implicit Surfaces. Computer Graphics International CGI 2004, Crete, Greece, 2004. [8] Cermak,M., Skala,V. Polygonization by the Edge Spinning. 16th Conference on Scientific Computing Algoritmy 2002, Slovakia, ISBN 80-227-1750-9, September 8-13, 2002. [9] Figueiredo, L.H.: Computational Morphology of Implicit Curves, doctoral thesis, IMPA, 1992. [10] Figueiredo L.H., Gomes J.M., Terzopoulos D., Velho L.: Physically-based methods for polygonization of implicit surfaces, In Proceedings of Graphics Interface 92, 1992. [11] Hartmann, E.: A Marching Method for the Triangulation of Surfaces, The Visual Computer (14), pp.95-108, 1998.

Appendix A

[12] Hilton, A., Stoddart, A.J., Illingworth, J., Windeatt, T.: Marching Triangles: Range Image Fusion for Complex Object Modelling, Int. Conf. on Image Processing, 1996. [13] “Hyperfun: Language for F-Rep Geometric Modeling”, http://cis.k.hosei.ac.jp/~F-rep/ [14] Karkanis, T., Stewart, A.J.: Curvature-Dependent Triangulation of Implicit Surfaces, IEEE Computer Graphics and Applications, Volume 21, Issue 2, March 2001. [15] Ohtake, Y., Belyaev, A., Pasko, A.: Dynamic Mesh Optimization for Polygonized Implicit Surfaces with Sharp Features, The Visual Computer, 2002. [16] Pasko, A., Adzhiev, V., Karakov, M., Savchenko,V.: Hybrid system architecture for volume modeling, Computer & Graphics 24 (6768), 2000. [17] Rvachov, A.M.: Definition of R-functions, http://www.mit.edu/~maratr/rvachev/p1.htm [18] Triquet, F., Meseure, F., Chaillou, Ch.: Fast Polygonization of Implicit Surfaces, Int. Conf. WSCG 2001.