What does teardown do?
You rebuild a real machine part by part from real numbers, drive it from one physical state, and build an engineering dashboard around it. The result must read as a real simulator, not an illustration. Never skip a step and never invent a number without marking it.
Inputs
- The machine (a named real model is best: "Chevrolet 350 small-block", "Mantis hexapod", "Airbus A320 main gear").
- One reference photo of the real thing. If the user attached one, use it. If not, ask for one; if they cannot provide it, find one freely licensed photo (Wikimedia Commons, check the licence on the file page) and record author, licence and URL. Look at the photo before modelling: proportions, part layout, colours and what moves.
Workflow (do these in order)
- Identify. Pin down the exact machine and variant. Say which one you chose in one line.
- Real numbers first, one data block. Research and write the
DATAblock before any geometry: every dimension, mass, ratio, speed, angle and timing the build will use, each withkind(published,derived,estimated) and a numbered source. Readreferences/research.md. Rules: prefer manufacturer sheets, manuals, standards, papers and records bodies; cross-check two sources when you can; a number you scaled off the photo isestimated; a number you computed from others isderived. Show this block to the user in chat as a short table before building. - Start from the kit. Copy
kit/template.htmlto<machine>-live.htmlin the output folder and copykit/three.jsnext to it. Edit only theMACHINE:CSS,MACHINE:DASHand<script id="machine">blocks. The kit gives you the stage, three.js setup, simple orbit, cutaway, gauges, and the clock. Readreferences/dashboard.mdfor the API. - Build parts from the numbers. Every mesh dimension comes from
N.<key>(the data block) or from a derivation written in code next to it. No magic numbers for anything that has a real counterpart. Match the photo's proportions and part shapes; usekithelpers (TD.span, extrude shapes,TD.glow). - One physical state drives everything. Define the minimal integrated state (crank angle, distance walked, time, valve position).
step()integrates it;derive()computes the whole machine from it with real kinematics (references/kinematics.md): positions, angles, velocities, forces, pressures.pose()only copies derived values onto meshes. NoMath.sin(time)decoration on moving parts. - Dashboard around the same state. Every readout, chart, strip and bar reads from the derived object
S, never from its own timer. Charts over a cycle are computed by calling the same solver at sampled phases. Include: the headline number, the current phase/stroke label, at least one chart vs angle or phase with a moving cursor, a per-part selector, the data block with sources, the reference photo with credit, and controls. Layout and gauge choice:references/dashboard.md. - Cutaway. Add the clipping-plane cutaway (
TD.cutaway) through the part that hides the action, hollow shells so only the wall section shows the cap colour, ghost what sits in front, and make the hidden action visible (combustion flash, oil column, gear mesh).references/cutaway.md. - Look. Apply
references/look.md(dark sci-fi default, light engineering variant on request). - Self-check by rendering stills. Run
node kit/stills.mjs <abs html> 0.5,2,4 <abs dir>/check-%.png(needs playwright; otherwise open the page in the browser tool and call__render). Read every PNG. Fix until: no console errors, the machine is framed and legible, the cutaway shows the inside, gauges visibly differ between stills (the script flags identical dashboards), anddeterministic: yes. Then walkreferences/qa.md. Delete the check PNGs. - Ship. Run
node kit/inline.mjs <machine>-live.htmlto fold three.js and images into<machine>-live.standalone.html, a single offline file. Reply with: the files, the data block (numbers + sources), the photo credit, and what is estimated rather than published.
Hard contract for the output file
- Opens from disk with no network; three.js is a classic script exposing
window.THREE(no ES modules, no CDN). window.__render(t): t in seconds, deterministic, no wall clock; it resets controls to defaults, re-integrates the state from 0 in fixed steps and draws one frame. The kit'sTD.rundoes this for you; do not bypass it.- Plays live with
requestAnimationFramewhen opened normally; controls change the state, and every gauge follows. - Desktop stage 1600x1000, scaled to fit any window.
- The data block, sources and photo credit are visible in the page.
Honesty rules
- Never present an estimated number as published. Tag it.
- If the published numbers disagree, pick one, show the other in the note, and say so.
- If a behaviour is modelled simply (static loads, ideal gas, no friction), say it in the reply in one line.