Rule and Compass as First Formal Language

The craftsmen who created the zellige of Bou Inania mosque in Fez in the 14th century had no computers. They had rules, compasses, and a corpus of construction methods. This corpus is, in its logic, a formal language — a set of precise rules that, applied, produce a family of patterns.

These construction rules correspond exactly to the structures that generative algorithms use: translation, rotation, reflection, recursion, tiling constraints.

Plane Symmetry Groups

There are exactly 17 plane symmetry groups (wallpaper groups), each describing a different combination of translations, rotations and reflections. Most zellige, arabesque and Islamic geometry patterns use these groups.

A programme implementing these groups can generate patterns in the spirit of this tradition — not by copying, but by sharing the same underlying logic.

The Fundamental Cell


function drawCell(cx, cy, size) {
  push(); translate(cx, cy);
  beginShape();
  for (let i = 0; i < 12; i++) {
    let a = i * PI/6;
    let r = (i % 2 === 0) ? size : size * 0.4;
    vertex(cos(a) * r, sin(a) * r);
  }
  endShape(CLOSE);
  pop();
}

Code as Exploration Tool

Creative coding is particularly interesting for these forms: it allows exploring configurations impossible by hand. What happens if the ratio of a star's points varies slowly over time? If each cell's colour depends on position? These aren't variations that denature the tradition — they reveal its deep structure.

See ZELLIGE KHATIM work → · Tessellation tutorial →