200806a

Okazz · 2020

A p5.js sketch from Okazz's dated daily series: a grid of panels, each filled with random circles, triangles and quadrilaterals drawn according to a fixed set of rules so that every cell varies while the whole stays coherent. Published openly on OpenProcessing under CC BY-NC-SA, and analysed in a peer-reviewed ACM paper as the antecedent of a community remix — a non-blockchain example of his colourful rule-based geometric work, distinct from his later on-chain editions.

How it works

A p5.js sketch that draws a grid of 2–6 × 2–6 panels; each panel is a solid rectangle in a shuffled palette colour, overlaid with one to three smaller shapes of a single randomly-chosen kind — circle, rotated square, triangle, quadrilateral or line — so every cell varies while staying internally coherent.

Grounded in the OpenProcessing source (sketch #942403), not reconstructed from the image. A fixed seven-colour palette (`colors`) drives everything. `setup` makes an 800×800 canvas and `noLoop`s (one static frame); `draw` centres and scales to 0.9 and calls `grid`. `grid` chooses `seg1` and `seg2` as `int(random(2,7))` (i.e. 2–6), giving a `seg1`×`seg2` lattice of cells sized `width/seg1` by `height/seg2` with a 10 px gutter (`off`). For each cell it `shuffle`s the palette, fills the panel rectangle with `colors[0]` (black stroke, weight 2), then calls `randomShape` four times with `colors[1..4]`. `randomShape` renders into an offscreen `createGraphics` buffer the size of the cell: it picks one shape kind `rnd = int(random(6))` (so 0–5) and a count `num = int(random(1,4))` (1–3), then draws `num` shapes of that single kind — `rnd 0` a circle, `1` a rotated square (one of eight 45° orientations), `2` a bottom-anchored triangle, `3` a bottom-anchored quadrilateral, `4` a rotated line of length `w*h`. `rnd 5` draws nothing, so a panel is occasionally left with only its base colour, and the `rnd == 7` branch in the source is unreachable dead code. Shape positions `(random(1.4)-0.2)*size` may spill slightly past the buffer edge, and each shape has a 10% chance of `noFill`. Because a cell commits to one shape kind, panels read as coherent while the grid as a whole varies — the structure the ACM "Forking a Sketch" paper reproduces as its Fig. 13.

Details

Medium
Real-time software

Sources

Last updated 2026-07-16