Import
Example
Notes
- Profile points are
[x, z]in metres.areais in square metres. - Holes are subtracted from the area.
perimetermeasures 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 theavoidboxes where the room has space. WithlabelMmandscalethe label fits the room at that paper size: the name stays, the area line only when it fits.show3Dshows the room as a translucent volume.- A room exports to IFC as
IfcSpace. usageis 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,colorandpropertySets. The savedbaseOffsetiselevationminus the storey elevation. labelName,showLabelandfontSizeare live only. The managed editors refuse a change to them.
extends OPElement implements IShape, IPlaceable, PlanVectorExportable
Constructor
Room number on the second label line (e.g. “01”). Default empty: the line shows the area only.
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.Show the translucent 3D volume in model view. Default off — a Space is primarily a plan-view
element.
Properties
Methods
editableSchema
move
delta (world-space, meters).
rotate
angleDeg around axis (default Y-up), pivoted at anchor (default the element’s own centroid).
setOPGeometry
getExportRoots
toDrawing
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
beginEdit before endEdit keeps the first start.
endEdit
getEditAnchors
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.Boxes the label keeps off where the room has space, such as furniture footprints.
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.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.imperial prints the area in whole square feet; absent or metric prints m² to 1 decimal.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.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.With
labelAt: the point inside the room where the leader line ends, in a dot.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.{
show?: boolean;
template?: string;
decimals?: number;
trimZeros?: boolean;
outranksCeilingHeight?: boolean;
}
The area line:
show: false prints none. In metric, template writes it with {area}
for the number (default {area} 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.