How to do array and random reduce

i have this shape and i looking for help how to array and random reduce from top to bottom , or any directions .

I did it manually but it takes long time and it hard to try deferent repeated pattern if i don’t like my first


3. Attach minimal versions of all the relevant files

There are so many ways to do something like this, and details matter. You suggest a two dimensional “array” of shapes, eh? But haven’t posted a GH file with your geometry :question:

Please start with that much at least. Otherwise, I’m inclined to think of gradient points, like this recent thread that uses random points on the surface (faces) of a 3D shape:

The same principles could be applied to an array of shapes.

1 Like

thank you so much , and yes your correct ,because i drown the shape on rhino first , then i tried to use GH but, i cloud not figure it out.

I’m still tiring to learn Grasshopper , and i’m not a codding person but i know if i lean the softwire , i can so much with it

Importing the shape from Rhino and using GH to create a two dimensional array is very basic. Until you can do that much (or post your Rhino file at the very least), I don’t think it’s reasonable to expect anyone else to do all the work for you.

I know this isn’t your shape. That’s one reason I asked you to provide it. The other reason is that if you can’t do this much, the gradient random reduce pattern is far beyond your skill level.

P.S. Your grid pattern is diamond shaped, which is more complicated to create but makes no difference to the gradient random reduce code.

Would love to post this file but you haven’t posted any geometry :question: Only images. :frowning:

1 Like

I found this post by @HS_Kim for a simple diamond grid and adapted it.

My version, still without your geometry.

1 Like

i really apparent that , honestly i was not expecting to do the file , that help my a lot .

after worked on the shape i connected to geometry params and i was traying to play with it on GH

and if you asking for the shape , here it is on a rhino file
shape 01.3dm (10.7 MB)

Full grid of shapes:


shape_grid_2023Dec28a.gh (29.9 KB)

Added to yesterday’s code:


shape_grid_2023Dec28b.gh (38.2 KB)

P.S. Added teal group (below white group) to trim the grid of shapes.


shape_grid_2023Dec28c.gh (39.6 KB)

Version ‘c’ above shows anomalies at the top resulting from ‘trim grid’ using SInt (Solid Intersection).

These are not caused by SInt failure but instead are coloring (and culling) errors due to five fragments in each branch (cell) instead of the expected three. The easiest way to see it is connecting the ColorJ cluster which shows pink. yellow, green, red and blue fragments (5) on the top row instead of pink, red and green fragments (3) for all other rows.

I don’t have a solution for this, only an explanation. :thinking:

This file got ridiculously complex, especially my fix to the problem noted above (orange group below).

The “gradient random reduce” code (gray group at the bottom) is relatively small and simple. All the rest is code that prepares the grid of shapes.

  1. The white group uses a single copy of the three shapes in each diamond “cell” (located far from the origin) to create rows and columns of the grid.

  2. The teal group (blue-green) trims the diamond shapes using a box and Solid Intersection.

  3. The yellow group jitters the cells to randomize their sequence.

  4. The orange group separates branches of trimmed cells into those that have three pieces (most of them) and those that have five pieces (cells at the top to be “fixed”). Branches with five pieces are then grouped to combine two pairs of fragments, resulting in three items per branch as expected by the gray group below.


shape_grid_2023Dec29a.gh (45.8 KB)

This is probably far more complex than a beginner will understand, but that happens sometimes. :man_shrugging:

really appreciate the work you did , i was not think it was this complex to do it, but also that gives me more motivation to learn more because i know it passable

again thank you so much

Two aspects of this geometry made the code more complex than it otherwise would be:

  1. Each “cell” contains three shapes instead of one.

  2. The “diamond” shape of each cell makes it more than a simple two dimensional array, but the bigger issue is that it requires the grid to be trimmed.

It is tempting to rewrite the code again to simplify it but these two factors will remain.

1 Like