"Cross Reference" between different branches

Hello dear community,

I need your help. I searched for a solution in the forum but didnt find it.
Lets say we have 12 lines - four in each branch of a tree with 3 branches. These lines are divided into segments and points. Now I want to connect each point with all points of the other branches with a line - exept with the points of the own branch.

Additionally, I need a specific data structure afterwards:
The lines to the points of the other branches should be in individual branches.
Lets say the lines have the following branches:
{0} with four lines / its points
{1} with four lines / its points
{2} with four lines / its points

There should be the final output with the following structure:

{0,1} with all lines connecting all points of branch {0} with all points of branch {1}
{0,2} “”
{1,0} “”
{1,2} “”
{2,0} “”
{2,1} “”

Can you help me?
I have the feeling that there should be a simple solution for this, but I can’t find it.

Thanks for your help, best,
Andreas
Forum.gh (6.4 KB)

A “simple” solution.

That uses Elefront’s Graft Parallel THREE times.

Are you really sure this is what you need ?..

Forum.gh (11.0 KB)

Hello magicteddy,

thanks very much for this solution. The result is exactly what I was looking for!
Im not sure if there is an easier solution for what Im doing - but I need all these lines seperated this way.
Maybe it would be easier with a matrix as input where all the wanted connections are defined?
So that there are two inputs as “start and end points”?
And then you would “just” need to connect all points between two branches each?

If you want something more compact, then the only other solution I can think of is a C# component with 4 loops.

Depends on what you call “simple” ! :smiley:

CrossReferenceC#.gh (8.9 KB)