Zellige Is Not Just Decoration
Moroccan zellige is often presented as decorative art. It's a reduction. It's primarily a geometric system: a set of construction rules allowing a plane to be covered without gaps or overlaps, producing symmetries of remarkable complexity.
The Construction Logic
A complex zellige rests on a few principles:
1. The base cell: a polygon (star, rhombus, hexagon, triangle) defined by a fixed number of sides and angles.
2. The replication rule: how the cell repeats in the plane — by translation, rotation, reflection. The mathematical classification of tilings (17 plane symmetry groups) describes exactly the possible combinations.
3. The hierarchy of patterns: some cells form super-cells, which repeat in turn. A recursive structure, analogous to recursion in programming.
4. Boundary constraint: at surface edges, patterns are completed by half-cells or adaptations — exactly what a tessellation algorithm must manage.
Translating to p5.js Code
function etoile(cx, cy, rOut, rIn, P, rot, col) {
beginShape();
for (let i = 0; i < 2 * P; i++) {
const a = rot + i * PI / P;
const r = (i % 2 === 0) ? rOut : rIn;
vertex(cx + cos(a) * r, cy + sin(a) * r);
}
endShape(CLOSE);
}
Zellige isn't an inspiration for code — it already is code, expressed in another language. The conversion from one to the other isn't an approximate translation: it's an exact correspondence.
See the ZELLIGE KHATIM work → · Tessellation tutorial →
A project in mind?
Book 15 min →