Joining a network of breps together

Attached is a Grasshopper expression of pipes based on a network of curves. I’ve spent a fair amount of time joining and deleting duplicates, but I do have control of how these curves are listed.

The real question is: how do I join all of these pipe base breps together? I’m going to use them to trim a surface.


Brep Join (137.0 KB)


I’m afraid there are still some problems with overlapping curves (see how there are two middle points on what should be a single curve)

Then after some cleaing up, I’d go for Solid Union - you may need to check your pipes orientation outwards before doing so.
EDIT : which I’ve tried on a small group and doesn’t work, even in Rhino.

I’d search for a possibility to cut your surface by the curves directly.
You may also want to use Simplify Curve because your arcs have a lot of control points.

Thanks, how does orientation affect Solid Union?

RE: Edit, thanks for checking.

Boolean operation tend to fail when all solids don’t have normals outside.
(here I flipped the normal of one of the boxes in the second case)

What components are you using here?

A custom Flip Brep component (then Merge and Solid Union). You can also flip the Brep in Rhino if you want to try.

And where I can find that custom Flip BREP component?

Only on my laptop, and I intend it to stay there :smiley:

Wow, wonderfull! I will give-it a try.

@Macuso : closed brep can usually not be flipped and it’s not necessary as long as your brep is really closed. else if really you want to flip a closed brep, you just explode it, flip all surfaces and join it back together. However, if your brep was correctly closed in the first time, then while joining the surfaces, they will be flipped back. I am pretty sure the problem has nothing to do with direction. If you make a boolean union with reversed geometry, you get the same result as boolean difference with a non reversed geometry. if really you want that famous element, just type


in a c# element and define x as Brep on the element. However, as I mentionned before, flipping closed breps is not possible. it would be much more intelligent to make all other selfintersection checks, open edges checks etc…

If you bake the geometry, you’ll see that the problem is not flipped surfaces, but overlapping curves that result in a selfoverlapping surface:

. When you happen to come across seemingly closed breps that are flipped, you’d probably check the brep with _-showedges rather than force it to flip. usually its some selfintersection or weird borders.

@kenzen: boolean unions are pretty tricky when they have perfect overlaps (like the round endings of your pipes) AND if some of the elements fail to create a closed brep. you can _-explode all curves and try _-selDup to sort out perfect copies and delete them.

if really you want to use the element instead of making it in rhino, usually just move every element by 0.01mm in different directions and the union will work fine.

However, if your brep was correctly closed in the first time, then while joining the surfaces, they will be flipped back.

To my knowledge, Rhino does that when adding or editing a Brep to a viewport, but not Grasshopper, unless this has been changed recently.

you are right indeed. Sorry my false explanation. I was not aware of this. In grasshopper you can flip closed breps using code and rhino fixes this strange construct when baking. Though for open breps I can see the use, but absolutely not for closed breps.