Merge 2D polygons into single polygon with outline

This is either deceptively easy or more involved than I thought and I’m not finding anything on the forums that involves 2D closed polylines. As shown below with a simple example, I’d like to return a single closed polyline that traces the outline off all selected polylines. My first attempt was to extrude the shapes into solids, union them, and then project that back onto the XY plane but I’ve run into an issue dealing the duplicate curves as grabbing the edges of the solid return overlapping edges for the top and bottom surfaces.

Is there a simpler method or how do I filter out the overlapping curves so that I can join them all together? The target polylines will always be some manner of overlapping rectangular or tubular closed polylines as they are just overhead outlines of roads.

If you’re on one of the more recent builds you could try this…


outline.dyn (11.3 KB)

If you’re missing Surface.ByUnion, you could try to intersect a union of the extruded closed curves (as solids) with a plane to obtain a surface and it’s boundary curves.

4 Likes

That works quite well, thanks.

I’m trying to take that and offset it a number of times but can’t find a node combination get from the curve output to a PolylineExtensions.Offset input, though. the polyline.bypoints output is “function” and not polyline and the other creation methods I saw produce an “object” which won’t work as an input either.

PolyCurve.ByJoinedCurves > Curve.Offset will do the job in Dynamo. If you need to move those into Civil 3D or Revit best to make a new topic.