Merging Grouped Room Surfaces into One Continuous, Closed Surface

Hi there,

I have a list of surfaces grouped based on distances extracted from rooms, but now I want to combine those grouped surfaces into one surface.
I’m not able to retrieve the bottom surfaces from the walls because I created the rooms using room separators. I also considered lofting between parallel lines with a fixed distance, but then I don’t get a fully closed surface at the intersecting points. Additionally, I thought about creating a bounding box and performing a scan-like approach to save only the lines that are shorter than a specified length, but that doesn’t result in a smooth continuation of the edges that I need.
Does someone have an idea to solve this problem?
Below is a picture of the surfaces. It can happen there is a hole in one of the surfaces as result of a column.

Assuming you have grouped all of the surfaces so you have a list of lists of surfaces, why not just use a PolySurface.ByJoinedSurfaces node?

Hi Jacob,
Yes, that is correct. I have already grouped all the surfaces, but that node is not removing the spaces in between the surfaces.

Ah. Wasn’t aware that was part of your goal.
For each group of surfaces:

  1. Get the perimeter curves and join into polycurves using a ByGroupedCurves method. Make sure you have a list of lists of lists of polycurves here as you won’t manage donut shaped spaces otherwise.
  2. Sort the loops by their enclosed area. Split out the last item out of each sublist.
  3. Offset the removed item by your separation distance in the + direction, and the remaining loops in the - direction.
  4. Add the large loops back into their respective lists.
  5. Patch the large loops into surfaces. These should all overlap within a given group.
  6. Trim any offset openings from the loops using a TrimWithEdgeLoops method where the new large loop surface is the surface and the combined offset loops is your loops. Your donut rooms should be back now but with an offset.
  7. Union into a single surface using a ByUnion method. You should now have a single surface with no walls that it a bit larger than the original surface.
  8. Pull the perimeter curves of the enlarged surfaces and create polycurves.
  9. Sort the loops by enclosed area again, and split out the last item.
  10. Offset the removed item by your separation distance in the - direction, and the remaining loops in the + direction. You should now be ‘on the edges’ of the previous surfaces, but with some detail removed.
  11. Add the large loops back into their respective lists.
  12. Patch the large loops into surfaces. If you want to remove any donuts you can skip the next steps, but if you have any donuts you want to keep proceed to the final step.
  13. Trim the large loop surface with the matching loop list using a TrimWithEdgeLoops method.

Hi Jacob,

Thank you for your fast reply. Is it possible if you can give me a sample code? I will try to make it myself as well, but I might interpret some things wrong, like sorting in descending or increasing order.

I’m tied up, but i f you dig into my post history you can find a similar post. Lots to look though though…

:thinking:

I did a little trial coding, and it seems to be working with two selected rooms. I still need to test if it works with a full list of grouped surfaces.

1 Like

This should work perfectly fine most of the time. The point at which you’ll have a problem is when a donut shaped room (something with a big hole in it) comes along.

I fixed it. When I make surfaces from the polylines, I will have two or more surfaces with a donut room. Then I filtered out the biggest surface from the donut rooms and used that surface to create one big surface with the remaining rooms. After that, I used the remaining smaller surfaces from the donut rooms as cookie cutters to cut them out from the room combined surface.

1 Like

Yep - that is the 'TrimWithEdgeLoops which I was explaining in my post above, but patching and using Surface.DIfference works just as well. :slight_smile: