Overview
TheSlabNode represents a floor slab (floor surface) within a level. Slabs are defined by a polygon boundary in 2D space with an elevation value. They can also have holes cut out (e.g., for stairs or atriums).
Key features:
- Polygon-based floor definition
- Support for holes (voids in the floor)
- Configurable elevation for multi-level floors
Type Signature
/home/daytona/workspace/source/packages/core/src/schema/nodes/slab.ts
Fields
Inherited from BaseNode
Unique slab identifier.Format:
slab_{randomString}Example: "slab_a1b2c3d4e5f6g7h8"Always set to
"slab".Default: "slab"Optional name for the slab.Example:
"Main Floor", "Living Room Floor"Reference to the parent level’s ID.Example:
"level_abc123"Default: nullControls slab visibility.Default:
trueOptional camera viewpoint for the slab.
Custom metadata for the slab.Default:
{}Slab-Specific Fields
Array of 2D points defining the slab boundary.Format: Array of The polygon should be closed (the renderer will automatically connect the last point to the first). Points are defined in the level coordinate system.
[x, z] coordinates in metersExample:Array of polygons defining holes (voids) in the slab.Default: Holes are used for features like:
[]Format: Array of polygons, where each polygon is an array of [x, z] coordinatesExample:- Stairwells
- Elevator shafts
- Atriums
- Floor openings
Elevation of the slab surface in meters.Default:
0.05 (5cm above level datum)Example: 0.0 (at level datum), 0.1 (10cm raised floor)The elevation is relative to the level’s base elevation. Use this for:- Slightly raised finished floors
- Stepped floor sections
- Platform areas
Example
Usage
Creating a Simple Rectangular Slab
Creating an L-Shaped Slab
Creating a Slab with a Hole
Creating a Slab with Multiple Holes
Raised Platform Area
Slab Geometry
The slab is rendered as a flat surface:- Shape: Defined by the polygon boundary
- Voids: Defined by the holes array
- Vertical position: Determined by level elevation + slab elevation
Coordinate System
Slabs use 2D coordinates in the level’s XZ plane:- X axis: horizontal (left-right)
- Z axis: horizontal (front-back)
- Y axis: vertical (determined by level elevation + slab elevation)
Use Cases
- Floor surfaces for rooms and spaces
- Platform areas with different elevations
- Outdoor terraces and balconies
- Multi-level floors with steps
- Complex floor plans with cutouts for stairs, elevators, or atriums