span-placement
Import from bear/blueprints/span-placement.
Interfaces
SpanSupports
Defined in: bear/blueprints/span-placement.ts:24
The supports a span rests on: its start rests on from, its end on
to, and each is also a bears edge. A bare element is a point
support (the end lands on its plan center: a post, a pier); a ref names
the plane the end lands on (getRef(ledger, "back"), a hanger's
seat), which pins the end along that plane's normal only.
Properties
| Property | Type |
|---|---|
from | BearingTarget |
to | BearingTarget |
Type Aliases
SpanPlacementProps
type SpanPlacementProps =
| {
along?: never;
direction?: never;
from?: never;
path: [Point, Point];
spans?: never;
to?: never;
}
| {
along?: `@${string}`;
direction?: "x" | "y";
from?: `@${string}`;
path?: never;
spans?: SpanSupports;
to?: `@${string}`;
};Defined in: bear/blueprints/span-placement.ts:35
Placement props shared by span-shaped solvable elements: either a fully
authored path, or solved placement from along/from/to, spans
and dims. The two are exclusive, and the type makes mixing them a
compile error.
Union Members
Type Literal
{
along?: never;
direction?: never;
from?: never;
path: [Point, Point];
spans?: never;
to?: never;
}| Name | Type | Description |
|---|---|---|
along? | never | - |
direction? | never | - |
from? | never | - |
path | [Point, Point] | The path the span follows. Pins both anchors; never solved. |
spans? | never | - |
to? | never | - |
Type Literal
{
along?: `@${string}`;
direction?: "x" | "y";
from?: `@${string}`;
path?: never;
spans?: SpanSupports;
to?: `@${string}`;
}| Name | Type | Description |
|---|---|---|
along? | `@${string}` | Put the span's line on this gridline (e.g. "@1"). |
direction? | "x" | "y" | Axis a solver-placed span runs along. Usually inferred: along, from, and to gridline names each imply it. A span between two point supports needs none: its line is the line between them. |
from? | `@${string}` | Pin the span's start to this gridline along its direction. |
path? | never | - |
spans? | SpanSupports | The supports the span rests on. Length is a consequence: the distance between where the ends land. Exclusive with from/to. |
to? | `@${string}` | Pin the span's end to this gridline along its direction. |
Functions
completeSpanPath()
function completeSpanPath(anchors): object;Defined in: bear/blueprints/span-placement.ts:173
Rebuild the completed path from solved anchors.
Parameters
| Parameter | Type |
|---|---|
anchors | Record<string, Vec2> |
Returns
object
gridValue()
function gridValue(
grid,
name,
axis
): number;Defined in: bear/blueprints/span-placement.ts:75
Parameters
| Parameter | Type |
|---|---|
grid | GridReferences | undefined |
name | string |
axis | "y" | "x" |
Returns
number
lowerSpanPlacement()
function lowerSpanPlacement(
p,
c,
grid,
what
): void;Defined in: bear/blueprints/span-placement.ts:122
Lower span placement props onto start/end anchors. An authored path
pins both anchors (constant-folded); otherwise along/from/to pin
what they pin on an axis-aligned span, spans rests the ends on their
supports, and dims supply the rest. Whatever stays unpinned is the
solver's standard "unbound" diagnostic: a span between two faces still
needs along or a dim for its position along the supports.
Parameters
| Parameter | Type |
|---|---|
p | SpanPlacementProps |
c | Lowerer |
grid | GridReferences | undefined |
what | string |
Returns
void
resolvePlacementPoint()
function resolvePlacementPoint(point, grid): Vec2;Defined in: bear/blueprints/span-placement.ts:85
Resolve an authored point: numbers, measurement strings, or grid refs.
Parameters
| Parameter | Type |
|---|---|
point | Point |
grid | GridReferences | undefined |
Returns
resolveSpanPath()
function resolveSpanPath(path, grid): [[number, number], [number, number]];Defined in: bear/blueprints/span-placement.ts:102
Resolve an authored path to numeric project-unit points.
Parameters
| Parameter | Type |
|---|---|
path | [Point, Point] |
grid | GridReferences | undefined |
Returns
[[number, number], [number, number]]