Skip to content

spatial-monorepo


spatial-monorepo / core/src / inferWallGeometry

Function: inferWallGeometry()

inferWallGeometry(levelPolygon, unitPolygons): MultiPolygon

Defined in: packages/core/src/layers/wall-inference.ts:49

Infer wall geometry for a floor level.

Algorithm:

  1. Convert the level polygon to polygon-clipping format.
  2. Union all unit polygons.
  3. Difference: level − union(units) = wall area.
  4. Return result as GeoJSON MultiPolygon.

Parameters

levelPolygon

Polygon | MultiPolygon

The bounding polygon of the floor level.

unitPolygons

(Polygon | MultiPolygon)[]

Unit (room) polygons to subtract from the level.

Returns

MultiPolygon

GeoJSON MultiPolygon representing the wall geometry.

Released under commercial licensing.