Skip to main content
It also draws the plan symbol.

Import

Example

Notes

  • Dimensions are in metres. origin is [x, z]. rotation is in degrees.
  • Floorkit calculates the number of risers from the rise. Read actualRiserHeight for the result.
  • Layout warnings tell you about steps that are not comfortable. They are not a building-code approval.
  • attachRailing makes a live railing follow the live stair. A saved railing follows its stair through host (see Railing).
  • toDrawing('top', { cutElevation }) draws the plan symbol against a world cut height: each primitive has style.edgeClass PlanBelow or PlanAbove by its own top, the break line is PlanCut, and the word UP sits before the start circle, clear of the treads. Without cutElevation the primitives have no state and the break line is at 60 % of the first flight.
  • toReachingDrawing({ storeyElevation, worldCutY, cutHeightAboveStorey }) draws the part of the stair that the plan of the storey above shows: the treads, landings and walking line above the stair’s own cut, the break line and DN past the top of the walking line. It is empty unless the stair reaches that storey.
  • 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.
Inheritance: 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”.
number
number
number
number
WINDER only: risers of the straight flight before the winders. Absent: half of the rest, rounded up.
180 | 90
WINDER only: how far the winders turn. Absent: 90.
boolean
true: the last riser climbs to the arrival floor and no top tread is drawn.
number
U_SHAPE only: the clear gap between the two flights (m). Absent: 0.05.
boolean
Draw the conventional break line in plan.
Pick<{ aboveCut?: "dashed" | "continuous" | "hidden"; breakLine?: "single" | "double" | "none" | "straight"; breakAngleDeg?: number; walkline?: boolean; startMark?: boolean; arrow?: boolean; words?: { up: string; down: string; } | "none"; upperArrow?: "down" | "up"; upperFlights?: "above-cut" | "whole"; upperExtent?: "stair" | "opening"; }, "aboveCut" | "walkline" | "startMark" | "arrow" | "words">
The parts of this stair’s plan symbol that draw whatever the plan view sets. Each absent field keeps the view’s setting.
number
Height in metres above the stair base at which a plan with a cut cuts this stair’s symbol, in place of the plan’s own cut. Absent: the plan’s cut.
number
Depth of the structure in metres, square to the pitch line under the nosings. With it, each flight builds as treads on a sloped waist and each landing as a slab flush with it. Absent (and no treadThickness or solid): a waist 0.15 m under the throat of the steps, at most the total rise, so the space under the stair is open.
number
Thickness of the boards of a timber stair in metres, less than the riser height. With it, each step builds as a tread board under its walking surface and a riser board behind its front edge, and each landing as a board, with nothing under them. Absent: structureDepth decides.
boolean
true builds the stair as a solid mass from each tread and landing down to the stair base, as a stair cast on the ground. Ignored when structureDepth or treadThickness is set. Absent or false: a waist (see structureDepth).
[left: number, right: number]
Solid stair’s left and right foot heights in metres from the nominal stair base.
Partial<Record<"structure" | "tread" | "riser" | "landing" | "support", StairMaterialFinish>>
Resolved part finishes. The compiler fills the colour from the project material table.
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

Self-describing editable surface; a host inspector renders this generically.

getPhysicalParts

Borrow actual material parts; descriptors contain no seeds, cutters or symbols.

move

Translate this element by delta (world-space, meters).

rotate

Rotate this element by angleDeg around axis (default Y-up), pivoted at anchor (default the element’s own centroid).

getRailingPath

Rail base path along one side of the stair: flight start → flight top at the step-walking-surface heights, then level AROUND the landing — never diagonally across it.

attachRailing

Host a railing on this stair: derives its base path from the flight nosings on the chosen side and re-derives it on every stair rebuild (subscribes onStairUpdated — the wall attachDoor re-bind pattern).

detachRailing

Unhost a railing: stops syncing its path (the path itself is kept).

getHostedRailings

Railings currently hosted on this stair.

materialOfPart

The authored material carried by a physical part, including its structure fallback.

setOPGeometry

waistStepBodies

One vertical column per step of a straight flight on a waist, from the lowest point of the soffit under the step up to its tread: the steps of the flight part, for checks the kernel cannot run on the whole flight body (an intersection with a slab that has arc edges, say).

getExportRoots

Vector-export roots (RFC §7).

planWalk

The plan path of the walkline, base to top, in world plan coordinates, whether or not the symbol draws it.

toReachingDrawing

The part of this stair that the plan of the storey above draws: the treads, landings and walkline above the stair’s own plan cut, the break line at that cut, and the arrow and DN as the symbol’s upperArrow says (by default the start circle and DN at the top and the arrow pointing down the flight).

toDrawing

