3D fractal
TPMS Schwarz P
Live turntable captured from Spiralyst Lab.
The Schwarz Primitive is a triply-periodic minimal surface — an infinite, soap-film membrane that is saddle-shaped at every point and cleanly divides space into two interlocking channels. The entire structure is defined by a single short equation.
An Infinite Soap Film
A triply-periodic minimal surface (TPMS) is a surface that repeats in all three directions of space and is 'minimal' — at every point it is saddle-shaped, curving up one way exactly as much as it curves down the other, in perfect balance, the way an infinite soap film would. The Schwarz Primitive surface, found by Hermann Schwarz in the 1880s, is the simplest of them: a smooth membrane that cleanly partitions space into two interpenetrating, identical channels.
What is astonishing is how compactly it is described. The entire infinite surface is the set of points where a single short equation — the sum of three cosines — equals zero. That one line of trigonometry defines a structure that looks engineered and biological at once, with a rounded, scaffold-like beauty.
Nature uses these surfaces for strength-to-weight efficiency: they appear in butterfly-wing scales, beetle exoskeletons, block-copolymer plastics, and the membranes of some cell organelles. Engineers print them as lightweight lattice infill, and architects borrow them for their mix of openness and rigidity.
The whole surface is this single implicit equation — the level set where the three cosines cancel. Remarkably compact for something so structural.
The defining property of a minimal surface: at every point it bulges up exactly as much as it dips down — the shape a soap film naturally takes.
In Spiralyst Lab
Spiralyst Lab ray-marches the implicit surface directly from cos x + cos y + cos z = 0 (coordinates pre-scaled by a frequency control that sets the period). Because a mathematical surface has zero thickness, the app renders it as a solid shell — points where the field is within a 'thickness' of zero — so you see a tangible membrane; a small Lipschitz safety factor keeps the ray-marcher from over-stepping. The camera orbits it; soft ambient light lets the saddles read.
Every parameter below is a live control — set it by hand, map it to a frequency band, or let it ride a smooth animation. These ranges are the actual in-app slider limits.
| Parameter | Range (in-app) |
|---|---|
| Frequency | 0.5 – 5.0 |
| Thickness | 0.01 – 0.7 |
| Surface ε | 0.0001 – 0.005 |
| Ray steps | 16 – 200 |
Audio-reactive by default: uFreq 0.8→4.5, uThick 0.02→0.6. Any control can be mapped to audio or animation.
Plus the universal 3D controls every ray-marched type shares: camera (yaw, pitch, distance, FOV) and lighting (light direction, ambient, fog density, glow falloff).
Watch it in action
assets/video/fractals/25-tpms-schwarz.mp4
Did you know: Minimal surfaces are exactly the shapes soap films form across wire frames — Schwarz studied them in the 1880s, more than a century before they turned up in 3D-printer infill patterns.