akten_quayola · MechanicalFlowerSpline
Mechanical Flower Spline
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. Inspired by Quayola's Sculpture Factory series, in which industrial robots carve endless variations of classical masterpieces — never completing the figure, leaving algorithmic traces of the process. Here, similarly, the petal count and petal geometry perform a slow random walk so the flower mutates over time without ever settling.
Original: https://quayola.com/sculpture-factory-laocoon/
▶ 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
Spline: r(θ) = r0 + A*cos(p_d*θ + δ_d) + B*cos(q_d*θ), then sweep phi = 0..2π around Y: (x3, y3, z3) = (cos(phi)*r*cos(θ), r*sin(θ), sin(phi)*r*cos(θ)). Project with tilt mixing of (1-y) and (1-z). p_d, q_d, A_d, B_d, δ_d each step by drift*N(0, 1). Render painter-sorted by iy*w + ix.
Parameters
| Name | Type | Default | Range | Description |
|---|---|---|---|---|
num_rot | int | 96 | 24–256 | Number of rotations around the Y axis. |
num_theta | int | 360 | 120–1080 | Samples along the radial spline. |
dim | int | 512 | 256–1024 | Output canvas side length. |
r0 | float | 0.5 | 0.2–0.9 | Base radius of the spline. |
A | float | 0.25 | 0.1–0.5 | Amplitude of the primary petal harmonic. |
B | float | 0.12 | 0.05–0.3 | Amplitude of the secondary petal harmonic. |
p | int | 5 | 3–12 | Primary petal count (integer). |
q | int | 3 | 2–8 | Secondary petal count (integer). |
delta | float | 0 | 0–6.283 | Phase offset of the primary harmonic. |
tilt | float | 0.65 | 0–1 | Camera tilt mixing the (y) and (z) screen coordinates. |
drift | float | 0.004 | 0–0.02 | Per-step random-walk magnitude on each petal parameter. |
Reference
First 60 lines of reference.py. Full source:
library_external/akten_quayola/MechanicalFlowerSpline/reference.py
from __future__ import annotations
from typing import ClassVar
import numpy as np
class MechanicalFlowerSpline:
"""Mechanical Flower Spline — Quayola, *Sculpture Factory* lineage.
Quayola's Sculpture Factory uses industrial robots to carve
classical sculptures block-by-block from a single block of matter.
The flowers produced along the way are not floral in any natural
sense; they are rotational splines swept around a vertical axis,
emerging from an algorithmic gesture rather than from botany.
Here the kernel is a parametric 2D spline
``r(θ) = r0 + A * cos(p θ + δ) + B * cos(q θ)``
swept around Y into a flower-like 3D surface, projected orthographically.
The petal count and petal geometry drift over time, the way
Quayola's robots are "instructed by the algorithms" rather than by
direct human design.
"""
family: ClassVar[str] = "akten_quayola"
sketch: ClassVar[str] = "MechanicalFlowerSpline"
def __init__(
self,
num_rot: int = 96,
num_theta: int = 360,
dim: int = 512,
r0: float = 0.5,
A: float = 0.25,
B: float = 0.12,
p: int = 5,
q: int = 3,
delta: float = 0.0,
tilt: float = 0.65,
drift: float = 0.004,
seed: int | None = None,
background: tuple[int, int, int] = (16, 14, 26),
**_,
) -> None:
self.num_rot = int(num_rot)
self.num_theta = int(num_theta)
self.dim = int(dim)
self.r0 = float(r0)
self.A = float(A)
self.B = float(B)
self.p = int(p)
self.q = int(q)
self.delta = float(delta)
self.tilt = float(tilt)
self.drift = float(drift)
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) Try running it locally
The reference implementation is self-contained Python with numpy. Install the package and run:
python library_external/akten_quayola/MechanicalFlowerSpline/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.
Pleated Fabric
akten_quayola · PleatedFabric
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.
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.