Boolean operations and Meshing Breps takes a long time within grasshopper

My end goal is to export a part, which I built from multiple bodies (breps, multipipe, meshes) to a file like .stl, all within Grasshopper, with no human interaction needed.

My intention was, to merge these Breps and meshes, to one combined solid, and export this mesh with a script component to a file.

I ran into various Problems (multipipe with extreme curvatures, or overlapping surfaces) and could solve some of them. (the multipipe is still a problem :blush:)

However, I noticed that the conversion and Boolean operations take a long time, although the same operation within Rhino (baking and Boolean Operation of the bodies) does not.

Are there better ways of achieving this? (merging bodies / meshes and exporting bodies / meshes)

I have tried the plugin dendro - which also takes quite some time, to convert the mesh to a volume and when merging the volumes, I loose a lot of detail.

image

(the Solid Difference could be an alternative, but not all bodies are Brep’s.)

Can’t tell much without seeing the GH definition but I have noticed significant performance differences with flattening vs grafting at times. Sometimes grafting speeds it up, sometimes flattening. I’m not suggesting you flatten an existing data tree rather check your data tree structures first and make sure they are sensibly aligned and that should help with performance.

I’m speculating here but it seems like the boolean nodes have an easier time when they are operating against parallel structures/branches. Same depth/size, etc.

1 Like

Of course, it’s good practice to add a .gh file. However geometry-wise there is not a lot going on.
Really just some breps, and somewhat annoyingly one triangulated mesh.

I have taken a look at the structure, and noticed an unnecessary merge, which cost me about 0.8 seconds. besides that it seems fine. The trees themselves are not nicely balanced, but unfortunately can’t reasonably be.

In the meantime I have taken a look at the human addin. this allows me to bake all the geometry to a specified layer. → this takes mere seconds, including manually merging the bodies in Rhino (computation-time) , compared to the grasshopper variant. If I can automate this, I would also succeed.

I will continue trying, and hope for the best :slight_smile:

you are booling two lists of objects - are you sure thats what you want? it might get you the same result faster if you join the meshes before the boolean component.

You are right, joining the meshes first is faster, and funny enough first flattening the list takes about twice as long, as not flattening it first, even tough the result is the same.
However, the time saving is marginal, which lead me to the conclusion to export the meshes separately, but to the same file.
We will see whether this work. I will update this thread for future reference.
Thank you guys!

Hi @Philip7

Is there a file we could use for testing? I’d like to have a look if I may - maybe there’s something I could learn from here.

Thanks,

Giulio


Giulio Piacentino
for Robert McNeel & Associates
giulio@mcneel.com

Hi Giulio

Yes, you can use this file for testing. Had to throw out the unnecessary components and internalize the data 😊

I have now implemented the above mentioned improvements, and also reduced the mesh-quality to keep the meshes simpler.

The current state does the Boolean operations on the Breps first, and only then joins and meshes them. I omitted the mesh-union completely. Although this is as fast as I could get it to work, the baking still seems a lot faster.

Best Regards Philip
testfile_merging.ghx (5.3 MB)

If you want to get a quick union of all sorts of objects and maybe even make it hollow, I’d suggest looking at Shrinkwrap in Rhino 8 WIP

1 Like