Random brick pattern w/ only 2 sizes

I would like to create a random brick pattern, but only using two sizes of brick. I will be using this pattern to create an array of geometry where there will also be two types of geometry that correspond to each brick size.

I’ve attached a sketch to illustrate what I’m going for.

2 Likes

Have a look at the attachment.

And Rectangle Mapping


PatternByTwoRectangles_re.gh (28.8 KB)

9 Likes

Thank you! This is definitely a bit more compex script than I could come up with. I’ll dive into this a little deeper and perhaps come back with more questions.

I cannot really follow the script through as I’m unfamiliar with quite a few components you’re using. If you have the chance, would you mind breaking it down for me? It looks like there is some list shuffling going on.

The logic is fairly simple, IMO.

There are two rectangle units, so I generated a bunch of item indices which are 0 and 1.
But if you use regular Random, then you can’t help but getting 4 ~5 consecutive 0 or 1.

In order to avoid this, I used some predefined list(01, 10…) and shuffling them using Jitterand finally break them into individual characters usingChars.
And I just added Shiftfor more control over the desired pattern you want, you can skip it if you want.

And the next step, by using these indices, you can choose the two rectangle’s X-sizes, and sum up usingMass Addition and convert the partial sums to points usingNumbers To Points.

And the next step, you can deploy these points by their row(tree branch respectively)using rectangle height.

Finally, all you have to do is to place two rectangles using these points as positioning vectors and Move.

4 Likes

Hi,

I’m currently want to do this but what if you have a specific rectangles that you want to randomize?