Skip to main content
It does not need the geometry kernel, so it also runs on a server. Use it for a model that comes from a file, an API or an AI agent.

Import

Example

Notes

  • Each problem has a path, a code and a message.
  • assertValidBuildingModel returns the typed model, or throws BmValidationError.
  • An opening that overlaps another opening, or whose offset is not on its wall, is an error. Floorkit does not move it.
  • Whether an opening fits between the joints of its wall is a fact of the build, not of this check: the build reports opening-does-not-fit in warnings.
  • A valid model can fail in the build step, because the build also checks the geometry.

Signature

Parameters

unknown
required

Returns

assertValidBuildingModel

Validate and return the document, throwing BmValidationError listing every problem.

BmValidationError

Types

BuildingModel

'floorkit.building' | 'floorkit.building-model'
required
Discriminator. Identifiers written by earlier versions are accepted on input and replaced by these; anything else is rejected rather than guessed at.
1 | 2 | 3 | 4
required
'meters'
required
An assertion, not a conversion knob. Spelled to match OPBaseDocument.units.
'y'
required
Y-up, matching the Three.js scene and every element’s own convention.
string
required
string
Record<string, string>
BmPsets
v2 interoperable name. psets remains readable for v1 documents.
BmPsets
BmSite
Optional site framing. Present so a multi-building document has somewhere to say where it is.
BmBuilding[]
required
Record<string, BmAssetRef>
Catalog assets, referenced by instances. .op / .opbase remain the asset format.
BmConditioning
Conditioning-export metadata; absent means sensible defaults.

BmArcObject

A circular arc authored in a building working plane; angles are radians.
'arc'
required
string
required
string
required
[ number, number ]
required
number
required
number
required
number
required
Signed sweep, with 0 &lt; abs(sweepAngle) &lt;= 2π.
BmColor

BmCuboidObject

BmCylinderObject

An analytic upright cylinder centered in a horizontal building working plane.

BmCuboidSizeObject

An upright solid dimensioned around a horizontal working-plane center.

BmCuboidFreeformObject

An upright extrusion with an authored footprint and optional through holes.

BmLineObject

A straight segment authored in the local coordinates of a building working plane.

BmPolylineObject

An open path authored as vertices in a building working plane.

BmPolygonObject

A filled profile authored in a building working plane.

BmRectangleObject

BmRectangleSizeObject

A rectangle dimensioned around a center in plane-local coordinates.

BmRectangleFreeformObject

An edited rectangle saved as an arbitrary filled plane-local profile.

BmModelObject

Extend this discriminated union as additional model primitives are supported.

BmWorkingPlane

A named local 2D frame in world XYZ coordinates.

BmColor

A colour as #rrggbb.

BmSceneCategory

BmPsetValue

BmPsets

BmCameraPose

A camera pose.

BmSite

The parcel.
string
required
string
PolygonProfile
Parcel in the world XZ plane; holes are excluded islands.
LotLineClass[]
One class per outer-ring edge of boundary (edge i = outerRing[i] → [i+1]).
number
World Y of grade. Default 0.
GeoAnchor
WGS84 anchor for the local origin, if the project is georeferenced.
number
Degrees from project north (−Z) to true north, positive clockwise from above.
ZoningRuleSet
The zoning rules this document was evaluated against — values are the consumer’s; the schema and evaluator are zoning/.
BmPsets
BmPsets

BmConditioning

string
BmSceneCategory
Record<string, string>
BmCameraPose[]
Default poses. --cameras and --sample-cameras both override these.

BmBuilding

string
required
string
string
Free-form programme tag — residential, office, … Kept open; consumers disagree on the set.
BmPsets
BmPsets
BmWorkingPlane[]
Named world-space frames for model objects owned by this building.
BmMass
The massing volume, when the building is (also) a mass. Its segments REFERENCE storeys in storeys by id — the storey list stays the single source of elevations and heights, and a storey may carry zero elements while the mass gives it a body.
BmStorey[]
required

BmMassSegment

One extruded segment of a mass (podium, tower, setback), bottom-up.
string
required
string
PolygonProfile
required
Footprint in the world XZ plane; holes are courtyards.
number
required
Extrusion height. Must equal the sum of the referenced storeys’ heights.
string
BuildingUse value, or any string (custom: is implied).
BmColor
Colour of this part, #rrggbb. A part without one takes the color of the mass, else the colour of its use in the palette of the build (MASS_COLORS_BY_USE, or BuildOptions.massColors), else #a0b8c8.
string[]
required
Ids of the storeys that tile this segment, bottom-up and contiguous.

BmMass

string
required
number
required
World Y of the bottom face of segments[0].
string
BmColor
Colour of every part of the mass that has no color of its own, #rrggbb.
BmPsets
Data on the physical mass element; building-scope data stays on BmBuilding.
BmMassSegment[]
required

BmWallSegmentRef

Authored identity of one segment, including a closed run’s final wrap segment.

BmDetachedFaceTrim

Auxiliary face trim; axes and host/opening ownership stay in authored walls.

BmWallNetworkState

V4 reconstruction state; saved nonautomatic joining is not supported yet.

BmStorey

One storey.
string
required
string
number
required
World Y of this storey’s structural floor datum.
number
required
Floor-to-floor height. Also the default wall height for walls that omit one.
string
Programme for this storey — retail, residential, …
AreaKind
What the plate of this storey counts as (basement, core, parking, …). Derived when absent: a parking use gives parking, a storey whose top is at or below the site grade gives basement, otherwise gross. Zoning counts toward the floor area ratio only the kinds in countsTowardFAR.
BmPsets
BmPsets
BmWall[]
BmModelObject[]
Basic geometry saved in this storey, placed by a building working plane.
BmUnhostedOpening[]
v3 openings placed in the world XZ plane without a host wall.
import('../../elements/walls/wall-model').WallJoinOverride[]
BmWallNetworkState
V4 only. Restored before the first network resolution; never a second wall model.
BmSlab[]
BmRoof[]
BmColumn[]
BmBeam[]
BmSpace[]
BmStair[]
BmRailing[]
BmAssetInstance[]

