Skip to content

Single place to convert your 2D floor plans to 3d model (no LLM)

Python

Docs: the map, tests and furniture steps name jobs.py and theme_store.py

23f2005639bd18f79fce61
diff --git a/AGENTS.md b/AGENTS.md
index 4ebea6d..63db5ff 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -17,7 +17,9 @@ Needs Python 3, Node 18+, Blender 4.2+ and poppler. If Blender is not on `PATH`,
| File | Job |
|---|---|
-| `server.py` | HTTP server (standard library only), one job folder per plan in `jobs/`, build queue (one Blender at a time) |
+| `server.py` | HTTP routes only (standard library only). Names `jobs.X` / `theme_store.X`, never a copy, so tests can swap the folders |
+| `jobs.py` | a plan's folder in `jobs/` and the work on it: status, `run_detect`, the build queue (one Blender at a time), exports, the furniture list and `check_items`, the setup check |
+| `theme_store.py` | people's own themes on disk, the Themes page's list, the pictures of each theme's pieces |
| `vector.py` | PDF page -> line segments, curves, fills, words (poppler) |
| `detect.py` | segments -> plan JSON: walls, openings, rooms, stairs, scale. Units: feet, y up |
| `furnish.py` | plan JSON -> furniture items `{fn, args, kw, box}`. Pure Python, no Blender |
@@ -54,12 +56,12 @@ CHROME=/path/to/chromium node tests/test_site.mjs examples/sample_plan.pdf http:
```
`test_site.mjs` needs a running server and takes about 2 minutes (it builds a draft house in a real headless browser).
-Run it after any change to `web/`, `server.py` or `blender/`.
+Run it after any change to `web/`, `server.py`, `jobs.py`, `theme_store.py` or `blender/`.
If you change `examples/make_sample.py`, run it to rewrite the PDF and keep its `EXPECT` in step.
## How to change things
-- **A new furniture item:** write the builder in `blender/furniture.py`, add it to `CALLS` and to `ITEM_FNS` in `server.py` (what the review page may send), place it from a rule in `furnish.py` with its footprint `box`. Add it to `themes.SLOTS` (and its size to `catalog.py`) if themes should be able to change it.
+- **A new furniture item:** write the builder in `blender/furniture.py`, add it to `CALLS` and to `ITEM_FNS` in `jobs.py` (what the review page may send), place it from a rule in `furnish.py` with its footprint `box`. Add it to `themes.SLOTS` (and its size to `catalog.py`) if themes should be able to change it.
- **A model for the themes:** measure it as Blender imports it (feet, front facing -y after `turn`), add it to `themes.LIBRARY` with the slots it may fill; `fetch_assets.py` downloads every library model. Large ones: keep it under about 30k triangles.
- **A new theme:** an entry in `themes.THEMES`. Furniture rules read only sizes from it (`Room.sizes`), so a model that does not fit falls back to the built-in piece in the theme's colours. Check it with `tests/test_themes.py` and look at a build: rules can be right and a room still look wrong.
- **A new built-in piece style:** a `style=` branch in its builder, listed in `themes.STYLES`. New materials go in `lib.py`; a coloured one goes in `PAINT` in `gen.py` so themes repaint it.
diff --git a/README.md b/README.md
index 63968a2..7359fdd 100644
--- a/README.md
+++ b/README.md
@@ -200,7 +200,9 @@ disk does not load the viewer's modules. Recordings there are saved as the brows
## Project layout
```
-server.py web server and build queue (standard library only)
+server.py web server: the HTTP routes (standard library only)
+jobs.py a plan's job folder, the build queue, exports
+theme_store.py your own themes and the pictures of their pieces
detect.py plan PDF -> plan JSON
vector.py PDF lines, curves, fills and words (poppler)
furnish.py furniture rules (pure Python)
@@ -225,7 +227,7 @@ tests/run_all.sh # detector on the sample, qua
CHROME=/path/to/chromium node tests/test_site.mjs examples/sample_plan.pdf http://127.0.0.1:8080
```
-GitHub Actions runs `tests/run_all.sh` on every push to `main` and every pull request (`.github/workflows/tests.yml`); it has no Blender, so run `test_site.mjs` yourself after changes to `web/`, `server.py` or `blender/`.
+GitHub Actions runs `tests/run_all.sh` on every push to `main` and every pull request (`.github/workflows/tests.yml`); it has no Blender, so run `test_site.mjs` yourself after changes to `web/`, `server.py`, `jobs.py`, `theme_store.py` or `blender/`.
`test_site.mjs` drives a real headless browser against a running server (about 2 min, one draft build): upload page, Furniture box, build box, screenshot, recording, map and top view. `tests/test_detect.py` scores the detector on the private drawings and is skipped unless `PLANTO3D_FIXTURES` points at them.
diff --git a/jobs.py b/jobs.py
index 4c90d54..6218439 100644
--- a/jobs.py
+++ b/jobs.py
@@ -163,7 +163,7 @@ def plan_items(jid):
return dict(floors=[furnish.floor_items(plan, f) for f in plan["floors"]], catalog=cat)
-# items the browser may send: must match gen.CALLS (gen.py runs inside Blender, so it cannot be imported here),
+# items the browser may send: must match furniture.CALLS (blender/furniture.py runs inside Blender, so it cannot be imported here),
# minus "model", whose argument is an asset file name
ITEM_FNS = set(catalog.CATALOG) | {"shower2", "geyser", "kitchen_run", "chimney", "wall_cab2", "rug", "car",
"outdoor_set", "bathtub", "round_rug", "armchair", "art", "mirror", "decor", "corner", "bed_end"}