Who wants this, and why
A production engineer at a small machining plant wants to try a layout change: a second forklift, or the rack block moved nearer the docks. The hall was built twenty years ago. Nobody can find the drawings, and there is no time for a survey. What they do have is a phone and an AI agent.
The goal is a model of the hall with its machines in it, good enough to try the change: a 2D plan, a 3D view, a simulation of the pallet flow and a drawing to show colleagues. The engineer also wants to know how far the model can be trusted.
What they had
- Eight photos: two outside in the yard and six inside the hall at eye height.
- One length: the hall is about 48 m long. They also knew which side faces south.

The eight photos the agent was given. All of them are generated (see below).
The photos are generated, not taken. To measure the agent's error we needed the true layout. So we first built a fictional plant in Laydyne, Kestrel Bend Precision Works, a 48 × 28 m machining and assembly hall. That model is the answer key. We drew it from eight camera positions with get_view_image. Then Codex's image generation turned each drawing into a colour photo, keeping the camera, the room and the count of every machine, rack and bench. The prompts and every attempt are in prompts.md. The agent that rebuilt the hall saw the eight photos and nothing else. It never saw the answer key, the drawings or the prompts.
The flow
- The engineer takes the photos.
- The agent reads them and builds the hall: walls, columns, doors, dock doors, windows, rooflights and the office.
- It places the equipment and Laydyne checks the layout.
- The agent draws the model from where each photo was taken and fixes what differs.
- Laydyne simulates the pallet flow with one and two forklifts.
- The engineer hands over a scaled drawing, the quantities and the project file.
The steps, their tools and their outputs are in flow.json.
Step by step
The agent was Codex (CLI 0.160.1) with its default model, gpt-6-astra, at low reasoning effort. It was connected to Laydyne Studio over MCP. It worked in an empty folder that held only the eight photos, and each prompt continued the same conversation. These are the prompts as sent.
1. The building
I'm the production engineer at our machining plant. We have no drawings of the hall, only the 8 photos I attached (they are also in this folder as photo-*.webp): photos 1 and 2 are taken outside in the yard, photos 3 to 8 inside the hall. The hall is about 48 m long; the long façade with the two dock doors and the personnel door faces south.
Using the Laydyne tools, start a new project (create_space with fresh: true) and build the building only: the hall floor, the outer walls with their height, the steel columns, the personnel door, the dock doors, the windows and roof lights, and the glazed office / QC room. Estimate the other sizes from things of known size in the photos (doors, dock doors, pallets, workbenches, the forklift) and give every part source "assumed" and a short note on how you estimated it. Show me a 2D plan and a 3D view, and tell me how you estimated the width and the height of the hall.
In 2 min 18 s and 10 tool calls the agent built a 48 × 24 m hall with 52 parts. It explained its two key estimates:
- Width (24 m): it saw two spans of roughly 12 m inside. It called this "the least certain overall dimension".
- Wall height (9 m): the façade looked about four personnel-door heights tall, at 2.2–2.3 m per door.
2. The equipment
Now place the equipment you can see in the photos: every machine by type (machining centres, lathes, grinders, saws, measuring machines and so on), the pallet racking, the workbenches and assembly cells, the roller conveyor and packing table, the pallets, the forklift, and the painted floor zones (aisles, walkways, hatched areas). Use get_part_catalog for suitable parts and sizes, turn each machine to face the side it is operated from, and count carefully across the photos so that nothing seen in two photos is placed twice. Give each part source "assumed" and a short note naming the photos it is seen in. Then run check_space and fix what it finds.
This took 3 min 52 s and 16 calls. The agent placed:
- two rows of machines facing each other across a machine aisle
- two runs of pallet racking along the east wall
- assembly benches, a roller conveyor, two packing tables, pallets and the forklift
- the painted aisles
The check found no remaining problems. The agent said plainly what it could not tell: "no separate lathe, grinder or saw was confidently identifiable."
3. Compare with each photo, and fix
Check the model against each photo. For every photo, estimate where it was taken from (eye at about 1.6 m, a target point and the vertical field of view) and draw the model from there with get_view_image (camera eye, target and fov; caption: false; 1536 × 1024 like the photos). Compare each drawing with its photo and fix what differs: sizes, positions, counts, doors and windows. When the model matches the photos, run check_space on all floors, save the project in the browser with save_local_project, and export it with export_project to the file rebuild.laydyne.json in this folder (join the pieces and check the SHA-256). Finally list which sizes are still estimates and the one measurement that would improve the model most.
This step took 9 min 50 s and 46 calls, 25 of them pictures. The agent estimated a camera for every photo and drew the model from there. Then it corrected the roof structure, the rack spacing, the machine stagger, the conveyor's direction and the dock surrounds.

