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.

TL;DR:

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?

Exact predicates and exact constructions Left, a predicate: point P lies inside a triangle, 7.4·10⁻⁸ from one edge, shown in a zoom. The exact orientation test says inside; the same test in 32-bit floats says outside. Right, a construction: lines A, y = 0, and B, y = 3x − 1, intersect at x = 1/3. A 32-bit float cannot hold 1/3: the construction stores x = 0.333333343, a point beside both lines' true intersection. Exact predicates Is the point inside the triangle? P P zoomed 8·10⁵× the exact edge the edge as float32 sees it float32 points Exact predicate: P is inside the triangle. 32-bit float predicate: P is outside the triangle. Exact constructions Where exactly do the lines intersect? y x A: y = 0 B: y = 3x − 1 1/3 zoomed 3·10⁷× 0.333333333… 0.333333343 Exact construction: x = 1/3 32-bit float construction: x = 0.333333343, the nearest float
Predicates answer questions about geometric relations, whereas constructions create geometries.

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.

Rounding changes the answer Lines A, y = 0, and B, y = 3x − 1, intersect at x = 1/3; a third line C, through two 32-bit float points, crosses A just right of it. A zoom onto A shows the 32-bit float values there: 1/3 is not one of them, and the nearest, 0.333333343, lies beyond C. An exact predicate says the exact intersection is left of C, and the correctly rounded one right of C. Rounding changes the answer Is the intersection of A and B left or right of C? y x A B C 0.333333313 0.333333343 0.333333373 B C 1/3 zoomed 6·10⁷× ticks: the 32-bit float values Exact construction, exact predicate: the intersection is left of C. Correctly rounded construction, exact predicate: the intersection is right of C.
The same exact predicate gives opposite answers for the exact and the rounded intersection point.

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.

Note:

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.

Cut and glue, six times Sphere B is cut out of sphere A and glued back on, six times in a row; each cycle should give back A. A naive float32 boolean grows from 3,480 to 37,786 triangles, 15,554 of them slivers, along the seam; Solidean returns the same 1,364 triangles every cycle. Up close, on the rim of A − B after the sixth cut, Solidean's faces of A and B meet in one crease; the naive result has a bundle of slivers and edges there that no longer meet. Cut and glue (A − B) ∪ (A ∩ B) should give back A, every cycle A, and B as a cage A − B and A ∩ B, apart glued back together purple: the faces the cut made Naive float32 boolean cycle 1 cycle 3 cycle 6 triangles 3,480 → 9,194 → 37,786 slivers 452 → 3,210 → 15,554 Solidean cycle 1 cycle 3 cycle 6 triangles 1,364 → 1,364 → 1,364 slivers 10 → 10 → 10 Naive float32: A − B, cycle 6 1,116 triangles here, 1,059 of them slivers Solidean: A − B, cycle 6 7 triangles here, 2 of them slivers each close-up is 1·10⁻⁵ wide, on the rim where the cap (purple) meets A (white)
The cut-and-glue case from our benchmark series: the same chain, once with a naive float32 boolean and once with Solidean.

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.