2.3 GPU-based Processing
3.1.4 Uniform CVD-based Mesh Coarsening
There are many applications where high quality triangulations are required, e.g. for finite elements analysis. To speed up the simulations it is desirable to make the mesh as coarse as possible. At the same time to have a stable simulation a mesh with well-shaped triangles (triangles that are as close as possible to equilateral) is required.
Given an input surface polygonal mesh M with m faces Fj, we want to coarsen the mesh M to a k output number of vertices. This means building a CVD clustering with k clusters. We use the Valette algorithm from Section 3.1.3, followed by a triangulation.
A uniform density function ρ(x) needs to be assumed to yield a uniformly coarsened mesh, i.e. a triangulation with well-shaped triangles. In this case we can safely remove any face weight ρj from our computations, i.e. we set ρj = 1 The energy∗∗ECV D0 in Eq. (3.14) computed only once before the algorithm starts. Correspondingly, for each cluster Ci two values P Aj and P Ajγj are saved and updated.
Figure 3.1 shows the result of a uniform mesh coarsening applied to the sphere model.
As expected, the algorithm yields a uniform (well-shaped triangles) output triangulation.
The final triangulation is created by inserting one vertex per cluster at the position equal to the cluster centroid γi = P Ajγj/P Aj, which is easily computed because the values P Aj andP Ajγj are already available. The vertices are connected, as described in [VC04], according to the cluster’s adjacency, where a triangle is created for each vertex where three Voronoi regions meet.
(a) (b) (c) (d)
Figure 3.1: (a) Sphere model with 28.5k triangles. Uniform coarsening results for k = 300 clusters which results in a mesh with 300 vertices: (b) Initial cluster growing. (c) Uniform CVD clustering. (d) Triangulation of (c).
Although, the result is visually pleasing there are many issues related to the CVD-based mesh coarsening. A discussion of these issues follows.
Initialization problem:
The problem of a “good” initialization, i.e. the starting positioning of seeds, has a long history as the problem of identifying the “true” number of clusters. Here one may ask if or why is the initialization so important, because the optimization step in any case provides a
“good” result regardless of the initial configuration, as presented in Figure 3.1. There are two important aspects which are strictly related to the initialization:
1. Faster convergence. If the initialization is very close to the final result, then the algorithm converges very quickly thus becoming very efficient.
2. More qualitative results. A better initialization always leads to a better clustering result, i.e lower clustering energy. It is well known that during optimization the clusters can be trapped in some region and cannot “jump” easily to other high energy regions to lower the total energy.
A “good” initialization is one that is very close or mimics the final solution of a given problem. It can be observed in the Figure 3.1(b) that a random sampling followed by an initial growing is far away from the final CVD result.
A random sampling is the simplest and most often employed strategy. Sometimes a multiple run random initialization approach (computationally very expensive) is also em-ployed, there the solution with smallest energy is chosen. However, a random initialization leads to a random results, as presented in Figure 3.2. Although the number of clusters is fixed the resulting triangulations differ and some feature points are lost.
The Farthest Point initialization [KJKZ94] is more appropriate in this context. It starts with some random seed and then iteratively adds a seed with maximum distance to the al-ready existing seeds. Although this is a good strategy, still a high computational complexity O(km) (k number of clusters and m total number of elements) makes it less attractive.
Figure 3.2: Results for two different random initializations with k = 527 clusters. (left) Uniform clustering. (right) Corresponding triangulation.
In Section 3.1.5 we propose a new initialization approach, which proves to be a good solution for a uniform CVD-based clustering.
Vertex placement:
In [VC04] the final triangulation is enhanced using as a vertex in the triangulation an original mesh vertex which is the closest to the cluster centroid γi(Eq. (3.6)). Although, this works well for planar or highly tessellated meshes, Figure 3.3(d) depicts an example where this fails to work properly. Note that, the result presented in Figure 3.3(d) is approximately identical to that in Figure 3.3(c) where only the cluster centroid γi is used. In Figure 3.3(f) we exemplify this situation showing that the closest vertex is a suboptimal choice, not to say that identifying these vertices requires an additional computational effort.
In [VKC05] and [VCP08] the Quadric Error Metrics (QEM) [GH97] was employed to relocate the cluster centroid position. As proposed in [Lin00], for each face Fj an associated 4 × 4 quadric matrix Qj is computed, which provides a very convenient representation for evaluating the squared distance between any point and the plane containing Fj. Then, for each cluster Ci a sum of all QEM of the cluster’s faces can be used to compute the
“optimal” cluster’s centroid position. In this case the centroid position has the smallest deviation from all planes containing Fj in a cluster.
In [VKC05] the QEM is used in the final post-processing to enhance the quality of the approximating mesh. Figure 3.3(e) shows the result of using the QEM for final vertex
(a) (b) (c)
(d) (e) (f)
Figure 3.3: Cube model with 30k triangles. Uniform coarsening results for k = 274: (a) Initial cluster growing. (b) Uniform CVD clustering. (c) Triangulation of (b) with cluster centroid as vertex. (d) Triangulation of (b) with closest original mesh vertex to the cluster centroid as vertex. (e) Triangulation of (b) with the QEM approach. (f) Illustration of an inadequate mesh vertex selection according to the smallest distance. The red vertices are the closest and not the green one.
placement, which indeed outperforms the results presented in Figure 3.3(c)-(d). In [VCP08]
this post-processing is embedded in the clustering process itself. At each iteration a better cluster centroid is computed and injected in the energy computation. This is in the same spirit as done for constrained CVD [DGJ03].
However, additionally to an increased computational complexity the QEM approach fails sometimes to provide reliable results. Figure 3.4 provides such an example. In a given situation a cluster (composed from three intersecting planes) contains two feature lines which are almost parallel, thus the optimal vertex position is far away from the original mesh vertices. To fix this problem additional checks are required to detect and project the vertex on the original mesh.
Figure 3.4: Triangulating with QEM post-processing. (left) Clustering result, number of clusters k = 527. (right) Triangulation of (left) with QEM positioning.
It is clear that the above described possibilities lack efficiency in many situations. A possible solution in this case is to use an adaptive CVD [VKC05], [CK06] where each triangle gets a specific density related to the surface property. Thus if the higher curvature regions have a larger weight than lower curvature regions the cluster centroid γi (Eq. (3.6)) will be “attracted” to the mesh surface, which in turn gives a lower approximation error.
Section 3.2 shows how this approach works.
Connectivity check for valid triangulation:
To obtain a valid triangulation in the final clustering each cluster has to be a 1-connected set of faces. To ensure this constraint in [VKC05] a three-step approach is proposed:
1. Perform the clustering without any checks.
2. Clean any disconnected cluster, by removing the smallest components and leaving the largest component only.
3. Perform the clustering with an additional embedded check, which does not allow the clusters to get disconnected.
As pointed out in [CK06] the algorithm proposed in [VKC05] for the third step does not guaranty a genus zero clusters, which is also a prerequisite for a valid triangulation.
In Section 3.1.5 we propose a new Vertex Boundary-edge Count approach, which is able to handle such configurations.