Dealing with sublists

Hello everyone,
I have a hard time trying to determine the distance between points by using points inside the sublists. I need to work like that because sometimes the script will have 3 groups and in some other case 20 groups. So I did group one part of the points in one node and other groups in some other node. Both nodes will always have the same number of groups. Like on the image below:

So, L1 number of indexes will always be the same but L2 number of elements will probably always be different. So, on the example above, I would like to connect both nodes to “Geometry.DistanceTo” node and I would expect that I will have in the first group 3*84 a number of elements but I can not set that. I do receive something like this:

Can you see where do I mistake, I did try a lot of things but I was unable to receive what I expect.

I Don’t fully understand what you mean, but have you tried cross-lacing?

Daan, thank you reply.
The idea behind all of that is to find a distance between a group of points. So, if I have on the one side group with 4 points and from the other side group of 84 points, I want to know the distance between each combination of two points. So, in that case, I expect to have 4*85=340 values regarding distance.

I did try with all options regarding lacing. I also try to get items by index and to compare just elements with index 0 and that is easy, that works. But when I connect one group and other groups the node "Geometry.DistanceTo” does not give me proper results. Below is a result of cross-product lacing:

I also created some example script. Again, two groups of points, the same number of groups but the first group have 4 points in the first sublist and the second group has 85 points in the first sublist. I would expect that I will have information regarding the distance between all points, but I do not receive that.example.dyn (20.1 KB)


A little daunting, but take a look at replication guides.

Clip below: 37 + 511 = 76

3 Likes