# Pattern Tiling question

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…)

I’m not sure exactly what you’re trying to achieve, but it might help you to read up on data trees - there is a new resource here: https://www.rhino3d.com/download/rhino/6.0/essential-algorithms

One component that might help you is Relative Item. Like shift list but for trees, you can shift the path as well as the item. So if you have a grid represented as a tree, relative item will allow you to traverse through the grid rows and columns, represented as branches and items. There are some examples of this in the pdf.

1 Like

oh my grasshopper!
I was amazed at the pufferfish documentation, didn’t know this existed!

Thanks!

1 Like

I’ve been trying for a week and still dont get it. I dug in “The Essentials” and still couldn’t figure it out.

Here’s the pattern im doing with 4 different methods but limited in branch splitting… which i can’t find.

the GH definition: Celtic Knot - new try splitting 3.3.gh (44.5 KB)

It’s a hex grid and i want to add curves and more circles to subdivide and scaling the circles creates more or less intersections.

Then i want to color some of the shapes in the intersections a different color from a list of x patterns in the shapes. And select with a slider the patterns and a color range (HS(x),V(y) based on the pattern of 1, 2 or x different shapes).

Thanks if you can help.

Found it, I needed to use the divide domain with the item list length or a factor of.

Any variations are welcome.