Geometric / Hexagonal Tiling
Algorithmic tiling/tessellation draws on centuries-old traditions — Islamic geometric pattern, Truchet tiles (Sébastien Truchet, 1704) — and aperiodic tilings (Penrose, 1974). No single first; a deep pre-computational lineage.
community / folk Name — A descriptive category label, not a coined or eponymous name; no single coiner of the term is attested.
In one line Covering the plane with a regular arrangement of tiles — square, triangular, hexagonal, or aperiodic (Penrose) — as a structural scaffold for pattern.
The code
The actual sketch behind the demo above — sandboxed and reproducible. This is the whole thing.
geometric-tiling/index.html
const SEED = Math.floor(Math.random()*1e9);
function setup() {
randomSeed(SEED); noiseSeed(SEED);
const s = Math.min(windowWidth, windowHeight);
createCanvas(s, s);
background('#0a0a0a');
noStroke();
// Hexagonal grid (pointy-top). Each cell is coloured by a 2-D noise
// sample and rendered as a regular hexagon.
const R = s * 0.055; // hex circumradius
const w = Math.sqrt(3) * R; // horizontal step
const h = 1.5 * R; // vertical step (rows)
const FREQ = 0.06;
const palette = ['#e6261f','#eb7532','#f7d038','#a3e048','#49da9a','#34bbe6','#4355db','#d23be7'];
for (let row = -1; row * h < height + R; row++) {
const xOffset = (row % 2 === 0) ? 0 : w / 2;
for (let col = -1; col * w + xOffset < width + R; col++) {
const cx = col * w + xOffset;
const cy = row * h;
const v = noise(cx * FREQ * 0.05, cy * FREQ * 0.05);
const idx = Math.floor(v * palette.length * 1.2) % palette.length;
fill(palette[idx]);
drawHex(cx, cy, R * 0.96);
}
}
}
// NB: `hex()` is a p5 built-in (number → hex string) — name our helper drawHex.
function drawHex(cx, cy, r) {
beginShape();
for (let i = 0; i < 6; i++) {
const a = (i / 6) * TWO_PI - HALF_PI;
vertex(cx + r * Math.cos(a), cy + r * Math.sin(a));
}
endShape(CLOSE);
}How it works
A tiling is defined by a repeating unit and the lattice that translates it: 1. Choose a lattice / grid. For a square grid, step in x and y; for a hex grid, offset alternate rows by half a cell and use row spacing of √3/2·size (or use axial/cube coordinates for clean neighbour math). 2. Place a tile (or motif) at every lattice point, optionally rotating/ reflecting per the tiling's symmetry group. 3. Fill or decorate each tile — solid colour, sub-pattern, or a Truchet-style randomised motif. Regular tilings repeat exactly; Penrose and other aperiodic tilings use matching rules or substitution (inflate each tile into smaller tiles) so they never repeat yet stay gap-free.
Parameters
tileShape: string — Base tile — square, triangle or hexagon.gridSize: number — Tiles per side.jitter: number — Random positional/rotational offset added to each tile.
Lineage
Frequently combined with
- Generative Typography · 4 works
- Fractal / Recursive Subdivision · 4 works
- HSL / Hue Cycle · 3 works
- Truchet Tiles · 3 works
- Perlin / Simplex Noise · 2 works
- Instanced Geometry · 2 works
- Polygon Mosaic · 2 works
- Cellular Automata · 2 works
- Quadtree / Recursive Quad Split · 1 work
- Fragment Shader (GLSL) · 1 work
- Bezier / Catmull-Rom Splines · 1 work
- Particle System · 1 work
Works using this algorithm (39)
Last updated 2026-07-16