Skip to Content
Bear documentation

place

Import from bear/engine/place.

Interfaces

PlacedRole

Defined in: bear/engine/place.ts:45

One resolved connection role, in the connector's parent frame.

The member is published as its own extents and its pose, never as the box it casts in this frame: a 4x6 post turned 45 degrees casts a box 6 3/8in square, which is neither of its faces. Nothing is derived here that a connector could not derive, and nothing is dropped that only this frame knows. blueprints/connectors/members.ts reads it.

Properties

PropertyTypeDescription
extentsBoxThe member's own box, in its own frame: the section it was cut to.
nodeTreeNode-
plane?WorldPlanePresent exactly when the author named a port (a Ref target).
poseTransformMatrixThe member's pose in the connector's parent frame.

Type Aliases

PlacedRoles

type PlacedRoles<Roles> = Record<Roles, PlacedRole>;

Defined in: bear/engine/place.ts:60

A connector's resolved roles, keyed by the role names its part declares. Roles is a literal union for a part with a stated contract, so roles.header is the header and a typo is a compile error.

Type Parameters

Type ParameterDefault type
Roles extends stringstring

Functions

placeFromRoles()

function placeFromRoles(
   node, 
   frame, 
   elementMap, 
   findings
): 
  | TransformMatrix
  | undefined;

Defined in: bear/engine/place.ts:76

The pose a connector derives from its resolved roles, if it has a place callback and wired roles; undefined otherwise, or on failure (reported as a finding on the connector).

Resolving the roles is also the moment the part can say whether it physically suits them, so the part's check runs here off the same resolution: one walk of the roles, one findings sink, no second pass that would have to resolve them again. Both run only once every role the part declares has a target, so neither has to ask whether it does.

Parameters

ParameterType
nodeTreeNode
frameTreeNode | null
elementMapReadonlyMap<BearElement<object>, TreeNode>
findingsFindings

Returns

| TransformMatrix | undefined

On this page