Skip to Content

subdivisions

2025

At its core, this pattern generator uses a beautifully simple concept: start with one large square and recursively divide it into four smaller quadrants. The decision to subdivide isn’t deterministic, instead it’s based on carefully tuned probabilities that change depending on how deep we are in the recursion.

Under the hood, the script maintains an array of square objects, each storing its position, size, recursion depth, and whether it should be filled solid or void. The rendering process sorts these squares by size, ensuring that smaller subdivisions always appear on top of their parent squares.

The result is an example of how simple mathematical concepts can produce surprisingly sophisticated visual results.