043 · 24 October 2026 · digital-twins · 3d · agents

Lab 104 · Factory Twin

Write a whole factory in JavaScript and watch it play as a technical drawing, with live fisheye and thermal cameras, coverage and blind spots, and an agent that edits the scene.

Previewin your browser
Plant 7 drawn in the ink renderer: reactors on a pipe rack, workers at a bench and the gestation lab behind glass walls

In early access for subscribers until 22 November 2026. Subscribe to run it now.

Subscribe →

A digital twin of a whole site, written as one JavaScript script. Zones, walls and doors, assets, cameras, people and robots with their programs compile into a technical drawing that plays: people walk their routes, reactors heat up, camera previews update live, and the floor shows what no camera sees. Of the twin apps here, this is the one that holds the whole plant; Twin Render Playground is its renderer on its own, Twin Motion IDE makes films over its sites, and Bench Twin and Millwright zoom in to one bench or one robot cell.

  • Write the site: site(), zone(), camera(), person() and the asset library are plain builders. build(ctx => …) runs once at compile time; live(ctx => …) keeps running while the twin plays, and drives tints, heat, badges and signals.
  • Assets are functions: defineAsset() turns parameters into boxes, cylinders and spheres, with versions and ranges. The example defines its own alien dog, reactor, gestation pod, pipe runs, kennels and crates.
  • Real cameras: fisheye and pinhole lenses with distortion, or OpenCV-style intrinsics. Look through any camera, pin its preview beside it, or read the thermal camera, which sees the heat that live() sets.
  • Coverage and blind spots: view cones, coverage washed over the floor and blind spots hatched, along with live trails and the last shift's tracks, coloured by person or speed.
  • See the compiler: the IR tab lists every stage (evaluate, expand, lower, nav, programs, traces, bind) with its timing, and the live dependency graph that the lambdas read. The Assets tab and a full API reference sit next to it.
  • An agent that edits the twin: the Agent tab asks Claude for changes. It edits the scene script and inspects the running simulation with a single eval() tool. On the site it uses your Claude account; run locally, it asks for an API key.

The example is Plant 7, Xenocanine Works: a chemical plant with a reactor hall, a gestation lab, a holding pen, dispatch and a loading dock, six cameras and fifteen agents. Some gallery images are frames from the Factory Twin trailer, which plays on the same engine. Built with three.js.