Randomly moving rectangle vertices in array


I’m trying to make an array of rectangles, where the vertices of each rectangle is randomly moved.

As you can see in the screenshot the random movement of the vertices in each rectangle is identical, although I want each one to be different.

I suspect this is because my geometry tree has 4 branches, but my random number list only has one.
I am relatively new to grasshopper, and even after watching several tutorials of data trees i can’t seem to find the solution.

Thanks in advance!

Welcome @mauriceq.visser,

You need to produce enough random numbers for each parameter and vary their seeds.

2020-11-30 21-37-29.2020-11-30 21_39_17

random_squares.gh (17.9 KB)

1 Like

This generates two random numbers for each of four vertices per rectangle, ‘xy’ angle (in radians) and ‘d’ (offset distance) controlled by the ‘Range’ slider. So each corner is effectively jiggled about randomly to create a new closed trapezoidal 4-point polyline. Two ‘Seed’ sliders in blue groups.

rectangle vertices_2020Nov30a.gh (16.9 KB)

1 Like