BaseStair
TheBaseStair class represents a staircase element in OpenPlans. It extends THREE.Group and provides functionality for creating customizable staircases with various types, including straight, L-shaped, U-shaped, spiral, and winder configurations.
Constructor
Optional configuration object for the staircase. If not provided, default values will be used.
Properties
The element type identifier. Always set to
ElementType.STAIR.The current configuration of the staircase including dimensions, step counts, and materials.
Map containing sub-elements of the staircase (steps, landing).
Indicates whether the staircase is currently selected.
Indicates whether the staircase is in edit mode.
Getters & Setters
The display name of the staircase element.
The 3D position of the staircase in the scene as [x, y, z].
The width of the staircase in meters.
The total vertical rise of the staircase in meters.
The desired height of each step (rise) in meters. Actual height is calculated to distribute evenly.
The depth of each step (run) in meters.
The hexadecimal color value for the staircase.
The material type of the staircase (e.g., ‘wood’, ‘concrete’, ‘steel’).
Methods
setOPConfig
New configuration object for the staircase.
getOPConfig
OPStair - The current staircase configuration object.
setOPGeometry
setOPMaterial
showProfileView
True to show profile view (outline only), false to show normal view.
dispose
OPStair
The configuration interface for staircase elements.Properties
Unique identifier for the staircase element.
Display name for the staircase.
Element type identifier.
Type of staircase (STRAIGHT, LSHAPED, USHAPED, SPIRAL, WINDER).
Dimensions configuration for the staircase.
3D position of the staircase as [x, y, z].
Desired height of each step (rise) in meters. Standard is ~0.17m (17cm).
Depth of each step (run) in meters. Standard is ~0.28m (28cm).
Total number of steps. Calculated automatically based on totalHeight and riserHeight.
Hexadecimal color value for the staircase (e.g., 0x8B7355 for wood brown).
Material type of the staircase (e.g., ‘wood’, ‘concrete’, ‘steel’).
Array of 4 corner coordinate points defining the staircase footprint. Calculated automatically.
StairType
Enum defining available staircase types:STRAIGHT- Straight run staircaseLSHAPED- L-shaped staircase with landingUSHAPED- U-shaped staircase with landingSPIRAL- Spiral staircaseWINDER- Winder staircase with wedge-shaped steps
Example
Building Code Notes
- Standard riser height: 17-18cm (0.17-0.18m) for residential buildings
- Standard tread depth: 25-30cm (0.25-0.30m) for comfortable stairs
- Minimum width: 90cm (0.9m) for residential, 120cm (1.2m) for commercial
- Rule of thumb: Riser (cm) + Tread (cm) should equal 45-48cm for comfort
BaseStair class automatically calculates the number of steps based on the total height and desired riser height, ensuring even distribution across all steps.