# Merge group surfaces or cut group curves

Hello, I have this puzzle, I would like to join all these groups of surfaces but I cannot do it with the Union Region Merge components among others, what do I need to do to achieve this, I appreciate any help

MODEL_DOMO.3dm (100.5 KB)
UNION SURFACES.gh (12.7 KB)

1 Like

I do also requested this feature some time ago but still didnâ€™t find any viable solution. Would be great to have a component capable to extract the overall internal/external edges of a bunch of connected geometries.

Hello,
There may be a better way to do itâ€¦

UNION SURFACES_Re.gh (14.1 KB)

2 Likes

I think you had the right approach, but you messed up the tree structure when you grouped points separately on the two sets. The resulting trees did not match.

Hereâ€™s a simplified solution. I added projection to plane just in case thereâ€™s slight deviation.

EDIT:
I realized that the Region Union dropped the center hole. Hereâ€™s a fixed version.

UNION SURFACES.gh (14.9 KB)

2 Likes
1 Like

Just changed a little bit the surfaces and it is not working anymore.

UnionSurfaces_2.3dm (58.0 KB)

1 Like

Wow, the three solutions seemed very good to me, this was the one I chose, very grateful for your time and support, this had me behind and had become a headache for me.

1 Like

@Cumberland
Yes, the holes are tricky, because the Curve Union patches those up. They have to be separated from the set prior union, and fed into the Boundary Surface.

Iâ€™m sure this is not the most intelligent way to identify interior holes, but sorting by Area works. The largest is assumed to be the exterior boundary, and all others to be interior holes.

UNION SURFACES.gh (15.0 KB)

This is the simplified case. You can build a lot of intelligence around this. Eg. grouping per plane or proximity, only allowing planar surfaces, etcâ€¦

1 Like

If only was a dedicated component that can do all this automatically without extra steps. I do have a very hard time making this to work with my shapes. They are so different and each time I do make to work with some of them it is not working with other ones.

For posterity - a more intelligent way to extract exterior brep edge in Python.

``````#x - Typehint:Brep
outerLoops = x.DuplicateNakedEdgeCurves(True, False)
innerLoops = x.DuplicateNakedEdgeCurves(False, True)

``````

1 Like

Useful script, however I canâ€™t replicate your results. Looks like this script canâ€™t extract the outside contours?

Extract Contour_GHpython.gh (21.1 KB)

@Cumberland
This falls under the category â€śWeirdâ€ť.
For reasons beyond my understanding, the first output was considered as the â€śoutâ€ť parameter, and was outputting the log. It must have been something with the parameter namesâ€¦

This seems to work, for me at least.

Extract Contour_GHpython.gh (19.1 KB)

1 Like