# 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. ## Default building 3 shafts, 6 floors. Shaft i's centre is at x = 1.2 + i * 2.8 m. Floor n's sill is at z = n * 3.2 m. The top of the last floor's slab is 6 * 3.2 + 0.2 = 19.4 m. ## Trapezoid move To go a distance `d` metres (absolute), with `v = 4`, `a = 1.5`: - If `d` is less than `v² / a` (10.666… m), the move is a triangle: accelerate halfway, decelerate halfway. Peak speed is `sqrt(a * d)`. - Otherwise: accelerate 4/1.5 s, cruise, decelerate 4/1.5 s. ## Fixture run (seed 1, passengers off, 3 shafts) Commands at t = 0: cabin 0 to floor 5, cabin 1 to floor 3, cabin 2 stays at 0. Documented positions of cabin 0's floor, in metres, at 1/60 s steps nearest these times (exact step index `round(t * 60)`): | t (s) | Cabin 0 z | Cabin 1 z | Cabin 2 z | | --- | --- | --- | --- | The machine-checked trail is `fixtures/elevator-trail.json`. Tests compare every cabin's z at every step through t = 12 s to that file, not to a re-typed table. Resting z on floor n is `n * 3.2 + 0.05` metres. ## Near-miss fixture Two cabins share shaft 0: A starts at floor 0 going to 5, B starts at floor 5 going to 0, both commanded at t = 0. They must not overlap. B stops at floor 4 (resting z 12.85 m). The closest-approach frame is screenshot `near-miss`. The trail for this fixture is `fixtures/elevator-nearmiss.json`. ## Screenshot times (fixture run, except near-miss) | File | t (s) | | --- | --- | | idle-shafts | 0 | | two-moving | 2 | | all-parked | 12 | Tolerance: 8 levels, 98% of pixels. ## Inputs | Key | Label | Default | Notes | | --- | --- | --- | --- | | `shafts` | Number of shafts | 3 | From 2 to 5. | | `floors` | Number of floors | 6 | From 4 to 12. | | `seed` | Physics seed | 1 | A whole number. The same seed and the same inputs replay the same run. | | `passengers` | Show passengers | on | People appear at floors and wait for a cabin. | | `cables` | Show cables | on | A line from each cabin to the top of its shaft. | | `units` | Units | metric | metric uses metres and seconds. playful uses floors and beats. | ## 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 | | --- | --- | | `design.md` | A shipped fixture. The build may move it, but then `design.md` must name the new path. | | `fixtures/elevator-nearmiss.json` | A shipped fixture. The build may move it, but then `design.md` must name the new path. | | `fixtures/elevator-trail.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/shafts.png` | Three shafts, six floors, seed 1; the mid cabin sits between 3 and 4. | ## 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 deterministic run with a fixed seed reaches the cabin positions in the fixture trail. Collision and door-timing tests cover the near-miss and a door opening at speed. A short headless recording is written and the four frames are checked against goldens. No hardware and no network.