Build your own house: walls, windows, doors, floors, roof, stairs, furniture
Deploy web Studio / deploy (push) Successful in 3m27s
Deploy web Studio / deploy (push) Successful in 3m27s
House parts (stdlib isokit/house): house_wall drawn along a line, with ends that adapt at corners, T-junctions and straight runs so no two walls overlap; window and door that sit on a wall and cut its opening (door styles panel, glass, double, sliding, opening; swing and hinge by rotation); floor (boards, tiles, carpet, stone); roof (hip, gable, flat, optional solar); stairs. Furniture (stdlib isokit/furniture): chair, sofa / armchair, table with chairs, desk with monitor and chair, TV, bed, cupboard, bookshelf, kitchen run, bathtub, shower, toilet, washbasin, plant, rug, floor lamp. Cut-open levels: on gf / 1f the walls in front of a room are cut low (rooms are found by their floors), the roof becomes an outline on the floor, and storeys above are left out. A part's storey comes from z (storey_h, default 3 m). Scripting: objects_of, objects_at, objects_on, mount_of, mounted, frame, to_world, to_local, local_of. Prefab meta: shape (line / rect), mount, storey. Studio: drag to draw lines and rectangles (walls, roads, fences, hedges, floors, areas, buildings, roofs). The Room tool draws a floor plus walls, without doubling walls that already stand on an edge. Windows and doors snap onto walls with a hover preview, and they move, turn, copy and delete with their wall in one undo step. New parts land on the storey the view shows. Palette categories collapse, and the palette scrolls apart from the object list. The MCP instructions explain house building, and list_prefabs shows sits_on. examples/house is a furnished bungalow; the web Studio gets a House demo button. Tests: wall corners and junctions, zero depth-sort cycles in every view, cut levels, and the house demo in every view; check_studio covers the room / window / door / storey flow, check_web the House demo.
This commit is contained in:
1 parent
84309a7a08
commit
95ea4a8512
26 files changed
+2137
-64
No files matched your search
+44
-2
@@ -27,6 +27,12 @@ fn prefab_kiosk(o) { // draw around (0, 0) in the object's own
|
||||
- Property types: `float`, `int`, `bool`, `choice` (with `choices`),
|
||||
`material` (a theme material, optionally with `choices`), `text`.
|
||||
Write `def:` for the default (`default` is a reserved word in Rhai).
|
||||
- How the Studio places it: `shape: "line"` (drag along the map: sets `rot`
|
||||
and the length prop `w`), `shape: "rect"` (drag a rectangle: sets `w` and
|
||||
`d`), default a click. `mount: ["house_wall"]`: the prefab sits on objects of
|
||||
those types; the Studio snaps it onto the nearest one and moves, turns,
|
||||
copies and deletes it with its host. `storey: true`: placed on the storey the
|
||||
view shows (level `1f` puts it at z = 1 × `storey_h`).
|
||||
- `o` holds `id, type, name, x, y, z, rot, p` (the props with defaults
|
||||
filled in), `pts`, `tag`, `info`, `level`.
|
||||
- The engine sets the object's frame before calling the prefab. All
|
||||
@@ -51,7 +57,14 @@ shaded automatically by face direction.
|
||||
| `tag(x, y, z, text[, prio[, id[, kind]]])` | label; `kind` "signtag" / "warntag" always shows |
|
||||
| `info(id, name[, detail])`, `info(id, #{name, detail, rows: [[k, v], …]})` | tooltip |
|
||||
| `focus(x, y, z)`, `bounds(x0, y0, x1, y1[, depth])`, `defs(svg)`, `warn(msg)` | framing and extras |
|
||||
| `level()`, `rot()`, `cfg()`, `cfg(name)`, `objects()` | inputs |
|
||||
| `level()`, `rot()`, `cfg()`, `cfg(name)`, `objects()` | inputs (`objects()`: every document object, props resolved) |
|
||||
| `objects_of(types)` | objects of a type or a list of types shown on this level |
|
||||
| `objects_at(types, x, y)` | … whose footprint (`p.w` × `p.d` around the origin) holds the world point |
|
||||
| `objects_on(types, x, y, tol)` | … whose centre line (local x, length `p.w`) passes within `p.t / 2 + tol` of the point, with `u, v` = the point in their frame |
|
||||
| `mount_of(o, hosts[, tol])` | the host o sits on (nearest centre line within `p.t / 2 + tol`, default 0.3 m, same height), with `u, v` = o's position in the host's frame; `()` if none |
|
||||
| `mounted(h, types, hosts[, tol])` | the objects of `types` whose host is h, each with `u, v` |
|
||||
| `frame(o)`, `frame(x, y, z, rot)` | draw in another frame from here on (a window draws in its wall's frame) |
|
||||
| `to_world(x, y)`, `to_local(x, y)`, `local_of(o, x, y)` | between the current frame (or o's) and world plan coordinates |
|
||||
| `vis(nx, ny)` | is a face with that outward normal turned to the viewer? |
|
||||
| `dv(dx, dy, dz)` | screen vector of a world vector (CSS motion) |
|
||||
| `along_x()` | should a mover run along x in this rotation? |
|
||||
@@ -81,7 +94,36 @@ shaded automatically by face direction.
|
||||
|
||||
Library helpers (`stdlib/*.rhai`): `s.tree_at(x, y, r)`, `s.car(x0, y0, x1, y1, cls)`,
|
||||
`s.drive(dx, dy, dur, delay)` … `s.end()`, `cut_walls(...)`, `win_list(...)`,
|
||||
`floor_of(level)`, `building_windows`, `gable_roof`, `flat_roof_kit`.
|
||||
`floor_of(level)`, `building_windows`, `gable_roof`, `flat_roof_kit`; for house
|
||||
parts (`stdlib/house.rhai`, `stdlib/furniture.rhai`): `storey_of(z)`,
|
||||
`house_view(o)` (0 closed, 1 on the storey cut open, 2 above it: leave out),
|
||||
`wall_top(w)`, `opening_at(o)`, `s.slab(a, b, th, z0, z1, mat)`,
|
||||
`s.chair_at(x, y, bx, by, mat)`, `s.office_chair(x, y, mat)`.
|
||||
|
||||
## House parts
|
||||
|
||||
`house_wall`, `window`, `door`, `floor`, `roof`, `stairs` and the furniture
|
||||
prefabs work together through the document, not through a parent object:
|
||||
|
||||
- A window or door at a point on a wall's centre line (within the wall's half
|
||||
thickness + 0.3 m, same height) sits on that wall (`mount_of`). The wall
|
||||
leaves a gap for it (`mounted`), the window draws the opening in the wall's
|
||||
frame with the wall's height, thickness and material. On no wall it stands
|
||||
alone as a short wall piece. Its rotation relative to the wall picks a
|
||||
door's swing side (0, 90: towards the wall's +y side) and hinge (0, 180:
|
||||
at the low end).
|
||||
- Wall ends adapt to the walls they meet, so no two walls overlap (the depth
|
||||
sort needs them apart): along a line two walls just meet, at a T the stem
|
||||
stops at the other wall's face, at a corner the wall along world x runs
|
||||
through and the other stops at it.
|
||||
- A part's storey is `floor((z + 0.5) / storey_h)` (`storey_h`: project
|
||||
parameter, default 3 m). On level `gf` (`1f`, …) the parts on that storey
|
||||
are cut open: a wall stays full height only when a floor lies on the
|
||||
viewer's side of it and none behind it (it is a back wall), all others are
|
||||
cut to 1 m. Roofs on that storey become an outline on the floor, parts on
|
||||
storeys above are left out, the storeys below stay closed.
|
||||
- Ground-level floors and rugs go to the `floor` layer; upper floors are slabs
|
||||
whose top is at the object's z. Furniture starts 0.02 m above its z.
|
||||
|
||||
## Rules that keep the depth sort right
|
||||
|
||||
|
||||
Reference in new issue
Block a user