# Ollin > A Metal-rendered creative-coding framework for Swift on Apple platforms. Sketches are Swift classes with a `setup()` and a `draw()` that runs every frame; the renderer sits on Metal and composites in linear light. Every page on this site has a markdown twin at the same address with `.md` in place of `.html`, which is what these links point at. The reference is the authority on what exists and how it behaves; the guide teaches it in order; the examples are runnable sketches. ## Start here - [Ollin quick reference](https://ollin.art/docs/quickreference.md): the framework in one read: the lifecycle, the calls by area and their units, the command line, and the mistakes that fail with no error - [Swift quick reference](https://ollin.art/docs/swift.md): just enough of the language to write a sketch ## Guide - [1. Hello, Ollin](https://ollin.art/guide/01-helloollin.md) - [2. Color that works](https://ollin.art/guide/02-color.md) - [3. Motion and time](https://ollin.art/guide/03-motionandtime.md) - [4. Randomness](https://ollin.art/guide/04-randomness.md) - [5. Noise](https://ollin.art/guide/05-noise.md) - [6. Grids and repetition](https://ollin.art/guide/06-gridsandrepetition.md) - [7. Tiles that cover the plane](https://ollin.art/guide/07-tiles.md) - [8. Words](https://ollin.art/guide/08-words.md) - [9. Pictures and data](https://ollin.art/guide/09-pictures.md) - [10. Vectors, gently](https://ollin.art/guide/10-vectors.md) - [11. Forces and physics](https://ollin.art/guide/11-forcesandphysics.md) - [12. Flocks and swarms](https://ollin.art/guide/12-flocksandswarms.md) - [13. Growing things](https://ollin.art/guide/13-growingthings.md) - [14. Fields and flow](https://ollin.art/guide/14-fieldsandflow.md) - [15. Shapes as material](https://ollin.art/guide/15-shapesasmaterial.md) - [16. Curves and figures](https://ollin.art/guide/16-curvesandfigures.md) - [17. Marks and media](https://ollin.art/guide/17-marksandmedia.md) - [18. Your first shader](https://ollin.art/guide/18-yourfirstshader.md) - [19. Layers and effects](https://ollin.art/guide/19-layersandeffects.md) - [20. Pictures restyled](https://ollin.art/guide/20-picturesrestyled.md) - [21. Pictures you solve](https://ollin.art/guide/21-picturesyousolve.md) - [22. Iterated forms](https://ollin.art/guide/22-iteratedforms.md) - [23. Simulations on a grid](https://ollin.art/guide/23-gridsimulations.md) - [24. Automata](https://ollin.art/guide/24-automata.md) - [25. Simulations made of particles](https://ollin.art/guide/25-particlesimulations.md) - [26. 3D, gently](https://ollin.art/guide/26-3dgently.md) - [27. Meshes and maps](https://ollin.art/guide/27-meshes.md) - [28. Materials and surroundings](https://ollin.art/guide/28-materialsandsurroundings.md) - [29. Landscapes and multitudes](https://ollin.art/guide/29-landscapes.md) - [30. Worlds with weight](https://ollin.art/guide/30-worldswithweight.md) - [31. Characters, vehicles, and cloth](https://ollin.art/guide/31-charactersandcloth.md) - [32. Sculpting with fields](https://ollin.art/guide/32-sculptingwithfields.md) - [33. Traced light](https://ollin.art/guide/33-tracedlight.md) - [34. Seeing](https://ollin.art/guide/34-seeing.md) - [35. Depth](https://ollin.art/guide/35-depth.md) - [36. The iPhone as a sensor](https://ollin.art/guide/36-thephoneasasensor.md) - [37. Listening](https://ollin.art/guide/37-listening.md) - [38. Controls and signals](https://ollin.art/guide/38-controlsandsignals.md) - [39. Making sound](https://ollin.art/guide/39-makingsound.md) - [40. Music by rule](https://ollin.art/guide/40-musicbyrule.md) - [41. Finishing a sketch](https://ollin.art/guide/41-finishingasketch.md) - [42. Making it physical](https://ollin.art/guide/42-makingitphysical.md) - [43. Performing](https://ollin.art/guide/43-performing.md) - [44. Handing it over](https://ollin.art/guide/44-handingitover.md) - [45. Installations](https://ollin.art/guide/45-installations.md) ## Concepts - [The frame](https://ollin.art/docs/concepts/frame.md): what a drawing call does, and what happens between `draw()` and the picture - [Where a point is](https://ollin.art/docs/concepts/coordinates.md): the canvas coordinates and their units, and the other coordinate frames a sketch meets - [Layers](https://ollin.art/docs/concepts/layers.md): what an off-screen layer is, what it costs, and when you need one - [What survives a frame](https://ollin.art/docs/concepts/persistence.md): what Ollin keeps between frames and what it drops: state, the canvas, layers, batches, saved values - [Why a run repeats](https://ollin.art/docs/concepts/determinism.md): the seed and the clock, and what makes a sketch draw the same picture twice - [Light and color](https://ollin.art/docs/concepts/light.md): why color mixes in linear light, and what the last pass of a frame does - [Values and bare calls](https://ollin.art/docs/concepts/values.md): the typed values under `drawCircle(x, y, r)`, and when to use them ## Core - [Sketch](https://ollin.art/docs/core/sketch.md): the lifecycle (`setup`/`draw`), the clock values (`time`, `frameCount`, …), loop control with `redraw()`, and `isExporting` - [Canvas, size, and export](https://ollin.art/docs/core/canvas.md): `scale`, the `canvasSize` export presets, and the preview window (`windowMode`) - [Variations](https://ollin.art/docs/core/variations.md): `variation`, the seed a run starts from. - [Record & replay](https://ollin.art/docs/core/replay.md): record a run's seed, clock, inputs, and parameter changes as a take (`--record-take`). - [Keyframed parameters](https://ollin.art/docs/core/automation.md): keyframed parameters. ## Drawing - [Drawing](https://ollin.art/docs/drawing/drawing.md): `background`, `fill`/`stroke`, the shapes, the transform stack, and the views over it (`withClip`, `withViewBox`, `viewControl`) - [Accumulation](https://ollin.art/docs/drawing/accumulation.md): `noClear` keeps the canvas across frames, so drawing builds up (long exposures, paint on canvas). `Accumulator` is a layer that keeps the running mean, so a picture built from… - [Depth of field from light](https://ollin.art/docs/drawing/depthoffield.md): `LineSpray` and `Bokeh`. Lines are drawn as millions of scattered points through a lens and added into a running mean until bokeh appears. - [HDR & tone mapping](https://ollin.art/docs/drawing/hdr.md): `toneMap` rolls bright, out-of-range light off instead of clipping it. - [Wide gamut & HDR output](https://ollin.art/docs/drawing/coloroutput.md): `colorOutput` to present through Display P3 and keep highlights brighter than white, `Color(displayP3:)` for colors outside sRGB, and HDR10 video export - [Retained batches](https://ollin.art/docs/drawing/batches.md): `makeBatch` records heavy static drawing once, and `drawBatch` replays it each frame from the GPU at almost no cost. - [Layered effects](https://ollin.art/docs/drawing/effects.md): `renderTarget`/`withTarget` draw into off-screen layers. `filtered`/`postProcess` run GPU filters over them (blur, bloom, halation, film grain, color grade, gradient map, edges… - [Looks: a grade from a .cube file](https://ollin.art/docs/drawing/looks.md): `ColorLUT` reads a `.cube` file, the color table a grading tool exports, and `Filter.lut` applies it to a layer or the whole frame, a cube by tetrahedral interpolation. - [Marks](https://ollin.art/docs/drawing/marks.md): `StrokeMark`/`drawMark` and `StrokeDynamics`. Width and opacity follow how a mark is being made, rather than where you are along the path. - [Text](https://ollin.art/docs/drawing/text.md): `drawText` with bitmap, outline (`.ttf`/`.otf`), and stroke (single-line / plotter) fonts, plus `textToShapes` (text as geometry) and text in any script (right-to-left… - [Images](https://ollin.art/docs/drawing/images.md): `loadImage`, `drawImage`, `tint`, and pixel access. - [Sample photographs](https://ollin.art/docs/drawing/samplephotos.md): `SamplePhoto`, twenty bundled photographs with their credits, one import away, for trying an image technique or a filter on a real picture. - [Glyph mosaic](https://ollin.art/docs/drawing/glyphmosaic.md): `drawGlyphMosaic` rebuilds an image as a grid of text glyphs. - [Halftone](https://ollin.art/docs/drawing/halftone.md): `drawHalftone` rebuilds an image as the classic print dot screen: area-exact dots on a rotated grid, drawn as real circles for the plotter path. - [Autostereogram](https://ollin.art/docs/drawing/autostereogram.md): `Image.autostereogram` hides a depth map in a repeating pattern. - [Photo mosaic](https://ollin.art/docs/drawing/photomosaic.md): `Image.mosaic` + `averageColor` + `drawMosaic` rebuild a picture out of many smaller pictures. - [Pixel sorting](https://ollin.art/docs/drawing/pixelsorting.md): `Image.pixelSorted` reorders runs of an image's own pixels along rows or columns, with each run bounded by brightness (the classic glitch melt). - [Seam carving](https://ollin.art/docs/drawing/seamcarving.md): `Image.seamCarved` and `SeamMap` resize a picture by removing the paths through it that matter least, so what matters keeps its shape. - [Color](https://ollin.art/docs/drawing/color.md): the `Color` type, the OKLab family and mixing, `CIELab`, how far apart two colors look and an image's histogram, `Ramp`s and `Palette`s (loaded from a file, extracted from an… - [Spectral color](https://ollin.art/docs/drawing/spectrum.md): `Spectrum`, the reflectance curve behind a color. - [Geometry](https://ollin.art/docs/drawing/geometry.md): the `Vector2`, `Vector3` (sharing one `Vector` surface), `Rotation3D`, `Ray3`, `Rectangle`, `Circle`, `LineSegment`, `Arc`, `Ellipse`, `Grid`, `Shape`/`Contour`, `Path`, and… - [SVG import](https://ollin.art/docs/drawing/svg.md): `loadSVG`/`drawSVG` read vector artwork into `Shape`s and `Contour`s: paths with curves and arcs, the basic shapes, groups and transforms, fills and strokes. - [Fourier epicycles](https://ollin.art/docs/drawing/epicycles.md): `Epicycles` + `drawEpicycles` rebuild any closed outline as a chain of spinning circles. - [Envelopes & caustics](https://ollin.art/docs/drawing/envelopes.md): `envelope` + `caustic`. An envelope is the curve a family of lines is tangent to, and a caustic is the bright curve where reflected or bent light gathers. - [Classic curves](https://ollin.art/docs/drawing/curves.md): the classic closed-form curves as geometry builders: `phyllotaxis`, `lissajous`, `rose`, `superellipse`, `supershape`, `hypotrochoid`/`epitrochoid` (the spirograph gears)… - [Anamorphosis: a drawing only a mirror can read](https://ollin.art/docs/drawing/anamorphosis.md): `Anamorphosis`, a plate that reads correctly only in a mirrored cylinder standing on the page, seen from one viewing spot. - [Clothoid: the curve that bends at a steady rate](https://ollin.art/docs/drawing/clothoid.md): the curve whose bend grows at a steady rate (the Euler or Cornu spiral). - [Shape morphing](https://ollin.art/docs/drawing/morphing.md): `ShapeMorph` tweens one `Shape` into another, and every in-between is a real vector shape (contour pairing, corner-keeping correspondence, holes that grow in and out). `Shape` is… - [Voronoi & Delaunay](https://ollin.art/docs/drawing/voronoi.md): tessellate points into vector geometry: Voronoi cells (the "crystallization" look) and the dual Delaunay triangle mesh, with Lloyd relaxation and weighted power diagrams - [Spatial index](https://ollin.art/docs/drawing/spatialindex.md): `SpatialIndex`, the structure that answers what is near a point without reading every point. - [Fitting](https://ollin.art/docs/drawing/fitting.md): `RadialBasis`, a smooth field of numbers, vectors, or colors fitted through values you know at a few scattered places (a field of vectors also works as a warp), with its exact… - [Truchet tiling](https://ollin.art/docs/drawing/truchet.md): one tile per grid cell, turned to a random orientation, so identical parts join into flowing loops (`.arcs`) or a maze (`.diagonals`) - [Hitomezashi stitching](https://ollin.art/docs/drawing/hitomezashi.md): one bit per grid line sets the phase of its dashes, and the shifted lines weave into staircases, loops, and a two-tone cloth - [Ten print](https://ollin.art/docs/drawing/tenprint.md): `tenPrint`, one of two diagonals per cell chosen by a coin flip, joined into the long connected paths the picture is known for - [Kolam and sona](https://ollin.art/docs/drawing/kolam.md): one line launched between a field of dots and bounced off the edges until it closes. - [Celtic knotwork](https://ollin.art/docs/drawing/knotwork.md): the same line given width and an alternating over-under rule, returned already broken where each cord passes under another - [Crease patterns: folding and cutting](https://ollin.art/docs/drawing/creasepattern.md): the flat sheet a folded or cut object comes from: the Miura fold with its rigid folding in three dimensions, rotating-squares kirigami, and Kawasaki's and Maekawa's laws, which… - [Tiling & layout](https://ollin.art/docs/drawing/tiling.md): the other ways to divide a canvas: `HexGrid`/`TriangleGrid` (the hex and triangle tilings, with hex distance, neighbors, and exact picking), `subdivide` (recursive panels, binary… - [Aperiodic tilings](https://ollin.art/docs/drawing/aperiodictilings.md): the tilings that never repeat: `penroseTiling` (kites and darts, rhombs, with the matching-rule arcs), `wangTiling` (edge-matching squares as one connected quilt), `girihPattern`… - [Parquet deformations](https://ollin.art/docs/drawing/parquetdeformation.md): `parquetDeformation` draws a tiling whose tile changes shape as you read across it. - [Hyperbolic tiling](https://ollin.art/docs/drawing/hyperbolictiling.md): regular tilings of the hyperbolic plane in the Poincaré disk. `hyperbolicTiling` takes any {p,q} with (p-2)(q-2) > 4 and returns typed tiles with depth and a two-coloring parity… - [Strange attractors & chaotic maps](https://ollin.art/docs/drawing/attractors.md): chaotic systems as points. - [SDF combinators](https://ollin.art/docs/drawing/combinators.md): compose signed-distance fields so shapes *merge* instead of stacking: smooth union/subtract/intersect and morph, round/onion, and domain mirror/tile. - [Measured distance fields](https://ollin.art/docs/drawing/distancefields.md): measure a distance field back out of a drawn layer with `Filter.distanceField`: how far every pixel is from the nearest edge, and in which direction. `Filter.fieldMap` reads it… - [Layer styles](https://ollin.art/docs/drawing/layerstyles.md): a layer given an edge of its own, read from its alpha: `.outline` inside, outside, or centered on the edge, `.dropShadow` and `.innerShadow`, `.outerGlow` and `.innerGlow` that… - [The frequency domain](https://ollin.art/docs/drawing/fourier.md): a picture read as a sum of waves instead of a grid of pixels. `Filter.fourier` writes the spectrum on the GPU and `.inverseFourier` reads it back. - [Light in a flat sketch](https://ollin.art/docs/drawing/light.md): `Combine.light` computes the light that reaches every pixel of a flat scene. - [Local averages](https://ollin.art/docs/drawing/localaverages.md): the average of the neighborhood around every pixel at a fixed cost, over a summed-area table. `Filter.boxBlur` costs the same at any radius, and `Filter.adaptiveThreshold` cuts a… ## Shaders - [User-supplied shaders](https://ollin.art/docs/shaders/shaders.md): write your own fragment shader (`Shader` + a `shade(uv, info)` function) and run it through the effect graph as a generator, filter, or combine, or as the paint a shape is filled… - [Visual chains](https://ollin.art/docs/shaders/visuals.md): compose animated imagery by chaining a `Visual`: sources (oscillator, noise, voronoi, shape) pass through warps, color moves, blends, and modulations. - [The shader library](https://ollin.art/docs/shaders/shaderlibrary.md): reference for the helper functions a fragment shader or compute kernel can call: color/OKLab, hashes, value/gradient/curl noise, the 2D signed-distance catalog (`smin`… - [Compute & GPU particles](https://ollin.art/docs/shaders/compute.md): GPU compute over buffers and textures. `Particles` updates and draws a million particles on the GPU each frame (the "sandpainting" engine), and `Simulation` runs… ## 3D - [3D](https://ollin.art/docs/3d/3d.md): opt into a 3D camera and depth buffer. - [Scenes (structure-preserving import)](https://ollin.art/docs/3d/scenes.md): `loadScene` keeps a glTF or USD file's *structure* instead of merging it. - [Instanced meshes](https://ollin.art/docs/3d/instancing.md): draw one mesh thousands of times in one call. `drawMesh(_:instances:)` takes a list of `MeshInstance` placements (position, rotation, scale, tint) that the GPU applies per copy. - [The Hopf fibration](https://ollin.art/docs/3d/hopffibration.md): a sphere's worth of circles, where no two circles meet and every two are linked exactly once. `hopfFibers` returns them as `[Vector3]` paths for `drawTube`, and `hopfBases`… - [Sweeps and strips](https://ollin.art/docs/3d/sweeps.md): `Mesh.sweep` carries a `Shape` along a `Curve3D`, a path through space whose frames turn with it and never twist about it, sizing and turning the shape on the way, and `Mesh.loft`… - [Lines in 3D](https://ollin.art/docs/3d/lines.md): `drawLine` and `drawPolyline` over `Vector3` draw a line between points in space through the camera, with the 2D stroke's weight, joins, caps, and soft edge, and a color per point… - [Hidden-line solids](https://ollin.art/docs/3d/hiddenlines.md): `featureEdges(creaseAngle:)` draws a mesh's faces in the fill and over them only its creases, its boundary, and its silhouette in the stroke, at `strokeWeight` in canvas points. - [Strand fields](https://ollin.art/docs/3d/strands.md): grass that a mesh pipeline grows inside the draw call itself. `StrandField` + `drawStrands` draw half a million bending, swaying blades with no vertex or instance buffer anywhere. - [The ocean](https://ollin.art/docs/3d/ocean.md): a sea built the way the ocean is measured. `makeOceanField` writes a wave spectrum, and one inverse Fourier transform turns it into the moving surface. `drawOcean` draws it as… - [Combining 3D features](https://ollin.art/docs/3d/combining.md): the practical map of what works with what: which geometry takes lights, materials, matcaps, and environment light; what casts, receives, and appears in shadows and reflections… - [Camera control](https://ollin.art/docs/3d/camera.md): move the camera by hand (`cameraControl()`: drag to orbit, scroll to dolly, right-drag or modifier-drag to pan, all damped) or play a ready-made cinematic move (`cameraMove(_:)`… - [Caustics: the light glass and metal focus](https://ollin.art/docs/3d/caustics.md): the light that glass and metal focus. `caustics()` photon-traces the caster light through every transmissive and mirror-polished surface and draws where it lands. - [Lens flare: the light the camera adds by itself](https://ollin.art/docs/3d/lensflare.md): the light the camera itself adds to a picture. `lensFlare()` works out the ghosts a real lens prescription makes of each bright source. - [Line drawing: a scene as line work a machine can follow](https://ollin.art/docs/3d/linedrawing.md): a 3D scene written down as 2D line work, with everything the surfaces hide taken out, so a pen plotter, a laser, or a vector file can have the scene the way only a picture could… - [Atmosphere: fog, aerial perspective & volumetric light](https://ollin.art/docs/3d/atmosphere.md): the air between the camera and the scene. `fog` fades surfaces with distance and pools low with a height falloff (exact closed-form transmittance). `aerialPerspective` splits the… - [Volumes](https://ollin.art/docs/3d/volumes.md): a cloud placed in the scene. - [Depth compositing](https://ollin.art/docs/3d/depthcompositing.md): place 2D drawing *inside* a 3D scene, so it occludes the geometry and is occluded by it: `depth(at:)`, `project`, and `withBillboard` (a 2D label hidden when it swings behind the… - [Record3D (RGBD recordings)](https://ollin.art/docs/3d/record3d.md): `import OllinRecord3D` turns an iPhone's color-plus-depth into a 3D point cloud, from a recorded `.r3d` file or a tethered phone's live USB stream - [RGBD frames and depth-lifted pose](https://ollin.art/docs/3d/rgbd.md): the one `RGBDFrame` (color + depth + intrinsics) that any depth source produces. - [Phone (iPhone sensor stream)](https://ollin.art/docs/3d/phone.md): `import OllinPhone` reads a tethered iPhone's live on-device ARKit sensor stream from Ollin's own capture app, over the USB cable. ## Generators - [Random](https://ollin.art/docs/generators/random.md): `random`, `randomGaussian`, and the `randomVector`/`ring` scatter helpers - [Noise](https://ollin.art/docs/generators/noise.md): Perlin `noise` / `signedNoise`, seamlessly looping `noise(loop:)`, layered `fbm`, and `curlNoise` flow fields - [Blue noise](https://ollin.art/docs/generators/bluenoise.md): `poissonDisk`, an even but organic scatter with no clumps or gaps (Poisson-disk sampling), over a rectangle or inside a `Shape` - [Low-discrepancy sampling](https://ollin.art/docs/generators/lowdiscrepancy.md): `haltonPoints` / `sobolPoints`, even coverage as an ordered stream: growing the count only adds points and never moves them - [Points on a surface](https://ollin.art/docs/generators/surfacesampling.md): `surfacePoints`, points scattered over a mesh's surface rather than its vertex list. - [Stippling](https://ollin.art/docs/generators/stippling.md): `stipple`, dots packed to reproduce an image's tone (weighted-Voronoi stippling) or any density function - [De Bruijn sequences](https://ollin.art/docs/generators/debruijn.md): `deBruijnSequence` + `DeBruijnCode`, a cyclic sequence that holds every window of a given length exactly once, so a glimpse of a few symbols tells you where it came from - [Ford circles](https://ollin.art/docs/generators/fordcircles.md): `fordCircles`, a circle for every fraction, each touching its neighbors and overlapping nothing, built over `fareySequence` and the exact `Fraction` type - [Shadow art](https://ollin.art/docs/generators/shadowart.md): `shadowArt`, a solid carved so that it throws the silhouettes you ask for, with the shadows it really casts so you can compare them - [Polyominoes](https://ollin.art/docs/generators/polyominoes.md): `Polyomino` + `tilePolyominoes`, the twelve pentominoes and an exact-cover search that fits a bag of pieces into a region, or reports that no fit exists - [Ulam spiral](https://ollin.art/docs/generators/ulamspiral.md): `ulamSpiral`, the whole numbers written in a square spiral, so a test on them becomes a picture. - [Fractals](https://ollin.art/docs/generators/fractals.md): `IFS` chaos games, `FractalFlame` renders, circle-inversion limit sets, and Kleinian limit-set curves, plus the `fitted` placement helper - [Chaotic maps & bifurcation](https://ollin.art/docs/generators/bifurcation.md): `IteratedMap`, the one-dimensional route to chaos: the logistic, sine, tent, and Gauss families, orbits and cobweb staircases, the bifurcation diagram as dots or a density image… - [Single line](https://ollin.art/docs/generators/singleline.md): `singleLine`, one continuous tour through an image's stipple (TSP art), returned as a plotter-friendly `Contour` - [Hilbert order](https://ollin.art/docs/generators/hilbertorder.md): `hilbertOrder` / `hilbertSorted` / `hilbertIndex`, points sorted by their place along a space-filling curve: one line through a stipple by a single sort, the local relative of the… - [Ant colony](https://ollin.art/docs/generators/antcolony.md): `AntColony`, a colony that lays pheromone trails and narrows a web of possible routes down to a short tour. - [Spanning tree](https://ollin.art/docs/generators/spanningtree.md): `spanningTree`, the minimum spanning tree of an image's stipple: the branching, vein-like relative of the single line - [String art](https://ollin.art/docs/generators/stringart.md): `StringArt`, one continuous thread wound over rim pins until the crossings reproduce a picture (a stateful stepper) - [Percolation](https://ollin.art/docs/generators/percolation.md): `Percolation`, site-percolation clusters over a seeded grid: largest-first labeling, the spanning cluster, cell rectangles, and traced boundary loops - [Isolines](https://ollin.art/docs/generators/isolines.md): `isolines`, level curves of any scalar field or of an image's tone, by marching squares: from metaball outlines to contour maps - [Isosurfaces and metaballs](https://ollin.art/docs/generators/isosurface.md): `isosurface` / `Metaballs`, the surface where a field over space crosses a level, marched into a `Mesh` (dual contouring where the field has corners to keep): soft spheres that… - [Subdivision surfaces](https://ollin.art/docs/generators/subdivisionsurfaces.md): `mesh.subdivided`, a low-poly control cage refined into a smooth solid by the Catmull-Clark or Loop rules, with welding and open-edge handling built in - [Mesh growth](https://ollin.art/docs/generators/meshgrowth.md): `MeshGrowth` / `MeshReactionDiffusion`, a surface that grows more area than it has room for and folds: brain coral, branching coral, a ruffled leaf margin - [Surface reconstruction](https://ollin.art/docs/generators/surfacereconstruction.md): `reconstructSurface` / `particleSurface`, from points back to a `Mesh`. Rebuild a scanned room or object with its holes kept, or skin a particle set as one blended body. - [Breaking things](https://ollin.art/docs/generators/fracture.md): `fractured`, breaking a `Shape` or a `Mesh` into pieces that fit back together with no gap and no overlap, evenly or crowded around a blow; plus `convexHull` in space and the… - [Hulls](https://ollin.art/docs/generators/hulls.md): `concaveHull` / `alphaShape`, two tighter answers to "what shape are these points?": one simple polygon that follows the gulfs, or the scatter's true footprint with islands and… - [Medial axis](https://ollin.art/docs/generators/medialaxis.md): `medialAxis`, a shape reduced to its skeleton, with every point carrying its inscribed-disk radius - [Straight skeleton](https://ollin.art/docs/generators/straightskeleton.md): `straightSkeleton`, the ridge network a shrinking boundary traces, with faces and exact mitered insets (`inset(by:)`). - [Force-directed layout](https://ollin.art/docs/generators/forcelayout.md): `ForceLayout`, a graph that untangles itself: repulsion between all nodes, attraction along edges, and cooling into an even web you can grow, pin, and drag - [Tensegrity](https://ollin.art/docs/generators/tensegrity.md): `Tensegrity` / `addTensegrity`, struts held apart by cables: the prism, the six-strut icosahedron, and a stacked mast, each in its balanced shape, with `imbalance` to check a form… - [Marbling](https://ollin.art/docs/generators/marbling.md): `Marbling` / `drawMarbling`, paper marbling in closed form: drops, tines, combs, and swirls rake vector ink outlines into feathered papers - [Watercolor](https://ollin.art/docs/generators/watercolor.md): `Watercolor` / `drawWatercolor`, watercolor pigment from recursively deformed polygons stacked as translucent layers - [Chladni figures](https://ollin.art/docs/generators/chladni.md): `chladni`, a ringing plate's standing-wave field in closed form, plus the `.chladni` generator's sand and wave readings and the mode-by-pitch join to audio - [Billiards: one rule, and the room does the rest](https://ollin.art/docs/generators/billiards.md): `Billiard`, a ball that bounces forever in a circle, an ellipse, a polygon, or a stadium, with posts standing in it. - [Drainage: rivers worked out from the ground](https://ollin.art/docs/generators/drainage.md): `Drainage`, rivers computed from a `Heightfield` rather than drawn. - [Terrain](https://ollin.art/docs/generators/terrain.md): `Heightfield`, landscapes from noise or `diamondSquare`, weathered by droplet hydraulic and thermal erosion, and emitted as terrain meshes, heightmaps, and contours - [Random walks](https://ollin.art/docs/generators/walks.md): `randomWalk` / `levyFlight` / `selfAvoidingWalk`, paths built one random step at a time: the local tangle, the cluster-and-leap, and the single stroke that never crosses itself - [Circle packing](https://ollin.art/docs/generators/packing.md): `packCircles` and `relaxCircles`, filling a region with non-overlapping circles that grow until they touch - [ShapeGrammar](https://ollin.art/docs/generators/shapegrammar.md): `ShapeGrammar`, a design written as rules over labeled shapes: the balanced cut behind the ice-ray lattices, splits for a building front, insets that become bars, and nested… - [Turtle](https://ollin.art/docs/generators/turtle.md): `Turtle`, a pen you drive from code: forward, back, left, right, pen up and down, and a remembered pose for branches, every run an ordinary contour - [L-systems](https://ollin.art/docs/generators/lsystem.md): `drawLSystem` and a preset catalog: a rewriting grammar that a turtle walks into fractal curves and branching plants, symbolic or parametric (symbols carry numbers, for fractional… - [Differential growth](https://ollin.art/docs/generators/differentialgrowth.md): `DifferentialGrowth`, a line of nodes that grows and folds into an organic, brain-coral structure (a stateful stepper) - [Meander](https://ollin.art/docs/generators/meander.md): `Meander`, a river centerline that migrates by curvature, cutting off oxbow lakes and recording scars (a stateful stepper) - [Wave Function Collapse](https://ollin.art/docs/generators/wavefunctioncollapse.md): `wfc` fills a grid so every neighbor is legal, from a tileset you declare or from the patches of an example picture (constraint-solved tile layouts, texture synthesis) - [Cellular automata](https://ollin.art/docs/generators/cellularautomata.md): `elementaryCA`/`totalisticCA` row stacks chosen by rule number, and `Turmite` walkers (Langton's ant and its relatives) painting a wrapped grid - [Shape packing](https://ollin.art/docs/generators/shapepacking.md): `packShapes` and `ContinuousPacking`, filling a region with non-overlapping shapes grown against each other's outlines - [Rectangle packing](https://ollin.art/docs/generators/rectanglepacking.md): `packRectangles` and `RectanglePacking`, fitting rectangles of given sizes into one bin at their own sizes for a contact sheet, a collage, or an atlas - [Flow fields](https://ollin.art/docs/generators/flowfield.md): `FlowField`, streamlines traced through a direction field (the flow-field look) and particles advected along it - [Flocking (boids)](https://ollin.art/docs/generators/boids.md): `Boids`, a flock that steers by separation, alignment, and cohesion into emergent flocking motion - [Pursuit](https://ollin.art/docs/generators/pursuit.md): `Pursuit`, runners that head straight at each other and leave logarithmic spirals: the ring of mice, and a quarry that runs straight (a stateful stepper) - [Steering behaviors](https://ollin.art/docs/generators/steering.md): `Vehicle`, a creature moved by composable steering forces (seek, flee, arrive, pursue, wander, follow a path or flow field) - [Space colonization](https://ollin.art/docs/generators/spacecolonization.md): `SpaceColonization`, branching growth (veins, roots, trees) toward scattered attraction points (a stateful stepper) - [Diffusion-limited aggregation](https://ollin.art/docs/generators/diffusionlimitedaggregation.md): `DiffusionLimitedAggregation`, branching clusters frozen out of random walkers (frost and coral; a stateful stepper) - [Dielectric breakdown](https://ollin.art/docs/generators/dielectricbreakdown.md): `DielectricBreakdown`, lightning grown where the solved electric field is strongest. - [Crack growth](https://ollin.art/docs/generators/crackgrowth.md): `CrackGrowth`, perpendicular cracks that subdivide the plane into city-block cells, each dragging a one-sided watercolor wash (a stateful stepper) ## Helpers - [Math helpers](https://ollin.art/docs/helpers/math.md): `map`, `dist`, `lerp`, the shaping scalars (`clamp`/`fract`/`step`/`smoothstep`), `polar` and `spherical`, `derivative` and `gradient`, and `Double.tau` - [Complex numbers](https://ollin.art/docs/helpers/complex.md): `Complex`, a point of the plane that multiplies: literals and `Numeric`, the polar form, `exp`/`log`/`pow`/`sqrt` and the trigonometric functions on the principal branch, the… - [Animation](https://ollin.art/docs/helpers/animation.md): looping progress (`loopProgress`/`pingPong`), the timers (`every`/`after`/`everyFrames`), `sway` (a value that travels between two ends and back, over five shapes), the `Easing`… - [A number written as a rule](https://ollin.art/docs/helpers/formula.md): a number written as a rule and read from text: `drive($radius, "190 + sin(time) * 80")`. The page covers the arithmetic a formula understands, the clock, canvas, pointer, and… - [Parameters](https://ollin.art/docs/helpers/parameters.md): `@Param` tunable parameters: typed inspector controls (from sliders and toggles to menus, color wells, text, and geometry fields) in grouped cards (with `.folded` sections that… - [Cues: looks you can call back](https://ollin.art/docs/helpers/cues.md): looks you can call back: `saveCue` stores every parameter's value under a name, `cue(_:over:)` brings them back at once or over a fade, the inspector's Cues card lists and saves… - [Input](https://ollin.art/docs/helpers/input.md): mouse and keyboard, files dropped or picked through the open panel, and the pointer's shape - [Accessibility](https://ollin.art/docs/helpers/accessibility.md): see your colors as the three kinds of color vision see them, check whether a palette's colors stay apart, and read the system's reduce-motion setting - [Data](https://ollin.art/docs/helpers/data.md): `loadTable` for CSV and TSV files (typed reads by column name) and `loadJSON` for documents you reach into by name and index - [Live data](https://ollin.art/docs/helpers/livedata.md): `DataFeed`, one address read over and over on a background queue, so a sketch draws what is true now. - [The weather outside](https://ollin.art/docs/helpers/weather.md): `Weather`, the sky over a place or a name as plain readings (temperature, clouds, wind, rain, the condition in a word), and `Place.sun(at:)` for where the sun is, with no network - [Audio](https://ollin.art/docs/helpers/audio.md): `import OllinAudio` for microphone, file, and oscillator sources, analyzed into `amplitude`/`spectrum`/band values, beats, and the note heard (`pitch`, `chroma`) you read in… - [Listening](https://ollin.art/docs/helpers/listening.md): speech as a caption you can draw and phrases you can act on, plus about 300 everyday sounds named as they happen, over any audio source - [Synthesis](https://ollin.art/docs/helpers/synthesis.md): `Synth`, the instrument a sketch plays: notes by name or number, `Voice` presets over a shaped and filtered oscillator, a wavetable read by position, a grain cloud cut out of a… - [Composition](https://ollin.art/docs/helpers/composition.md): working out what to play: Euclidean rhythms, scales and chords, arpeggios, and Markov sequences, as pure values of a step number, plus a step sequencer with swing, chance, and… - [MIDI files](https://ollin.art/docs/helpers/midifiles.md): a piece as a Standard MIDI File, read into notes a sketch plays or draws and written back out, with the tempo map that turns its beats into seconds, and a take recorded off a live… - [Sonification](https://ollin.art/docs/helpers/sonification.md): numbers played as notes: a table column, a terrain profile, or a picture row, spread over a range of pitch and snapped to a scale ## Simulation - [Physics](https://ollin.art/docs/simulation/physics.md): `import OllinPhysics` for a `World` you step each frame, so motion comes from simulation. - [3D physics](https://ollin.art/docs/simulation/physics3d.md): rigid bodies inside the 3D scene. - [Swarm](https://ollin.art/docs/simulation/swarm.md): the steering behaviors at GPU scale: separation, alignment, cohesion, seek, flee, arrive, wander, and flow following, as weights over tens or hundreds of thousands of agents - [Artificial life](https://ollin.art/docs/simulation/artificiallife.md): three emergent-behavior systems on the GPU: `ParticleLife`, the `PPS` turning rule, and `Physarum` slime mold. - [Evolution](https://ollin.art/docs/simulation/evolution.md): populations that get better at something. `Evolution` breeds tens of thousands of GPU flights toward a target past obstacles by tournament selection, and `Population` breeds a… - [Fluids & soft bodies](https://ollin.art/docs/simulation/fluids.md): GPU particle dynamics: `ParticleFluid` (smoothed-particle hydrodynamics) and `SoftBodies` (shape-matched jelly blobs), both in a walled box you can splash and knead with the mouse - [Watercolor](https://ollin.art/docs/simulation/watercolor.md): wet paint on rough paper: a three-layer wash simulation (`watercolor(pigments:)`) with real pigment behavior and Kubelka-Munk glazing. - [Articulated & chaotic motion](https://ollin.art/docs/simulation/motion.md): CPU motion systems you step each frame: `IKChain` (inverse-kinematics tentacles and limbs), `DoublePendulum` (the classic chaos machine), and `NBody` (quadtree gravity for orbits… - [Crowds](https://ollin.art/docs/simulation/crowds.md): `Crowd`, walkers that avoid each other by reciprocal velocity obstacles on the CPU: no overlap while every walker finds a safe velocity, obstacles and walls that hold even in a… - [Coupled oscillators](https://ollin.art/docs/simulation/oscillators.md): `Kuramoto`, a crowd of oscillators each pulled toward the phase of the others, on the CPU: the order parameter `coherence`, the critical coupling where a locked group forms, and… ## Integration - [OSC](https://ollin.art/docs/integration/osc.md): `import OllinOSC` to send and receive OSC messages over UDP (to and from TouchOSC, Max/MSP, TouchDesigner, …), read in `draw()` or bound to a `@Param` - [OSCQuery](https://ollin.art/docs/integration/oscquery.md): `import OllinOSC` to publish the sketch's `@Param` parameters as a namespace a control app finds on the network and builds its own controls from, the values coming back over OSC… - [TUIO](https://ollin.art/docs/integration/tuio.md): `import OllinOSC` to read a tangible surface: touches, tagged pieces, and shapes from a marker table, a touch wall, or a phone app, each keeping its id while it stays on the… - [MIDI](https://ollin.art/docs/integration/midi.md): `import OllinMIDI` to read from and send to MIDI controllers and keyboards over Core MIDI, read in `draw()` or bound to a `@Param` - [Link](https://ollin.art/docs/integration/link.md): `import OllinLink` to join the local network's shared tempo-and-phase session (the Link protocol most music apps support). - [Serial](https://ollin.art/docs/integration/serial.md): `import OllinSerial` to read a USB microcontroller's sensor lines in `draw()` (or bound to a `@Param`) and write lines back to drive servos and LEDs. - [Bluetooth](https://ollin.art/docs/integration/bluetooth.md): `import OllinBluetooth` to read a Bluetooth Low Energy sensor in `draw()` (or bound to a `@Param`) and write back to it. - [MQTT](https://ollin.art/docs/integration/mqtt.md): `import OllinMQTT` to join the message bus a building speaks. - [Remote](https://ollin.art/docs/integration/remote.md): `import OllinRemote` to serve the sketch's `@Param` parameters to a phone or a second machine on the local network: a touch surface in any browser, live in both directions, for… - [Room](https://ollin.art/docs/integration/room.md): `import OllinRoom` to let several machines on one network draw one work. - [DMX](https://ollin.art/docs/integration/dmx.md): `import OllinDMX` to drive stage lights and dimmers from `draw()` over Art-Net or sACN (a `DMXUniverse` of 512 channels, with a named-fixture shorthand). - [Laser](https://ollin.art/docs/integration/laser.md): `import OllinLaser` to draw with a show laser from `draw()`. Line work is optimized into the point stream a projector scans (spacing, corner and blanking dwell, path order, the… - [Syphon](https://ollin.art/docs/integration/syphon.md): `import OllinSyphon` to share live visuals with other Mac apps (openFrameworks, Resolume, MadMapper, VDMX, …): publish a sketch's frames as a Syphon source, and draw an incoming… - [Virtual camera](https://ollin.art/docs/integration/virtualcamera.md): `import OllinCamera` to feed a sketch's frames to the Ollin Camera system camera, so webcam apps and browser tools (Zoom, OBS, Hydra via `getUserMedia`, …) read the sketch as a… - [Game controllers](https://ollin.art/docs/integration/controller.md): `import OllinController` to read a game controller in `draw()`: sticks, triggers, and buttons on any pad, plus motion and a touchpad on hardware that has them, with several… - [Haptics](https://ollin.art/docs/integration/haptics.md): `import OllinHaptics` to add touch feedback beside the picture. - [Screen capture](https://ollin.art/docs/integration/screencapture.md): `import OllinScreen` to take any display, app, or window on the Mac as a live GPU-textured frame source, drawn and filtered like any image and read by the vision trackers. ## Vision - [Vision](https://ollin.art/docs/vision/vision.md): `import OllinVision` for the Mac's camera (built-in, Continuity, or external) plus Apple's on-device perception, returned as typed results you read in `draw()`. Nineteen trackers… ## Video - [Video](https://ollin.art/docs/video/video.md): `import OllinVideo` to play a video file into a sketch as a live image. - [Slit scan](https://ollin.art/docs/video/slitscan.md): `SlitScan`, a rolling frame history read back through a per-pixel time delay: the classic scan, time ripples, displacement maps ## Output - [Export](https://ollin.art/docs/output/export.md): save frames as raster (PNG, sequences), motion (video, animated GIF), vector (SVG for pen plotters, PDF for print), or linear EXR with depth, for a compositor - [A sketch as a web page](https://ollin.art/docs/output/web.md): `--export-web` records what a sketch draws and writes a page that plays it back in a browser, as one self-contained file or as a fragment for a page of your own - [Path-traced export](https://ollin.art/docs/output/pathtraced.md): `--path-traced` renders the same 3D scene offline by tracing light paths, for soft shadows, color bleed, mirror-in-mirror reflections, and a real lens - [Recording](https://ollin.art/docs/output/recording.md): record a live run as it happens, with the picture and the sketch's own sound (or the room's sound) in one movie, in real time, or copy one frame to the clipboard - [Fabrication](https://ollin.art/docs/output/fabrication.md): write a `Mesh` as STL, OBJ, or 3MF for 3D printing, with real units and a printability check - [G-code](https://ollin.art/docs/output/gcode.md): write a frame's line work as a program that a pen plotter, laser cutter, or CNC router runs directly - [DXF](https://ollin.art/docs/output/dxf.md): write a frame as a DXF drawing a CAD program or a laser cutter's software opens: lines, polylines, and true circles in millimeters, each color on its own layer - [Embroidery](https://ollin.art/docs/output/embroidery.md): write a frame as the stitches an embroidery machine sews, a `.dst` file with strokes as running stitch, fills as rows, and each color as its own thread - [Running unattended](https://ollin.art/docs/output/installation.md): leave a sketch running for days: full screen, no pointer, a clock that survives a week, a watch that restarts it, and the building's hours - [A sketch as an app](https://ollin.art/docs/output/app.md): wrap a finished sketch as a signed, double-clickable Mac app that runs without the toolchain, with a frame of itself as its icon - [A sketch as the machine's screen saver](https://ollin.art/docs/output/screensaver.md): wrap a sketch as the machine's screen saver: one command writes the project, one script installs it, and the sketch stays an ordinary sketch - [A sketch as the desktop wallpaper](https://ollin.art/docs/output/wallpaper.md): run a sketch as the desktop wallpaper: one window per display at desktop level, behind the icons, with a menu-bar item to quit it - [A sketch in the menu bar](https://ollin.art/docs/output/menubar.md): run a sketch as a small live strip among the menu bar's status items, drawn at a rate an all-day surface can afford - [A sketch as a widget](https://ollin.art/docs/output/widget.md): show a sketch as a widget on the desktop, drawn one picture per moment, so the sketch changes through the day rather than moving - [Print separations](https://ollin.art/docs/output/printseparations.md): split a sketch into per-ink grayscale masters for risograph and screen printing, with an overprint preview and registration marks - [Print color](https://ollin.art/docs/output/printcolor.md): soft-proof a canvas against a press profile, flag the colors ink cannot reach, and split it into process-color plates with their total-ink figures - [Spatial export](https://ollin.art/docs/output/spatial.md): write a 3D frame or a `Scene` as USDZ, so the work opens in Quick Look, sends in a message, and stands on a real table through AR. ## Tools - [The project generator](https://ollin.art/docs/tools/projectgenerator.md): `ollin new` and `ollin generate`: a ready-to-run sketch folder from a few questions, with templates you can watch running before you pick one - [Single-file sketches](https://ollin.art/docs/tools/singlefile.md): the `ollin` command: run one `.swift` file as a sketch from anywhere, no package needed, or a package's sketch with every file of it reloading - [The sketch on the phone](https://ollin.art/docs/tools/onthephone.md): `ollin phone`: the sketch on a paired iPhone or iPad. - [Live coding](https://ollin.art/docs/tools/livecoding.md): the OllinLiveCoding performance host: write and evaluate sketch code live, with the code shown over the visuals - [Bringing a shader over](https://ollin.art/docs/tools/shaderimport.md): `ollin new --from-shader`: translate a GLSL fragment shader into Metal and get a project around it - [Checking the machine](https://ollin.art/docs/tools/doctor.md): `ollin doctor`: what this machine can run, with the line that fixes each answer; shell completions, and `--list-params` for what a sketch declares - [Checking a shader](https://ollin.art/docs/tools/shadercheck.md): `ollin check`: compile a `.metal` file on this machine's GPU and see the errors at your own line numbers, what kind of shader it is, and the parameters it reads - [Bringing a scene over](https://ollin.art/docs/tools/sceneimport.md): `ollin new --from-scene`: a glTF or USD scene written out as the camera, lights and placement calls that draw it - [Writing an extension](https://ollin.art/docs/tools/extensions.md): `ollin new --kind extension`: a library other sketches import, the `ollinx-` naming convention, and the seams to build on - [Dragging a shape](https://ollin.art/docs/tools/dragtoedit.md): Command-drag a shape in the live window, or on the performance stage, to move it, drag a corner to resize it, or drag the knob above it to turn it. - [The parameter timeline](https://ollin.art/docs/tools/timeline.md): OllinLive's timeline panel: a lane per automated parameter, keys placed from the inspector's diamonds and dragged by hand, a playhead over the sketch clock, and a round trip to… - [The reference offline](https://ollin.art/docs/tools/reference.md): `ollin docs`, `ollin examples`, `ollin api`, and `ollin site`: these pages, every example sketch, and every public name, read in the terminal or written out as a website. - [Profiling](https://ollin.art/docs/tools/profiling.md): the inspector's cost row: CPU against GPU on one scale, the draw and pass counts, and a frame handed to Xcode ## The project - [Examples](https://ollin.art/examples/index.md): 633 runnable sketches by category, each with its whole source - [Ollin architecture & internals](https://ollin.art/architecture.md) - [Ollin: the shipped-capability inventory](https://ollin.art/capabilities.md) - [Changelog](https://ollin.art/changelog.md) ## Optional - [Ollin roadmap](https://ollin.art/roadmap.md) - [Ollin design notes](https://ollin.art/design-notes.md) - [Influences & attribution](https://ollin.art/attribution.md) - [Contributing to Ollin](https://ollin.art/contributing.md)