# FurniDraw: guide for AI agents Design a room and fitted wardrobes for a person by describing the result as a design spec (JSON). The editor builds it with its own rules and reports back what it built, so you can check and adjust. ## In a chat, without running JavaScript: give the person a link 1. Write the design spec as JSON (conventions, names and an example below). 2. Give the person this site's address followed by `#spec=` and the JSON, URL-encoded (encodeURIComponent). They open it and see the design built, with every measurement. If something cannot be built, the page says what and why; ask them for that message and fix the spec. Example, a 240 cm wardrobe in a bedroom for 30 shirts and 10 pairs of shoes: `/#spec=%7B%22specVersion%22%3A1%2C%22room%22%3A%7B%22template%22%3A%22bedroom%22%7D%2C%22wardrobes%22%3A%5B%7B%22against%22%3A1%2C%22width%22%3A240%2C%22for%22%3A%7B%22short%22%3A30%2C%22shoes%22%3A10%7D%7D%5D%7D` ## Functions (`window.furnidraw`, and the same as WebMCP tools where the browser offers them) - `help()`: this guide. - `schema()`: the JSON Schema of a design spec, every field described. - `example()`: a complete spec to start from. - `check(spec)`: builds it without changing the editor. Returns `{ ok: true, report }` or `{ ok: false, problems }`. - `build(spec)`: builds it and shows it in the editor (the person can undo it in one step). Same result. In a browser without 3D (WebGL) nothing is shown: the result has `shown: false` and a `link` for the person. - `describe()`: the report of the design the editor shows now (without 3D, of the last design built). - `link(spec)`: a URL that opens this design in the editor; give it to the person. Without JavaScript, give a link instead (above): `#spec=` with the JSON, URL-encoded, or base64url as `link(spec)` makes. ## How to work 1. Gather the measurements: the room's inside width and depth and wall height; doors and windows (which wall, width, distance from the wall's left end); stairs, landings, sloped ceilings or boxes coming down (which wall, heights at points along it); and what the person wants to store, with counts. 2. Write a spec, `check` it, fix every problem (each has a `path` and says what to do), then `build` it. 3. Read the report: gaps, what each wardrobe holds of what was asked, warnings. Adjust and build again. ## Conventions - Centimetres. Walls are numbered from 1: 1 is the back (the wardrobe wall), 2 right, 3 front, 4 left. - "from" along a wall is measured inside the room from the wall's left end, as you face the wall. - A wardrobe `against` a wall fills its free stretch unless you give a `width` (and `from` to place it). Under stairs or a slope it takes the ceiling's shape. `for` plans its fittings with Auto design. ## Names Built-in rooms (`room.template`): - `wall`: One wall behind the wardrobe - `corner`: Two walls meeting in a corner - `alcove`: A recess in the wall, 220 cm wide and 65 cm deep - `bedroom`: A 4 × 3.5 m room with a door and a window - `under-stairs`: A 3.8 × 1.15 m space under a staircase with a landing - `walk-in`: A 2.2 × 2.4 m dressing room with a door Ceiling shapes (`ceilings[].shape`): - `stairs`: The underside of a staircase above, rising along this wall - `landing`: A staircase that turns on a landing above - `slope`: A roof sloping down to this wall - `box`: A boxing or a beam lower than the ceiling - `pillar`: A column or chimney breast standing against this wall, floor to ceiling - `boxing`: A boxed-in wall on the floor, as over a toilet frame or pipes, with a shelf on top - `stepped`: A soffit that steps down, as over pipes or a cistern Wardrobe tops (`wardrobes[].shape`): - `regular`: Rectangular wardrobe - `sloped`: Angled top for sloping ceilings - `stepped`: Different heights per section - `under-stairs`: Follows a staircase above - `alcove`: Fits around a beam or boxing - `custom`: Free-form top to shape yourself What wardrobes hold (`wardrobes[].for`, counts): - `short`: Shirts & jackets - `long`: Dresses & coats - `pants`: Trousers & jeans - `folded`: T-shirts & knitwear - `shoes`: Shoes - `small`: Underwear & socks - `handbags`: Handbags ## Example ```json { "specVersion": 1, "name": "Under the stairs", "room": { "width": 380, "depth": 115, "height": 260, "openings": [ { "wall": 4, "kind": "door", "width": 80 } ] }, "ceilings": [ { "wall": 1, "shape": "landing", "points": [ [ 95, 205 ], [ 185, 205 ], [ 320, 105 ], [ 380, 105 ] ] } ], "wardrobes": [ { "against": 1, "fill": true, "for": { "short": 20, "pants": 10 } } ] } ```