Skip to main content
The path can slope, so a railing can follow a stair.

Import

Example

Notes

  • All dimensions are in metres. The rail height is measured above the path.
  • Stair.attachRailing makes this live railing follow a live stair. Detach the railing before you dispose it. A saved railing follows its stair only through host (see below).
  • balusterSpacing sets the distance between balusters. The clear gap also depends on the baluster size.
  • The default sizes are not a safety-code check.
  • When you replace topRail, give its width and its height.
  • 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.

Saved railings

In a building model, a railing is an entry in the railings list of a storey (BmRailing). It has a path or a host, not both.
  • path is a list of [x, y, z] points in world coordinates. Each y is the base of the rail, so a path can climb. A railing with a path keeps that path: it does not follow a stair when the stair changes.
  • host names a stair of the same storey: { stairId, side, inset }. side is 'left' or 'right' when you walk up. inset is the distance in metres from the side of the flight to the rail. The build makes the path from the stair, so a move, a reshape or a new layout of the stair moves the railing in the same step.
  • A stair that hosts a railing cannot be removed alone. Delete in an editor removes the stair and its railings in one step.

Balusters and top rail

A saved railing can set balusterSpacing (default 0.11 m), balusterSize (default 0.02 m) and topRail ({ width, height }, default 0.06 ร— 0.04 m). The build uses them; a file without them builds the defaults.
  • balusterSpacing must be 0.02 m or more and balusterSize 0.005 m or more. A smaller value, 0 or a value that is not a number is refused with its path and the value.

Draw a railing

In a plan editor, startRailingDrawing draws a railing by clicks, as the wall tool does, and saves it as one undo step. Enter or a double click ends the railing when it has two points or more. Backspace removes the last point. Escape saves nothing. The path is at the storey elevation plus baseOffset (default 0).
Inheritance: extends OPElement implements IShape, IPlaceable, PlanVectorExportable

Constructor

string
string
ElementType.RAILING
Vec3[]
Rail base path (world coordinates). Segments may slope โ€” a stair-hosted railing follows the flight nosings. The top rail runs height above this path; balusters drop from the rail to it.
RailArcs
(number | null)[]
number
Rail height above the base path (m). Guard code: โ‰ฅ 1.0 m typical.
number
Maximum clear spacing between balusters (m). Code: a 100 mm sphere must not pass โ€” the 0.11 m default center spacing with 20 mm balusters keeps the clear gap at 90 mm.
number
Square baluster side (m).
RailingTopRail
boolean
False leaves the top rail out: posts and balusters run to height. Default true.
BmRailingPanel
string
ogid of the hosting Stair, when attached via Stair.attachRailing.
"right" | "left"
number
number
number
PropertySets

Properties

ElementType
string
Map<string, OPGeometry>
Map<string, OPGeometry>
boolean
boolean
boolean
RailingOptions
string
Vec3[]
number
number
number
string | undefined
number
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.

setHostPath

Replace the base path from a hosting element (Stair).

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).

getEvaluatedPath

setOPGeometry

getExportRoots

Vector-export roots (RFC ยง7).

toDrawing

Base path as standardized line primitives.

toReachingDrawing

setOPMaterial

getEditAnchors

Draggable handles: one per base-path point, free on its own horizontal plane (Y preserved, so a sloped/stair-hosted path keeps its slope).

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

Types

RailingOptions

EvaluatedRailingSegment

RailingPlanDrawingOptions

number
Finite world Y of the plan cut. Omit for one unstated line per segment.
'single' | 'double'
double draws both faces of the top rail, one rail width apart; without a top rail, both faces of the glass or of the balusters. Default single.

RailArcs

The package does not export this type by name.

RailingTopRail

number
required
Horizontal rail width (m).
number
required
Vertical rail height/depth (m).

ArcThrough

The circle of an arc from a through through to b; undefined when the three are on a line. The package does not export this type by name.
PointXZ
required
number
required
number
required
Angle of a from the centre, in radians (+X is 0, toward +Z positive).
number
required
Signed angle from a to b through through.
Last modified on November 30, 2026