Mesh Union & Difference - What are the constraints on the meshes?

Hi There,

I have a couple of intersecting meshes, which appear to be “good” as far as Panels >> Mesh Repair is concerned, but where Mesh Union and Mesh Difference laugh at me and do nothing!

What are the requirements on meshes that meshes must follow in order for them to Union correctly? I’m not wanting a fix for this particular case; I just want to understand it!

Many thanks,

Bob

MeshUnionDiff.gh (38.8 KB)

Be it curve booleans, solid (surface/polysurfaces/breps) booleans or mesh booleans, the “rules” are always the same:
Avoid co-planar faces.
You want the 2 solids to not share vertexes, edges or faces.
Make intersections that completely intersect.
Rhino needs to easily detect “in” and “out”.

Here an example with 2D curves:
good intersection
2021-01-12 03_38_47-Window

bad/risky intersection
2021-01-12 03_38_52-Window
In this second case, the small rectangle was slightly rotated, resulting in a dirty cut.
Tolerances will make you meet such situations.


In your case with meshes, the 2 meshes share most of their vertexes and faces, perfectly aligned.
Rhino fails to detect “in” and “out” , giving you an “incorrect” result.

Thank you again, Riccardo. I’m getting there!

In this particular case, none my attempts to move one of the meshes by a small amount in any axis, nor to scale to something just under 100% worked, since the two meshes are essentially the same, except for the caps. One gets anomalies in all cases.

But thank you again for the advice.

Bob

This actually all came about because I tried to use Mesh Tools+ Mesh Caps tool, which comes with a cute ‘Distance’ option, which also fails to understand the difference between ‘in’ and ‘out’, giving a cap that went in for one end and out for the other. Trying both at once and then unioning was a complete failure! Sigh!

There is a plugin Carverino which I have found useful when the native GH mesh booleans didn’t work. The site says Rhino 4 and 5 but it does work for 6.

Thank you! I’ll have a look at that. I hope that it also works for 7!

Bob

And it works perfectly, at least for this simple test case. All the booleans in one component!

Back to my indolent ways!