Exact Predicates ≠ Exact Constructions
Exact predicates guarantee correct geometric decisions, but not exact output coordinates. For robust mesh Booleans, exact constructions matter just as much.
For reliable mesh Boolean operations both exact predicates and exact constructions are essential, especially when operations are performed repeatedly. Exact predicates ensure mathematically correct geometric decisions, while exact constructions preserve the precise coordinates of the newly created geometry.
A single mesh Boolean operation, such as cutting, combining, or subtracting 3D objects, often works without any issues. However, when these operations are performed repeatedly, small inaccuracies can lead to geometric inconsistencies.
Exact predicates are the usual answer, but they only get the decisions right. If the constructed points are not exact, later predicates decide on coordinates that already differ from the intended geometry.
Exact Predicates: Making the Right Decision
Geometric predicates answer questions about geometric relationships. For example, do two line segments intersect? Or does a point lie on the plane defined by three other points?
An exact predicate guarantees a mathematically correct answer for the given input.
This becomes especially important when geometric elements are very close together. Geometric predicates are often evaluated using floating-point arithmetic, where even small rounding errors during calculations can change the result of a test.
Exact predicates prevent these rounding errors from causing incorrect geometric decisions.
But are exact predicates alone enough to guarantee exact geometry?
Exact Constructions: Creating the Right Geometry
Exact predicates alone are not enough, because determining whether two lines intersect is different from calculating their intersection point. For the latter, we also need exact constructions.
Consider two lines, y = 0 and y = 3x - 1.
The two lines intersect at x = 1/3, y = 0.
However, the fraction 1/3 cannot be represented exactly by a finite binary floating-point number.
Instead, the computer stores a rounded approximation of the intersection coordinate.
If this approximated point is used in a subsequent Boolean operation, even an exact predicate may return a different result than it would for the original intersection. The predicate still makes a mathematically correct decision for the coordinates it receives, but it cannot recover the exact position lost during construction.
0.333333343 is the correctly rounded value, the closest a 32-bit float can get to 1/3.
But floating-point calculations don't always produce the closest possible approximation.
Typical floating-point code computing an intersection lands further away than that.
How far off is typical float code? The error is counted in ULPs (units in the last place): one ULP is the gap between two neighboring floats.
A textbook 2D line-line intersection, lines through p1, p2 and p3, p4, computes t = ((p3 − p1) × (p4 − p3)) / ((p2 − p1) × (p4 − p3)) and returns p1 + t (p2 − p1).
A textbook 3D intersection of three planes first builds each plane from a triangle, n = (b − a) × (c − a) and d = n · a,
then returns (d1 (n2 × n3) + d2 (n3 × n1) + d3 (n1 × n2)) / (n1 · (n2 × n3)).
We ran both in 32-bit floats on random inputs with coordinates in [−1, 1], keeping intersections inside that box, and compared each coordinate with the correctly rounded exact result:
- Line-line: 41% of the coordinates are correctly rounded; half are within 1 ULP, one in ten is 5 or more off, one in a hundred 53 or more.
- Plane-plane-plane: 17% are correctly rounded; half are within 2 ULPs, one in ten is 11 or more off, one in a hundred 112 or more.
The tail has no bound: as lines or planes approach parallel, the error grows without limit, and the worst samples here were tens of thousands of ULPs off.
Repeated Operations on Approximate Geometry
When Boolean operations are performed repeatedly, the resulting geometry becomes the input for subsequent operations. If intersection points are only approximated, later operations rely on coordinates that may differ from their mathematically exact positions.
This can lead to mismatched edges, small gaps, or other geometric inconsistencies.
These errors don't necessarily accumulate with every operation, and not every rounding error leads to a failure. Repeated operations increase the opportunities for such inaccuracies to cause problems.
This is particularly useful in applications such as automated manufacturing, interactive 3D editing, and simulations, where many Boolean operations may be performed repeatedly.
Building Geometry That Remains Reliable
None of this is new. Exact predicates and exact constructions have been studied since the 1990s, and large libraries like CGAL use them all the time. The Mesh Arrangements paper (Zhou et al. 2016), for example, computes its intersection points with exact rational numbers.
The hard part is speed. Exact arithmetic is traditionally much slower than floating point, with slowdowns of 1-3 orders of magnitude being common, which is why most mesh processing still accepts the rounding errors. Solidean uses exact predicates and exact constructions throughout and still competes with classical floating-point mesh processing, in our benchmarks often outperforming it. How we get there is something we'll write about more in future posts.
This combination is one of the foundations of Solidean's iteration-proof mesh Boolean operations.