Automatic extend lines

Hi,
I have a collection of lines and I would like to automatically extend them until they intersect each other another like in the image.
Someone can help doing in?
What I have


What I want

Test.gh (4.6 KB)

Thank you.

This could be one way to do it, but note that you will need to be consistent with the line pieces you feed it. There is now one small horizontal linepiece that is ‘missing’
extend_lines.gh (13.0 KB)

Here’s another possibility, but since all your lines are not necessarily lying along the exact same grid, it might deviate from what you want.

Test (1)-b.gh (10.8 KB)

2 Likes