BaseSlab
TheBaseSlab class represents a horizontal concrete or floor slab element. It extends the Cuboid class and provides functionality for creating customizable floor slabs with various materials and dimensions.
Constructor
Optional configuration object for the slab. If not provided, default values will be used.
Properties
The element type identifier. Always set to
ElementType.SLAB.The current configuration of the slab including dimensions, color, and material.
Map containing sub-elements of the slab (body, finish, reinforcement).
Indicates whether the slab is currently selected.
Indicates whether the slab is in edit mode.
Getters & Setters
The display name of the slab element.
The 3D position of the slab in the scene as [x, y, z].
The width of the slab in meters (X-axis).
The length of the slab in meters (Z-axis).
The thickness of the slab in meters (Y-axis).
The hexadecimal color value for the slab.
The material type of the slab (e.g., ‘concrete’, ‘wood’).
Methods
setOPConfig
New configuration object for the slab.
getOPConfig
OPSlab - The current slab configuration object.
setOPGeometry
setOPMaterial
showProfileView
True to show profile view (outline only), false to show normal view.
dispose
OPSlab
The configuration interface for slab elements.Properties
Unique identifier for the slab element.
Display name for the slab.
Element type identifier.
Dimensions configuration for the slab.
3D position of the slab as [x, y, z].
Thickness of the slab in meters.
Hexadecimal color value for the slab (e.g., 0xCCCCCC for gray).
Material type of the slab (e.g., ‘concrete’, ‘wood’, ‘steel’).
Array of 4 corner coordinate points defining the slab geometry. Calculated automatically.
Example
Notes
- The slab is positioned with its top surface at the Y position specified in
slabPosition - The slab extends downward by its thickness value
- Coordinates are automatically calculated based on the dimensions and represent the four corners
- The default color (0xCCCCCC) represents a typical concrete gray color