In the image above it shows that the points are contained inside a rectangle (that is just there for visualization). I know that each rectangle has a row of 12 points and a column of 24 points, but as you can see, my data is structred in a way that the list slides through the horizontal line of points, and then skips to the next line above. So my goal was to pack all those points that are contained in these 12x24 grids inside a one branch for every grid
Each branch containing the points (or in this case circles) that are inside the panels boudary in order to create each panel individually
In the example file you’ll see these points are ordered first in the horizontal, then skipping to the line above, as I mentioned. The amount of panels is parametrized by the amount of isotrims of a surface in the beginning of the script
fully variable by number of points in a row or column of a panel, and the number of panels in a row or column.
This is a tortured beginner’s attempt. I am sure there are more experienced people on this forum that could do better. However, I have heard that re-establishing data structure from a flattened data tree is never easy, which is why you should never flatten data if you don’t have to. If the number of elements in the rows and columns were static this would be much easier to approach with the Path Mapper. But while the Path Mapper can do expressions, it won’t accept variables. Hence the mess above.
so this also tells us that columns of points are sorted left to right in a given panel, and points in each column are sorted top to bottom
what you want to do is to first flip matrix but just inside each panel (maintaining the first branching) then trim tree in such a way to delete the division by rows
after flip matrix, points are organized by horizontal rows instead of columns (here is the Path Mapper Bible Path Mapper Help - Grasshopper )
trim tree removes the outmost branch, so points now are not branched into rows anymore but just by panel (in particular, points go left to right from the top row, then move to the next lower row)
Cheer Volker and inno, I appreciate the reply and the help. Inno’s solution seems to work better for my existent script and goal.
I’m trying to solve this for after the points were distributed in the way the final script shows, first the entire bottom most row skipping to the next one above and so on, that is because I intend to use image sampler fo turn these points into circles of different radius
You basically have everything you need right in front of you. The script I gave you takes the data structure of the image sampler and puts it into panel heirarchy. One of the two groups “Panels by Column, then Row” or “Panels by Column” will match the changes inno made to the data structure of your “Surface Domain Chord Distance” component so that they are compatible to each other. Or inno has a more direct solution, which I’m sure he has.
well… if you are using the standard Image Sampler, that component will just output data with the very same tree-structure you fed its input with
if that is the case, I would not bother in matching a particular color data structure by changing the way points are organized, but I would just map the points to the original whole area like the following (Domain [0, 1] on the reparametrized Surface) and get the color output with matching data structure (or use brightness output as a function of circle diameter)
That worked out almost perfectly, thanks. The only problem is that something with the remapping numbers is messing up the image, you have any idea what it could be? Mapped Facade_Re_Obama_Eyes.gh (250.4 KB)