Skip to content

Agent tools

Torins gives the agent 78 tools over MCP. This is the text the agent reads: the tool’s description, then its parameters. Coordinates on a page are page pixels; in the model, metres.

What the user has selected or drawn, showing things, asking, the house at a glance.

What the user has selected in the Torins window: the element (kind and id), its level, the room it is in or that the clicked wall face looks into, and the clicked point. Call this whenever the user says “this”, “here”, “that wall” and the like.

A mark-up the user drew on the Torins view and sent to you (“[Markup 2]”): the view image with their red marks, and the elements under the marks (kind, id, room, point). Without a number: the latest one. Use the element list for ids; the image shows what they mean.

Parameter Type
number integer optional

Select an element in the Torins window and turn the view towards it, to point the user at something (“this one?”) or show the result of a change.

Parameter Type
element_id text required

Tell the user, in one short sentence, what you just changed. It is shown in the Torins window (and read aloud when voice is on). Call it once after a change, not for every step.

Parameter Type
message text required

Ask the user up to four questions in the Torins window, each with two to four answers they click (they can also type their own), and wait for the answers. Use it before you build, once, for what the plans and photos leave open AND what changes the result a lot: which page is which level, how many storeys, the roof shape when no elevation or photo shows it, the overall size when the drawn and the written sizes disagree. Not for things you can measure or check yourself, and never a second round before the user has seen a model: choose sensible defaults for the rest and name them in one sentence when you are done.

questions: [{“question”: “…”, “options”: [“…”, “…”], “recommended”: 0}], each option a few words (or {“label”: “…”, “description”: “…”}); “recommended” is the index of the answer you would pick.

Parameter Type
questions list of object required

Adding and sorting sources, the scale, reading pages, finding walls, fitting cameras to photos.

Numbered points of the model that photos show well: outside wall corners at the floor and at the wall top, window and door corners on the outside faces (left/right as seen from outside), roof eave corners and ridge ends. Use them in calibrate_photo as [u, v, “K12”] instead of typing coordinates (mix freely with [u, v, x, y, z]). With photo (calibrated or not): a plan sketch with the numbers, and for a calibrated photo the points drawn where the camera puts them. near = [x, y]: list the 40 closest to that plan point first.

Parameter Type
photo text optional
near list of number optional

Fine-tune a photo’s camera so the model’s edges (outside corners, wall tops and bases, window and door frames, roof edges) fall on the photo’s edges. Needs a rough camera first (calibrate_photo with 4-6 landmarks is enough). Keeps the result only if it fits better; the clicked points still count, a little. Then check with project_model. The focal length stays as it is when it came from the file or from focal_35mm; fix_focal keeps it in any case.

Parameter Type
photo text required
fix_focal true/false optional

How to extract a house from plans and photos with these tools, step by step. Read it before starting an extraction or photo fit.

Add plans and photos of the house (files, or folders of them): PDFs and scans become plan pages (d0p1, d0p2 …), photos get ids ph0, ph1 … kind: auto (a PDF is a plan; an image is a plan when it looks like paper and ink, else a photo) | plan | photo; set_source_kind corrects it later. The files are copied into the house folder. A file that is already there is skipped and named; a different file of the same name is kept as “name (2)”. Returns contact sheets with the ids.

Parameter Type
paths list of text required
kind text optional
dpi integer optional

The plan pages and photos of this house and how far each one is: what it is (type, facing, title, printed scale), page orientation, scale, origin, level and standard sheet; photo lens, camera (position, error) and its points.

Record what a page or photo is, as facts the app and the other tools use. Pages: type floor_plan | section | elevation | site_plan | detail | text | other; level_id: the level a floor plan draws; facing N | E | S | W: the side of the house an elevation shows; title and scale as printed on the sheet (scale like “1:100”). Photos: type facade | aerial | interior | other; facing: the side of the house a facade photo shows; title: a few words. Photos have no level or scale. shows (photos, and pages that show the outside): what it tells about the house, in a sentence or two, looked at closely: the roof (shape, which way the ridges run, gables, hips, dormers, roughly how steep), storeys, facade and roof materials, windows, porch, canopy, terrace, garage. An interior photo: which room (the plan’s name), its ceiling (flat, sloped: under the roof), a dormer niche or a roof window and which way it looks, what the windows look out on, the furniture. The build is planned from these (describe_house), so look before you write. A field left empty stays as it is; “-” clears it.

