Join lines using Longest path condition

Hi everyone,

I have a list of lines in GH. I want to create the longest possible polylines from that input. Does anyone have an idea of solving that problem? I tried with JOIN CURVES component but it does create the polylines I want.

For example, this is the result I want to get:

image

Thanks in advance :slight_smile:

Sample_Lines.gh (6.1 KB)

Hi @bbalbastre
wouldn’t the longest line on the right-side example actually be the interior rectangle?
Or, if you allow intersections, like this:

And on the left side, longest would actually be like this.

I think you need to give a little bit more detail, as the solution depends on what you actually need.

Totally right @Toni_Osterlund

Intersections are not allowed. I want to get the red polylines from the initial points but I cannot think about a logical method right now