Skip to content

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

Python

Merge pull request #16 from 23f2005639/refactor/server-split

Shreyas_2706a7372d67a82b
diff --cc AGENTS.md
index 833af56,63db5ff..7894737
--- a/AGENTS.md
+++ b/AGENTS.md
@@@ -54,22 -56,12 +56,22 @@@ CHROME=/path/to/chromium node tests/tes
```
`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.
+**Refactors (code moves, behaviour stays):** prove the house is the same. On `main`, then on your branch:
+
+```bash
+python3 tests/same_house.py snapshot before.json [jobs/<id>/plan.json] # the sample in every theme (+ a storeyed plan: stairs, roof)
+python3 tests/same_house.py snapshot after.json [jobs/<id>/plan.json]
+python3 tests/same_house.py compare before.json after.json # must print SAME HOUSE
+```
+
+It builds without baking (about 20 s a house) and compares every Blender object (name, box, vertices, materials) and `meta.json`.
+
## 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.