


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!



This paper looks at the implementations for two mesh generating methods, and discusses some optimization techniques that can be used to speed up the time by a factor of at least 10 in some cases. Furthermore, it analyzes the Edgebreaker compression techniques, and use that for compressing/decompressing meshes, both manifold and non-manifold.
Most of the data and images are located on our website here. http://s87412207.onlinehome.us/cs7491/projects/ proj002/proj002Solution.htm
Keywords: surface, compression, mesh compression, edgebreaker
Given a set of points in space that roughly represent a horse, how can we render a descriptive image for the users, one that can con- vince them that the points form a horse, and not a cow, or any other objects? A classical approach is to build a triangle mesh upon these points, i.e. for any three ”close” points, we form a triangle and paint it with a designated color. Given the number of points ranging in the order of million or higher, it is a tough task to triangulate the point set. We propose an automated process, an algorithm that takes in a set of points as input (and a fixed radius, but more on this later), and when finished, will yield corresponding tables that determine what our meshes will be like: their internal data storage, traversal within meshes, etc.
We shall discuss two approaches to the mesh-building process. The brute force algorithm runs in O ( n^4 ) time, with n being the number of vertices, whereas the improved voxelized method runs in almost linear time on average. Improvement can be most easily noted for meshes with large number of points (more than 100). We shall also discuss several speed-up techniques for the voxelized method, rendering it enough power to process meshes with approximately 100 vertices in a mere 6 seconds as shown in table 1.
A triangle mesh may be represented by its vertex data and by its connectivity. The vertex data comprises the coordinates of vertices, and is stored in the ”geometry table.” We also constructed a ”tri- angle table”, which stores every three consecutive corners repre- senting a triangle. If a mesh has t triangles, then it would have 3t corners. Lastly, we also have an ”opposite table”, which stores the opposite corner of a corner c. Before we can define ”opposite”, we must first define the next and previous of a corner. If we have a corner c, then c.next is the corner counterclockwise from c in the same triangle. Similarly, c.previous is the corner clockwise from c in the same triangle. We define d to be the opposite corner of c if and only if: (c.n.v = d.p.v) and (c.p.v = d.n.v). The opposite table is used to traverse manifold meshes. We shall discuss what to do in the case of non-manifold meshes later in the paper.
∗e-mail:[email protected] †e-mail:[email protected] ‡e-mail:[email protected]
Another problem we addressed is how best to store our mesh on a disk drive or transmit it over the network. We are interested in compressing a mesh, and be able to restore it to one whose fea- tures do not differ from the original. Currently, we can only man- ually check this. From our requirement, we must choose a lossless compression technique, and Edgebreaker compression and decom- pression scheme [Rossignac 1999] and wrap and zip decompression scheme [Rossignac and Szymczak 1999] suits our needs. Currently, Edgebreaker is believed to only work on manifold meshes. We pro- pose to convert non-manifold meshes to manifold ones, and then use Edgebreaker to compress these.
2.1.1 Points Generation:
Several implementations were implemented to generate points on spheres, points in balls, and a mixture of both. To uniformly gen- erate points on a sphere, we first randomly pick a random slice, in the range of [− r , r ] where r is the radius of the sphere. We then ran- domly pick an angle in the range of [ 0 , π] and determine the point using Pythagorean theorem. This method is taken for granted, and was not verified for correctness: it should yield equally distributed points on a sphere of fixed radius.
To uniformly generate points in a ball of radius r, we first con- structed a cube of side length r, and randomly choose 3 random numbers in the range of [− r , r ]. We keep a point if and only if it falls within the sphere of radius r centered at c.
To generate points for a hybrid shape, we implemented a blocker function, which serves to remove points from a sphere based on the information about the blocker.
We generalize the sphere, the ball, and the blocker with a class called pointSet, which contains the coordinate of points in the set and the geometry of the point set. After the generalization, we can create hybrid shapes with syntax similar to what has been used in CSG. For example, to create a shpere and a ball with a cut on the sphere, our syntax would look like the following:
CPointSet(d, SPHERE, (0, 0, 0), 3, true)
In the above syntax, d is the user input average distance between neighboring points. With a given d , the number of samples will be
determined automatically according to the formulas: n =
4 3 π r 3 d^3 for spheres and n = 4 π r
2 d^2 for balls to ensure uniform density (or distance between neighboring points) among different geometry. By supply- ing the average distance instead of the number of samples, the user can get away with the task of ensuring such uniform density across different geometries. The point set generated using the above syn- tax is displayed in Figure 1 and Figure 2 shows the triangle mesh generated on top of the same point set. (For more details, the reader can refer to the examples provided on the authors’ website.)
Figure 1: Point set
Figure 2: Triangle Mesh
Further more, to guarantee that a small number of points are not only uniformly distributed but also evenly spaced on a sphere or in a ball, we push each point away from its neighbors within the radius of influence predefined by the user. This method ensures that all points are evenly spaced apart and the distance between any two neighboring points are close to the average neighbor distance.
2.1.2 Brute Force Scheme:
We now have a set of ”random” points in space, how do we ”con- struct” a triangle mesh that would resemble the shape we had in mind when we generated these points? In the brute force method, we shall construct a sphere that would fit all triple of points in our set, and perhaps construct a triangle for all triples that can be cov- ered by a sphere. But 3 points do not define a sphere, and hence we must fix a radius r for every sphere to guarantee existence of a finite
number of spheres for any triple of points (in our case, fixing r will yield two spheres that circumscribe the same three points). Further- more, we would like the sphere circumbscribing a triple of points to not contain any other fourth point. This special property yields a Delauney triangulation for these 3D points. The time complexity of this algorithm is therefore O ( n^4 ).
We construct a circumscribing sphere of radius r on three points by first constructing a circumscribing circle through these points. Once the center of this circle has been determined, we move along the normal to the plane of the circle, starting at the center, by an amount that would make the final destination a center for a sphere of radius r touching all these three points. This amount is easily determined from Pythagorean theorem. The center of the circumscribing circle is also easily determined: it is the intersection of two perpendicular bisectors of two sides of the triangle.
2.1.3 Voxelized Scheme:
In the brute force approach, we pick triplet of points without much regards to their relative positions. When we do consider these rela- tive positions, the time taken to build a mesh can be reduced signif- icantly. Let S be the set of sampled points, xMin be the minimum global x coordinate of points in S, xMax be the maximum global x coordinate of points in S, and give similar definitions to yMin , yMax , zMin , and zMax. Construct a bounding box of dimensions [ xMax − xMin , yMax − yMin , zMax − zMin ], call this B. We choose to further divide B into cubic cells of side length 2 r : r being the radius of the circumscribing spheres that we will construct. Ob- serve that given a point in cell [ i , j , k ], it is sufficient to consider points in the 27 neighboring cells (including [ i , j , k ]) for candidate triplets. Why is this? Suppose P belongs to cell [ i , j , k ], a sphere of radius r that contains P must lie entirely inside these 27 neigh- boring cells. Hence we can eliminate ”unnecessary” triplets, those whose circumscribing sphere radius is larger than r. Although the worse-case time complexity for this algorithm is O ( n^4 ) when there is only one cell, by wisely choosing a suitable radius, and given a suitable set of points, this scheme runs in almost linear time. This will be discussed more in the result section.
2.1.4 Data Structures:
Following the triangle mesh format used in Edgebreaker, we have implemented a geometry table, a triangle table, and an opposite ta- ble to completely describe our mesh. The geometry table stores the x-, y-, and z- coordinates of vertices in the mesh. The trian- gle table stores information regarding each triangle in the mesh: its three corners oriented counter-clockwise from the center of the circumscribing sphere. The opposite table stores opposite corners to each corner in the triangle table. Suppose c and d are cor- ners, then c is d’s opposite corner, and vice versa if and only if ( c. next. v = d. previous. vANDc. previous. v = d. next. v ). We define c. next to be the corner immediately following c in the counter- clockwise orientation of a triangle. We define c. previous to be c. next. next , or the corner immediately following c in the clockwise orientation of a triangle.
Triangles are oriented correspondingly when we get a good triplet of points: no other fourth point lies inside the circumscribing sphere. To build the opposite table, we implement two methods: a brute force approach that is derived from the above definition of opposite corners, and an improved approach in which we pin the success on a good sorting algorithm. We shall describe the sorting approach here.
3 Result
Please refer to the table on our website for a quick reference to the running time for the brute force and voxelized methods. The time given are results from both optimized approaches, with optimal op- posite corners search, and minimized computations and checks.
Although the worst-case time complexity for the brute force ap- proach is O ( n^4 ), in practice, it runs in near cubic time. We conjec- ture that this has to do with the special distribution of points: in this case, it’s a spherical point distribution. In the algorithm, most of the time is taken in generating triples of points; the check on whether a fourth point lies in the circumscribing sphere is called in constant time because there are only constant number of points lie within the 2 r neighboring region of the triplets due to the surface (instead of volume) nature of the sphere, especially when the points are evenly spaced on the sphere.
The worst-case time complexity for the voxelized scheme is also O ( n^4 ): this happens when we unwisely choose a ”bad” radius for the circumscribing sphere. However, since we implemented a ”re- verse” process, where the radius for the shape of points is deter- mined by the radius of the circumscribing sphere, we are guaran- teed a good shape every time, one in which a ”nice” mesh is very likely to be generated. Therefore, it is predictable that in practice, this algorithm runs in linear time.
The method which converts a non-manifold mesh into a mesh that is manifold is O ( n ) because it goes through the corner table only once. However, the time it takes to make a mesh manifold is in- significant with respect to the amount of time it takes to execute the voxelized rolling ball algorithm. Please refer to the Performance of ”makeManifold” section of the authors’ webpage for detailed test results and analysis.
Because our approach does not modify the original edgebreaker al- gorithm, the result of the compression should be the same as in the original paper [Rossignac 1999], and we refer our readers to the paper for more details. However, since in most cases we increased the number of vertices V by two folds, the compression ratio for our approach will be halved. Nevertheless, We observe that the co- ordinates of duplicated points can be reused and it is possible to not decrease the compression ratio on the geometry part and only halve the connectivity compression ratio. We will explore such an approach in our future work.
4 Discussion and Conclusion
If a shell had V vertices and our RAM had only V /5 Bytes, How would our algorithm perform on the compression assuming that a page is V /100 bytes and the goal here is to reduce the number of page faults? In fact, our algorithm does not do well in this sce- nario. Since our algorithm would generate twice as many vertices in general, this will basically double the number of page faults that can happen in the original approach; however, as discussed above, there maybe a way to save the day in this situation and we will explore it in our future work.
As we have discussed, there are two methods that can generate a tri- angle mesh given a set of points. Once a triangle mesh is generated
using one of the above mentioned algorithms, the triangle mesh can be compressed using the edgebreaker algorithm described in [Rossignac 1999].
References
ROSSIGNAC, J., AND SZYMCZAK, A. 1999. Wrap & zip: Linear decoding of planar triangle graphs. In The Journal of Comp. Geom. Theory and Appl.
ROSSIGNAC, J. 1999. Edgebreaker: Connectivity compression for triangle meshes. In IEEE Trans. on Visual. and Comp. Graph.