anorganic.org - Random Square Grids

Random Square Grids

Initially started as a study on how to implement simple concepts in both Python and Processing and finding out in which programming language such simple projects could be realized quicker, this study about random square grids quickly turned into something with its own beauty and complexity.

Pseudocode

  1. choose a number n and divide your canvas width by it. This is your number of squares per canvas width.
  2. chose a number m of iterations for the vertical axis.
  3. for each i in (0..n) draw a square with center point (x0, y0) and corners defined by (canvas/n)/2 minus grid spacing (spc).
  4. for j in (0..m) copy the parent square drawn in 3) and distort each corner and the center point by a certain random range.
  5. set the suare drawn in 4) as parent square as long as j <= m; j++.
  6. repeat steps 4-5.
  7. i++; go to 3) and draw the next square.

A First Simple Implementation

Random Square Grids Random Square Grids Random Square Grids Random Square Grids

A Happy Accident

Playing around with the algorithm and its setting I accidentially added an additional loop level which turned the thing into something more interesting.

Random Square Grids: The happy accident Random Square Grids: The happy accident

«