slabSockets(top: number) → void
A cell-sized slab's sockets: its four top edges, its top centre (four ways
round), its four top corners.
| arg | type | description |
|---|
| top | number | |
wallSockets(h: number, t: number, opts: any?) → void
A wall-like panel's sockets: its top (both sides), its two ends, its two faces.
| arg | type | description |
|---|
| h | number | |
| t | number | |
| opts | any? | |
wallPlugs(side: string?) → void
A wall-like panel's plugs: onto a slab edge, onto another wall's top, beside another wall.
| arg | type | description |
|---|
| side | string? | |
slabPlugs(top: number) → void
A cell-sized slab's plugs: beside another slab at the same top, resting on a wall top.
| arg | type | description |
|---|
| top | number | |
onFloorPlugs( ) → void
"Sits on a slab": centred on a floor top, turned four ways.
corners(w: number, d: number, y: number?) → void
| arg | type | description |
|---|
| w | number | |
| d | number | |
| y | number? | |
slabSupport(w: number, d: number) → void
Slabs resting on walls: the corners and the middle of each edge, since a
wall's ends stop short of the slab's corners.
| arg | type | description |
|---|
| w | number | |
| d | number | |
norm(s: string) → string
| arg | type | description |
|---|
| s | string | |
pick(list: { any }, name: string?, what: string) → string
| arg | type | description |
|---|
| list | { any } | |
| name | string? | |
| what | string | |
ghostId(name: string?) → string return pick
| arg | type | description |
|---|
| name | string? | |
menuId(name: string?) → string return pick
| arg | type | description |
|---|
| name | string? | |
snapId(name: string?) → string
| arg | type | description |
|---|
| name | string? | |
styleId(name: string?) → string
| arg | type | description |
|---|
| name | string? | |
kind(id: string) → Kind
| arg | type | description |
|---|
| id | string | |
style(id: string) → any
| arg | type | description |
|---|
| id | string | |
cost(kindId: string, styleId: string?) → void
What one piece costs in one style: { coins = 15 } scaled by the style.
| arg | type | description |
|---|
| kindId | string | |
| styleId | string? | |
refund(kindId: string, styleId: string?, rate: number) → void
What taking a piece down gives back: `rate` of its cost, rounded down.
| arg | type | description |
|---|
| kindId | string | |
| styleId | string? | |
| rate | number | |
validVec(v: any, n: number?) → boolean
| arg | type | description |
|---|
| v | any | |
| n | number? | |
definePiece(id: string, def: any) → Kind
Add (or replace) a piece kind. Missing fields get sensible values: one box
the size of the piece, support at its footprint corners, slab sockets for
floors, wall plugs for walls, and so on.
| arg | type | description |
|---|
| id | string | |
| def | any | |
defineStyle(id: string, def: any) → any
Add (or replace) a style. `flavor` is "timber" or "panel" (how shapes are
built), or a style id to borrow shapes from; `materials` maps roles to a
material identity or { color = {r,g,b}, rough, metal, glow, alpha };
a role a style leaves out is borrowed from `base` (default "rustic").
| arg | type | description |
|---|
| id | string | |
| def | any | |
defineGhost(id: string, def: any) → any
| arg | type | description |
|---|
| id | string | |
| def | any | |
catalogue( ) → void
Everything as one list of { kind, setting, id, name, description, tags }:
pieces, styles, ghost looks, menus and snap modes.
⌬ Types
Vec = { number }Box = { c: Vec, s: Vec, pitch: number?, roll: number?, yaw: number?, moving: boolean? }Socket = { tag: string, p: Vec, yaw: number }Plug = { tag: string, p: Vec, yaw: number }Kind = {