Plan symbol as standardized primitives, emitted parametrically from the solved layout: flight/landing regions, nosing lines, the walkline with its arrowhead, the break line and UP before the start circle.

setOPMaterial

getEditAnchors

Draggable handles for a parametric stair: the plan origin (free on the floor plane), an elevation grip (vertical) in the middle of the first flight, clear of the start point, and width, going and landing grips that slide across or along the first flight.

applyEditAnchor

getOPConfig

setOPConfig

beginEdit

Start one live edit; a second beginEdit before endEdit keeps the first start.

endEdit

End the live edit; its exact undo and redo, or undefined when no option changed.

dispose

computeStairLayout

Solve the riser count and lay out flights/landings for the requested configuration.

defaultStructureDepth

The structure depth of a stair that sets none (and no treadThickness or solid): its waist reaches DEFAULT_STAIR_WAIST under the throat of its steps (the inner corner of a step, square to the pitch line), so the soffit always passes under every step, and it is never more than the total rise.

stairRuleBreaches

The limits of its rules that a saved, valid stair breaks, measured as the build lays it out: the solved riser, the going, 2R + G and the pitch.

STAIR_RULE_SETS

Published stair rules to save as a stair’s rules.

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
Nosing to nosing: treadDepth, or on a radial layout the chord of a step on its walkline.
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

PhysicalPartRole

Semantic part identity is recorded when physical geometry is constructed.

StairReachInputs

The plan of another storey that a stair is asked to reach; see Stair.toReachingDrawing.
number
required
Elevation of the storey of the plan.
number
required
World Y of the plan’s cut.
number
required
Height of the plan’s cut above its storey; the stair’s own plan cuts at the same height.
number
Elevation of the stair’s own storey. The stair base when omitted.
StairPlanSymbol
How the parts of the symbol draw.
(points: { x: number; y: number; }[]) => { x: number; y: number; }[]
Cuts the walk of the symbol, lowest point first, where the floor of the plan covers it.

StairPlanDrawingOptions

View-only options; never change the saved stair dimensions or solids.
number
Finite world Y of the plan cut.
{ aboveCut?: 'dashed' | 'continuous' | 'hidden'; breakLine?: 'single' | 'double' | 'none' | 'straight'; breakAngleDeg?: number; walkline?: boolean; startMark?: boolean; arrow?: boolean; words?: { up: string; down: string; } | 'none'; upperArrow?: 'down' | 'up'; upperFlights?: 'above-cut' | 'whole'; upperExtent?: 'stair' | 'opening'; }
The parts of the symbol a plan view draws. Each absent field keeps today’s symbol: the flight above the cut dashed, a single break line, the walkline, the start circle, the arrow and the words UP and DN.

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. A riserHeight above a saved cap warns against the stair’s own cap.
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.
number
number
number
number
WINDER: risers of the straight flight before the winders, 0 to the risers left after the winders. Defaults to half of those, rounded up. L and U: risers of the first flight up to and including the landing, 1 to one less than all the risers, so the second flight climbs the rest. Defaults to half of all the risers, rounded up.
90 | 180
WINDER: how far the winders turn, 90 or 180 degrees. Defaults to 90.
number
U: clear gap between the two flights (m), 0 or more. Defaults to 0.05.
boolean
true: the last riser climbs to the arrival floor, so the final flight has one tread fewer than its risers and ends at the floor’s edge (Revit’s End with Riser). Absent or false: the final flight’s top tread is drawn at the arrival level.

StairRuleBreach

One limit a stair breaks: what it measures and the limit it passes.
StairRuleLimit
required
number
required
Rise and going in metres, the step (2R + G) in metres, the pitch in degrees.
number
required
string
required

StairFinishes

The package does not export this type by name.

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 for the final flight risers, its top tread at the arrival level, or risers − 1 when the stair ends with a riser).
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; path?: PointXZ[]; }
required
Walkline along the flight centerline, base → top.
PointXZ
The centre of a flight that turns about one point (FAN, CURVED, SPIRAL): its inner and outer edges and its walkline are arcs about it, so a plan draws them as arcs. Absent for a flight of straight edges.

StairLanding

StairRect
required
number
required
{ start: PointXZ; end: PointXZ; }
required
Walkline across the landing connecting the adjoining flights.

StairPlanSymbol

The package does not export this type by name.

StairRuleLimit

StairMaterialFinish

The material and optional RGB override on an individual stair part. The package does not export this type by name.

StairStep

StairRect
required
Plan rectangle of the tread.
number
required
Elevation of the tread’s walking surface above the stair base.
PointXZ[]

StairRect

Axis-aligned-in-local-space plan rectangle, CCW [corner, +run, +run+across, +across].
Last modified on December 4, 2026