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.

Geometric / Hexagonal Tiling · Open in new tab ↗ · Motion begins only when you press Run.

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);
}

Open the demo source ↗

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

Lineage

Related
Truchet Tiles, Multi-color Modular Truchet, Wave Function Collapse, Polygon Mosaic

Frequently combined with

Works using this algorithm (39)

Aerial View
dalenz
Agglo
leander-herzog
Andradite
eltono
Black and White Structure
zdenek-sykora
Boundary Functions
scott-snibbe
Dear Hash,
modnar-wolf
Dive
rafael-rozendaal
Dynamic Slices
pxlq
Elementals
michael-connolly
Endless Nameless
rafael-rozendaal
Escherly Seeds
martijn-cohen
Exhibition: 3291
cryptobauhaus
Fifteen Systematic Colour Rows with Vertical Condensations
richard-paul-lohse
Fontana
harvey-rayner
Grid Distortion
marius-watz
Implications
ixnayokay
Imposter Syndrome
ippsketch
Interruptions
vera-molnar
Intersections
rafael-rozendaal
Lobofour
tony-robbin
Loom
anna-lucia
marfaMESH
harvey-rayner
Masonry
eric-davidson
Orthogone
pandelune
Ouroboros
raregonzo
Panelscape 🅰🅱
paolo-tonon
Planetary Folklore Participations No. 1
victor-vasarely
Quinze variations sur un même thème
max-bill
QWERTY
tara-donovan
Quine
larva-labs
Ringers
dmitri-cherniak
Schotter
georg-nees
Squares and Triangles
maksim-hapeyenka
Swimming Pool
paul-brown
Swing
eltono
Time Squared
steen-n-e-o
Triangular Tonal Drawing
tony-longson
Trossets
anna-carreras
Variant Plan
jeff-davis

Last updated 2026-07-16