Extend (unsorted) boundaries to make a closed polygon

I have a set of planar curves like shown below. I like to extend/intersect those lines to make a closed polyline. What makes things difficult is that my input curves are NOT sorted correctly (e.g. clockwise). This might seem weird but I have broken down my bigger definition to this problem so I cannot avoid the fact that input curves are not in order. If the input curves are not in order I cannot perform the shift list + line | line + polyline workflow. My second approach is to obviously simply extend the curves until they meet. But this cannot be a solution since I always have to set the extend-value manually. If it is too high the splitted surfaces will not be correct. If set to low the lines will not intersect → no solution.

How can I achieve that?!
Thanks in advance!

Hi @paul.metzger,

As long as your lines are coplanar and sorted, your first workflow using line-line-intersections should work, but you have to graft and simplify both inputs!