Left: photo 3 (generated). Right: the rebuilt model, drawn from where the agent estimated the photo was taken.

The machine aisle. Left: photo 5 (generated). Right: the rebuilt model from the agent's estimated camera.

Between the racks. Left: photo 8 (generated). Right: the rebuilt model.
All eight pairs are in compare-sheet.webp. Asked for the one measurement that would help most, the agent named "the clear internal north–south hall width". That is the dimension it got wrong (below).

The rebuilt hall in Laydyne, roof hidden.
4. One forklift or two?
Next I want to know whether one forklift is enough. Read get_process_catalog first. On this model, set up the material flow for one 8-hour shift: a pallet of raw material arrives at the dock doors about every 6 minutes and the forklift puts it away in the pallet racks; every 6 minutes on average a pallet is taken from the racks to the machines; machined parts go to the assembly cells, then along the roller conveyor to the packing table, and every 10 minutes on average a finished pallet is taken by forklift from the packing table to the dock staging area. One forklift does all the pallet moves. Run it, then tell me the forklift utilisation, how long pallets wait for the forklift, and how many pallets are moved. Save this as option A (save_process_option). Then change one thing, a second forklift, save it as option B, and compare A and B with compare_process_options under the same arrivals, seed and number of runs. Tell me which differences are beyond the noise and which inputs are assumptions I should measure.
This took 6 min 58 s and 19 calls. The agent built the scenario on the rebuilt model and ran both options for 20 paired runs of the same 8-hour shift (seed 20261006).

From the saved comparison (process-des-2.7.0).
| Per shift, mean of 20 runs | A: one forklift | B: two forklifts |
|---|---|---|
| Forklift utilisation (each) | 90.3% | 46.4% |
| Mean wait for a forklift | 9.9 min | 0.5 min |
| Pallet moves | 200.8 | 207.2 |
The waiting difference is beyond the noise: the 95% interval for the change in mean wait is 6.1–12.7 minutes. The difference in forklift travel distance is not.
The agent named the inputs to measure first: pickup and set-down times. It had assumed 20/40/60 s and 30/60/90 s. It also pointed out a problem in the prompt: production is fed 10 pallets an hour but only 6 an hour are shipped, so finished stock builds up in both options.

One hour into the shift with two forklifts: the forklifts and the pallets they carry on the plan. This run of option B was made again for the picture; the numbers above come from the agent's saved comparison.
5. Hand-over
Finally, prepare the hand-over for my colleagues: a dimensioned A3 PDF drawing of the hall (get_view_image with delivery: true, format "pdf", dimensions: true; join the pieces and check the SHA-256), the floor areas and part counts from get_space_quantities saved as quantities.json, and a fresh export of the whole project as handover.laydyne.json. Save the files in this folder, save the project in the browser again, and tell me where each file is.
This took 1 min 51 s and 9 calls. The result was an A3 sheet at 1:200 with dimensions and an area table, plus the quantities (1,152 m², 136 parts) and the project file with both options and their comparison. Download the PDF, quantities.json or the project.

The A3 sheet the agent produced: the model's drawing, not a survey.
Results
Accuracy against the answer key
We scored the rebuild (after step 3) with a scoring script. The script places the rebuild on the answer key by the middle of its walls. It then matches parts of the same class, nearest first, within 4 m. The full result is in score.json and the summary in facts.json.

