Line like curves flattened list branching based on connectivity

hello everyone ,
here is a problem that i tried to solve it with native grasshopper components, but it turned out to be a hard one,
we have a flattened list of line like curves that can have intersection with each other at endpoints ,
we want a component to get this flattened list of curves and put curves in several branches based on connectivity (intersection) . all curves that have an intersevtion point with eachother are gonna be one branch .
just like this picture below , we have a list of curves that we wanna put them in two branches based on their connection .
any solution with native grasshopper components or any codes in C# or Python component is appreciated .
thanks in advance , Masood

1 Like

@Mahdiyar @DanielPiker
it would be great if you could help me here.

Here’s one way.


LineGroup_re.gh (13.9 KB)

2 Likes

That’s really a cool solution, thank you.
although I think, it might get a little slow with more number of curves. :thinking:
That’s Great.