Mesh boolean difference operation problem

Hi everybody.
I came through this problem and I can’t figure out what’s wrong with the input.
In the attached file I try to make a boolean difference, subtracting the blue items from the red one.
I tried using Mesh.CreateBooleanDifference in my plugin, I tried both subtracting single blue items and a list of the two blue items.
Looks like the first difference succeeds while the second is completely missed.
I tried manually on Rhino as well getting the same result.
I think the problem lies in the input but all the objects look fine to me, correct normals etc.
Can anybody please help me out with this ?
Thank you!
f

developer_rhino.3dm (235.1 KB)

Hi Fabio,

Mesh booleans are notoriously difficult to work if you have triangles in plane. Generally, you want to have two distinct bodies before conducting an operation. At the moment your two blue meshes have parallel base and top planes… but there is a way to workaround this.

Firstly, scale one of your blue meshes so that the top and bottom planes do not align with the other. Then boolean union them. Then chop the base of this new thing (5 units down as per your 3dm file). Then finally, use this to subtract with when conducting the mesh boolean difference. There might be other elaborate ways to do the same thing as this, but generally avoiding these difficult in-plane mesh triangle operations is something to strive for.

developer_rhino_edit.3dm (410.2 KB)

Hope this helps,

John.

1 Like

Hi John,
thank you so much for the hint. I’ll rethink my code chunk in the light of this workaround.
Cheers :slight_smile:

1 Like

Hi @fabiopasquarell

If you use Rhino 7 WIP, you could use MeshSplit commands. However, MeshBoolean* are still the same as in Rhino 6 for now. See more at New Mesh Intersection Milestones.

2 Likes

Hi Giulio,
I’m working with Rhino 6 at the moment since the plugin I’m developing works on that version… I’ll check the new functions on the WIP.
Thank you!
f

Hello John,
since you’ve provided a good workaround for my problem yesterday, I try my luck, maybe you’ve a good hint for this too… I’m trying to cut my teeth on mesh geometries.
This time I’m trying to create a union of the two on the attached file, but the result is pretty bizarre…
Any idea?
Thank you!
f

mesh_union.3dm (176.0 KB)

My best advice would be to work on the quality of the initial mesh. The ones you are using look pretty nasty to be honest and are likely to result in errors. This is the stuff of Giulio’s nightmares:

Anyway, I tried just redrawing the top curves and extruding to make capped solids (a). Solid boolean worked fine (b). Then I tried by meshing these solids first (c ) and using the mesh boolean union which when offset, also worked fine (d).

mesh_union_edit.3dm (431.7 KB)

So my point stands, I hope you can find a way to create some cleaner initial geometry, otherwise I can’t think of anything else that will work if I’m honest.

John.

Hello John,
thank you for your explanation, it’s pretty clear.
I do the same, creating capped extrusions starting from top curves and meshing them using these parameters:


Is there something wrong with these parameters in your opinion?
My problem is that I’m working with an iteration on boolean unions, so I try to boolean union of a freshly meshed extrusion with the result of a previous boolean meshing and so on.
I wonder if the nasty mesh comes from a previous boolean union operation (the tallest one in my example).
If so, it would be a problem…
Any ideas?
Thank you!
f

After you draw (or extract it), try rebuilding the top curve with say, 100 points.
Then extrude the curve down and finally mesh (I just used the ‘more polygons’ in the simple settings to be honest).

Hi John,
yes it’s an option, I’ll surely try rebuilding the curves… what we’re trying to do is finding a way of simulating some material removal, progressively subtracting shapes from a base stock shape… maybe this means pushing Rhino a bit too far… we don’t know if anyone already tried this…
Thank you
f

There was this thread recently, albeit with BReps rather than meshes:

I would also use solids if I were doing this, but granted I’m not sure of your constraints.

John,
this looks really interesting… we’ll get through the gh solution and see what we can do.
Thanks, much appreciated
f

1 Like