Get an outer boundary of multiple polygons (Room Boundaries)

Hi, everybody!
I am trying to get the outer boundary of a number of rooms.

I thought that shouldn’t be a difficult task, but I’m kinda stuck.
Any ideas here?

…but since we have a geometry library you could turn all of these rooms into surfaces and boolean union them, then get the perimeter curves… I would try that first if performance doesn’t matter at this point.

1 Like

I’m almost achamed of how dirty it is … :smile:
but works!

in designscript:

pc = PolyCurve.ByJoinedCurves(c);
dist = 500;
co = Curve.Offset(pc, dist);
sf = Surface.ByPatch(co);
th1 = Surface.Thicken(sf,500,1);
solidunion = Autodesk.Solid.ByUnion(Flatten(th1));
sf2 = Autodesk.Geometry.Intersect(solidunion,Plane.XY());
pc2 = sf2.PerimeterCurves();
pc3 = PolyCurve.ByJoinedCurves(pc2);
Curve.Offset(pc3,-dist);
8 Likes

@Michael_Kirschner , @Mostafa_El_Ayoubi

Thank you guys!
That’s doing the job!

You should also check out clockwork’s ConvexHull2d node

1 Like

I haven’t tried this one. Since it is calculating a Convex Hull do you think that this could handle these kind of shapes:

@viktor_kuzev - No, it can’t.

As Andreas confirmed, the convex hull will get rid of all concave parts of the shape, but will be much faster to compute. Not sure if it will be good enough for your needs, because you have yet to describe what your final goal is :slight_smile:

2 Likes

I am doing this as a possible step in a workflow for creating plans for typical apartments.
The apartments are created as groups (I am not a big proponent of that, but it has some advantages). In the apartment group, there are also rooms, which get closed by walls inside and outside the group when the group is placed.
Then I need the contour line to create a custom shape for the crop region of the plan view. This contour has to be offset with the surrounding wall thickness, to show the wall inside the plan. That’s why I wanted to use rooms - I can extract the walls’ thicknesses and feed them as offset distance.
I am not convinced that this is the best way to do it - it’s getting really complicated for something that’s not so impressive.

1 Like

Sth like this?

@Tomasz_Puchala
Which nodes are you using? Not visible from this image. Thanks

A post was split to a new topic: Boundary that encloses polygons