C:\GRIFFIN\PROJECTS\SOFTWARE\CABINFEVER>

[@] MAP
###C########P###
#...........$..#
#.[]..[]..[]...#
#......@.......#
#.[]..[]..[]...#
#..............#
###H########O###
SOFTWARE/CABINFE

Doors are hotkeys. Or click the screen and walk with the arrow keys.

CabinFever

Status
In development
Stack
Generative Art · Computational Geometry · Simulation · JavaScript · Canvas
Source
github.com/Griffinhale/cabinFever
The library itself, drawing live. Each drop displaces the ink already floating rather than covering it, squeezing earlier colours into rings; then a comb drags the whole surface at once. Every operation preserves area exactly, which is what a film of pigment on water actually does. Tap to drop pigment, drag to comb.
  1. #1 Griffin Hale

    A dependency-free browser library that produces 17 traditional paper-marbling patterns with area-preserving geometric maps.

    At a glance

    • Outcome: A browser library for paper marbling that needs nothing else installed. It builds 17 traditional patterns, including battal, gel-git, nonpareil, feather, hatip, suminagashi and Italian hair vein.
    • Status: Version 0.1 on GitHub, the second engine. All 17 patterns, nine named rakes and the texture pass are in the repo. The demo on this page runs an earlier copy of the engine with five patterns and no rake catalog.
    • Role: Solo: designed the model, the maps and the tests; reviewed AI-assisted implementation.
    • Stack & libraries: Plain JavaScript modules, zero dependencies, no build step, one canvas. The texture pass runs on the CPU over ImageData, without WebGL.
    • Validation: node --test checks that drops, combs, curved rakes and ripples keep every color’s area exact. Every figure comes from a fixed seed with no clock, so it reproduces pixel for pixel.
  2. #2 Griffin Hale

    • Source: MIT-licensed at github.com/Griffinhale/cabinFever.
    • Tests: Other tests check that a held press equals one large drop to 1e-6 and that every named rake keeps its teeth apart.
    • Limitations: No fluid solver and no color mixing, because pigment displaces rather than blends. The stylus is the one tool that is slightly lossy. italianVein takes about 2.4 s on a full sheet; the other patterns take 50 to 600 ms.
  3. #3 Griffin Hale

    Marbled paper is made by floating ink on a thickened bath and combing it. CabinFever does this on a web page. You tap or hold to drop ink and drag to comb. One <script type="module"> tag puts a marbling tray on a page.

  4. #4 Griffin Hale

    Ink on a marbling bath does not cover other ink. It pushes it aside, because the film it floats on cannot be squeezed. So every tool in CabinFever is a math rule that moves every point on the tray while keeping each color’s area the same.

    A stone-ground marbling pattern: dense overlapping pigment drops compressed into nested concentric rings.
    Battal uses only drops. Later ink displaces earlier ink into nested rings because the floating film cannot compress.
  5. #5 Griffin Hale

    A drop moves each point by C + (P−C)·√(1 + r²/‖P−C‖²), which keeps area exactly. A comb tooth slides points sideways by an amount that depends only on their distance from the tooth. That also keeps area.

    One striped ground combed four ways: straight teeth, a rolled comb, a swung comb, and a curved rake.
    Four tools comb one ground in one direction. Each rake sets tooth spacing, sharpness and shape: straight, wandering or curved.
  6. #6 Griffin Hale

    Color edges are stored as outlines, not pixels, so a strand pulled hair-thin stays a sharp line. A texture pass then adds paper grain and a darker rim along each edge.

    The same nonpareil pattern shown twice, once with flat vector-like fills and once with pigment grain and darkened boundary rims.
    Flat exact shapes look like vector art rather than marbled paper. A per-pixel pass adds pigment grain and darker rims along each edge.
  7. #7 Griffin Hale

    Hatip, a traditional flower pattern, is built this way. Colors dropped one inside another squeeze into rings. A needle is then pulled outward through the rings and back in between them. No code draws a petal: the petals are what that pull does to rings inside rings.

    A grid of twelve traditional marbling patterns, each labeled, from poured stripes through suminagashi and Italian hair vein.
    Twelve more traditional patterns combine a ground with named tool passes. Hatip forms petals by pulling nested circles outward.
  8. #8 Griffin Hale

    Each pattern runs in the order a marbler works. stone is only drops. gelGit works a needle down and up across the tray. nonpareil adds a fine comb, and feather a wide comb at right angles. Every drop is seeded, so one script and seed make the same pixels on any machine.

    Four marbled panels in sequence: a stone ground of nested rings, then a gel-git zigzag, then a fine comb pass, then a feather.
    Each traditional pattern adds one tool pass to the previous result: battal, gel-git, nonpareil and feather. The code follows the physical process.
  9. #9 Griffin Hale

    Twelve earlier prototypes and a first engine treated ink as areas that stop where they meet. None of them could push ink aside, so all were discarded.

  10. #10 Griffin Hale

    The library is on GitHub with all 17 patterns, nine named rakes, a small example and a full playground. The demo at the top of this page still runs an earlier copy with five patterns. Next is moving the demo and the clip onto the current library.

  11. #11 Griffin Hale

    Published version 0.1 on GitHub: 17 traditional patterns, a catalog of named rakes and the texture pass, with no dependencies.