Parameter Type
source_id text required
type text required
level_id text optional
facing text optional
title text optional
scale text optional
shows text optional

Write down the house as the plans AND the photos show it, before building it: what kind of house (detached, semi-detached and which half, terraced), storeys and basement, the roof of each part (shape, ridge direction, cross gables, hips, dormers, pitch), garage and its roof, porch, canopy, terrace, balcony, facade and roof materials, window style; and what the sources leave open. Built from classify_source’s shows= of every photo and from the plans; the roof and photo checks are held against it. Write it again when you learn better. Say where each dormer, roof window and balcony is, over which rooms, and why: the interior photos (a dormer niche in a photo of an attic room means a dormer over that room; the user’s photos are of the user’s part) and what it sits next to outside (the gable beside it, the window under it). Distances read from a camera fit are the weakest evidence. A semi-detached or terraced house: the user’s part in full, the neighbours’ as a shell (outer walls, the roof continued), with nothing on it (no dormers, roof windows, panels or finishes of its own).

Parameter Type
description text required

Remember something about a page or photo in free words (e.g. “dimensions hard to read in the north-east corner”). What it is goes into classify_source.

Parameter Type
source_id text required
note text required

Correct what a file was taken for: kind “plan” turns a photo (ph3) into a plan page, kind “photo” turns a plan page that is a single image (not a PDF page) into a photo. The source gets a new id, which is returned; its calibration is dropped, its note and title are kept.

Parameter Type
source_id text required
kind text required

Take a plan page (d0p3), a photo (ph1) or a whole document with all its pages (d0) out of the house. Its id is not used again. The original file stays in the house folder unless delete_file; a PDF stays as long as other pages of it are in use.

Parameter Type
source_id text required
delete_file true/false optional

Look at a plan page (normalised if done) or a crop [x0, y0, x1, y1] of it, with a grid whose labels are page pixels so you can read positions off it. standard: look at the page’s standard sheet instead (the drawing in the house frame, 100 px per metre); crop, grid labels and grid_step are then in model METRES (x east, y north), so walls can be read off directly.

Parameter Type
page text required
crop list of number optional
max_size integer optional
grid true/false optional
grid_step integer optional
standard true/false optional

Remove perspective from a phone photo of a paper plan: give the four corners of the sheet in page px as view_page shows them, in any order. The page is replaced by the straightened sheet (the picture as it was is kept beside it), and its orientation, scale and origin are reset: normalize_page and calibrate_scale along both axes come next. corners_px [] puts the picture back as it was.

Parameter Type
page text required
corners_px list of list of number required

Turn a page upright (rotate 0/90/180/270 clockwise) and remove scan skew. Give all levels the same orientation. Resets the page’s scale and origin.

Parameter Type
page text required
rotate integer optional
deskew true/false optional
skew_deg number optional

Add a known distance on a page (a dimension line between its tick marks, e.g. 3,51⁵ = 3.515 m). Calibrations along x and y are kept apart (scans are often stretched along one axis); their spread shows a misread number.

Parameter Type
page text required
p1 list of number required
p2 list of number required
meters number required
label text optional

Forget a page’s scale calibrations (to start over after a misread).

Parameter Type
page text required

Which page pixel is model (0, 0), and which level the page draws. Use the same physical point on every level (e.g. an outer corner that exists on all floors) so the levels stack. With a scale and an origin the page also gets its standard sheet (see standardize_page).

Parameter Type
page text required
origin_px list of number required
level_id text optional