Top: the answer key the photos came from. Bottom: the hall rebuilt from the photos. Both at 1:200.
| Answer key | Rebuilt | Error | |
|---|---|---|---|
| Hall length (given) | 48.0 m | 48.0 m | 0 |
| Hall width | 28.0 m | 24.0 m | −4.0 m (−14%) |
| Wall height | 8.6 m | 9.0 m | +0.4 m |
| Floor area | 1,344 m² | 1,152 m² | −14% |
| Column bays along the hall | 8 m | 8 m | 0 |
| Machines | 12 | 12 | 9 matched |
| Rack bays | 10 | 10 | 8 matched |
| Windows / rooflights | 14 / 6 | 14 / 6 | all matched |
| Dock doors along the wall | 36.0 / 44.0 m | 35.8 / 44.3 m | −0.2 / +0.3 m |
| Personnel door along the wall | 12.5 m | 10.4 m | −2.2 m |
- Position error of the 47 matched parts: median 1.97 m, 95th percentile 3.08 m, maximum 3.16 m. - Most of this comes from the 4 m width error, which shifts everything about 2 m north or south. - Scaled to the true walls, the layout error is median 1.63 m and 95th percentile 2.59 m.
- Within that: columns 0.05 m, dock doors 0.25 m, windows 0.40 m, machines 1.86 m, racks 1.84 m.
- Machine direction: all nine matched machines face the right way.
- Missed or merged: - The agent drew two rows of six machines where the plant has six machining centres facing two lathes and two grinders. It extended both rows into the tool corner, where the band saw stands. - It placed six assembly benches where the three cells have nine, and one 12 m conveyor instead of three 4 m sections.
- Camera estimates: the agent's guess of where each photo was taken was off by a median 4.0 m (which includes the 2 m shift) and 4.6° in direction. The worst was 27.5°, for photo 6.
- Effect of the photo comparison (step 3): compared with step 2, the 95th percentile fell from 3.35 m to 3.08 m. The racks matched within 4 m rose from 4 to 8.
One measured width would have removed the largest error. The agent named that measurement itself.
Tokens and time
| Prompt | Time | Tool calls (failed) | Input tokens (cached) | Output tokens |
|---|---|---|---|---|
| 1. Building | 2 min 18 s | 10 (1) | 578k (511k) | 2.3k |
| 2. Equipment | 3 min 52 s | 16 (0) | 833k (810k) | 4.9k |
| 3. Compare and fix | 9 min 50 s | 46 (3) | 2.66M (2.49M) | 13.5k |
| 4. Simulation | 6 min 58 s | 19 (0) | 2.55M (2.37M) | 6.2k |
| 5. Hand-over | 1 min 51 s | 9 (0) | 1.02M (0.97M) | 1.7k |
| Total | 24 min 49 s | 100 (4) | 7.64M (7.15M, 94%) | 28.7k |
The rebuild itself (steps 1–3) took 16 minutes and 72 tool calls. The four failed calls were the agent's mistakes, and each came back with a clear reason:
- a camera given for a 2D drawing
text: nulland thentext: ""sent to clear a floor marking's label (we have since madenullclear it)- a picture requested while three earlier calls were still running (the Studio tab answers three at a time)
What it cannot do
- Measure. Every size here is an estimate from proportions in the photos. The 4 m width error is typical of what a single wrong guess does, and the agent marked every part as assumed. One tape-measure reading fixes the most important number.
- See what is not in the photos. Machines hidden behind others, the far ends of rooms, the inside of the office. The agent could not tell a lathe from a machining centre, and it said so.
- Know the work. The simulation's arrival rates, pickup times and machining times are the engineer's assumptions, typed into the prompt. Laydyne computes queues and capacities with those numbers. It does not compute collisions between forklifts or anything about real drivers.
- Turn photos into a survey. The drawing is a scaled drawing of the model, and its title block says the dimensions are not yet measured on site.
Try it yourself
- Connect your agent to Laydyne over MCP (Codex, Claude Code or another client; see the docs) and keep Studio open.
- Take six to ten photos of your own space, inside at eye height and outside, and note one length you know.
- Start from the prompts above, or from the "Model a room from photos" starting prompt.
- To repeat this test with a known answer, use the photos in
images/photo-*.webpand compare your result with answer-key.laydyne.json:
node apps/studio/scripts/score-photo-rebuild.mjs docs/articles/factory-from-photos/answer-key.laydyne.json your-rebuild.laydyne.json
Modelling, checks, drawings and export are free. The simulation runs need Pro.
