I have a set of lines instanced along a curve using "Replicate Matrix" and "Object Matrix Output."
My goal is to loop through the instanced lines and, for each one, get a random point on it, find the nearest point on the next instanced line, and make edge between them. The end result I want is edges drawn through all of the instanced lines, looking something like this:
I've tried to do the following way. First, a loop that runs through the lines and finds edge starts and ends:
The "random point" comes from the Random Number that inputs to the Get List Element, which has the vertices from the first line. I then pass these edge starts and ends out of the loop to draw the edges.
This works to some extent, but I'm having problems achieving the result I want. The result I actually get is more like this:
Edges are drawn between adjacent lines, but only between the two lines currently being compared in the loop. And the number of edges being drawn between adjacent lines increases as the loop runs. I don't understand why that is. And the edges don't accumulate as the loop runs - so the edges drawn on first iteration aren't preserved in the second, etc.
To try to fix the second, accumulation issue, I tried to make this second loop, which would save all the edges the loop calculates:
But this hasn't worked. The list in the Append gets longer after each iteration, but each element in the list gets written over with a single vector value. You can see that happening, e.g., in the Viewers connected to the Append to List nodes. It's weird.
So, that's where I am. I can't figure out how to turn something like the second drawing into something more like the first. Maybe I'm going about this whole thing the wrong way! But even just figuring out how to get the Append node to hold values across iterations would be awesome.
Here's the .blend file: