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
| Parameter | Type |
|---|---|
length | number |
width | number |
thickness | number |
Returns
object
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
| Parameter | Type |
|---|---|
footprint | Vec2[] |
thickness | number |
Returns
object
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
| Parameter | Type | Default value |
|---|---|---|
length | number | undefined |
height | number | undefined |
thickness | number | undefined |
pitchRise? | number | 0 |
Returns
object
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
| Parameter | Type |
|---|---|
extents | ReferenceExtents |
face | string |
Returns
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
| Parameter | Type |
|---|---|
origin | Vector3 |
v | Vector3 |
n | Vector3 |
boundary | Boundary |
Returns
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
| Parameter | Type |
|---|---|
surface | Surface |
distance | number |
Returns
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
| Parameter | Type |
|---|---|
origin | Vector3 |
u | Vector3 |
n | Vector3 |
boundary | Boundary |