I feel ultra stupid because i can’t get this worked out… I’ve seen dozens of examples, learned what flatten graft means (i think i grafted it). Anyway despite 35 years of coding, scripting, barrel shifting calculations, double-indirection-pointer arrays to speed up natural log calculations (computers were slow then!)…
Back to Rhino, i am only 8 month old learnig and I managed to make from scratch a fingerjoint designer with variable dogbones, including the female-like adjacent panel - shiftlist was my friend i think and it was super easy to do it - like magic.
But then i tried to make an example from @parametric displacing a shape across a hex grid it worked fine until i wanted to assign colors to regions…
I tried culling, shifting, and i really really tried for 1 whole week every day to get another way to change the patterning to get back to a design i had made before.
But despite very few differences between the script, i added more polygons to the grid and a surface split i found two problems i can’t resolve - but it would be a simple for loop in code…
So it’s easy to cull pattern for items in a 1D list with a 1-0 or 1-1-1-0-0-1[-…] filter.
But i found it impossible to go from a list of 100 shapes to put them into a 2D array. And then select which items i wanted per line.
How do you go from a list of 36 objects to split them in patterns like
1-2[-…]
2-1[-…]
[-…]
or for a hex list like this (if im not too high-level minded (i mean im not testing my code if this is a correct pattern for this hex grid - but im presuming it is for this example - sorry, im an economist coding storage solution for finance industry and 3d design coding is a new hobby.)
1-2[-…]{0…n}
2-1[-…]{1…n-1}
[-…]{a()…b()}
Note: [is optional], a() is a function returning index item like vector/factor/point
Im pretty much confused on the way to achieve these for-loops and imbricated for-loops when it comes to trees… I checked the point list too but couldn’t get it - I do see the concept (flip matrix maybe or per branch of the tree?) but flatten (like most modules/lists require) = list - not array. How do you shape a list into an array is what i dont get with the tree concept i guess…
I see where my center points for each shape is… again, in a list… I found the way to cull but it wasn’t fun… and now i end up with x branches i got to ‘wire’ individually which kind of beats the purpose of lists and pattern matching (yes i saw the pattern matching modules - im clueless again. Im sure there’s a stupid solution to this…)