Import
Example
Notes
- Dimensions are in metres.
originis[x, z].rotationis in degrees. - Floorkit calculates the number of risers from the rise. Read
actualRiserHeightfor the result. - Layout warnings tell you about steps that are not comfortable. They are not a building-code approval.
attachRailingmakes a railing follow the stair.- Start the geometry kernel before you create this object. See
Floorkit. - This object is live geometry. To save a building, write it in a building model.
extends OPElement implements IShape, IPlaceable, PlanVectorExportable
Constructor
string
string
ElementType.STAIR
StairLayout
Point2
Plan position of the first flight’s walkline start: [x, z].
number
Plan rotation in degrees about
origin (CCW viewed from above).number
World Y of the stair base.
number
Flight width (m).
number
Level-to-level rise (m).
number
Tread depth / going (m); clamped to ≥ 0.1, warned below 0.25.
number
Optional target riser height (m); the solver auto-counts equal risers at or below
min(riserHeight, maxRiserHeight).number
Hard riser cap (m).
number
Landing depth (m), clamped to ≥ width (L/U layouts).
StairTurnDirection
L/U turn direction walking up: “left” or “right”.
boolean
Draw the conventional break line in plan.
number
PropertySets
Properties
ElementType
string
Map<string, OPGeometry>
Map<string, OPGeometry>
boolean
boolean
boolean
Event<null>
Fires after every geometry rebuild — hosted railings re-derive their paths from it (mirrors
onWallGeometryChanged/onOpeningUpdated).StairOptions
string
StairLayout
StairTurnDirection
number
number
number
number
number
number
boolean
number
number
Read-only. Solved riser count. Computed, read-only.
number
Read-only. Solved equal riser height (m). Computed, read-only.
number
Read-only. Total walkline length in plan (m). Computed, read-only.
string[]
Read-only. Industry-rule warnings from the last layout solve (riser cap, tread minimum, 2R+T
comfort). Empty when the stair is code-friendly.
StairLayoutResult
Read-only. The solved flight/landing layout in stair-local coordinates.
boolean
boolean
boolean
Methods
editableSchema
getPhysicalParts
move
delta (world-space, meters).
rotate
angleDeg around axis (default Y-up), pivoted at anchor (default the element’s own centroid).
getRailingPath
attachRailing
onStairUpdated — the wall attachDoor re-bind pattern).
detachRailing
getHostedRailings
setOPGeometry
getExportRoots
toDrawing
setOPMaterial
getEditAnchors
origin (free on the floor plane), an elevation grip (vertical), and width, going and landing grips that slide across or along the first flight.
applyEditAnchor
getOPConfig
setOPConfig
beginEdit
beginEdit before endEdit keeps the first start.
endEdit
dispose
computeStairLayout
Solve the riser count and lay out flights/landings for the requested configuration.Types
StairOptions
StairLayout
Pure stair layout solver — riser math and flight/landing plan rectangles in stair-local coordinates, separated from the element class so the industry rules are unit-testable without the WASM kernel.StairTurnDirection
StairLayoutResult
number
required
number
required
number
required
Total tread rectangles across all flights.
number
required
Total walkline length in plan (flights + landings).
number
required
Clamped landing square side,
max(landingDepth, width). 0 for STRAIGHT.StairFlight[]
required
StairLanding[]
required
string[]
required
StairPlanDrawingOptions
View-only options; never change the saved stair dimensions or solids.number
Finite world Y of the plan cut.
StairLayoutInput
StairLayout
required
number
required
Flight width (m).
number
required
Level-to-level rise (m).
number
required
Tread depth / going (m).
number
Target riser height (m); the solver picks the count whose equal risers come closest below this.
Defaults to 0.178.
number
Hard riser cap (m). Defaults to 0.19.
number
Landing depth (m), clamped to ≥ width (L/U layouts).
StairTurnDirection
L/U turn direction, viewed from above walking up: “left” turns toward −Z, “right” toward +Z.
StairFlight
number
required
Risers this flight climbs (its tread count is
risers − 1 when it ends at a landing — the landing
is the arrival surface — and risers for the final flight, whose top tread represents the arrival
level).number
required
Elevation of the flight’s first tread’s base above the stair base.
PointXZ
required
Unit run direction in local XZ.
StairStep[]
required
{
start: PointXZ;
end: PointXZ;
}
required
Walkline along the flight centerline, base → top.
StairLanding
StairRect
required
number
required
{
start: PointXZ;
end: PointXZ;
}
required
Walkline across the landing connecting the adjoining flights.
StairStep
StairRect
required
Plan rectangle of the tread.
number
required
Elevation of the tread’s walking surface above the stair base.