Truchet Tiles

First appeared 1704 · Sébastien Truchet — Sébastien Truchet, "Mémoire sur les combinaisons" (1704). · timeline ↗

third-party / eponym Name — An eponym: Truchet described the tiles in his 1704 memoir but did not name them after himself. The "Truchet tiles" name was carried into the modern literature by Cyril Stanley Smith, who popularized them in his 1987 Leonardo paper "The Tiling Patterns of Sebastian Truchet and the Topology of Structural Hierarchy" (which included a translation of Truchet's text). The exact coiner of the eponym is not established here.

In one line A classic technique that tiles a grid with one simple, asymmetric square placed in random orientations, so the tile edges connect into complex global patterns. Variants use diagonal splits or quarter-circle arcs (Smith tiles).

Truchet Tiles · 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.

truchet-tiles/index.html
const SEED = Math.floor(Math.random()*1e9);

function setup() {
  randomSeed(SEED);
  const s = Math.min(windowWidth, windowHeight);
  createCanvas(s, s);
  background(15);
  noFill();
  strokeCap(SQUARE);

  // Curved Truchet: each cell randomly orients two quarter-arcs
  // connecting opposite midpoints.
  const N = 14;
  const cs = width / N;
  strokeWeight(cs * 0.25);
  stroke(240);

  for (let i = 0; i < N; i++) {
    for (let j = 0; j < N; j++) {
      const x = i * cs;
      const y = j * cs;
      if (random() < 0.5) {
        // Arcs connecting (top↔right) and (bottom↔left)
        arc(x + cs, y,       cs, cs, PI/2, PI);
        arc(x,      y + cs,  cs, cs, -PI/2, 0);
      } else {
        // Arcs connecting (top↔left) and (bottom↔right)
        arc(x,      y,       cs, cs, 0, PI/2);
        arc(x + cs, y + cs,  cs, cs, PI, -PI/2);
      }
    }
  }
}

Open the demo source ↗

How it works

Take a single square tile whose design meets its edges at fixed connection points — e.g. a diagonal line corner-to-corner, or two quarter-circle arcs joining adjacent edge-midpoints. Then: 1. For each cell of a grid, pick one of the tile's rotations (and/or reflections) at random — for the diagonal tile, 2 states; for the arc tile, 2 rotations. 2. Draw the tile in that orientation. Because every variant aligns at the same edge points, adjacent tiles always connect, so the local randomness assembles into continuous mazes, contours and looping curves. Weighting the random choice, or driving it from noise, biases the texture.

Parameters

Lineage

Related
Multi-color Modular Truchet, Geometric / Hexagonal Tiling, Wave Function Collapse

Frequently combined with

Works using this algorithm (11)

70s Pop Ghost Bonus Pack 👻
daniel-catt
70s Pop Series One
daniel-catt
70s Pop Super Fun Summertime Bonus Pack 🍸
daniel-catt
Cushions
devi-parikh
Fermented Fruit
cyberia
Loom
anna-lucia
Mental pathways
fabianospeziari-x-donnoh
nullMachines
kerim-safa-loackme
Swing
eltono
Trossets
anna-carreras
Undercover
artplusbrad

Last updated 2026-07-16