# 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.