Make the standard sheet of a page that has a scale and an origin: the drawing resampled into the house frame, exactly 100 px per metre in both axes (a scan’s stretch along one axis is gone), up = model +y, cropped to the ink plus 1 m, the paper flattened to white. All levels then share one pixel grid and positions read in metres: view_page with standard=true. It runs by itself whenever the page’s scale, origin or orientation changes; call it only to make the sheet again.

Parameter Type
page text required

Convert page pixels to model metres (points_px) and back (points_m).

Parameter Type
page text required
points_px list of list of number optional
points_m list of list of number optional

Lengths along a polyline of page points, in px and (when calibrated) metres.

Parameter Type
page text required
points list of list of number required

Ink along a line: where it crosses walls and lines, and how wide each crossing is, in px and metres. Good for exact wall faces and thickness, or opening edges along a wall: run it along a wall’s middle and the gaps are its doors and windows. Coloured plans: wall_color (#rrggbb or “auto”) counts only wall-coloured pixels as wall (W) and reports blue glass (G) too.

Parameter Type
page text required
p1 list of number required
p2 list of number required
width_px integer optional
wall_color text optional
color_tolerance number optional

Wall candidates on a page: straight axis-aligned bands with their thickness, diagonal strokes, and gaps between collinear pieces (candidate doors and windows). Thin linework (dimensions, text, furniture) is removed by an opening of side min_thickness_px. For walls drawn as two thin outlines with a hollow middle, set fill_gap_px a little above the thickest wall. Page px. Coloured plans (estate-agent plans with furniture, plants, lawn): give wall_color, the walls’ colour as #rrggbb, or “auto” for the most common dark colour), and only pixels within color_tolerance (CIELAB) of it count as wall, so dark furniture and plants drop out. A page in colour gets “auto” by default; wall_color=“none” forces the greyscale detector.

Parameter Type
page text required
crop list of number optional
min_thickness_px number optional
max_thickness_px number optional
min_length_px number optional
fill_gap_px number optional
merge_gap_px number optional
max_size integer optional
wall_color text optional
color_tolerance number optional

The current model drawn over a plan page, to check that it sits on the drawn walls: walls as red bands at their thickness, windows blue, doors green, rooms purple, the origin as an orange cross. The user sees the same overlay live in the Sources view.

Parameter Type
page text required
level_id text optional
crop list of number optional
max_size integer optional
labels true/false optional

Replace the whole house model (all levels, walls, openings, rooms, roofs …) with a complete JSON model, e.g. a first extraction. It is validated; errors come back to fix. One undoable change. For small fixes use update_element instead.

Parameter Type
model object required
message text optional

The whole house model as JSON (to edit and write back with write_model).

Snap room polygons to the walls: each room becomes the space its walls enclose (rooms sharing one open space are clipped to it; terraces and rooms in no enclosed space stay as drawn). write_model does this by itself; use this after moving walls by other means.

Parameter Type
level_id text optional

Move a wall corner: every wall end and room corner of the level within tolerance m of from_xy moves to to_xy, so joined walls and rooms stay joined. Openings keep their offsets.

Parameter Type
level_id text required
from_xy list of number required
to_xy list of number required
tolerance number optional

Look at a photo or a crop [x0, y0, x1, y1] of it, with a grid labelled in photo pixels (to read the pixel positions of corners for calibrate_photo and locate_on_photo).

Parameter Type
photo text required
crop list of number optional
max_size integer optional
grid true/false optional

Find the camera of a photo from points you can see in it and whose 3D position you know: each point is [u, v, “K12”] (a landmark from photo_landmarks: the easy way) or [u, v, x, y, z] = photo pixel and model metres (x east, y north, z up; e.g. a wall corner at the ground, the top corner of a window, the eaves end of a gable wall). Then refine_photo_camera. Use at least 6, spread over the photo and NOT all in one plane (two facades, or ground + heights). The focal length is found too. free_z: indices of points whose plan position you know but not their height (a window head, an eave or ridge end): the z you give is a first guess, and the solved heights are reported, so a calibration can measure heights too (at least 2 points of known height, e.g. door thresholds at the floor, fix the datum). focal_35mm: the lens’s 35 mm-equivalent focal length if known (phones ~26, drones ~24); it makes few or flat points far more stable. When you give none, the one the camera wrote into the file is used if there is one (list_sources shows it; wrong for a cropped picture); 0 searches for it instead. Replaces the photo’s points; prints each point’s error so you can fix a misread one, and returns the model drawn on the photo.

Parameter Type
photo text required
points list of list of number required
labels list of text optional
free_z list of integer optional
focal_35mm number optional

The model drawn on a calibrated photo with hidden lines removed: outlines and creases of roofs (orange), walls (cyan), windows and doors (green), with the calibration points (green circle = clicked, red = where the model puts it). opacity > 0 also fills the model faces. Where outlines miss the photo’s edges, the model (or a calibration point) is off.

Parameter Type
photo text required
opacity number optional
crop list of number optional
max_size integer optional
labels true/false optional
grid true/false optional

3D positions of photo pixels on a calibrated photo: the ray through each pixel meets a plane. plane: ‘x=1.5’ | ‘y=-0.3’ | ‘z=0’ | ‘wall:ID’ (that wall’s face towards the camera) | ‘model’ (the first model surface the ray hits; also tells which element). E.g. the ridge end of a gable on the gable wall’s plane gives the ridge height. Use two photos and triangulate when there is no known plane.

Parameter Type
photo text required
points_px list of list of number required
plane text optional

The 3D point seen at px_a in one calibrated photo and px_b in another (the closest point of the two rays), and how far apart the rays pass (a large gap = not the same point, or a poor calibration).

Parameter Type
photo_a text required
px_a list of number required
photo_b text required
px_b list of number required

A wall straightened out of a calibrated photo: the photo warped onto the wall’s outer face, as an orthographic view at px_per_m pixels per metre, with a grid in metres (horizontal: from the wall’s left end as seen from outside; vertical: heights above ±0). Read opening edges, sills, heads, eaves and gable tops off it in metres, without a section drawing. Only what lies in the wall’s plane is true to scale: things in front of it (a canopy, a tree) are smeared. margin: metres shown beyond the wall’s ends; top: the highest point shown (default: the wall’s top plus 2 m, for the roof above it).

Parameter Type
photo text required
wall_id text required
px_per_m integer optional
margin number optional
top number optional

Walls, openings and rooms straight from page pixels; edits in bulk.

Walls and openings straight from page pixels: the page’s scale and origin turn them into metres (calibrate_scale and set_origin first). One change.

walls: [id, [x, y], [x, y], thickness_m] or {“id”, “start”, “end”, “thickness”?, “height”?, “finish”?}, end points in page px on the wall’s centre line. Nearly level or plumb walls are straightened; ends within join_px of each other become one corner. walls=“detected” builds every straight candidate of the page’s last detect_walls (a quick first model to correct), and a list of numbers, e.g. [0, 3, 7], builds just those candidates. openings: {“kind”: door|window|opening, “at”: [x, y] centre px (or “edges”: [[x, y], [x, y]], its two ends, which also give the width), “width”? m, “height”? m, “sill_height”? m, “id”?, “wall_id”? (else the nearest wall)}. Defaults: doors 2.01 m high, windows 1.26 m at 0.9 m. openings=“detected” turns the last detect_walls gaps (0.5-3.5 m, between two wall pieces) into windows in outside walls and doors inside; [2, 5] or [“g2”, “g5”] takes just those gaps. With detected walls, the pieces either side of a gap become one wall through the opening. level_id: the page’s level (set_origin) unless given; a new id makes a new level.

Parameter Type
page text required
walls list or text optional
openings list or text optional
level_id text optional
thickness number optional
join_px number optional

Doors, windows and plain openings at plan-metre points, on walls that exist: the wall and the offset along it are found. Each: {“kind”: door|window|opening, “at”: [x, y] (its centre, on the wall) or “edges”: [[x, y], [x, y]], “width”? m, “height”? m, “sill_height”? m, “id”?, “wall_id”?, “frame_material”?, “leaf_material”?}.

Parameter Type
level_id text required
openings list required

Rooms from the walls: every space the walls of a level enclose becomes a room, shaped to the walls. Name them by pointing into each: rooms=[{“name”: “Kitchen”, “at”: [x, y]}, …], a point inside the room, e.g. where its label is printed on the plan. With page, the points are that page’s px (and the level is the page’s); without, plan metres. A point in a space that already has a room renames it. Spaces you do not name are called “Room 1”, “Room 2” … (rename later with update_element). “outdoor”: true for a terrace or balcony (needs a polygon instead: write_model). One change.

Parameter Type
level_id text optional
rooms list optional
page text optional

Several pieces of furniture in one change: a list of add_furniture’s arguments (room_id, kind, description, size, material_id, position?, rotation_deg?, secondary_material_id?, furniture_id?). Stops at the first bad piece and adds none.

Parameter Type
items list of object required

Change the same fields on many elements in one change: the given ids, or every element of a kind (windows | doors | openings | walls | rooms | furniture | roofs | panels), optionally on one level. E.g. all window frames anthracite: kind=“windows”, fields={“frame_material”: “frame_anthracite”}.

Parameter Type
fields object required
ids list of text optional
kind text optional
level_id text optional

The house model’s fields (what write_model, update_element and the other tools accept): without part, the parts; with part (e.g. wall, opening, roof, room, level, furniture, material, stair, panel, house), that part’s fields with type, default and meaning.

Parameter Type
part text optional

Walls, roofs, stairs, furniture, materials, undo and redo.

Overview of the house: levels, rooms (id, name, area, floor/ceiling material, wall colours), furniture, and all materials. Call this first.

Full JSON of one element (wall, opening, room, furniture, roof, material …) plus context: for a wall, the room on each side; for a room, its walls and which side faces the room.

Parameter Type
element_id text required

Create or replace a material. base_color is hex ‘#rrggbb’. pattern: none | brick | tile | planks, with pattern_size [unit width, unit height] in metres (oak planks [1.2, 0.18], tiles [0.3, 0.3], bricks [0.24, 0.0715]); secondary_color varies the units; mortar_color/mortar_m is the joint.

Parameter Type
material_id text required
base_color text required
name text optional
roughness number optional
metallic number optional
pattern text optional
pattern_size list of number optional
secondary_color text optional
mortar_color text optional
mortar_m number optional

Apply a material to a room’s surface: ‘walls’ (every wall face that faces the room), ‘floor’ or ‘ceiling’.

Parameter Type
room_id text required
material_id text required
surface text optional

Set the material of one face of one wall. side: left | right | both, or a room id to pick the face that looks into that room (easiest when the user clicked a wall inside a room).

Parameter Type
wall_id text required
side text required
material_id text required

Add a piece of furniture to a room. kind: desk | table | chair | bed | sofa | wardrobe | shelf | cabinet | box. size = [width, depth, height] m (desk ~[1.4, 0.7, 0.75], bed [1.6, 2.0, 0.9], sofa [2.2, 0.9, 0.85], wardrobe [2.0, 0.6, 2.2]). position = [x, y] footprint centre in plan metres (e.g. the point the user clicked); omitted = room centre. rotation_deg: 0 = front faces -y (south), 90 = front faces +x (east), 180 = north, 270 = west. If omitted, the back is put to the nearest wall.

Parameter Type
room_id text required
kind text required
description text required
size list of number required
material_id text required
position list of number optional
rotation_deg number optional
secondary_material_id text optional
furniture_id text optional

Change fields of any element by id (furniture position/size/rotation/material, an opening’s width/height/sill_height, a room’s name, a wall’s height, a material’s colour …). A door’s “swing”: “flip” turns it to open the other way. Only the given fields change; the whole model is re-validated.

Parameter Type
element_id text required
fields object required

Remove a piece of furniture, an opening (door/window), or a wall/room/roof/panel by id.

Parameter Type
element_id text required

Add a roof over a rectangle. kind: gable | hip | shed | flat. outline = 4 plan corners [x, y] in order, overhangs included (~0.3-0.5 m past the walls). eave_z = height of the roof’s top at the eaves (wall top + a little). gable: ridge parallel to outline[0]->outline[1], given by pitch_deg (typical 30-50) or ridge_z (+ ridge_at, its distance from that side); eave_z2 / pitch2_deg for an asymmetric one. hip: pitch_deg (20-35) on all sides. shed: pitch_deg (3-15) rising from side 0-1, or eave_z2. flat: just eave_z (use material roof_flat). Walls below are trimmed to the roof, so gable walls can be taller.

Parameter Type
roof_id text required
kind text required
outline list of list of number required
eave_z number required
pitch_deg number optional
eave_z2 number optional
pitch2_deg number optional
ridge_z number optional
ridge_at number optional
material_id text optional
thickness number optional

One roof over the whole house, its outline taken from the walls: the usual way to roof a house, whatever its shape (rectangle, L, T, U; corners must be right angles). kind: hip (Walmdach, all sides slope) | gable (Satteldach, “double”: two slopes and gable walls at the wings’ ends) | shed (Pultdach, one slope) | flat. pitch_deg (hip 20-35, gable 30-50, shed 3-15) or ridge_z. overhang past the walls (0.3-0.8 m). level_id: the top level with walls (default). exclude_rooms: rooms under a roof of their own (a garage: then add_roof flat over it). cover_rooms: outdoor rooms under this roof (a covered terrace). gable_edges: which outline edges are gable ends (see the outline in the reply; default: the ends of the wings). shed_edge: the low side. eave_z: default from the wall tops. Gable walls are raised to meet the roof. To change it later: update_element, or remove and add again.

Parameter Type
roof_id text optional
kind text optional
pitch_deg number optional
ridge_z number optional
overhang number optional
level_id text optional
exclude_rooms list of text optional
cover_rooms list of text optional
only_rooms list of text optional
gable_edges list of integer optional
shed_edge integer optional
eave_z number optional
material_id text optional
thickness number optional

Add one wall: a garden wall, a stub, a parapet, a wall the extraction missed. start/end = plan points of its centre line [x, y]; height above the level floor (default: the level’s wall height); base > 0 lifts its bottom (infill above an opening). material_id paints both faces (set_wall_finish for one side). Rooms are refitted to the walls on the next model write.

Parameter Type
level_id text required
start list of number required
end list of number required
thickness number optional
height number optional
base number optional
material_id text optional
wall_id text optional

Add a square pillar (brick pier, column under a terrace roof or carport) centred at the plan point at = [x, y]; size = its side in metres; height above the level floor (default: up to the underside of the roof above, or the level’s wall height).

Parameter Type
level_id text required
at list of number required
size number optional
height number optional
material_id text optional
pillar_id text optional

A roof window: a hole in the roof at plan point at = [x, y] with glass in it, width across the slope and length up it (standard sizes 0.55x0.98, 0.78x0.98, 0.78x1.18, 1.14x1.18).

Parameter Type
roof_id text required
at list of number required
width number optional
length number optional
skylight_id text optional

A dormer (Gaube) in one step: its front wall with windows, the two side walls (cheeks), its own small roof, and the hole in the main roof under it. front = the two plan points [x, y] of the outside face of the dormer front, left and right as seen from outside (often on the outer wall line below); front_height = top of the front wall above level_id’s floor (the attic); kind shed (Schleppgaube, a wide flat dormer, default pitch 12) or gable (Giebelgaube, pitch ~40). The dormer runs back into roof_id until its roof meets it. Windows are spread evenly over the front; sill_height (above the floor) defaults to just above the main roof. The front takes the facade; the cheeks the main roof’s material unless cheek_material_id is given. The dormer is one element (its id): when roof_id changes it is rebuilt to fit; update_element(dormer_id, {“front_height”: …}) changes it, remove_element removes it whole.

Parameter Type
roof_id text required
level_id text required
front list of list of number required
front_height number optional
kind text optional
pitch_deg number optional
windows integer optional
window_width number optional
window_height number optional
sill_height number optional
cheek_material_id text optional
dormer_id text optional

The material of the whole outside of the house: every outside wall face without a finish of its own (gable walls and dormer fronts too), in one step. E.g. brick_red for red clinker, plaster_exterior for render, or a material from use_material / match_material. Single walls that differ: set_wall_finish.

Parameter Type
material_id text required

Steps from the garden up to an outside door, when the floor is above the ground (set_ground first). steps: number of risers (default: about 16 cm each); tread: depth of each step; width: default the door’s width + 0.4 m. Built as solid blocks in front of the door.

Parameter Type
door_id text required
steps integer optional
tread number optional
width number optional
material_id text optional
steps_id text optional

The garden’s height relative to the ground floor (0 = floor at garden level). A house whose floor is 3 steps up (about 0.45 m) has ground_elevation -0.45; then add_entrance_steps at its doors. Levels below the ground are basements.

Parameter Type
ground_elevation number required

The house’s notes (what was assumed, what is unsure, sources): mode replace (the whole list) or append.

Parameter Type
notes list of text required
mode text optional

Add a stair going up from a level by rise (to the next level’s floor). path = walking line (centre) bottom to top as plan points [x, y]; one point per corner (an L has 3 points, a U 4). It covers one going per riser and ends one going onto the upper floor, so its length should be about steps x 0.26 m. steps = number of risers (rise / 0.18). turn at corners: winders | landing. style: open | solid. railing: none | left | right | both (seen walking up). Then call fit_stair_well so the floor above gets its opening, and check_stair.

Parameter Type
level_id text required
stair_id text required
path list of list of number required
rise number required
steps integer required
width number optional
turn text optional
style text optional
railing text optional
tread_material_id text optional

Check a stair against the usual rules for homes: riser 14–21 cm, going 21–37 cm, 2·riser + going 59–65 cm, winders ≥ 10 cm at the narrow end, 2.00 m headroom under the floor above. Use after adding or changing a stair; fit_stair_well fixes headroom problems.

Parameter Type
stair_id text required

Cut the opening the floor above needs over a stair (where there would be less than headroom metres), replacing the old opening over that stair. Call after adding a stair or changing its path, width, rise or steps.

Parameter Type
stair_id text required
headroom number optional

Revert the last change (it can be redone).

Re-apply the last undone change.

Sizes the user tries with a slider in the Adjust tab.

Make a size adjustable with a slider in the Torins window, so the user can try values without asking you again. Do it when they ask for something adjustable (“make the table size adjustable”, “I want to try different window heights”), and offer it after a change they may want to fine-tune.

name: what the user sees, e.g. “Dining table width”. unit: “m”, “deg” or “” (a count). targets: the fields the slider moves, each {“element”: id, “field”: path, “scale”: 1}. The path is a field name with optional indices: “width”, “height”, “sill_height”, “size.0” (furniture width), “size.1” (depth), “position.0” (x), “position.1” (y), “start.0”, “polygon.2.1”, “pitch_deg”, “wall_height” (a level). Each field becomes offset + scale * value; the offset is worked out from the current model, so nothing moves when the parameter is made. Use scale 0.5 for something that should move half as far (a chair on one side of a table that grows on both sides), -0.5 for the other side, and 0 never. value: the parameter’s current value; by default the first target’s current field value (that target then needs scale 1). min, max: the slider’s range, around sensible real sizes.

Parameter Type
name text required
targets list of object required
min number required
max number required
unit text optional
step number optional
value number optional

Set a parameter (a slider in the Adjust tab) to a value: all its targets move along.

Parameter Type
parameter_id text required
value number required

Remove a slider from the Adjust tab. The model stays as it is.

Parameter Type
parameter_id text required

Floor plans, sections and elevations as the user exports them.

The technical drawings of the house: a floor plan per level by default (cut 1.0 m above the floor, with doors, windows, stairs, rooms with net areas, dimensions) and four elevations (each side seen from outside), plus kept copies. Parts the model marks as assumed or unsure are drawn dashed in orange. view_drawing shows one; add_drawing adds or changes a definition.

Look at a drawing (a plan from list_drawings, or a kept copy) as an image. Use it to check the model the way a plan reader would: wall joints, door swings, room areas, dimensions.

Parameter Type
drawing_id text required
max_size integer optional

Add or change a drawing. Give one of: - level_id: the floor plan of a level (cut 1.0 m above its floor); - facing N | E | S | W: the elevation of that side, seen from outside; - look N | E | S | W and at: a section, a vertical cut through the house; looking W or E the cut is the plane x = at, looking N or S the plane y = at (metres). name is its letter (A, B …); the cut line shows on the plans. title; scale auto | 50 | 100 | 200 (auto takes the largest that fits); paper A4 | A3, landscape. By default there is a plan per level, four elevations and section A across the main roof.

Parameter Type
level_id text optional
facing text optional
look text optional
at number optional
name text optional
title text optional
scale text optional
paper text optional

Freeze a copy of a drawing as it is now (e.g. “before the renovation”); it stays as it is when the model changes.

Parameter Type
drawing_id text required
title text optional

Real materials and furniture models from Poly Haven and ambientCG.

Find real (photo-scanned, CC0) materials by words: “oak floor”, “red brick”, “grey roof tiles”, “white plaster”, “terrazzo”. kind narrows it: wall | brick | roof | floor | tile | wood | fabric | stone | ground. The built-in ones come first (no download); the rest come from Poly Haven and ambientCG. Returns ids with their real size and a numbered picture of each; give the chosen id to use_material.

Parameter Type
query text required
kind text optional
limit integer optional

Find the real materials that look most like a surface in a photo: crop [x0, y0, x1, y1] (photo pixels, as view_photo shows them) is a patch of only that surface (brick, render, roof tiles, paving; no window, sky or shadow edge in it), query says what it is (“brick”, “white render”, “grey concrete roof tiles”). Up to 36 candidates (built in, Poly Haven, ambientCG) are compared by colour and pattern; returns the best with a picture (the photo patch first, then the matches, numbered) and the patch’s average colour: give the chosen id to use_material, with match_color set to that colour to take on the photo’s exact shade.

Parameter Type
photo text required
crop list of number required
query text required
kind text optional
limit integer optional

Add a real material to the house (or change one): texture is an id from search_materials (polyhaven:<id> or ambientcg:<id>). material_id names it in the house (default from the texture; an existing id, e.g. floor_oak, is changed in place, so everything using it changes); tint multiplies its colour (#ffffff = as scanned); scale_m overrides its real size (metres per repeat); roughness only for its flat fallback colour. match_color “#rrggbb” keeps the scanned surface but scales it to that average colour (a white render, a green lawn, plaster in a paint colour); empty = the scan’s own colours. Then paint_room / set_wall_finish / update_element(material=…) apply it.

Parameter Type
texture text required
material_id text optional
name text optional
tint text optional
scale_m number optional
roughness number optional
match_color text optional

Find real 3D furniture models (photo-scanned or modelled, CC0, from Poly Haven) by words: “armchair”, “wooden table”, “sofa”, “bed”, “bookshelf”, “lamp”, “plant”. Returns ids with their real size (w x d x h m) and a numbered picture of each; give the chosen id to use_model.

Parameter Type
query text required
limit integer optional

Show a piece of furniture (from add_furniture) as a real 3D model: model is an id from search_furniture. real_size=True sets the furniture’s size to the model’s real size (its place and turn stay); False squeezes the model into the furniture’s current size. model=“” goes back to the plain shape.

Parameter Type
furniture_id text required
model text required
real_size true/false optional