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 live railing follow the live stair. A saved railing follows its stair throughhost(seeRailing).toDrawing('top', { cutElevation })draws the plan symbol against a world cut height: each primitive hasstyle.edgeClassPlanBeloworPlanAboveby its own top, the break line isPlanCut, and the wordUPsits before the start circle, clear of the treads. WithoutcutElevationthe 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 andDNpast 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.
extends OPElement implements IShape, IPlaceable, PlanVectorExportable
Constructor
Optional target riser height (m); the solver auto-counts equal risers at or below
min(riserHeight, maxRiserHeight).WINDER only: risers of the straight flight before the winders. Absent: half of the rest, rounded
up.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.
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.
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.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.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).Solid stair’s left and right foot heights in metres from the nominal stair base.
Resolved part finishes. The compiler fills the colour from the project material table.
Properties
Fires after every geometry rebuild — hosted railings re-derive their paths from it (mirrors
onWallGeometryChanged/onOpeningUpdated).Read-only. Industry-rule warnings from the last layout solve (riser cap, tread minimum, 2R+T
comfort). Empty when the stair is code-friendly.
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
materialOfPart
setOPGeometry
waistStepBodies
flight part, for checks the kernel cannot run on the whole flight body (an intersection with a slab that has arc edges, say).
getExportRoots
planWalk
toReachingDrawing
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
UP before the start circle.
setOPMaterial
getEditAnchors
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
beginEdit before endEdit keeps the first start.
endEdit
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 notreadThickness 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 itsrules 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’srules.
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
Nosing to nosing:
treadDepth, or on a radial layout the chord of a step on its walkline.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.Height of the plan’s cut above its storey; the stair’s own plan cuts at the same height.
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.{
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
Target riser height (m); the solver picks the count whose equal risers come closest below this.
Defaults to 0.178.
Hard riser cap (m). Defaults to 0.19. A
riserHeight above a saved cap warns against the stair’s
own cap.L/U turn direction, viewed from above walking up: “left” turns toward −Z, “right” toward +Z.
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.
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.StairFinishes
The package does not export this type by name.StairFlight
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).Walkline along the flight centerline, base → top.
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
Walkline across the landing connecting the adjoining flights.