model
Import from bear/engine/model.
Interfaces
ConstraintReport
Defined in: bear/engine/model.ts:50
What every solver constraint reports, whatever stated it: one shape, so
printConstraints prints a new constraint source without a case for
it. Solve describes each constraint the way its author would write it.
Extended by
Properties
| Property | Modifier | Type | Description |
|---|---|---|---|
derived? | readonly | boolean | True when value was filled in by solve rather than authored. |
eq? | readonly | EqGroup | - |
label | readonly | string | "@A → W.start along x", "J1.start on H1.seat along y". |
max? | readonly | number | - |
measured? | readonly | number | - |
min? | readonly | number | - |
node | readonly | TreeNode | - |
priority | readonly | DimPriority | - |
value? | readonly | number | The stated value: a dim's, or 0 for the gap between an anchor and its plane. |
Model
Defined in: bear/engine/model.ts:37
The materializer's owning handle. Consumers only need ModelView.
Extends
Properties
| Property | Modifier | Type | Description | Inherited from |
|---|---|---|---|---|
constraints | readonly | readonly ResolvedConstraint[] | Every constraint the solver saw, dims first, with its measured value. | ModelView.constraints |
diagnostics | readonly | readonly Diagnostic[] | Findings from collection, relations and solve, at the fixed point only. | ModelView.diagnostics |
edges | readonly | readonly Edge[] | The relationship edges, resolved against the finished tree. | ModelView.edges |
elementNodes | readonly | ReadonlyMap<BearElement<object>, TreeNode> | The collected identity of JSX handles, including transparent assemblies. | ModelView.elementNodes |
geometry | readonly | ReadonlyMap<TreeNode, Geometry> | Every geometry part's solid, built once after convergence. See geometryOf. | ModelView.geometry |
passes | readonly | number | How many collect → solve passes the fixed point took. | ModelView.passes |
tree | readonly | TreeNode | - | ModelView.tree |
Methods
dispose()
dispose(): void;Defined in: bear/engine/model.ts:42
Free the solids in geometry. Whoever called materialize() owns the
model and disposes it when done; the geometry is unusable afterward.
Returns
void
ModelView
Defined in: bear/engine/model.ts:20
What materialize() returns: the tree plus every fact about it that is not a
property of one node. Consumers reach into it through functions that
take the result (q(result), treeToScene(result), printTree(result),
printConstraints(result), logDiagnostics(result)), so the shape here
is a contract with those functions, not with model code.
Extended by
Properties
| Property | Modifier | Type | Description |
|---|---|---|---|
constraints | readonly | readonly ResolvedConstraint[] | Every constraint the solver saw, dims first, with its measured value. |
diagnostics | readonly | readonly Diagnostic[] | Findings from collection, relations and solve, at the fixed point only. |
edges | readonly | readonly Edge[] | The relationship edges, resolved against the finished tree. |
elementNodes | readonly | ReadonlyMap<BearElement<object>, TreeNode> | The collected identity of JSX handles, including transparent assemblies. |
geometry | readonly | ReadonlyMap<TreeNode, Geometry> | Every geometry part's solid, built once after convergence. See geometryOf. |
passes | readonly | number | How many collect → solve passes the fixed point took. |
tree | readonly | TreeNode | - |
ResolvedAttachment
Defined in: bear/engine/model.ts:75
One plane of an attachment (Lowerer.attach): the anchor's gap to it.
Extends
Properties
| Property | Modifier | Type | Description | Inherited from |
|---|---|---|---|---|
anchor | readonly | string | - | - |
derived? | readonly | boolean | True when value was filled in by solve rather than authored. | ConstraintReport.derived |
eq? | readonly | EqGroup | - | ConstraintReport.eq |
kind | readonly | "attachment" | - | - |
label | readonly | string | "@A → W.start along x", "J1.start on H1.seat along y". | ConstraintReport.label |
max? | readonly | number | - | ConstraintReport.max |
measured? | readonly | number | - | ConstraintReport.measured |
min? | readonly | number | - | ConstraintReport.min |
node | readonly | TreeNode | - | ConstraintReport.node |
priority | readonly | DimPriority | - | ConstraintReport.priority |
target | readonly | string | The target as the author named it ("H1.seat", "P1"). | - |
value? | readonly | number | The stated value: a dim's, or 0 for the gap between an anchor and its plane. | ConstraintReport.value |
Type Aliases
ResolvedConstraint
type ResolvedConstraint =
| ResolvedDim
| ResolvedAttachment;Defined in: bear/engine/model.ts:82
ResolvedDim
type ResolvedDim = EffectiveDim & ConstraintReport & object;Defined in: bear/engine/model.ts:66
A dim's effective intent together with the construction node that authored it.
Type Declaration
| Name | Type | Description |
|---|---|---|
fromPlane? | WorldPlane | The world plane each endpoint resolved to. Absent when it did not resolve. |
kind | "dim" | - |
toPlane? | WorldPlane | - |
Functions
isModel()
function isModel(value): value is ModelView;Defined in: bear/engine/model.ts:84
Parameters
| Parameter | Type |
|---|---|
value | unknown |
Returns
value is ModelView