Skip to main content
It has a name, a number, an area and a perimeter. Use it for room labels and area lists.

Import

Example

Notes

  • Profile points are [x, z] in metres. area is in square metres.
  • Holes are subtracted from the area. perimeter measures the outer boundary.
  • You give the boundary. Floorkit does not find rooms from walls.
  • Rooms do not follow walls yet. When a wall moves, the room boundary stays. See Define a room.
  • For a text label, call setGlyphScene(scene, camera) before you create the space.
  • The plan label is the name over number · area. A room with no number prints no number: the second line is the area only.
  • The label sits at the centroid when that is inside the room and clear of the walls. Else it sits at the inside point farthest from the walls.
  • toDrawing('top', { avoid, labelMm, scale }) keeps the label off the avoid boxes where the room has space. With labelMm and scale the label fits the room at that paper size: the name stays, the area line only when it fits.
  • show3D shows the room as a translucent volume.
  • A room exports to IFC as IfcSpace.
  • usage is free text for what the room is for. A building model saves it on the room (BmSpace.usage).
  • 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.
  • A room of a building model saves name, number, usage, elevation, height, show3D, color and propertySets. The saved baseOffset is elevation minus the storey elevation.
  • labelName, showLabel and fontSize are live only. The managed editors refuse a change to them.
Inheritance: extends OPElement implements IShape, IPlaceable, PlanVectorExportable

Constructor

string
string
ElementType.SPACECONTAINER
string
Room name shown as the first label line (e.g. “Kitchen”).
string
Room number on the second label line (e.g. “01”). Default empty: the line shows the area only.
string
What the room is used for (bedroom, kitchen, …): free text. Not printed on the plan.
PolygonProfile
Room boundary in the world XZ plane. outerRing is auto-closed and normalized to CW (the convention opengeometry.Polygon expects). Holes are auto-closed and normalized to CCW and are excluded from area.
{ outerRing?: (BmWallArc | null)[]; holes?: (BmWallArc | null)[][]; }
number
World Y of the room’s floor plane.
number
Height of the optional 3D volume (profile × height).
boolean
Show the translucent 3D volume in model view. Default off — a Space is primarily a plan-view element.
boolean
Show the name/number label in plan view.
number
Label text height in world meters.
number
PropertySets

Properties

ElementType
string
Map<string, OPGeometry>
Map<string, OPGeometry>
boolean
boolean
boolean
Event<null>
SpaceOptions
string
string
string
SpaceProfile
number
number
number
Push/pull alias for the GUIEditor — the extrude dimension is the height.
boolean
boolean
number
number
Read-only. Net floor area in m² — outer ring minus holes. Computed, read-only.
number
Read-only. Outer-boundary length in m. Computed, read-only.
boolean
boolean
boolean

Methods

editableSchema

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

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

setOPGeometry

getExportRoots

Vector-export roots (RFC §7).

toDrawing

Plan footprint region plus the name and number · area texts inside the room. Throws: {Error} When only one of labelMm and scale is given, or one is not positive, or when labelRotationDeg is given without labelAt, or when minFontSize is not a finite positive number.

setOPMaterial

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.

getEditAnchors

Draggable handles: one grip per boundary vertex (move on the XZ plane) and a height grip at the centroid (raise/lower the 3D volume along +Y).

applyEditAnchor

dispose

Types

SpaceOptions

SpaceProfile

Polygon profile for a Space — alias of PolygonProfile.

SpaceDrawingOptions

How Space.toDrawing places and sizes the room label of a plan.
readonly LabelRect[]
Boxes the label keeps off where the room has space, such as furniture footprints.
number
Paper text height in mm; with scale, the label fits the room at this paper size.
number
Paper ÷ real of the sheet, such as 0.01 at 1:100.
number
The smallest paper height of the detail line in mm, such as 1.8; else 0.7 × labelMm.
number
Clear space in metres the label keeps from each side of the room when it sizes itself: a room too narrow for the label with that space round it gets a smaller label (or no detail). The width and depth are those of the room’s bounding box, so an L-shaped room or one with a hole is sized by its box, not its narrower clear parts; the placing (avoid) keeps the gap.
number
The smallest name height in model metres a label without labelMm fits down to. A room too narrow for the label at it gets a label of this size that overflows the room, not a smaller one; a label whose own fontSize is under it is drawn at it. Absent keeps the fit as before (down to 0.7 of fontSize), and labelFit 'reduced' and 'small' shrink no further than it either. A label with labelMm ignores it.
'metric' | 'imperial'
imperial prints the area in whole square feet; absent or metric prints m² to 1 decimal.
{ x: number; y: number; }
The point of the name line in plan metres (y is world Z), in place of the automatic place. A point outside the room draws a leader line from it to the nearest point of the room outline.
number
With labelAt: the label turned by this many degrees about labelAt, counter-clockwise as the plan prints, so 90 reads up the page. The label fits the room along its turned lines.
{ x: number; y: number; }
With labelAt: the point inside the room where the leader line ends, in a dot.
'name' | 'wrapped' | 'reduced' | 'small'
A smaller label for a room with no clear place: wrapped breaks the name on two lines over the detail line, reduced prints the name at the size of the detail line over it, on two lines when it is longer than the detail, name drops the detail line, small prints the name alone at the smallest size, broken into lines no wider than the room.
string
A ceiling height line, such as CH 2500, between the name and the area; it shows with them.
{ show?: boolean; template?: string; decimals?: number; trimZeros?: boolean; outranksCeilingHeight?: boolean; }
The area line: show: false prints none. In metric, template writes it with &#123;area&#125; for the number (default &#123;area&#125; m²), decimals sets its decimal places (default 1) and trimZeros: true drops trailing zeros, so 13.0 prints 13. outranksCeilingHeight: true is read by the plan label pass of a project drawing only: a label with no clear place inside with all its lines then tries an inside place without the ceilingHeight line, keeping the area, before a place outside on a short leader with all its lines.

LabelRect

An axis-aligned box in plan drawing space: x is world X, y is world Z.
Last modified on November 28, 2026