Shift List to connect point with a line

Hello all. I’m pretty new in grasshopper and probably my problem is very simple to solve. If someone can help me with a quick explanation how to make the shift list work in this case I would appreciate very much.

I need to connect some specific points of a list with lines and transform them in poles for a structure. They need to cross the way shown in the picture: 1 to 7 / 2 to 6 / 3 to 5.

The part of the script I made for this is the pink one. Can somebody assist me with this?
Find the model attached:

Grass_house_08.gh (42.7 KB)
HOUSE08.3dm (10.4 MB)

Hi,

Say you have a grocery list with 6 zero-indexed items on it:

0 apples
1 oranges
2 lettuce
3 onions
4 mango
5 cinnamon

You split it in half - this works best for lists with an even number of items -, and get two lists of equal length:

0 apples
1 oranges
2 lettuce
0 onions
1 mango
2 cinnamon

From the two lists you then want to pair items with each other:

  • oranges and mango
  • lettuce and onions

And you don’t care about apples and cinnamon.

In order to make the lists match, you can reverse the second list first:

0 apples
1 oranges
2 lettuce
0 cinnamon
1 mango
2 onions

Now the items already match index-wise, but you still need to get rid of apples and cinnamon:

0 oranges
1 lettuce
0 mango
1 onions

This can be done by shifting, but it doesn’t have to. Shifting is more for offsetting list items in order to match them up that way.

Here’s how this looks in Grasshopper:

I’m removing the first item (0) from the first list and the last item (-1) from the reversed one.

Grass_house_08-rev.gh (41.1 KB)