Skip to Content
Bear documentation

surfaces

Import from bear/engine/surfaces.

Functions

computeHorizontalSurfaces()

function computeHorizontalSurfaces(
   length, 
   width, 
   thickness
): object;

Defined in: bear/engine/surfaces.ts:244

Compute the top and bottom surfaces for a horizontal assembly (floor or roof deck).

The assembly is centered at the origin in XY with the given length (X) and width (Y). Thickness is along Z. The bottom face is at z=0, top at z=thickness.

For a floor: "top" is the walking surface, "bottom" faces the space below. For a roof: "top" is the weather surface, "bottom" faces the attic/interior.

Parameters

ParameterType
lengthnumber
widthnumber
thicknessnumber

Returns

object

NameType
bottomSurface
topSurface

computePolygonHorizontalSurfaces()

function computePolygonHorizontalSurfaces(footprint, thickness): object;

Defined in: bear/engine/surfaces.ts:295

Compute the top and bottom surfaces for a polygon-shaped horizontal assembly.

The footprint defines the boundary in local XY. The surface frame origin is placed at the bounding-box minimum so boundary coordinates are non-negative (matching the convention used by panelization).

Parameters

ParameterType
footprintVec2[]
thicknessnumber

Returns

object

NameType
bottomSurface
topSurface

computeWallSurfaces()

function computeWallSurfaces(
   length, 
   height, 
   thickness, 
   pitchRise?
): object;

Defined in: bear/engine/surfaces.ts:19

Compute the exterior and interior surfaces for a wall from its dimensions.

When pitchRise is non-zero, the boundary is trapezoidal: the top edge slopes from height at x=0 to height + pitchRise at x=length.

Origins are placed at the bottom-left corner of each face so that panelization coordinates start at (0,0) and work along u/v.

Parameters

ParameterTypeDefault value
lengthnumberundefined
heightnumberundefined
thicknessnumberundefined
pitchRise?number0

Returns

object

NameType
extSurface
intSurface

deriveFaceFromExtents()

function deriveFaceFromExtents(extents, face): Surface;

Defined in: bear/engine/surfaces.ts:144

Derive a face Surface from the 6 standard bounding-box faces.

Reads the extents' box, so the result is correct in the node's local frame whether its geometry is corner-origin (0..width) or centered (±width/2). Face origins sit on a corner of the face so boundary coordinates start at (0,0) and run along u/v.

Parameters

ParameterType
extentsReferenceExtents
facestring

Returns

Surface


flatPlane()

function flatPlane(
   origin, 
   v, 
   n, 
   boundary
): Surface;

Defined in: bear/engine/surfaces.ts:102

A flat (u = +X) reference plane in a node's local frame: the shape of every horizontal ref a blueprint publishes (a post base's seat, the plane it stands on). v runs the other way across the plane, so a downward-facing plane is v = -Y, n = -Z, the way a box's bottom face is derived below.

Parameters

ParameterType
originVector3
vVector3
nVector3
boundaryBoundary

Returns

Surface


offsetSurface()

function offsetSurface(surface, distance): Surface;

Defined in: bear/engine/surfaces.ts:118

Offset a surface along its normal by a given distance. Returns a new Surface with the origin shifted.

Parameters

ParameterType
surfaceSurface
distancenumber

Returns

Surface


uprightPlane()

function uprightPlane(
   origin, 
   u, 
   n, 
   boundary
): Surface;

Defined in: bear/engine/surfaces.ts:79

An upright (v = +Z) reference plane in a node's local frame: the shape of every vertical ref a blueprint publishes (wall faces, span ends, centerlines).

Parameters

ParameterType
originVector3
uVector3
nVector3
boundaryBoundary

Returns

Surface

On this page