Create a line with the next branch

Hello,

I would like to create a line with ‘construct point’ that joins each respective point of the list with the same one in the following branch. so each point is at the same time the first of a line and the end of a line (except on the first and last point).
How can I sort data to achieve that?
Thanks in advance
Line.gh (13.2 KB)

this is a way:

2023_02_11_lines.gh (9.8 KB)

Perfect, thanks.

What is the wrap option for?

if you ask for an item/index in a list, that is bigger then the last index, counting will restart at the beginning of the list.

Example:
if you have a list with 10 items, they will have index 0…9
if you ask for index 12, you will get index 2

General
if you have a list with n items, they will have index 0…(n-1)
if you ask for j
you will get
i=j%n

(the operation is called modulo Modulo - Wikipedia (remainder of division))

Note
index -1 will return the last position of a list in python - and I think in plain grasshopper too.

Ok understood, Thanks.

So now I’m trying to create sweep2 rails with those initial tween curves and then create points that are created on those line.
I managed to create the sweep2 rails with the twin curves and the generated lines. but I would like to generate the sweep2 with section generated from points that have been generated on those lines

So I create a curve with control points but I couldn’t figure out how to reorganize the tree so that it create the lines out of those 6 points created in the correct order.

I tried to use partion list, but it doesn’t organise it in the correct order sadly…
Line.gh (15.9 KB)

Or maybe it is before the Merge component that it needs to be correctly organised…

Hello,

I don’t really see where you are going but indeed you need to graft all the inputs of the Merge component so the points end up correctly grouped.

But, since those points are created along a line, the resulting curve will still be a line…

Your base curves are not internalized btw.

image

Thanks magicteddy.
The idea is to create a fading pattern that can also fade vertically