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
Properties
| Property | Modifier | Type |
|---|---|---|
authoredSegment | readonly | string |
children | readonly | readonly N[] |
fqn | readonly | string |
parent | readonly | N | null |
WorldPlane
Defined in: bear/engine/planeOf.ts:20
A plane in world coordinates.
Properties
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
| Parameter | Type |
|---|---|
direction | Axis |
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
| Parameter | Type |
|---|---|
end | string | Ref |
direction | Axis | undefined |
dimNode | NamedNode |
elementMap | ReadonlyMap<BearElement<object>, NamedNode> |
Returns
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
Returns
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
| Parameter | Type |
|---|---|
name | string |
from | N | 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
| Parameter | Type |
|---|---|
name | string |
from | NamedNode |
Returns
| {
key: string;
node: NamedNode;
}
| {
error: string;
}