Connect Lines With Touching End Points in a Flattened List

01_Trace Surface Outline and Return Model Curves.dyn (9.9 KB)
Hi All

Thanks for all the help on this forum. I am trying to rationalize the internal and external outlines of the Colonel Sanders KFC logo into lines not smaller than 1mm so that Revit does not return an error when I attempt creating an extrusion. However, when I select the surface and produce the edge curves, the PolyCurve.ByJoinedCurves node returns an error because lines in the list do not connect, resulting in multiple wires.

I found a Python script on this forum that might work with some tweaking, but my Python skills are still quite rudimentary. See a link to the thread below and a Revit and dyn file.
Thanks for your assistance.
ATT01_Colonel Lightbox.rfa (1.4 MB)

Surface Outline without inner cutouts / holes / whatsover - Revit - Dynamo (dynamobim.com)

@jacob.small @Jannis @Vikram_Subbaiah @maciek.glowka