Restructuring list


(Ka) #1

Hello again,
can someone help me restructing the two list into one list , in a order that gives me an ability to draw the shape between every four points? i mean i should be able to have the shapes seperated in the end. thank you
q3

q3.gh (39.6 KB)

thank you


#2

I would start by creating the lines like this - though to make closed curves between four points, further data tree manipulation is required…


q3_2018Apr4a.gh (37.2 KB)


(Ka) #3

thank you but how would you make a surface for evey unit if you don’t change the tree order?


(Luis Fraguada) #4

I took a similar approach. To get the 4 points in a list, I used Relative Item (apologies for the wires, I’m on Rhino for Mac):


q3Mod.gh (32.0 KB)
Final PLine is warning due to not cleaning Nulls like @Joseph_Oster did.


#5

you mean like this?


file:q3Srf.gh (24.9 KB)


(Ka) #6

i think yes, it looks good, would mind sharing the definition please


#7

I just put it, sorry


#8

I never learned how to use RelItem like @fraguada - that’s MUCH simpler!


q3_2018Apr4b.gh (41.8 KB)

P.S. This is another way to use the ‘Tree/List Viewer’, where the ‘path idx’ slider chooses the “quad” and the ‘list idx’ slider chooses the edge (yellow).


(Ka) #9

thank you all, i hope i will understand the logic behind the components you have used, still i love this program!


(Luis Fraguada) #10

Relative Item is a deep cut, but comes in handy at times. Try it out with a simple point grid or a hex grid:


In this case I’m shifting one branch and one item, so the point at {0}(0) will connect with the point at {1}{1}, etc.
Relative Item.gh (11.2 KB)


#11

Relative Item is like, practically, a Shift List, but for trees. You shift branch paths n times with “{n}” and the items in branches m times with “(m)”: “{n}(m)”. The first output is like the input tree, but cut properly in case the wrappers are disabled (if n=3, m=2, the last three branches and the last two items per branch will disappear). The second output returns the shifted tree.


(Ka) #12

would expleain the logic behind using the shift two times, why the merge component need the data to be in the order you have made?


#13

I am shifting one time for and one time back to get the lines in the correct order, than I merge them to pairs of 2. You can observe it by the point order and the param viewer like this:


(Luis Fraguada) #14

The “List Shake”, a classic GH move!