Gallery › Geometry and fractals
Woven Labyrinth
Truchet's 1704 two-triangle tile, randomly quarter-turned 256 times, chains into a flowing quilt.
How it is made
Sébastien Truchet's 1704 tile is a square split corner to corner into two contrasting triangles. Each of 256 copies is turned by a random quarter turn, and because the diagonals meet from tile to tile, the single motif chains into a continuous, flowing labyrinth. The program carries its own copy of artkit's truchet.
Details
- Category
- Geometry and fractals
- Libraries
- none: this piece is plain PostScript
- Added
- 2026-08-01
- Page size
- 640 × 640 points
Source
View source the whole program in a scrolling window, or read gallery/woven_labyrinth.ps on GitHub. To draw it yourself, from a checkout of the repository:
pscat --page 640x640 gallery/woven_labyrinth.ps
Open it in the playground and watch it draw in your browser: this piece reads no other file, so it runs there unchanged.
The first 40 of 89 lines of the source
%!PS-Adobe-3.0
%%Title: Woven Labyrinth
%%BoundingBox: 0 0 640 640
%%EndComments
% A quilt built from the oldest Truchet tile there is: Sébastien
% Truchet's 1704 original was nothing but a square split corner to
% corner into two contrasting triangles. Scatter that one motif across
% a grid at four random quarter-turns and the diagonals chain into a
% continuous, flowing labyrinth — no two runs the same, though every
% run of *this* file is (seeded rand: same seed, same weave). The
% frame and the grid's own stitch-lines are the only other ink.
%
% Gallery II (Stage 24, tiling library) — inlines `chance` and
% `truchet` from lib/artkit.ps per the gallery's self-containment
% doctrine (see hortus.ps).
%
% pscat --page 640x640 gallery/woven_labyrinth.ps
11 srand
% --- the toolkit subset (from lib/artkit.ps) -------------------------
/chance { rand 8192 idiv exch mod } def
/truchet {
/tgproc exch def /tgrows exch def /tgcols exch def
/tgh exch def /tgw exch def /tgy exch def /tgx exch def
/tgcw tgw tgcols div def
/tgch tgh tgrows div def
0 1 tgrows 1 sub {
/tgj exch def
0 1 tgcols 1 sub {
/tgi exch def
gsave
tgx tgi tgcw mul add tgcw 2 div add
tgy tgj tgch mul add tgch 2 div add
translate
4 chance 90 mul rotate
tgcw tgch tgproc
grestore
} for