Sort, join, blend and close a group of curve

Hi guys and girls,

I would like to rebuild a new curve using piece of existing polyline like this :


I have been able to it, but it was with a lot of luck and it wasn’t the intial way that I wanted and tried to do it…
here is in the attached grasshopper file the way I did it, and the kind of way I would have done it. If any of you know a way to sort and create a logical way to rebuild one curve without any self crossinf polyline, It will be very helpfull for me next time !
thanks !
question-polyligne.gh (46.3 KB)

You could try with Connect Curves


question-polyligne_re.gh (68.9 KB)

THX
It work perfectly !