Skip to Content
Bear documentation

planeOf

Import from bear/engine/planeOf.

Interfaces

Scoped

Defined in: bear/engine/planeOf.ts:104

A node shape the lexical search can walk: identity and a named tree, generic so the result is the caller's own node type.

Type Parameters

Type Parameter
N

Properties

PropertyModifierType
authoredSegmentreadonlystring
childrenreadonlyreadonly N[]
fqnreadonlystring
parentreadonlyN | null

WorldPlane

Defined in: bear/engine/planeOf.ts:20

A plane in world coordinates.

Properties

PropertyType
normalVector3
pointVector3

Type Aliases

PlaneResult

type PlaneResult = 
  | {
  plane: WorldPlane;
}
  | {
  error: string;
};

Defined in: bear/engine/planeOf.ts:25

Functions

axisVector()

function axisVector(direction): Vector3;

Defined in: bear/engine/planeOf.ts:27

Parameters

ParameterType
directionAxis

Returns

Vector3


planeOf()

function planeOf(
   end, 
   direction, 
   dimNode, 
   elementMap
): PlaneResult;

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

Resolve a dim endpoint to a world plane.

The one function that turns an endpoint into geometry. Three endpoint forms, one implementation: a gridline ("@A") resolves through the GridRefs context of the dim's ancestors; a name ("corridor.coreExt") resolves lexically to an element and then to its published refs; a Ref object resolves through the element map. World pose always comes from the tree's composed transforms, never from props.

Parameters

ParameterType
endstring | Ref
directionAxis | undefined
dimNodeNamedNode
elementMapReadonlyMap<BearElement<object>, NamedNode>

Returns

PlaneResult


refPlane()

function refPlane(
   source, 
   key, 
   direction
): PlaneResult;

Defined in: bear/engine/planeOf.ts:182

The world plane of a named ref (or bbox face) on a resolved node.

Parameters

ParameterType
sourceNamedNode
keystring
directionAxis | undefined

Returns

PlaneResult


resolveElementName()

function resolveElementName<N>(name, from): 
  | {
  node: N;
}
  | {
  error: string;
};

Defined in: bear/engine/planeOf.ts:121

Resolve a dotted element name, lexically: search scope's subtree (the asking node's parent), then the grandparent's, outward; the nearest enclosing scope with a match wins, and within it the match must be unique. Names are fqn-segment suffixes, so adding parent segments reaches past the local scope. Deduplicated siblings (P1-1, P1-2) also answer to their authored name, so "P1" reports them as candidates. Shared by dim endpoints and relation targets.

Type Parameters

Type Parameter
N extends Scoped<N>

Parameters

ParameterType
namestring
fromN | null

Returns

| { node: N; } | { error: string; }


resolveRefName()

function resolveRefName(name, from): 
  | {
  key: string;
  node: NamedNode;
}
  | {
  error: string;
};

Defined in: bear/engine/planeOf.ts:84

Resolve a "name.refKey" endpoint to its element, lexically: the last segment is the ref key, the rest name the element.

Parameters

ParameterType
namestring
fromNamedNode

Returns

| { key: string; node: NamedNode; } | { error: string; }

On this page