IFClite TypeScript API
    Preparing search index...

    Class SpacePlateHandle

    A persistent, editable floor-plate topology. See the module docs.

    Index
    • Build a plate from flat wall-axis segments.

      segCoords: [ax, ay, bx, by, …] (length a multiple of 4). segSources: one i32 per segment, -1 for none. segHalfThickness: one f64 per segment — half the wall's thickness in metres, carried onto the derived edges for netOutline. Pass an empty array (or all zeros) when thickness is unknown (centreline only). snapTolerance / minArea: pass <= 0 to take the defaults.

      Parameters

      • seg_coords: Float64Array
      • seg_sources: Int32Array
      • seg_half_thickness: Float64Array
      • snap_tolerance: number
      • min_area: number

      Returns SpacePlateHandle

    roomCount: number

    Number of live rooms.

    • Returns void

    • Author a new room from a flat ring [x0, y0, x1, y1, …] (no repeated closing vertex). source -1 marks a user-drawn room. Winding is normalised to CCW; returns the new room patch. The room is its own connected component — it does not merge into existing topology.

      Parameters

      • coords: Float64Array
      • source: number

      Returns any

    • Bounding half-edges of a face paired with their source element — [{ edge, source }, …] — for IfcRelSpaceBoundary at bake.

      Parameters

      • face: number

      Returns any

    • Dissolve a degree-2 vertex, welding its two edges into one straight edge between the neighbours — the inverse of splitEdge, and the "delete this corner / node" affordance. Returns the rooms it changed. Rejects a wall junction (degree ≥ 3) or a weld that would duplicate an edge.

      Parameters

      • v: number

      Returns any

    • Move a vertex; returns the rooms it changed. A shared wall is one edge whose endpoints are shared vertices, so one drag updates both rooms.

      Parameters

      • v: number
      • x: number
      • y: number

      Returns any

    • Deep-copy the plate for an undo/redo snapshot. The clone owns its own heap; the caller must .free() it like any handle.

      Returns SpacePlateHandle

    • Absolute area (m²) of a face.

      Parameters

      • face: number

      Returns number

    • Flat outline [x0, y0, x1, y1, …] of a face (no repeated closing vertex).

      Parameters

      • face: number

      Returns Float64Array

    • Nearest live vertex id to (x, y) within tol, or undefined.

      Parameters

      • x: number
      • y: number
      • tol: number

      Returns number | undefined

    • Returns void

    • Face-based gap-room boundary as flat [x0, y0, …]: each edge pushed OUTWARD (into the wall) by factor × the source wall's half-thickness. 0 → net (the gap / inner faces); 1 → centre axis (½ thickness, the editable node line on the wall mid); 2 → gross outer face.

      Parameters

      • face: number
      • factor: number

      Returns Float64Array

    • Remove a shared wall, unioning the two rooms it separated. Returns the surviving room.

      Parameters

      • edge: number

      Returns any

    • The room on the far side of a half-edge (its twin's face), or undefined. O(1) — the "who's across this wall" query.

      Parameters

      • edge: number

      Returns number | undefined

    • The face outline offset to a wall boundary, as flat [x0, y0, …]: each edge is moved by its own wall's half-thickness — inward when inset (the net / inner face), outward otherwise (the gross / outer face). Shared room↔room edges are pinned when pushing outward. Falls back to the centreline outline when no offset applies — so it's always a sane ring. (For a center boundary just use faceOutline.)

      Parameters

      • face: number
      • inset: boolean

      Returns Float64Array

    • Sweep the whole plate clean: remove dangling spur walls, isolated nodes, and redundant collinear nodes — the "clean up orphans" / eraser action. Area-neutral and idempotent. Returns how many topology elements were pruned (0 = the plate was already clean); the caller re-renders via snapshot like any other edit.

      Returns number

    • Remove a wall edge, choosing the right semantics from its two faces: two real rooms → union them; a bridge / spur / outer-only wall → delete it and auto-clean the orphaned inner lines and nodes it leaves; a real enclosing wall (room ↔ exterior) → rejected (BordersExterior). This is the "remove this wall and tidy up" affordance for the orphan cruft the non-destructive wall arrangement leaves behind. Returns the rooms it changed (empty if the edge bounded no room).

      Parameters

      • edge: number

      Returns any

    • Face ids of every live room.

      Returns Uint32Array

    • Set a face's floor / ceiling planes (the vertical dimension that turns a 2D face into a prismatic space at bake).

      Parameters

      • face: number
      • floor_z: number
      • ceiling_z: number
      • non_planar: boolean

      Returns void

    • All live rooms as { face, area, simple, outline } patches.

      Returns any

    • Insert a new vertex at (x, y) on edge edge, subdividing it (no new face). Returns the new vertex id — use it as a splitFace endpoint to cut between points that weren't existing corners. Project (x, y) onto the edge to keep areas unchanged.

      Parameters

      • edge: number
      • x: number
      • y: number

      Returns number

    • Subdivide a face with a partition between two of its vertices. source -1 marks a brand-new partition (materialised as a fresh wall at bake). Returns the kept face and the new face.

      Parameters

      • face: number
      • va: number
      • vb: number
      • source: number

      Returns any

    • FACE-BASED build: rooms are the gaps between wall footprint rectangles. rectCoords is flat [x0, y0, x1, y1, x2, y2, x3, y3, …] — 8 f64 per wall (its 4 plan-rectangle corners, CCW). A bounded arrangement face is a room only if its centroid is outside every rectangle (a gap, not a wall interior). The room outline IS the net (inner-face) area; gapBoundary gives the centre axis (½ thickness) and the gross outer face.

      Parameters

      • rect_coords: Float64Array
      • snap_tolerance: number
      • min_area: number

      Returns SpacePlateHandle