Ribbon physics

Cloth or ribbon strips in a seeded breeze: the run stays free of NaNs, matches a golden frame, and recolour controls are tested.

This is an interactive visual spec on Spekkr, published by nova. It is listed with the other specs. Paste the line to an agent that can open a web address, and the agent fetches the files and builds from them.

Spec
nova/ribbon-physics
Version
0.2.2
Published by
nova
Updated
15 Nov 2026

Build this spec

Build the spec at https://spekkr.com/nova/ribbon-physics/start.md.

Paste this to your AI agent. It opens the address, fetches the spec's files, records your choices and builds from them. Nothing to install, no account.

Published by nova.

What does the result look like?

Ribbon physics: heroRibbon physics: loop

What can I customize?

Palette The strip colours. Recolour is also a live control, tested separately.

Your choices go into the line you copy. Anything else is yours to edit, but it leaves the tested path.

What do I get?

  • spec.md Requirements and acceptance checks.

    Ribbon physics

    What this builds

    A handful of ribbon or cloth strips, fixed at one end, moving in a breeze. The person can drag a strip, change the wind, and recolour them. A seeded breeze run must stay stable — no NaNs, no exploding lengths — and match a golden frame. The look is original.

    Read spekkr.inputs.json first. title is in a corner. strips and seed pin the scene. palette is the starting colour. collide and trail change the physics and the picture.

    Out of scope

    • A cutting-room cloth simulator for film.
    • Network or a public gallery in the checks.
    • A sewing pattern or a garment in this version.

    Requirements

    Each requirement has an id. Checks name the id they cover.

    R1. Stability
    • Each strip is a chain of 32 particles with a fixed rest length, integrated with Verlet and a documented constraint iteration count.
    • After 600 steps of seed 3, 8 strips, collide off, no particle position is NaN or infinite, and no segment is longer than 2 times its rest length.
    • The tip positions at step 600 match fixtures/ribbon-tips-3.json within 0.5 world units.

    Accept when: the NaN check, the length check, and the tip positions all pass.

    R2. Recolour
    • A live control sets a strip's colour to a #rrggbb. The palette swap only sets the defaults.
    • A script that recolours strip 0 to #e07a3d is visible in the recoloured frame and in a colour read-back of that strip's vertices.

    Accept when: the read-back is #e07a3d within 2 levels, and the golden matches.

    R3. Frames and files
    • Goldens: still air (wind 0) at step 60, breeze at step 600, recoloured, and 24 strips at step 200.
    • One command runs the stability, tip, and colour tests, and writes the frames. No network.

    Accept when: the command passes with collide on and off (tips file is for off; collide on has its own stability check only).

    R4. Inputs
    • The build reads spekkr.inputs.json. Settings label the UI, options turn features on or off, and a swap must be one of its choices.
    • A value outside a stated range, or a swap that is not one of its choices, is refused before the app starts its checks, with a message that names the key.

    Accept when: the default inputs render, an illegal swap is refused by name, and changing a visible setting (for example the title) shows up in a later check.

    Verification

    A seeded breeze run of 600 steps has no NaNs and no exploded segment, and tip positions match a file. Recolour of a strip is read back and shown in a golden. A golden breeze frame is checked. No network.

    Definition of done

    • Every acceptance check above runs from one command, and all pass at the person's inputs.
    • A README says how to drag a strip, how to pin a seed, and how to run the checks.
    # Ribbon physics
    
    ## What this builds
    
    A handful of ribbon or cloth strips, fixed at one end, moving in a breeze.
    The person can drag a strip, change the wind, and recolour them. A seeded
    breeze run must stay stable — no NaNs, no exploding lengths — and match a
    golden frame. The look is original.
    
    Read `spekkr.inputs.json` first. `title` is in a corner. `strips` and
    `seed` pin the scene. `palette` is the starting colour. `collide` and
    `trail` change the physics and the picture.
    
    ## Out of scope
    
    - A cutting-room cloth simulator for film.
    - Network or a public gallery in the checks.
    - A sewing pattern or a garment in this version.
    
    ## Requirements
    
    Each requirement has an id. Checks name the id they cover.
    
    ### R1. Stability
    
    - Each strip is a chain of 32 particles with a fixed rest length,
      integrated with Verlet and a documented constraint iteration count.
    - After 600 steps of seed 3, 8 strips, collide off, no particle position
      is NaN or infinite, and no segment is longer than 2 times its rest
      length.
    - The tip positions at step 600 match `fixtures/ribbon-tips-3.json` within
      0.5 world units.
    
    Accept when: the NaN check, the length check, and the tip positions all
    pass.
    
    ### R2. Recolour
    
    - A live control sets a strip's colour to a `#rrggbb`. The `palette` swap
      only sets the defaults.
    - A script that recolours strip 0 to `#e07a3d` is visible in the
      `recoloured` frame and in a colour read-back of that strip's vertices.
    
    Accept when: the read-back is `#e07a3d` within 2 levels, and the golden
    matches.
    
    ### R3. Frames and files
    
    - Goldens: still air (wind 0) at step 60, breeze at step 600, recoloured,
      and 24 strips at step 200.
    - One command runs the stability, tip, and colour tests, and writes the
      frames. No network.
    
    Accept when: the command passes with collide on and off (tips file is for
    off; collide on has its own stability check only).
    
    ### R4. Inputs
    
    - The build reads `spekkr.inputs.json`. Settings label the UI, options
      turn features on or off, and a swap must be one of its choices.
    - A value outside a stated range, or a swap that is not one of its
      choices, is refused before the app starts its checks, with a message
      that names the key.
    
    Accept when: the default inputs render, an illegal swap is refused by
    name, and changing a visible setting (for example the title) shows up in a
    later check.
    
    ## Verification
    
    A seeded breeze run of 600 steps has no NaNs and no exploded segment, and
    tip positions match a file. Recolour of a strip is read back and shown in
    a golden. A golden breeze frame is checked. No network.
    
    ## Definition of done
    
    - Every acceptance check above runs from one command, and all pass at the
      person's inputs.
    - A README says how to drag a strip, how to pin a seed, and how to run the
      checks.
    

    Open spec.md as plain text

  • design.md The Verlet strips, the seeded breeze, and the recolour control.

    Design

    This file fixes the parts that are easy to get wrong. The language and tools are up to you, as long as the numbers here hold.

    Integration

    Timestep 1/60 s. Gravity 0.0 (the breeze is the force). Wind is a vector field from a small curl of value noise, seed 3, amplitude in fixtures/ribbon-wind.json. Constraint iterations: 8.

    Screenshot tolerance

    8 levels, 98% of pixels, camera fixed as in the fixture.

    Inputs

    KeyLabelDefaultNotes
    titleTitleA ribbon in a breezeShown in a corner.
    stripsNumber of strips8From 1 to 24.
    seedBreeze seed3A whole number.
    collideStrip collisionsoffIf on, strips push apart. The default is they pass through, which is more stable.
    trailLeave a trailoffA faint path of the tips.
    palettePaletteinkThe strip colours. Recolour is also a live control, tested separately.

    Acceptance at the defaults

    The numbers, names and fixture paths already in this file are the authority. Where a later table or a shipped fixture file disagrees with prose, the table or the fixture wins.

    FixtureRole
    fixtures/ribbon-tips-3.jsonA shipped fixture. The build may move it, but then design.md must name the new path.
    fixtures/ribbon-wind.jsonA shipped fixture. The build may move it, but then design.md must name the new path.
    spekkr.inputs.jsonA shipped fixture. The build may move it, but then design.md must name the new path.

    Golden frames are compared at 1400 by 1000 CSS pixels unless a requirement names another size. Tolerance, unless a tighter figure is given above: 8 levels, 98% of pixels, with motion, cursors and clocks frozen as this file says. A build's goldens are of that build; they do not have to match a shipped reference preview pixel-for-pixel if the tool or the type is different, but they do have to match this file's layout, counts and copy.

    Screenshots

    These pictures are headless-Chrome captures of the working reference in reference/preview.html, at the default inputs. They are not drawings of a product that has not been built. The first picture is the one Spekkr shows on the spec's card. A build may ship its own goldens; those goldens are of that build and do not have to match these frames pixel-for-pixel.

    FileWhat it shows
    shots/ribbons.pngEight strips in a breeze, seed 3, a golden frame with no NaNs.

    How to verify

    1. Run the checks at the default inputs, without a network.
    2. Walk through the scripted playthroughs, fixture lookups or goldens named in the requirements; each must match this file.
    3. Repeat once at the person's inputs when they differ from the defaults.
    4. A seeded breeze run of 600 steps has no NaNs and no exploded segment, and tip positions match a file. Recolour of a strip is read back and shown in a golden. A golden breeze frame is checked. No network.
    # Design
    
    This file fixes the parts that are easy to get wrong. The language and
    tools are up to you, as long as the numbers here hold.
    
    ## Integration
    
    Timestep 1/60 s. Gravity 0.0 (the breeze is the force). Wind is a vector
    field from a small curl of value noise, seed 3, amplitude in
    `fixtures/ribbon-wind.json`. Constraint iterations: 8.
    
    ## Screenshot tolerance
    
    8 levels, 98% of pixels, camera fixed as in the fixture.
    
    ## Inputs
    
    | Key | Label | Default | Notes |
    | --- | --- | --- | --- |
    | `title` | Title | A ribbon in a breeze | Shown in a corner. |
    | `strips` | Number of strips | 8 | From 1 to 24. |
    | `seed` | Breeze seed | 3 | A whole number. |
    | `collide` | Strip collisions | off | If on, strips push apart. The default is they pass through, which is more stable. |
    | `trail` | Leave a trail | off | A faint path of the tips. |
    | `palette` | Palette | ink | The strip colours. Recolour is also a live control, tested separately. |
    
    ## Acceptance at the defaults
    
    The numbers, names and fixture paths already in this file are the
    authority. Where a later table or a shipped fixture file disagrees with
    prose, the table or the fixture wins.
    
    | Fixture | Role |
    | --- | --- |
    | `fixtures/ribbon-tips-3.json` | A shipped fixture. The build may move it, but then `design.md` must name the new path. |
    | `fixtures/ribbon-wind.json` | A shipped fixture. The build may move it, but then `design.md` must name the new path. |
    | `spekkr.inputs.json` | A shipped fixture. The build may move it, but then `design.md` must name the new path. |
    
    Golden frames are compared at 1400 by 1000 CSS pixels unless a requirement
    names another size. Tolerance, unless a tighter figure is given above: 8
    levels, 98% of pixels, with motion, cursors and clocks frozen as this file
    says. A build's goldens are of that build; they do not have to match a
    shipped reference preview pixel-for-pixel if the tool or the type is
    different, but they do have to match this file's layout, counts and copy.
    
    ## Screenshots
    
    These pictures are headless-Chrome captures of the working reference in
    `reference/preview.html`, at the default inputs. They are not drawings of a
    product that has not been built. The first picture is the one Spekkr shows on
    the spec's card. A build may ship its own goldens; those goldens are of that
    build and do not have to match these frames pixel-for-pixel.
    
    | File | What it shows |
    | --- | --- |
    | `shots/ribbons.png` | Eight strips in a breeze, seed 3, a golden frame with no NaNs. |
    
    
    ## How to verify
    
    1. Run the checks at the default inputs, without a network.
    
    2. Walk through the scripted playthroughs, fixture lookups or goldens
    named in the requirements; each must match this file.
    
    3. Repeat once at the person's inputs when they differ from the defaults.
    
    4. A seeded breeze run of 600 steps has no NaNs and no exploded segment,
    and tip positions match a file. Recolour of a strip is read back and shown
    in a golden. A golden breeze frame is checked. No network.
    

    Open design.md as plain text

  • tasks.md Build tasks in order, each with a check.

    Tasks

    Work in order. Finish a task's check before starting the next.

    1. Set up. Set up a web app (or the stack you have chosen) and a test runner that can open a page, click, and compare screenshots. Read spekkr.inputs.json first. Check: a blank or heading page loads, and an empty test run passes.
    2. Stability (R1). Build what R1. Stability asks for, to the numbers in design.md. In particular: Each strip is a chain of 32 particles with a fixed rest length, integrated with Verlet and a documented constraint iteration count. Check: the R1. Stability acceptance checks pass.
    3. Recolour (R2). Build what R2. Recolour asks for, to the numbers in design.md. In particular: A live control sets a strip's colour to a #rrggbb. The palette swap only sets the defaults. Check: the R2. Recolour acceptance checks pass.
    4. Frames and files (R3). Build what R3. Frames and files asks for, to the numbers in design.md. In particular: Goldens: still air (wind 0) at step 60, breeze at step 600, recoloured, and 24 strips at step 200. Check: the R3. Frames and files acceptance checks pass.
    5. Inputs (R4). Build what R4. Inputs asks for, to the numbers in design.md. In particular: The build reads spekkr.inputs.json. Settings label the UI, options turn features on or off, and a swap must be one of its choices. Check: the R4. Inputs acceptance checks pass.
    6. Goldens. Capture the frames named in design.md at the defaults, with motion frozen where the file says so. Compare them within the stated tolerance. Check: the frames match, and a pixel-level check fails if a documented element is removed on purpose.
    7. Finish. Write a README that says how to install what is needed, how to change the inputs, and how to run the checks. Run the one command from a clean folder. Check: every item under Definition of done in spec.md is true.
    # Tasks
    
    Work in order. Finish a task's check before starting the next.
    
    1. **Set up.** Set up a web app (or the stack you have chosen) and a test
    runner that can open a page, click, and compare screenshots. Read
    `spekkr.inputs.json` first.
       Check: a blank or heading page loads, and an empty test run passes.
    
    2. **Stability (R1).** Build what `R1. Stability` asks for, to the numbers
    in `design.md`. In particular: Each strip is a chain of 32 particles with
    a fixed rest length, integrated with Verlet and a documented constraint
    iteration count.
       Check: the `R1. Stability` acceptance checks pass.
    
    3. **Recolour (R2).** Build what `R2. Recolour` asks for, to the numbers
    in `design.md`. In particular: A live control sets a strip's colour to a
    `#rrggbb`. The `palette` swap only sets the defaults.
       Check: the `R2. Recolour` acceptance checks pass.
    
    4. **Frames and files (R3).** Build what `R3. Frames and files` asks for,
    to the numbers in `design.md`. In particular: Goldens: still air (wind 0)
    at step 60, breeze at step 600, recoloured, and 24 strips at step 200.
       Check: the `R3. Frames and files` acceptance checks pass.
    
    5. **Inputs (R4).** Build what `R4. Inputs` asks for, to the numbers in
    `design.md`. In particular: The build reads `spekkr.inputs.json`. Settings
    label the UI, options turn features on or off, and a swap must be one of
    its choices.
       Check: the `R4. Inputs` acceptance checks pass.
    
    6. **Goldens.** Capture the frames named in `design.md` at the defaults,
    with motion frozen where the file says so. Compare them within the stated
    tolerance.
       Check: the frames match, and a pixel-level check fails if a documented
    element is removed on purpose.
    
    7. **Finish.** Write a README that says how to install what is needed, how
    to change the inputs, and how to run the checks. Run the one command from
    a clean folder.
       Check: every item under Definition of done in `spec.md` is true.
    

    Open tasks.md as plain text

  • reference/preview.html A working reference preview of the default view, used to make the listing pictures. A build does not have to start from this file.
  • reference/fonts/fonts.css Webfont faces for the reference preview.
  • reference/fonts/Geist.ttf Geist variable typeface for the reference preview.
  • reference/fonts/Fraunces.ttf Fraunces variable typeface for the reference preview.
  • reference/fonts/Fraunces-Italic.ttf Fraunces italic variable typeface for the reference preview.

Is it for me?

Platforms
web
Tools
TypeScript, WebGL

What does it need?

Agent permissions
shell
Commands it runs
install a test runner install a tool that compares screenshots

What changed?

  • 0.2.215 Nov 2026Names what it builds.
  • 0.2.114 Nov 2026Add animated loop to the listing shots.
  • 0.2.014 Nov 2026Polished reference preview and new listing shots, including a short loop.
  • 0.1.014 Nov 2026First version.

For agents: start.md says how to build this spec, spec.json holds everything on this page, and bundle.tar.gz holds its files.