Skip to Content
Bear documentation

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

PropertyTypeDescription
normalVector3World-space exterior normal (unit vector).
sourcesPositionedSurface[]The source surfaces that contributed to this group.
surfaceSurfaceUnified 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

PropertyType
surfaceSurface
worldTransformMatrix4

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:

  1. Their world-space normals are parallel (same direction)
  2. 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

ParameterType
surfacesPositionedSurface[]

Returns

CoplanarGroup[]

On this page