Conceptcore
Geometric robustness problem
Also called robustness of geometric algorithms.
Rounded geometric tests in a modeler can disagree with each other, so the computed topology can be impossible and Booleans or offsets fail.
The geometric robustness problem is the failure of geometric programs that make exact decisions from rounded numbers. A modeler decides with signs, such as whether a point is above a plane or whether two edges cross, and the topology of its output follows from these decisions. With floating point, each sign is computed from rounded values, and the signs need not agree with each other or with any real input. The program can then build a face that does not close, a vertex on both sides of a plane, or a solid that breaks the Euler-Poincaré formula, and it may crash or loop. There is no single formal problem: the name covers a family of failures and of fixes, and authors define a robust algorithm in different ways.
In plain words
A CAD program asks yes or no questions about shapes. Is this corner above that face? Do these two edges cross? The answers decide how the pieces of a model connect.
The computer computes with numbers that are rounded after each step. Most of the time a small rounding error does not change an answer. But when a corner is almost exactly on a face, the error is larger than the true distance, and the answer can be wrong.
One wrong answer is not the real trouble. The trouble is two answers that cannot both be true, such as "this corner is above the face" and "this corner is below the face", asked in two different ways. The program trusts both, connects the pieces in an impossible way, and the result is a broken model or a crash.
The idea
Predicates and constructions. A geometric program has two kinds of steps. A construction computes new numbers: the point where three planes meet, the plane of a face, the parameter where a ray enters a box. A predicate computes a sign from numbers: the orientation test of three points in the plane or four points in space, the side of a point against a plane, the in-circle test. Only predicates choose branches, so the combinatorial output, which vertices bound which edges and which faces meet at which vertex, is a function of the predicate values alone.
Exact reals and floating point. Algorithms are designed and proved in the real RAM, where every sign is exact. In that model a set of answers always comes from one real input, and so it obeys every geometric law: a point is on one side of a plane only, three cyclic orders of a triangle have one orientation, a constructed point lies on the planes it was built from. A floating-point program computes each sign from rounded values, and the error is largest exactly when the true value is near zero (catastrophic cancellation). A set of rounded answers may come from no real input at all. Proofs assume that it does, so they no longer apply.
Three sources of failure. The examples below show each one.
- Rounded predicates. The same sign, computed by two formulas that are equal in exact arithmetic, comes out different.
- Rounded constructions. A constructed point is rounded, so it is not on the objects it came from, and later predicates on it see a small error as real geometry.
- Degenerate input. Coplanar faces, touching solids and a vertex on a face give predicates that are exactly zero. CAD models have many such cases on purpose, because designers align faces. Code that treats zero as an error, or that assumes general position, fails even with exact arithmetic.
What "robust" means. Hoffmann separated accuracy, how close the numbers of the output are to the true ones, from robustness, whether the program ends with a valid and consistent result. There are several formal goals in use:
- Exact decisions. Every predicate is evaluated exactly on the input, so the combinatorial output is the exact one. This is exact geometric computation.
- Consistent decisions. The decisions need not be exact, but they must be consistent with some real input near the given one, so the output is a valid structure for a perturbed input. Hoffmann, Hopcroft and Karasick built Boolean operations on polyhedra in this style, deriving an uncertain sign from decisions already made.
- Tolerances. Two entities closer than a tolerance are taken as equal. This is common in commercial kernels, but it is not a proof of anything: "closer than " is not transitive, so a chain of almost equal points can join points far apart.
The fixes in short. Exact integer or rational arithmetic; floating-point filters with an exact fallback (Shewchuk's expansion sum, interval arithmetic); an infinitesimal move of the input that removes the degenerate cases (simulation of simplicity); and the design of algorithms whose decisions are few and independent, so that they cannot contradict each other.
Examples
All numbers below were computed in IEEE double precision, with , and checked with exact rational arithmetic on the same doubles.
A triangle with three orientations. The orientation test page gives a point with and , where the exact value is and the float value is negative. The three cyclic orders of the same triangle are equal in exact arithmetic, but in floating point:
| order | float value | float sign |
|---|---|---|
| right turn | ||
| collinear | ||
| left turn |
Over the grid of points , , the three orders do not all agree for of the points, and for points they give both a left and a right turn. A program that tests the triangle once from each vertex sees an impossible triangle.
A point on both sides of a face. Let a face lie in the plane of , and , as doubles, and let be a point near it. The side of is the sign of the determinant of the differences from a base vertex. With base the float value is , below the plane. With base , the determinant of , , , which is the same number in exact arithmetic, the float value is , above the plane. The exact sign is negative. Two edges of a B-rep that test the same vertex against the same face, each with its own base vertex, disagree about where the vertex is. In a test of points placed in the plane of the triangle and rounded to doubles, gave different signs with the two base vertices.
A constructed point that is off its lines. The lines and meet at . The usual formula for the crossing of two segments, from to and from to , gives in floating point. The line through and passes exactly through , so the three lines are concurrent. The float orientation of , and the computed point is , a left turn. The program sees a tiny triangle between three lines that meet in one point. In a solid, three planes through one line give the same kind of sliver face.
Classroom examples. Kettner, Mehlhorn, Pion, Schirra and Yap give small float inputs, built on grids like the one above, on which a textbook incremental convex hull program returns a polygon that is not convex or leaves out a point far from the polygon. The programs are correct in the real RAM, and the only change is the rounding of the orientation test.
A degenerate case with exact numbers. The cubes and share the face . Every point of that face gives a side-of-plane value of exactly against both cubes. The page on regularized set operations shows that the regularized intersection is empty while the plain one is the face. A Boolean that takes as "inside" keeps the face, and one that takes it as "outside" drops faces it needs. No precision helps here, because the issue is the rule for zero.
Where it is used
- Boolean operations. Solid Boolean operations, boundary evaluation and vertex neighborhood classification cut faces at rounded points and then classify the pieces. Most of their published failures are of the kinds above. The same holds for mesh Boolean operations.
- Ray casting and classification. CSG ray casting can return a sliver interval at a shared face when the exit from one primitive and the entry into the next are rounded apart.
- Intersections of curved surfaces. Surface surface intersection and solid offsetting construct curves by numerical methods, so their output is always approximate, and the decisions made on it need a tolerance or a proof of consistency.
- Computational geometry in general. Convex hulls, Delaunay triangulations and sweeps (degeneracies in sweeps) have the same failure modes. The classroom examples are planar hulls.
- Mass properties. Volumes and moments are constructions, not decisions, so rounding makes them a little wrong but not inconsistent. Mirtich's method is exact with rational input.
References
- Christoph M. Hoffmann, The problems of accuracy and robustness in geometric computation, IEEE Computer 22(3), 31 to 41, 1989, the whole paper (why rounded tests give inconsistent topology in solid modeling, and the approaches of exact arithmetic, tolerances and consistent reasoning)
- Lutz Kettner, Kurt Mehlhorn, Sylvain Pion, Stefan Schirra and Chee Yap, Classroom examples of robustness problems in geometric computations, Computational Geometry 40(1), 61 to 78, 2008, the whole paper (float inputs on which the orientation test fails and a textbook convex hull program gives a wrong result)
- Chee K. Yap, Towards exact geometric computation, Computational Geometry 7(1-2), 3 to 23, 1997, the discussion of the sources of nonrobustness and of the exact geometric computation approach
- Christoph M. Hoffmann, John E. Hopcroft and Michael S. Karasick, Robust set operations on polyhedral solids, IEEE Computer Graphics and Applications 9(6), 50 to 59, 1989, the whole paper (Boolean operations in floating point that keep the topological decisions consistent)
- Christoph M. Hoffmann, Geometric and Solid Modeling, An Introduction, Morgan Kaufmann, 1989, Chapter 4, Robust and error-free geometric operations
Where this leads
About this page
The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.
| Ladder | Level | What the next level needs |
|---|---|---|
| Human proof | H0 no proof |
|
| Lean | L0 no Lean part |
|
| Visual | V0 none |
|
| Writing | W4 complete |
|
Tag 7BX1AZ Edit this page History Report an error Markdown