build_floor_plan
Convert floor plan coordinates into tagged 3D walls, door/window openings, and a floor slab in SketchUp, with materials and one undo step.
Instructions
Turn a floor plan into 3D walls, doors, windows and a floor slab, already tagged and given materials according to the house rules.
All numbers are METRES. Coordinates are [x, y] on the ground plane.
spec = {
"building": "Rumah A", # container group for the whole building
"name": "Lantai 1", # name of this floor's group
"wall_height": 3.0, # default height
"wall_thickness": 0.15, # default thickness
"base_z": 0, # floor level (use 3.2 etc. for upper floors)
"wall_ref": "center", # default for "ref" below
"walls": [ # from/to line of each wall, see "ref"
{"id": "W1", "from": [0, 0], "to": [6, 0]},
{"id": "W2", "from": [6, 0], "to": [6, 4], "thickness": 0.1, "height": 2.8}
],
"openings": [ # offset = distance from the wall's "from"
{"wall": "W1", "type": "door", "offset": 1.0, "width": 0.9, "height": 2.1},
{"wall": "W2", "type": "window", "offset": 1.2, "width": 1.5, "sill": 0.9, "height": 1.2}
],
"slab": {"outline": [[0, 0], [6, 0], [6, 4], [0, 4]], "thickness": 0.12}
}
An opening with no "sill" (or sill 0) is a door; with a sill it is a window.
Doors get a 4 cm leaf and windows a 1 cm glass pane ("infill": false for
plain holes). Walls and slab accept "material": "Dinding - Bata Ekspos".
"ref" on a wall says what its from/to line is: "center" (centreline,
the default), "left" or "right" (that face of the wall, as seen walking
from `from` to `to`; the wall body lies on the other side). Use the one
the plan is dimensioned to, or the error equals the wall thickness:
- outside dimensions of the building: trace the outline anticlockwise
with "ref": "right";
- clear (inside) dimensions of a room: trace the room anticlockwise
with "ref": "left";
- grid/axis dimensions: "center".
Where walls meet, their ends are lengthened or trimmed automatically so
corners close and walls do not overlap ("extend": false, a number, or
[start, end] in metres overrides that for one wall).
The whole plan is one undo step. The reply reports the built size and any
opening that was skipped (for example because it does not fit the wall):
read it, then call verify_dimensions and look at export_scene(format="png").
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| spec | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |