Dealing with extra triangles after boolean comparison (that shouldn't be there) #1165
Replies: 3 comments 14 replies
-
|
Beta Was this translation helpful? Give feedback.
-
In addition to what @pca006132 said, be aware that this is pretty much expected behavior. Subtracting exactly aligned surfaces is indeterminant because an epsilon perturbation one way gives you no surface and the other way gives you an epsilon-thick surface. If you manage to introduce zero floating point error into your verts (which is hard), we do our best to choose symbolic perturbation directions that tend to remove thin surfaces and such, but we can't do it correctly in all situations. Decimating them away after the fact is also an imperfect solution, as you've found. We test our Boolean correctness primarily on volume, as floating-point error easily leads to thin shards, that while ugly, are not entirely wrong. |
Beta Was this translation helpful? Give feedback.
-
@elalish @pca006132 |
Beta Was this translation helpful? Give feedback.
-
I'm doing a boolean subtraction in order to find what changed between one mesh and another.
In about half of my cases I have a lot of extra slivers that protrude from the result, some connected to meshes that are correct, and some disconnected.
Here's one example:

This is doing one mesh minus the other, and the only thing that changed is that the holes have moved by some offset, so only the big solid shapes should appear.
These long triangles at the bottom shouldn't appear:

and these are connected to the part but should not have been added:

Things I tried:
Decompose
on the result to treat each lump separately (what you see as different colors in the screenshots), and I'm filtering out some lumps by volume (only add if volume > 1e-3). This filters some but not all cases, and I don't think it's viable to just keep increasing this numberSetTolerance(1e-3)
andRefineToLength(1)
on the mesh before doing the boolean operationInterestingly, if I find the common area (Intersect) instead of Subtract, I get only one lump without any extra triangles, which seem to me that it means it's able to find correctly the parts that are common and should be removed when doing subtraction.

What else can I do improve the results?
Beta Was this translation helpful? Give feedback.
All reactions