BmWall

string
required
string
PointXZ[]
required
Centreline in the world XZ plane. Network walls require horizontal paths, so there is no Y here to get wrong; the compiler places it at the storey’s elevation.
boolean
import('../../elements/walls/wall-model').LocationLine
number
number
{ start: import('../../elements/walls/wall-model').WallEndJoin; end: import('../../elements/walls/wall-model').WallEndJoin; }
number
required
number
Defaults to the owning storey’s height.
WallMaterial | string
BmColor
BmPsets
BmPsets
BmOpening[]
Hosted by this wall. The nesting IS the host relationship.

BmStationAlong

Distance along the wall centreline from points[0], accumulated across segments and including the closing segment when closed.

BmOpening

BmUnhostedOpening

An opening placed in the world XZ plane, with no wall cutter or host relationship.

BmUnhostedDoor

BmUnhostedWindow

BmUnhostedOpeningPose

PointXZ
required
World [X, Z] position in metres.
number
required
Degrees in the world XZ plane: +X is 0, turning toward +Z is positive.
number
Former host wall depth, or an authored frame depth. Defaults to 0.15 m.
never
never
never
never

BmOpeningBase

BmDoor

'door'
required
number
required
number
required
number
Threshold height above the wall base. A real 3D position for a door. Default 0.
number
number
DoorType
1 | 2 | 3 | 4
Which way the door swings, as a 2x2 of hinge side x swing face.
number
BmColor
BmColor

BmWindow

'window'
required
number
required
number
required
number
required
Bottom of the glass above the wall base — the only vertical control for a window.
number
number
WindowType
BmColor
BmColor

BmVoid

A plain unfilled hole — WallOpening.
'void'
required
number
required
number
required
number
Sill height above the wall base. Default 0.

BmSlabRole

Which class to build.

BmSlab

string
required
string
BmSlabRole
PolygonProfile
required
number
required
number
required
Metres above the storey’s elevation to the plate’s BOTTOM face (its underside, for a ceiling).
SlabMaterial | FloorMaterial | CeilingMaterial
BmColor
BmPsets
BmPsets

BmRoof

string
required
string
PolygonProfile
required
RoofType
number
number
number
required
number
required
Metres above the storey’s elevation to the EAVE (the wall-plate top).
number
boolean
RoofMaterial
BmColor
BmPsets
BmPsets

BmStair

A stair on a storey.
string
required
string
StairLayout
Defaults to STRAIGHT.
PointXZ
required
Plan position of the first flight’s walkline start.
number
Plan rotation in degrees about origin, CCW from above. Defaults to 0.
number
required
Metres above the storey’s elevation to the stair base.
number
Flight width. Defaults to 1 m.
number
Level-to-level rise. Defaults to the storey’s height, which is what a stair inside a storey almost always climbs.
number
Tread depth / going. Defaults to 0.28 m.
number
Target riser height; the solver fits equal risers at or below this and maxRiserHeight.
number
Hard riser cap. Defaults to 0.19 m.
number
Landing depth for L and U layouts, clamped to at least width. Defaults to 1 m.
StairTurnDirection
Which way an L or U turns walking up. Defaults to left.
boolean
Draw the conventional break line across the first flight in plan. Defaults to true.
BmColor
BmPsets
BmPsets

BmRailing

A railing, as a path in WORLD coordinates rather than relative to the storey — a stair-hosted rail follows the flight nosings and therefore climbs through the storey, so a single baseOffset could not describe it.
string
required
string
[ number, number, number ][]
required
Rail base path, world coordinates, [x, y, z] per point. Segments may slope.
number
Rail height above the base path. Defaults to 1 m; guard code typically wants at least that.
BmColor
BmPsets
BmPsets

BmColumn

string
required
string
ColumnShape
PointXZ
required
number
number
required
Metres above the storey’s elevation to the column base.
number
Defaults to the storey’s height.
number
number
number
PolygonProfile
ColumnMaterial
BmColor
BmPsets
BmPsets

BmBeam

string
required
string
BeamShape
[ number, number, number ]
required
[x, yOffset, z] — y is STOREY-RELATIVE, unlike BeamOptions.start which is world.
[ number, number, number ]
required
number
number
number
PolygonProfile
ColumnMaterial
BmColor
BmPsets
BmPsets

BmSpace

BmAssetRef

BmAssetInstance

string
required
string
required
[ number, number, number ]
required
position.y is STOREY-RELATIVE; the compiler adds the storey elevation.
number
[ number, number, number ]
string
BmPsets
BmPsets

BmIssue

string
required
JSON path into the document, e.g. buildings[0].storeys[0].walls[1].openings[2].offset.
string
required
Stable machine code, so a caller can branch without parsing prose.
string
required
One sentence, with the numbers in it.
BmOpeningFit
The numbers of an opening-does-not-fit issue.

BmOpeningFit

Where a hosted opening fits on its wall, in offsets along the saved centreline of that wall.
string
required
string
required
number
required
The offset that was asked or saved.
{ start: number; end: number; } | null
required
The range of fitting offsets on its wall segment that holds nearestOffset; null when none.
number | null
required
The fitting offset nearest to offset, or null when the opening fits nowhere there.
WallOpeningFitReason[]
required
Why it does not fit; t-junction alone means it is over the seam of a T stem.

BmValidationResult

BmCuboidBase

The package does not export this type by name.

BmRectangleBase

The package does not export this type by name.
Last modified on October 16, 2026