Professional Documents
Culture Documents
Phillip Lu
Advised by Dianna Xu
Haverford College, Department of Computer Science
Abstract
A method of analyzing the quality of quadrilateral meshing algorithm is presented. By running each quadrilateral of the mesh through
John Robinsons Continuum-Region-Element (CRE) method, the resultant numeric values correlate with the shape parameters of each
quadrilateral. We find that Robinsons Jacobian determinant, even
after accounting for scale, is only as good as a mesh quality measure
as aspect ratio as defined by the CRE method.
Keywords. quadrilateral mesh, mesh quality, mesh analysis
Introduction
effort has gone into triangle mesh construction. As such, though there are
several methods of measuring the quality of a triangle mesh [2, 5], there is
no widely accepted similar metric to measure the quality of a quadrilateral
mesh.
Beyond simple metrics like the amount of polygons in a mesh, it is difficult
to find a measurement of quality that represents the entire mesh without
resorting to measurement of the individual polygonal elements. As such,
almost all mesh quality measures examine the shape quality of each polygon.
As Eppstein states in his presentation to the Meshing Roundtable in 2001,
there are numerous measures of a triangle, such as ratio of circumcricle to
incircle radii, ratio of diameter to height, or perimeter squared to area [5].
However, he mentions that the quality guarantees for quad/hex meshes [are]
much less developed. It is easy to see that finding a metric for triangles is
easier than finding one for quadrilaterals: while triangles can always be inscribed within a circle (the smaller the circle is, the better a triangle is),
not all quadrilaterals can be inscribed within a circle (i.e. non-cyclic quadrilaterals). While diameter to height is a consistent measure of a triangles
quality, it is not for that of a quadrilaterals, as using that measure would
return the same value for both squares and a rhombus (same diameter, same
height). However, we would not want the measure for a square and rhombus to be the same, since the preference for quadrilateral meshes over other
types of meshes is partially due to the quadrilateral having two dominant
local directions, typically associated with principal curvature directions. We
would thus prefer to have a mesh composed of mostly squares, where the two
dominant local directions are, for the most part, orthogonal to each other,
and thus accurately representing curvature directions, as opposed to a mesh
composed of mostly rhombuses, especially extremely tapered ones.
Measuring the quality of a quadrilateral is significantly more difficult than
that of a triangle, since there are more geometric features in a quadrilateral
that need to be properly reflected in the metric itself (i.e. skew, aspect ratio)
than in a triangle. While John Robinson was primarily concerned about
finite element stress testing in his Continuum-Region-Element (CRE) method
paper, he shows that the determinant of the quadrilaterals Jacobian matrix
is a numerical variable that reflects all significant features of a quadrilateral
[8]. This paper will attempt to evaluate the Jacobian determinants viability
as a measurement of quadrilateral mesh.
Throughout this paper, I will use the shorter term quad to refer to
quadrilateral.
2
Related Works
As mentioned before, this paper will be an evaluation of the validity of Robinsons CRE method [8] in mesh quality measurement. Thus, this paper will
draw heavily from the terminology and methods of Robinsons paper and
book (i.e. aspect ratio, skew, and taper are all defined within his works,
and will be integrated within my analysis). Robinson was concerned about
having a general method of finite element stress testing: a method of analyzing the forces on and within physical structures (planes, bridges, dams, etc.)
by breaking them down into many small discrete structural pieces (finite
element) [9]. Since these individual finite elements are made up of simple polygons (polygons with non-intersecting perimeters), there is significant
work done on analyzing the effects of pressure, torque, and bending on materials modeled by simple polygons. As such, the CRE method, while originally
developed as an element testing procedure, can be used to measure a quads
aspect ratio, skew, and taper, amongst other measurements of shape.
The first quad mesh algorithm I will be testing my quality measurement
on will be Atalay, Ramaswami, and Xus quad-tree algorithm [1] for generating a quad mesh. I will be using the mesh quality measures section of
their paper and comparing my results with theirs. The algorithm itself will
be discussed in section 2.1
While the Bommes et al. survey of quad-mesh algorithms [3] contains
multiple quad-mesh algorithms, few would mesh over a 2D point cloud, fewer
still have publicly available executables. Thus, I will be using Jonathan
Richard Shewchuks publicly available triangle mesh generator [10] to create
an initial triangle mesh, from which I will convert to a quadrilateral mesh.
A discussion of this process will be in section 2.2.
2.1
Atalay, Ramaswami, and Xus algorithm for generating quad meshes relies on
using quadtrees effectively [1]. A quadtree, effectively a tree data structure
such that each node has either no children (leaf), or exactly 4 children. Atalay
et al.s algorithm first takes the point set, and creates a quadtree, each node
splitting whenever it has more than two elements in it. This effectively
means that each node will contain at most one point. Further, Atalay et al.s
algorithm ensures that no two neighbouring structure are two or more levels
3
2.2
Shewchuks Triangle
Method
(b) Quad mesh by running the tri-to-quad mesh algorithm over the triangulation.
method was designed to work on any shape of element with any number of
nodes, the elementary shape he derives all the equations in the paper from
is the quad [8]. Since bad shapes can affect the results of finite element
analysis, Robinson developed the CRE method to find the shape parameters that differentiate one shape to another, so as to be able to identify
bad shapes prior to conducting finite element analysis via an automated
analysis system.
In his paper, Robinson shows that any quad shape can be constructed
given four parameters: aspect ratio (AR), skew (), and the respective taper
in two principle directions (Tx , Ty ) [8]. He further shows that given the coordinates of the four points on the quad, one can plug in equations to find all
four shape parameters, the proof of which can be found in Robinsons paper.
I will explain these equations in detail in the sections 3.1 and 3.2 below.
The method and structure for comparing the different algorithms will be
discussed in section 3.3.
3.1
Each of our quads exist as four points in some global Cartesian coordinate
system. To ease calculations and to make sure the quad is in the right
orientation (see Figure 3), we need to convert to a local Cartesian coordinate
system [9]. To do this, the four vectors from the centroid going through
the four bisectors of the quad edges is used (i.e. V 05 being the vector from
the centroid to the bisector of the segment from vertex 1 to vertex 2. See
Figure 4). The corresponding V 06 is used as the vector to define the local x
vector (
x ). To find the corresponding y vector, we cross V 06 with V 07 to
get the normal vector to the plane of the quad (corresponding to the local
z vector,
z ). With
x and
z defined, we can then find the
y by crossing
xi = V 0i
yi = V 0i
7
where i from 1 to 4 indicates the four respective vertices of the quad, and
V 0i is the vector from the centroid to that particular vertex. Thus, we now
have all four vertices in the local coordinate system.
The interpolation function from the old system to the new system can
be also expressed in the following equation, where and are curvilinear
coordinates with limits 1;
x = e1 + e2 + e3 + e4
y = f1 + f2 + f3 + f4
The curvilinear coordinates (, ) of the four points are (1, 1), (1, 1),
(1, 1), (1, 1) for points 1, 2, 3, and 4 respectively (Figure 3). The e and f
coefficients are given in the following equations:
1
1
f1 = (y1 + y2 + y3 + y4 )
e1 = (x1 + x2 + x3 + x4 )
4
4
1
1
e2 = (x1 + x2 + x3 x4 )
f2 = (y1 + y2 + y3 y4 )
4
4
1
1
f3 = (y1 y2 + y3 + y4 )
e3 = (x1 x2 + x3 + x4 )
4
4
1
1
e4 = (x1 x2 + x3 x4 )
f4 = (y1 y2 + y3 y4 )
4
4
We can now produce the shape parameters by using the coefficients produced above.
3.2
Shape Parameters
The four coefficients of e and f each are closely related to the features of the
quad. While I will be explaining how each coefficients affect the features,
Figure 5 provides a quick glance at what the coefficients do.
e1 and f1 may be the most straight-forward coefficients to explain. Since
e1 is the sum of the four x coordinates divided by four, this is the average
value of x. Likewise, f1 represents the average value of y. The coordinates
(e1 , f1 ) thus points to the centroid of the quad.
9
(y4 y1 ) represent the edges of the original rectangle parallel to the y-axis. By
halving the respective sums, we find the average length of the line segments
parallel to their respective axis. By halving the result again, we find the
half-length of the line segments.
e3 and f2 both represent a similar concept: the length between the bisector of a segment on the original rectangle to its respective point on a
skewed parallelogram (see Figure 5c). Again, we can see that e3 is actually
1
1 1
2 ( 2 (x3 x2 ) + 2 (x4 x1 )). Since (x3 x2 ) and (x4 x1 ) represent twice the
distance between the vertex to the respective point on the original rectangle in the x-axis, 12 (x3 x2 ) and 12 (x4 x1 ) represent just the distance.
1
1 1
2 ( 2 (x3 x2 ) + 2 (x4 x1 )) thus represents the average distance of the two.
The logic follows for f2 on the y-axis.
e4 and f4 both represent the distance from a point on the tapered quadrilateral (resembling a trapezoid) to its respective point on the original rectangle. The logic is similar to that of the other coefficients. Taper causes
points 1 and 3 to move in one direction, and points 2 and 4 to move in the
other (as seen when comparing the movement of the vertices on a rectangle
as it gradually becomes a trapezoid). Thus, to measure the average distance
of movement on the x-axis, we add x1 and x3 while subtracting x2 and x4 to
find the total distance of taper. Dividing by 4 yields the average distance
of taper.
The shape parameters are given in Robinsons paper as the following [8]:
e2
f3
e3
skew =
f3
f4
taper in the x-direction(Tx ) =
f3
e4
taper in the y-direction(Ty ) =
e2
aspect ratio =
or
f3
e2
(largest)
We can easily see how e2 and f3 are related to the aspect ratio. e2
represents the half-width, f3 represents the half-length; by dividing one over
the other and taking the bigger of the two, we get the aspect ratio (width
over length, or length over width, whichever is bigger).
Regarding skew, since e3 represents the absolute distance of skew in the
x direction, we need a way of scaling so that if the shape is identical, our
11
metric for skew does not increase as the shape becomes larger. f3 is chosen
for this, as it is a scale of the associated parallelogram in the y direction.
e3
Thus, skew =
f3
Regarding the two tapers, e4 and f4 represent the emphabsolute distance
of taper in the x and y direction, respectively. Similar to what we did with
skew, we need to ground the distance to the size of the quadrilateral. Thus,
taper in the x direction would use the half-width e2 , and taper in the y
f4
e4
direction would use the half-length f3 . Thus, taperx = , and tapery =
f3
f2
From Robinsons paper [8]: the Jacobian matrix for a flat (projected)
quadrilateral is given by:
x
[J] =
x
y
(e2 + e4 ) (f2 + f4 )
=[
]
(e3 + e4 ) (f3 + f4 )
y
Skew
Tx ))
AR
As we can see, all four shape parameters are present within the determinant, in addition to the half-length of the basic rectangle. For analysis,
we will be taking the determinant at the third vertex of the quadrilateral
(top-right), as that vertex has the curvilinear coordinate where = = 1.
Due to the presence of the half-length, the size of the quadrilateral will
affect its Jacobian determinant. This, plus the possibility of having negative
tapers which can actually reduce the determinant to below the determinant
of a square, have led me to suggest a new metric, Modified determinant, for
quadrilateral quality, by removing the mentioned metrics from the equation:
M odDet[J] = (AR)(1 + Tx + (Ty
Skew
Tx ))
AR
Again, we will use only the third vertex of the quadrilateral for analysis.
12
Since the aspect ratio, skew, both tapers, and the Jacobian determinant
are all calculable from only the four points of a quad, these calculations can
be implemented in a relatively straight-forward way. Since quad meshes are
made up of quad elements by definition, I can run the CRE method over all
the quads in the mesh and find out the average of all four respective shape
elements and the Jacobian determinant.
Running the mesh generation algorithm over a set of different inputs
would yield many quad meshes derived from an algorithm. By using the
average value of the shape elements from all the quads from all the meshes
generated by a single algorithm, we can compare that average to that of other
algorithms.
3.3
Comparison Method
I have written a program that takes in a quad mesh in Geomview Object File
Format (.OFF), and outputs the average and worst metric of quads in the
mesh using the method discussed previously. Using this program, for each
mesh generation algorithm I examine, I will run and record the metrics over
several selected point sets. This includes 6 sets of points placed randomly in
various quantities (10, 50, 100, 200, 500, 1000) and a set of 303 points that
is a polygonal representation of Lake Superior. The 6 sets of random points,
once generated, is tested on all the algorithms: all the meshing algorithms
are tested on the same data set.
The metrics that I will specifically compare with are the following:
Total quads
Average/worst
Average/worst
Average/worst
Average/worst
Average/worst
Average/worst
AR
Skew value
Taper in the x-axis
Taper in the y-axis
Jacobian determinant
Modified Jacobian determinant
The tables below show the average (Table 1) and worst (Table 2) metrics of
the resultant meshes using the specified algorithm and the specified input.
13
Total quads
Avg. AR
Avg. skew value
Avg. taperx
Avg. tapery
Avg. Jacobian det.
Avg. mod. det.
10 pts
50 pts
100 pts
200 pts
500 pts
1000 pts
801
1.182521
0.187232
0.15145
0.173889
119.4661
1.609149
3768
1.207838
0.176465
0.156579
0.16305
31.66326
1.631948
7613
1.191341
0.176154
0.151035
0.163772
16.43845
1.601269
15074
1.200362
0.176752
0.150312
0.159986
8.39404
1.608572
37219
1.202959
0.175277
0.149911
0.158285
3.417593
1.610947
75057
1.197838
0.176673
0.149348
0.161002
1.698783
1.605722
Lake Superior
(303 pts)
24444
1.198281
0.185968
0.155988
0.172206
0.013589
1.629233
Total quads
Avg. AR
Avg. skew value
Avg. taperx
Avg. tapery
Avg. Jacobian det.
Avg. mod. det.
10 pts
50 pts
100 pts
200 pts
500 pts
1000 pts
39
5.587552
2.81124
0.25
0.361675
338.2453
8.636394
273
4.619727
2.498871
0.25
0.320704
70.20836
7.061956
555
4.916503
2.540989
0.25
0.329417
51.46118
7.643117
1152
3.703014
1.768101
0.25
0.321119
20.99207
5.718958
2949
4.028027
1.965916
0.25
0.312787
50.31810
6.274875
5934
3.658026
1.790858
0.25
0.309766
4.078406
5.601143
Lake Superior
(303 pts)
1758
5.456112
2.884117
0.25
0.358115
0.031532
8.545263
Total quads
Avg. AR
Avg. skew value
Avg. taperx
Avg. tapery
Avg. Jacobian det.
Avg. mod. det.
10 pts
50 pts
100 pts
200 pts
500 pts
1000 pts
126
1.649084
0.510837
0.25
0.289354
35.49717
2.493724
489
1.647021
0.513869
0.25
0.284134
28.91249
2.475079
1032
1.639505
0.505065
0.25
0.281548
14.93490
2.456549
1935
1.647352
0.508918
0.25
0.282497
8.27568
2.470872
4830
1.643218
0.500012
0.25
0.282193
3.483061
2.464108
9921
1.660241
0.516299
0.25
0.281665
1.69971
2.488185
Lake Superior
(303 pts)
3339
1.678473
0.526546
0.25
0.281482
0.005471
2.514221
Table 1.c Shewchuk Triangle with minimum 20 angles, tri-to-quad meshing average metrics
14
Worst
Worst
Worst
Worst
Worst
Worst
AR
skew value
taperx
tapery
Jacobian det.
mod. det.
10 pts
50 pts
100 pts
200 pts
500 pts
1000 pts
3.000000
1.145833
0.6
0.730798
4783.264
4.89
3.000004
1.333333
0.6
0.730798
2990.188
4.890005
3.000003
1.333333
0.6
0.730798
3140.657
4.890003
3.000007
1.333334
0.6
0.730799
3153.046
4.890004
3.000027
1.875
0.600002
0.7308
3157.515
4.89001
3.000055
1.875002
0.600002
0.730805
3160.102
4.890047
Lake Superior
(303 pts)
3.00073
1.875004
0.600029
0.730854
17.503433
4.890585
Worst.
Worst.
Worst.
Worst.
Worst.
Worst.
AR
skew value
taperx
tapery
Jacobian det.
mod. det.
10 pts
50 pts
100 pts
200 pts
500 pts
1000 pts
42.79535
28.77125
0.25
1.823832
2448.629
64.19302
281.9245
127.9088
0.25
1.044526
3334.426
422.8869
466.2196
294.6275
0.25
7.098919
4191.789
699.3325
559.2251
329.0671
0.25
4.005084
1702.153
838.8374
1777.939
1254.819
0.25
9.556236
107129.7
2666.950
1174.521
624.1278
0.25
3.096078
964.6050
1761.781
Lake Superior
(303 pts)
530.1884
351.1376
0.25
3.855682
8.472251
795.2556
Worst.
Worst.
Worst.
Worst.
Worst.
Worst.
AR
skew value
taperx
tapery
Jacobian det.
mod. det.
10 pts
50 pts
100 pts
200 pts
500 pts
1000 pts
3.34753
1.656701
0.25
0.018427
276.9116
5.021296
4.425987
1.820182
0.25
0.066429
661.7325
6.63898
4.043448
1.757625
0.25
0.072425
200.6794
6.065173
4.180376
1.744029
0.25
0.079237
136.0718
6.270564
4.376373
1.812709
0.25
0.077191
47.29270
6.56456
4.558736
1.899074
0.25
0.086745
32.69729
6.838106
Lake Superior
(303 pts)
4.615184
1.925705
0.25
0.087063
0.273995
6.922818
Table 2.c Shewchuk Triangle with minimum 20 angles, tri-to-quad meshing worst
metrics
15
17
Evaluation
Conclusion
References
[1] Atalay F. B., Ramaswami S. and Xu D. (2012) Quadrilateral Meshes
with Provable Angle Bounds, Engineering with Computers 28, Issue 1,
pp 31-56
[2] Bern M., Eppstein D., Gilbert J. (1994) Provably Good Mesh Generation
Journal of Computer and System Sciences 48, Issue 1, pp 384-409
20
[3] Bommes D., Levy B., Pietroni N., Puppo E., Silva C., Tarini M., Zorin
D. (2013) Quad-mesh Generation and Processing: A Survey, Computer
Graphics Forum 32, Issue 6, pp 51-76
[4] Devadoss S. L. and ORourke J. (2011) Discrete and Computational Geometry
[5] Eppstein D. (2001) Global Optimization of Mesh Quality, from http:
//www.ics.uci.edu/~eppstein/pubs/Epp-IMR-01.pdf [Accessed Dec.
19 2014]
[6] Eppstein D., Goodrich M. T., Sun J. Z. (2005) The Skip Quadtree:
A Simple Dynamic Data Structure for Multidimensional Data, from
http://www.ics.uci.edu/~eppstein/pubs/EppGooSun-SoCG-05.pdf
[Accessed Apr. 19 2015]
[7] Remacle, J.-F., Lambrechts, J., Seny, B., Marchandise, E., Johnen, A.
and Geuzainet, C. (2012) Blossom-Quad: A non-uniform quadrilateral
mesh generator using a minimum-cost perfect-matching algorithm. International Journal for Numerical Methods in Engineering 89, Issue 9,
pp 1102-1119
[8] Robinson J. (1987) CRE Method of Element Testing and the Jacobian
Shape Parameters, Engineering Computations 4, Issue 2, pp 113-118
[9] Robinson J. (1988) Understanding Finite Element Stress Analysis
[10] Shewchuk J. R. (1996) Triangle: Engineering a 2D Quality Mesh Generator and Delaunay Triangulator, Applied Computational Geometry Towards Geometric Engineering, pp 203-222
[11] Tarini M., Pietroni N., Cignoni P., Panozzo D. and Puppo E. (2010)
Practical Quad Mesh Simplification, Computer Graphics Forum 29, Number 2, pp 407-418
21
(a) A quad, with aspect ratio = 1.2, mod. Jacobian determinant = 1.6733
(b) The same quad, rotated 90 to the right. Aspect ratio = 1.5, mod. Jacobian
determinant = 2.0
22