@hatiolab/things-scene 10.1.72 → 10.1.73
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import * as THREE from 'three';
|
|
2
|
-
import { type FigureAsset, type FigureAssetEvaluation, type FigureDriver } from '@hatiolab/figure-model';
|
|
2
|
+
import { type FigureAsset, type FigureAssetEvaluation, type FigureCapabilityChangesEvaluator, type FigureAssetGeometry, type FigureDriver } from '@hatiolab/figure-model';
|
|
3
3
|
import { type CompiledFigure } from './figure-compile-cache.js';
|
|
4
|
+
/** The rig's own evaluator: one that tells an evaluation as its changes (figure-model docs/evaluation-changes-design.md). */
|
|
5
|
+
type RigEvaluator = FigureCapabilityChangesEvaluator;
|
|
4
6
|
/** What the rig's own evaluator returns: an instance's evaluation, its values and places frozen (figure-model F1). */
|
|
5
|
-
type InstanceEvaluation = ReturnType<
|
|
7
|
+
type InstanceEvaluation = ReturnType<RigEvaluator['evaluate']>;
|
|
6
8
|
/**
|
|
7
9
|
* An evaluation as the rig dresses it: bodies with their appearance, and the places the evaluator gave -- read, never
|
|
8
10
|
* written, so they keep the evaluator's (frozen) type.
|
|
@@ -10,6 +12,18 @@ type InstanceEvaluation = ReturnType<ReturnType<CompiledFigure['document']['eval
|
|
|
10
12
|
export type FigureRigEvaluation = Omit<FigureAssetEvaluation, 'bindings'> & {
|
|
11
13
|
bindings: InstanceEvaluation['bindings'];
|
|
12
14
|
};
|
|
15
|
+
/**
|
|
16
|
+
* What the rig last drew from (\`lastDrawn\`): its own drawing state, not a kernel snapshot. The bodies are the rig's --
|
|
17
|
+
* dressed, made from the kernel's changes (ids, keys, shapes, poses, flags) or from a snapshot -- and are not frozen;
|
|
18
|
+
* the places are the kernel's, as it told them. Pose steps move the meshes past it. The kernel's snapshot, as it stands
|
|
19
|
+
* now, is \`evaluation()\`.
|
|
20
|
+
*/
|
|
21
|
+
export type FigureRigDrawing = {
|
|
22
|
+
geometry: FigureAssetGeometry[];
|
|
23
|
+
bindings: InstanceEvaluation['bindings'];
|
|
24
|
+
inputs: Record<string, number>;
|
|
25
|
+
palette: Record<string, string>;
|
|
26
|
+
};
|
|
13
27
|
export interface FigureRigOptions {
|
|
14
28
|
/**
|
|
15
29
|
* A theme mapping: token → colour, replacing the asset's own snapshot where a token is present (designer's
|
|
@@ -92,6 +106,8 @@ export declare class FigureRig {
|
|
|
92
106
|
* its rollers, not its bed (figure-model's evaluator(), 2026-09-26).
|
|
93
107
|
*/
|
|
94
108
|
private evaluator?;
|
|
109
|
+
/** Each visibility flag the looks name, as the evaluator last told it. */
|
|
110
|
+
private readonly flags;
|
|
95
111
|
/** Each appearance's material, copied once. */
|
|
96
112
|
private readonly materials;
|
|
97
113
|
/**
|
|
@@ -118,11 +134,11 @@ export declare class FigureRig {
|
|
|
118
134
|
private static readonly stillJudges;
|
|
119
135
|
private static stillJudgeOf;
|
|
120
136
|
/**
|
|
121
|
-
*
|
|
122
|
-
*
|
|
123
|
-
* stand now, read \`evaluation()\`.
|
|
137
|
+
* What the meshes were last made from (\`FigureRigDrawing\`): the rig's own drawing state. It was \`lastEvaluation\`, a
|
|
138
|
+
* dressed kernel snapshot, until the rig drew from the kernel's changes (2026-10-05); renamed so no reader of the old
|
|
139
|
+
* name goes on reading a different thing unawares. For the kernel's values as they stand now, read \`evaluation()\`.
|
|
124
140
|
*/
|
|
125
|
-
|
|
141
|
+
lastDrawn: FigureRigDrawing | null;
|
|
126
142
|
/**
|
|
127
143
|
* Where each body slot of the last evaluation is drawn, for pose steps (ADR-0108): a mesh drawn alone, or a copy of a
|
|
128
144
|
* batch at an index. Made with every evaluation, valid for its generation.
|
|
@@ -179,6 +195,17 @@ export declare class FigureRig {
|
|
|
179
195
|
* made from the evaluation. Nothing is returned: read \`evaluation()\` for the values as they stand.
|
|
180
196
|
*/
|
|
181
197
|
update(): void;
|
|
198
|
+
private fromChanges;
|
|
199
|
+
/** The visibility flag a body's look names, if any. */
|
|
200
|
+
private flagOf;
|
|
201
|
+
/** A body from the kernel's changes, shown as the kernel last told its flag. */
|
|
202
|
+
private dressBody;
|
|
203
|
+
/**
|
|
204
|
+
* The one rule a body is dressed by -- from a snapshot, from changes, from a whole evaluation: the look of the part it
|
|
205
|
+
* is (a row's copy: the part it copies), one copy of that look's material, its segments, and shown as the flag the
|
|
206
|
+
* look names says (absent: shown). \`flag\` reads a flag's value where the caller has it.
|
|
207
|
+
*/
|
|
208
|
+
private dressOne;
|
|
182
209
|
/** The values as they stand now -- an evaluation, made if pose steps moved past the last one (fresh on read). */
|
|
183
210
|
evaluation(): FigureRigEvaluation;
|
|
184
211
|
private movesMerged;
|
|
@@ -207,6 +234,8 @@ export declare class FigureRig {
|
|
|
207
234
|
* with no second account of the motion. Null when the asset declares no place by that id.
|
|
208
235
|
*/
|
|
209
236
|
placeNode(id: string): THREE.Object3D | null;
|
|
237
|
+
/** One place from the kernel as it stands; after a refused evaluation (nothing bound) the snapshot answers instead. */
|
|
238
|
+
private placeNow;
|
|
210
239
|
private static pose;
|
|
211
240
|
/** The batch plan for these bodies: the last one while only their poses moved, a new one otherwise. */
|
|
212
241
|
private planOf;
|
|
@@ -235,6 +264,11 @@ export declare class FigureRig {
|
|
|
235
264
|
/** The inputs this rig evaluates at now: the figure's defaults, its drivers and external values, and its size. */
|
|
236
265
|
evaluationInputs(): Record<string, number>;
|
|
237
266
|
evaluate(): FigureRigEvaluation;
|
|
267
|
+
/**
|
|
268
|
+
* A whole evaluation at the rig's inputs, dressed by the rig's one rule -- for a rig asked once and let go (the plan
|
|
269
|
+
* seen from above): no instance evaluator is made, nothing is kept or frozen, all of it is the caller's.
|
|
270
|
+
*/
|
|
271
|
+
evaluateOnce(): FigureRigDrawing;
|
|
238
272
|
/** An evaluation's bodies with their appearance: material, visibility and segments. */
|
|
239
273
|
private dress;
|
|
240
274
|
private colourOf;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"figure-rig.d.ts","sourceRoot":"","sources":["../../src/figure/figure-rig.ts"],"names":[],"mappings":"AAiCA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAML,KAAK,WAAW,EAChB,KAAK,qBAAqB,EAE1B,KAAK,YAAY,EAClB,MAAM,wBAAwB,CAAA;AAI/B,OAAO,EAAoB,KAAK,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAIjF,
|
|
1
|
+
{"version":3,"file":"figure-rig.d.ts","sourceRoot":"","sources":["../../src/figure/figure-rig.ts"],"names":[],"mappings":"AAiCA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAML,KAAK,WAAW,EAChB,KAAK,qBAAqB,EAE1B,KAAK,gCAAgC,EACrC,KAAK,mBAAmB,EACxB,KAAK,YAAY,EAClB,MAAM,wBAAwB,CAAA;AAI/B,OAAO,EAAoB,KAAK,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAIjF,6HAA6H;AAC7H,KAAK,YAAY,GAAG,gCAAgC,CAAA;AACpD,sHAAsH;AACtH,KAAK,kBAAkB,GAAG,UAAU,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC,CAAA;AAE9D;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,qBAAqB,EAAE,UAAU,CAAC,GAAG;IAAE,QAAQ,EAAE,kBAAkB,CAAC,UAAU,CAAC,CAAA;CAAE,CAAA;AAExH;;;;;GAKG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAAE,QAAQ,EAAE,mBAAmB,EAAE,CAAC;IAAC,QAAQ,EAAE,kBAAkB,CAAC,UAAU,CAAC,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,CAAA;AAK7K,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC,MA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,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAUlG;IAED;;;OAGG;IACH,kHAAkH;IAClH,gBAAgB,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAU1C,QAAQ,IAAI,mBAAmB;IAO/B;;;OAGG;IACH,YAAY,IAAI,gBAAgB;IAQhC,uFAAuF;IACvF,OAAO,CAAC,KAAK;IAmBb,OAAO,CAAC,QAAQ;IAIhB,OAAO,CAAC,WAAW;IAqBnB,gHAAgH;IAChH,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,KAAK,CAAC,IAAI,GAAG,SAAS;IAI1C,yHAAyH;IACzH,QAAQ,IAAI,MAAM,EAAE;IAOpB,OAAO,IAAI,IAAI;CA2BhB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hatiolab/things-scene",
|
|
3
|
-
"version": "10.1.
|
|
3
|
+
"version": "10.1.73",
|
|
4
4
|
"description": "A high-performance 2D/3D scene graph library for building interactive visual editors, combining HTML5 Canvas and Three.js to enable facility visualization, data-driven animations, and real-time monitoring dashboards",
|
|
5
5
|
"main": "things-scene-min.js",
|
|
6
6
|
"module": "things-scene.mjs",
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
},
|
|
92
92
|
"homepage": "https://github.com/hatiolab/things-scene#readme",
|
|
93
93
|
"dependencies": {
|
|
94
|
-
"@hatiolab/figure-model": "^0.3.
|
|
94
|
+
"@hatiolab/figure-model": "^0.3.4",
|
|
95
95
|
"@wizpanda/super-gif": "^0.0.6",
|
|
96
96
|
"dompurify": "^3.3.1",
|
|
97
97
|
"jsonata": "^1.8.6",
|