Converted from Elvar's teardown post into a nine-step workflow, reviewed and approved, then run on this machine. The same workflow rebuilds any machine with moving parts as one self-contained page. Scope note for this delivery: the interactive lab (steps 1-7) is what this page is; the step-8 video capture is a follow-on run from this same page, and step 9 ships as page + Three.js library together under 1 MB rather than one literal file.
Paste this into a coding agent with the required tools above. It carries the whole workflow, the machine numbers and the acceptance gate.
Verbatim - edit the machine name and numbers to retarget it.
MASTER PROMPT - TEARDOWN LAB
Role: you are a teardown engineer. Turn the machine below into a 3D simulator you can take apart, in ONE self-contained HTML page, and run the task on your own until completion.
MACHINE: Mecha Cat MK-IV - a quadruped robot cat.
REFERENCE: one exploded-view / cutaway image of the machine, studied before modelling. No reference, no build - without one the machine comes out generic.
THE NUMBERS (check on paper before coding; the solver, the clock and every chart must agree):
- One drive input only: crank/servo phase φ, 0-120 RPM. Everything else is derived from φ.
- Gait: trot. Phase offsets FL 0°, BR 0°, FR 180°, BL 180°. DIRECTION CHECK: the machine walks FORWARD, head first - in stance the planted foot sweeps BACKWARD relative to the body, in swing the lifted foot returns FORWARD. A flipped sign walks it backwards; verify the sign on paper before shipping.
- Legs: upper L1 = 0.55 m, lower L2 = 0.55 m, hip height 1.02 m, stride ±0.31 m, foot lift 0.16 m. Solve each leg with 2-bone IK (law of cosines) from the foot target - never hand-animate joint angles.
- Body bob 0.022 m at sin 2φ; head counter-pitches to stay level; tail is a 5-segment travelling wave lagging φ.
- Stress slider 100-160 % of rated load scales stride, torque (²) and core temperature. Over 135 % the machine must visibly complain.
- Head design: an angular wedge of folded armour plate - extruded side profile for the skull, visor-band eye slits, cheek guards, hinged jaw, blade crest fin. NO spherical or blob forms anywhere: core is a faceted octahedron, joints are octahedra, paws end in claws.
- Neck & surfaces: mount the head on a gimbal collar (ring + struts + piston) with visible clearance from chest and skull - no shell may intersect the neck, or it will clip and flicker as the head stabilises. No stripe, decal or appliqué may sit coplanar with its plate: offset every one proud of the surface, or it z-fights in motion.
BUILD ORDER:
1. Model first: a single solver object is the source of truth. Clock, charts and 3D pose all read it. One input (φ) poses the whole mechanism.
2. Subsystems = buttons: Head, Energy core, Chassis, Tail, Leg FL/FR/BL/BR. Pressing one detaches that subsystem in an exploded move while the rest of the machine steps aside; pressing Assembled reverses it. An Explode-all slider drives every subsystem together. An X-Ray toggle fades the armour to reveal the frame and core.
3. Console (1600×900 discipline): big live primary number (crank RPM) top-left with φ under it; one live chart per quantity - servo torque (N·m), core temperature (°C), foot lift (mm), power draw (W) - each with running min/max; subsystem button row always visible at the bottom; a Replay button.
4. Look: clean research model on a light studio background, soft contact shadow, ONE strong accent colour, white/translucent panels, dark text. Log every look defect as its own line and fix it.
5. Critic gate (mandatory before showing anyone): render stills at every tour beat, press every button and slider yourself, fix what fails, re-render.
6. Self-driving tour: on load, a scripted tour runs with a visible fake cursor that presses the real buttons. ANY user interaction stops the tour instantly and hands over control. Camera is committed - no free-fly during the tour - and the machine never leaves the frame.
7. Video: render(t) is a pure function of time; capture 60 fps at 1920×1080, cut 30 s, lay music in with ffmpeg on the same timeline.
8. Ship: single HTML under 1 MB, works offline, no sign-in, a "Load this machine" button that loads a JSON config {name, rpm, stress, explode, xray}. Alive in the first 3 seconds on a phone and on integrated graphics, target 60 fps.
REQUIRED TOOLS: Node 20+ · the teardown skill (npx skills add elvarofficial/teardown) as method reference · Three.js · ffmpeg · Python 3 · Playwright + Chromium for the critic pass.
ACCEPTANCE: the page opens already moving; every subsystem detaches and returns; charts move with the model and their min/max are honest; the tour completes untouched and yields to the first touch; the stress slider pushed to 160 % raises torque, temperature and warnings together. Do not declare done until you have pressed everything yourself.