Professional Documents
Culture Documents
Milenko Vic 2019
Milenko Vic 2019
PII: S0010-4485(18)30289-6
DOI: https://doi.org/10.1016/j.cad.2018.10.003
Reference: JCAD 2647
Please cite this article as: Milenkovic V. and Sacks E. Geometric rounding and feature separation in
meshes. Computer-Aided Design (2018), https://doi.org/10.1016/j.cad.2018.10.003
This is a PDF file of an unedited manuscript that has been accepted for publication. As a service to
our customers we are providing this early version of the manuscript. The manuscript will undergo
copyediting, typesetting, and review of the resulting proof before it is published in its final form.
Please note that during the production process errors may be discovered which could affect the
content, and all legal disclaimers that apply to the journal pertain.
Geometric Rounding and Feature Separation in Meshes
Victor Milenkovic
Department of Computer Science, University of Miami, Coral Gables, FL 33124-4245, USA
Elisha Sacks∗
Computer Science Department, Purdue University, West Lafayette, IN 47907-2066, USA
Abstract
Geometric rounding of a 3D triangle mesh is the task of approximating the vertex coordinates by floating point numbers while
preserving the topology. We present a practical geometric rounding algorithm based on a novel strategy: 1) modify the mesh
to achieve a feature separation that prevents topology changes when the coordinates change by the rounding unit; and 2) round
each vertex coordinate to the closest floating point number. The geometric rounding algorithm allows computational geometry
algorithms to interface with numerical algorithms. Mesh feature separation is also useful on its own, for example for enforcing
minimum feature sizes in CAD models. We demonstrate a robust, efficient implementation.
Keywords: geometric rounding, mesh simplification, robust computational geometry
4
We first try a fast, conservative test: there is no intersection
if (u + lv + mw) · (b + b′ − a − a′ ) > 0 for all vertices a ∈ A and
b ∈ B. Otherwise, we compute the t values where the features
are coplanar by solving a cubic, transform the vertices by each
value, and check if the transformed features intersect.
7. Testing
5
4) Approximate 4D free spaces. The meshes jointly approxi- The meshes have median 9,200 and maximum 770,000 tri-
mate the 4D free space of a polyhedral robot that rotates around angles, and median 400 and maximum 88,300 close feature
the z axis and translates freely relative to a polyhedral obsta- pairs. Modification reduces the number of close pairs to me-
cle [16]. Each mesh is the complement of the Minkowski sum dian 18 and maximum 2,000, and displaces median 1.8% and
of the obstacle with a polyhedral approximation of the volume maximum 8.6% of the vertices with median and maximum dis-
swept by the negative of the robot as it rotates over 1/40 of the placements of 0.08d and 10.7d. Expansion displaces median
circle. We employ a rational parameterization of the rotation 2% and maximum 30% of the vertices with median and max-
matrix with parameter t. The coordinates of a rotated vertex imum displacements of 0.4d and 6d. Of the 110 meshes that
are ratios of polynomials that are quadratic in t and linear in we optimize (types 1 to 4), expansion displaces the vertices by
the input coordinates, for total degree 6. The highest precision median 0.5d and maximum 4d, which optimization changes to
vertices of the swept volume are intersection points of three 0.45d and 6d.
triangles comprised of rotated vertices. The degree of their co- We tested 100 type 6 meshes with 4,000 random tetrahe-
ordinates is 13 × 6 = 78 and the input has 27 bit precision, so dra. We used d = 10−5 to increase the number of close fea-
the mesh precision is about 2100 bits. tures hence the difficulty. The meshes have median 168,000 and
maximum 178,000 triangles. They have 13,000 to 14,000 con-
5) Triangulated 3D free spaces. The meshes are triangulated nected components, whereas the custom meshes have at most
3D free spaces for a polyhedral robot that rotates around the z 5 components. There are median 8,800 and maximum 13,400
axis and translates freely in the xy plane relative to a stationary close feature pairs. Modification reduces the number of close
polyhedron, which we compute with our prior algorithm [17]. pairs to median 7,400 and maximum 12,000, and displaces me-
The free space coordinates are (x, y, t) with t a rational parame- dian 0.02% and maximum 0.04% of the vertices with median
terization of the rotation angle. The t coordinates of the vertices and maximum displacements of 0.4d and 0.8d. Expansion dis-
are zeros of quartic polynomials whose coefficients are polyno- places median 0.65% and maximum 0.85% of the vertices with
mials in the coordinates of the input vertices. Their algebraic median and maximum displacements of 0.6d and 24d, which
degree and precision are very high. The implementation uses a optimization changes to 0.5d and 29d.
heuristic to detect degenerate (zero) predicates involving roots We tested 10 meshes with 8,000 random tetrahedra, median
of polynomials because exact computation is too slow. It as- 720,000 and maximum 740,000 triangles, and median 49,000
sumes that a predicate is zero if its sign is ambiguous in 848-bit and maximum 57,000 close feature pairs. Modification reduces
interval arithmetic. The output of the geometric rounding algo- the close pairs to median 41,000 and maximum 49,000, and
rithm is verified in exact arithmetic. displaces median 0.03% and maximum 0.04% of the vertices
with median and maximum displacements of 0.4d and 0.8d.
6) Random meshes. Each mesh is the overlay of random tetra-
Expansion displaces median 0.9% and maximum 1.0% of the
hedra in the unit cube. Each tetrahedron has vertices t, t + a,
vertices with median and maximum displacements of 0.6d and
t + b, and t + c with the coordinates of t uniform in [0, 0.9] and
21d. Comparing these results with those on the smaller random
the coordinates of a, b, and c uniform in [0, 0.1] (Fig. 7). The
meshes shows that increasing the input size by a factor 4.3 has
random coordinates are double-floats and the overlay vertices
little impact on the performance.
where three triangles intersect have about 700 bit precision.
The running time of mesh separation on the random meshes
is approximately linear in the number of close features c with
median and maximum ratios of 0.02 and 0.06. The running
time is similar on most of the custom meshes, but there are a
few outliers where it is quadratic in c. The running time of
geometric rounding equals that of mesh separation plus the time
to round the vertex coordinates to double-float. The latter is
independent of the geometric rounding algorithm. It is under
10% of the total running time in our tests.
8. Discussion on [0, d], the average displacement is the same. The running
time increases because mesh edits take constant time, whereas
The mesh separation algorithm performs well on the tests. expansion is quadratic in the number of close feature pairs.
The median vertex displacement is under 0.5d. The ratio of dis- We could contract non-manifold edges subject to a more
placed vertices to close feature pairs is nearly constant: median complicated precondition. We have found no application where
0.03 and maximum 3.0 for the custom meshes and median 0.04 this is worthwhile. Closed surfaces have no non-manifold edges
and maximum 0.05 for the random meshes. The median num- and open surfaces have few. Tetrahedral meshes have mostly
ber of expansion iterations is 1 for the custom meshes, 4 for non-manifold edges, but they cannot be contracted because do-
the small random meshes, 5 for the large random meshes, and ing so would destroy the tetrahedral structure.
maximum 11. The ratio of running time to close feature pairs Expansion has the potential to increase the volume of the
is close to linear. We observe no difference in performance as d mesh unboundedly, which is why we cannot prove a useful
varies from 10−5 to 10−15 . bound on the number of iterations or the mesh displacement.
This performance corresponds to the assumption that every We estimate the expansion in our tests as the ratio of the vol-
pair of close features is far from every other pair. The com- umes of the mesh bounding boxes before and after expansion.
plexity of modification is linear in the number of short edges The largest increase is 0.001%, including the tests without mod-
and skinny triangles because mesh edits do not create close fea- ification where expansion moves many more vertices. This re-
tures. The error is bounded by d because a vertex is displaced sult helps explain why the number of iterations and the mesh
at most once. The expansion LP achieves the optimal displace- displacement are small in practice.
ment with ∆ = d because the truncation error is negligible. The standard linear distance function, in which l and m are
Thus, the number of steps is constant. Optimization converges functions of the vertex coordinates, is much slower than our
in a few steps because the initial displacement is close to d. version, in which l and m are LP variables bounded by 1. If the
A more realistic assumption is that every pair of close fea- bound is reduced to 0.001, the running time drops and the error
tures is close to a bounded number of close feature pairs. An grows. If it is set to zero, the running time drops further, but in
analysis under this assumption is a topic for future work. rare cases expansion does not converge.
We tested the benefit of modification by performing mesh Geometric rounding can be sped up by skipping optimiza-
separation via expansion alone. The median vertex displace- tion when modification plus expansion achieve mesh separation
ment increases slightly, the mesh size increases proportionally with a small displacement. This is the case for the custom and
to the number of short edges, and the running time increases random meshes. The median error after expansion is well under
sharply. To understand the small change in displacement, con- d, and optimization reduces it by 10% and 16%, and takes 70%
sider two vertices that are e apart. Modification displaces them and 88% of the running time.
by e/2, versus (d − e)/2 for expansion. Assuming e uniform
7
The results on tetrahedral meshes suggest that mesh sepa- Vitae
ration can play a role in mesh improvement. It simultaneously
improves the close features by displacing multiple vertices in a Sacks is a professor in the Department of Computer Sci-
locally optimal manner, whereas prior work optimizes one ver- ence of Purdue University. His research interests are Computa-
tex at a time. The tests show that the simultaneous approach is tional Geometry, Computer Graphics, and Mechanical Design.
fast and effective. It readily extends to control other aspects of Milenkovic is a professor in the Department of Computer Sci-
the mesh, such as triangle normals. Applying the approach to ence of the University of Miami. His interests are Computa-
other mesh improvement tasks is a topic for future work. tional Geometry, Packing and Nesting, Graphics, and Visual-
ization.
Acknowledgments
8
Practical geometric rounding algorithm for 3D triangle meshes.
Validated on fives types of meshes, including large and high bit complexity.