akten_quayola · PleatedFabric
Pleated Fabric
A textile grid whose vertical coordinate follows z = A * envelope(y) * sin(2π f x + phase(t)), projected obliquely onto a 2D canvas so the folds read as parallel ridges of light. Inspired by Quayola's experiments with pleating — fabric folded and unfolded through algorithmic systems — the formula renders the tension between flat weave and three-dimensional form. A secondary horizontal pleating creates a subtle cross-hatch that deepens with depth/tilt; the fold frequency slowly drifts so the fabric never freezes.
Original: https://quayola.com/
▶ Try the live demo (JS port) ▶ Run reference.py via Pyodide 10 formulas have instant JS ports. The Pyodide path runs the actual Python in your browser — first load is ~6 MB, then instant.
Math essence
x, y normalized to [-1, 1]. z = A * clip(1 - 0.7*|y|, 0, 1) * sin(2π*f_x*x + phase) + 0.18*A*sin(2π*f_y*y + phase*0.6). Project: u = x + z*tilt, v = y - z*(1-tilt). Painter's-algorithm sort by u+v yields correct overlap. Fold frequency fx drifts by N(0, fold_drift) per step.
Parameters
| Name | Type | Default | Range | Description |
|---|---|---|---|---|
dim | int | 512 | 256–1024 | Output canvas side length. |
fold_freq | float | 0.18 | 0.05–0.45 | Spatial frequency of the primary pleats. |
fold_drift | float | 0.0008 | 0–0.005 | Per-step random walk on fold frequency. |
cross_freq | float | 0.05 | 0–0.2 | Spatial frequency of the cross pleats. |
amplitude | float | 0.45 | 0.1–0.9 | Peak displacement of the fold. |
tilt | float | 0.65 | 0–1.5 | Camera tilt — ratio of horizontal to vertical screen displacement. |
Reference
First 60 lines of reference.py. Full source:
library_external/akten_quayola/PleatedFabric/reference.py
from __future__ import annotations
from typing import ClassVar
import numpy as np
class PleatedFabric:
"""Pleated Fabric — Quayola, *Pleated* / folded-textile studies.
Quayola's research into pleating (Issey-Miyake-influenced folded
surfaces) translates into a periodic vertical displacement of a
textile grid: z(x, y, t) = amp * sin(fold_freq * x + phase(t)) *
envelope(y). Here the grid is projected under a slow oblique
camera tilt so the folds read as parallel ridges of light; a
secondary horizontal pleating introduces a subtle cross-hatch.
The pleats evolve over time — Quayola's "form and matter in
tension" — with the fold frequency drifting so the textile never
freezes. A fabric-coloured palette of bone, indigo and rose
completes the look.
"""
family: ClassVar[str] = "akten_quayola"
sketch: ClassVar[str] = "PleatedFabric"
def __init__(
self,
dim: int = 512,
fold_freq: float = 0.03,
fold_drift: float = 0.0008,
cross_freq: float = 0.012,
amplitude: float = 0.45,
tilt: float = 0.65,
depth: float = 0.6,
seed: int | None = None,
background: tuple[int, int, int] = (240, 232, 214),
**_,
) -> None:
self.dim = int(dim)
self.fold_freq = float(fold_freq)
self.fold_drift = float(fold_drift)
self.cross_freq = float(cross_freq)
self.amplitude = float(amplitude)
self.tilt = float(tilt)
self.depth = float(depth)
self.bg_color = np.array(background, dtype=np.float32)
self.reset(seed=seed)
def reset(self, seed: int | None = None) -> None:
self.rng = np.random.default_rng(seed)
self.t = 0.0
self.fold_phase = 0.0
gn = self.dim
ys, xs = np.mgrid[0:gn, 0:gn].astype(np.float32)
self.grid_x = xs / gn
self.grid_y = ys / gn
def step(self, n: int = 1) -> None:
for _ in range(n): Try running it locally
The reference implementation is self-contained Python with numpy. Install the package and run:
python library_external/akten_quayola/PleatedFabric/reference.py Need help? See Learn for the standard environment setup, or Playground for an in-browser sketchbook.
More from akten × quayola
Gesture Driven Field
akten_quayola · GestureDrivenField
Particles advected through a vector field whose structure is driven by a synthetic gesture signal: a chain of sinusoids at integer-related frequencies.
Lissajous 3D
akten_quayola · Lissajous3D
A three-dimensional Lissajous figure rendered as a single precision line drawing on a deep field.
Mechanical Flower Spline
akten_quayola · MechanicalFlowerSpline
A 2D petal-radius spline r(θ) = r0 + A*cos(p*θ + δ) + B*cos(q*θ) swept 360° around a vertical Y axis to form a procedural flower-like 3D surface, then orthographically projected and depth-shaded.
Simple Harmonic Motion
akten_quayola · SimpleHarmonicMotion
A 100x100 grid of damped harmonic oscillators driven by a periodic central impulse.
Strata Landscape
akten_quayola · StrataLandscape
A geological landscape rendered as N horizontal strata stacked vertically, each band displaced by a slowly growing sinusoid and shaded with its own hue.
Wave Interference
akten_quayola · WaveInterference
N drifting point sources emit circular sinusoidal waves whose superposition is tone-mapped into a stormy ocean-like field.