random tiler - blossommerz/locus-hub GitHub Wiki

Home > The random-tiler system

< Previous: Reading the symmetry notation | Next: Phyllotaxis >

Patterns & Symmetry

The random-tiler system

Controlled randomness inside a wallpaper group - scatter a mix of tiles per cell while keeping strict symmetry.

Sometimes you don't want the same motif in every cell - you want variety. A field where each cell holds one of several tiles, mixed so it reads as lively rather than mechanical, but still locked to a real symmetry group so it repeats and reads as pattern, not noise. That's the random-tiler system, and designs that use it carry _rand in their name.

The trick is controlled randomness. The scatter is random in which tile lands where, but the underlying wallpaper symmetry is strict - every rule of the group still holds. You get variety and structure at the same time.

The building blocks

The random-tiler clusters are assembled from a few small, plain-language pieces. You rarely wire these by hand - the _rand clusters do it for you - but knowing what each one does makes the whole thing predictable.

List Length + Random

List Length counts how many tiles are in your collection. Feed it a group of six tiles and it reports six.

Random is a seeded dice roll. Give it a range and a seed, and it produces a number - but the same seed always produces the same result, so your pattern is reproducible. Wire List Length into Random's upper bound and the dice automatically roll across exactly however many tiles you've supplied. Add or remove a tile and the range resizes itself.

Random also produces a per-point version: instead of one number, it draws an independent pick at every position it's asked about. That's what lets one Random give a different tile to every cell in the lattice.

PlaceVariant - pick a tile per site

PlaceVariant is the node that does the actual scattering. It stamps a copy onto every lattice site, and at each site it chooses which member of your collection to drop, based on an index. Wire Random's per-point draws into that index and each cell gets its own tile - a genuine mix, stable until you change the seed. Feed it a plain fixed number instead and every cell shows the same tile, which is handy for previewing one option.

Random Per-Point - stable seeding by index

Early on, the per-point draw was tied to each cell's position. That caused a frustrating quirk: move or scale the whole pattern and every cell re-rolled, scrambling your careful arrangement. The fix keys each draw to the cell's index - its place in the emission order - rather than where it sits in space. Now the mix stays put when you transform the pattern; a cell keeps its tile as you move, scale, or rotate the lattice.

[!TIP] If a _rand pattern reshuffles when you didn't touch the seed, that used to be the position-versus-index issue. On a current build the mix should hold steady through transforms - only changing the seed reshuffles it.

Keeping whole tiles intact

A tile is often more than one shape - several regions that together make one unit. The scatter has to move a tile as a whole, not fling its pieces apart. The system does this with one level of list nesting: a collection of tiles where each tile can carry its own several regions. List Length counts tiles, not loose shapes, and PlaceVariant stamps a whole tile - all its regions together - per cell. See Lists and collections for how this nesting works.

A _rand cluster for every group

Just as every wallpaper group ships as a cluster preset, every one of the 17 groups also ships a _rand twin - p1_rand, pm_rand, pgg_rand, all the way through the hexagonal family p3m1, p31m, p6, and p6m. Each twin reuses its group's domain and guides exactly, and swaps only the pattern step: instead of arraying one motif, it scatters a random tile per cell. You drop it in and feed it a collection of tiles plus a seed instead of a single motif. Each _rand cluster comes with its own sample file so you can see it working.

Per-copy randomization

Within a single cell, some groups make several copies of a tile - a p6 cell spins six copies around a point, for instance. By default the whole rosette of six shows the same randomly chosen tile. If you'd rather each of the six be chosen independently - six different tiles in one rosette - the symmetry-variant nodes handle that: they stamp the group's full set of rotations or mirrors at each site and take a fresh random draw for every copy, not just every cell. That moves the variety from per-cell to per-copy, for a richer mix.

[!NOTE] Aperiodic tilings - Penrose tilings and the like, which never exactly repeat - are out of scope. The random-tiler stays strictly inside the 17 repeating wallpaper groups: the arrangement of tiles is varied, but the pattern still tiles the plane periodically.

< Previous: Reading the symmetry notation | Next: Phyllotaxis >

Related