API referenceEngine
coplanar
Import from bear/engine/coplanar.
Type Aliases
CoplanarGroup
type CoplanarGroup = object;Defined in: bear/engine/coplanar.ts:17
A group of coplanar surfaces with a unified surface in building coords.
Properties
| Property | Type | Description |
|---|---|---|
normal | Vector3 | World-space exterior normal (unit vector). |
sources | PositionedSurface[] | The source surfaces that contributed to this group. |
surface | Surface | Unified surface in building coordinates. |
PositionedSurface
type PositionedSurface = object;Defined in: bear/engine/coplanar.ts:11
A wall surface with its world transform (composed from ancestor chain).
Properties
| Property | Type |
|---|---|
surface | Surface |
worldTransform | Matrix4 |
Functions
groupCoplanarSurfaces()
function groupCoplanarSurfaces(surfaces): CoplanarGroup[];Defined in: bear/engine/coplanar.ts:72
Group positioned surfaces by coplanarity and create unified surfaces.
Two surfaces are coplanar if:
- Their world-space normals are parallel (same direction)
- They lie on the same geometric plane (same distance from origin)
For each coplanar group, a unified Surface is created in building coordinates that spans all contributing walls (including inter-level gaps). Cutouts from individual walls are transformed and merged.
Parameters
| Parameter | Type |
|---|---|
surfaces | PositionedSurface[] |