@hatiolab/things-scene 10.1.74 → 10.1.76
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.
- package/dist-types/figure/figure-instance.d.ts +26 -6
- package/dist-types/figure/figure-instance.d.ts.map +1 -1
- package/dist-types/figure/figure-real-object.d.ts +9 -1
- package/dist-types/figure/figure-real-object.d.ts.map +1 -1
- package/dist-types/figure/figure-size.d.ts +31 -0
- package/dist-types/figure/figure-size.d.ts.map +1 -0
- package/dist-types/figure/figure-top-view.d.ts +4 -3
- package/dist-types/figure/figure-top-view.d.ts.map +1 -1
- package/package.json +1 -1
- package/things-scene-min.js +2 -2
- package/things-scene-min.js.map +1 -1
- package/things-scene.mjs +2 -2
- package/things-scene.mjs.map +1 -1
|
@@ -269,20 +269,40 @@ export declare class FigureInstance extends FigureInstance_base {
|
|
|
269
269
|
get hasTextProperty(): boolean;
|
|
270
270
|
is3dish(): boolean;
|
|
271
271
|
/**
|
|
272
|
-
* The component's properties
|
|
273
|
-
*
|
|
274
|
-
*
|
|
272
|
+
* The component's properties, each a map edited by the general \`number-map\` editor:
|
|
273
|
+
* - the design values the figure publishes (ADR-0096) -- \`state.designInputs\`, with name, unit, range and the
|
|
274
|
+
* figure's own value;
|
|
275
|
+
* - its state values, the joints and other moving inputs -- \`state.parameters\`, with unit, range and the figure's
|
|
276
|
+
* resting value;
|
|
277
|
+
* - its clips -- \`state.clips\`, clip name → playback speed 0–3 (as the figure modeller plays it), 0 or empty stopped.
|
|
278
|
+
* A map the figure has nothing for is not offered.
|
|
275
279
|
*/
|
|
276
280
|
get nature(): ComponentNature;
|
|
277
281
|
buildRealObject(): IRealObject | undefined;
|
|
278
282
|
render(ctx: SceneRenderContext): void;
|
|
279
283
|
private _top?;
|
|
280
284
|
/**
|
|
281
|
-
* The plan at this instance's size, the size the 3D object
|
|
282
|
-
* the
|
|
283
|
-
* figure content and size, not per frame.
|
|
285
|
+
* The plan at this instance's applied size (`figureAppliedSize`), the size the 3D object is drawn at: re-evaluated
|
|
286
|
+
* with the size inputs, or the authored plan at one scale. Evaluated once per figure content and size, not per frame.
|
|
284
287
|
*/
|
|
285
288
|
private topView;
|
|
289
|
+
/** The depth written on the instance, when one is. */
|
|
290
|
+
get askedDepth(): number | undefined;
|
|
291
|
+
adjustResize(bounds: {
|
|
292
|
+
left: number;
|
|
293
|
+
top: number;
|
|
294
|
+
width: number;
|
|
295
|
+
height: number;
|
|
296
|
+
}, origin: any, diagonal: boolean): {
|
|
297
|
+
left: any;
|
|
298
|
+
top: any;
|
|
299
|
+
width: any;
|
|
300
|
+
height: any;
|
|
301
|
+
};
|
|
302
|
+
added(parent: any): void;
|
|
303
|
+
onchange(after: Record<string, any>, before: Record<string, any>): void;
|
|
304
|
+
/** Sets the box to the applied size's occupancy, when it is not already. */
|
|
305
|
+
private fitBoxToFigure;
|
|
286
306
|
/** The place the figure takes, so a 2D board shows where it stands. */
|
|
287
307
|
private renderPlace;
|
|
288
308
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"figure-instance.d.ts","sourceRoot":"","sources":["../../src/figure/figure-instance.ts"],"names":[],"mappings":"AAIA,OAAO,SAAS,MAAM,4BAA4B,CAAA;AAClD,OAAO,KAAK,MAAM,wBAAwB,CAAA;AAE1C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AACpE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AI,MAAM,GAAG,SAAS,CAGnC;IAQD,YAAY,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,OAAO;;;;;;IAkBjH,KAAK,CAAC,MAAM,EAAE,GAAG;IAKjB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAShE,4EAA4E;IAC5E,OAAO,CAAC,cAAc;IAgBtB,uEAAuE;IACvE,OAAO,CAAC,WAAW;IAiBnB;;;;OAIG;IACM,UAAU,CAAC,OAAO,EAAE,kBAAkB,GAAG,IAAI;CAGvD;AAMD,eAAe,cAAc,CAAA"}
|
|
@@ -25,12 +25,18 @@ export declare class FigureRealObject extends RealObject<THREE.Group> {
|
|
|
25
25
|
/** The playback time of one clip in seconds, as the rig holds it. */
|
|
26
26
|
clipTime(clip: string): number;
|
|
27
27
|
onchange(after: Properties, before: Properties): void;
|
|
28
|
-
/**
|
|
28
|
+
/**
|
|
29
|
+
* The size applied from the component's box (`figureAppliedSize`, ADR-0087 2026-10-06) -- the one the 2D plan is
|
|
30
|
+
* drawn at too: the size inputs to evaluate with, or one scale for a figure that has none.
|
|
31
|
+
*/
|
|
32
|
+
private applied;
|
|
33
|
+
/** The size inputs the rig evaluates with; null when the figure has none and is scaled as a whole. */
|
|
29
34
|
instanceSize(): {
|
|
30
35
|
x: number;
|
|
31
36
|
y: number;
|
|
32
37
|
z: number;
|
|
33
38
|
} | null;
|
|
39
|
+
/** The height the instance stands in: its applied occupancy's. */
|
|
34
40
|
get effectiveDepth(): number;
|
|
35
41
|
/**
|
|
36
42
|
* Where it stands when the board did not say: what the asset says it is authored from (`placement`). A
|
|
@@ -38,6 +44,8 @@ export declare class FigureRealObject extends RealObject<THREE.Group> {
|
|
|
38
44
|
*/
|
|
39
45
|
get effectiveZPos(): number;
|
|
40
46
|
updateDimension(): void;
|
|
47
|
+
/** Evaluates the rig at the applied size inputs, or scales its whole group by the applied scale. */
|
|
48
|
+
private size;
|
|
41
49
|
/**
|
|
42
50
|
* The asset frame rises from the floor -- its y = 0 is the bottom of the instance (ADR-0065) -- while the object3d
|
|
43
51
|
* stands at the centre of the instance's box, as every real object does. The rig is lowered by half the instance's
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"figure-real-object.d.ts","sourceRoot":"","sources":["../../src/figure/figure-real-object.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AACrD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAExD,OAAO,EAAyC,KAAK,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AACtG,OAAO,EAAa,KAAK,sBAAsB,EAAE,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"figure-real-object.d.ts","sourceRoot":"","sources":["../../src/figure/figure-real-object.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AACrD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAExD,OAAO,EAAyC,KAAK,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AACtG,OAAO,EAAa,KAAK,sBAAsB,EAAE,MAAM,sBAAsB,CAAA;AAI7E,qBAAa,gBAAiB,SAAQ,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC;IAC3D,OAAO,CAAC,GAAG,CAAyB;IACpC,OAAO,CAAC,WAAW,CAAC,CAAa;IACjC,OAAO,CAAC,QAAQ,CAAI;IAEpB,IAA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AI,IAAI;IAM1B,0HAA0H;IAC1H,gBAAgB,IAAI,IAAI;IAMxB,oHAAoH;IACpH,WAAW,IAAI,IAAI;IAUnB,OAAO,CAAC,OAAO;IAMf,OAAO,CAAC,YAAY;IAUpB;;;;OAIG;IACH,IAAI,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAgBtB,OAAO,CAAC,OAAO;IAIf;;;;;OAKG;IACH,eAAe,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,GAAG;QAAE,MAAM,EAAE,KAAK,CAAC,QAAQ,CAAC;QAAC,aAAa,EAAE;YAAE,CAAC,EAAE,MAAM,CAAC;YAAC,CAAC,EAAE,MAAM,CAAC;YAAC,CAAC,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,GAAG,SAAS;IAa7J,KAAK,IAAI,KAAK,CAAC,KAAK;CAO9B;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,GAAG,UAAU,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAUxG"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type FigureAsset } from '@hatiolab/figure-model';
|
|
2
|
+
export type FigureAxis = 'x' | 'y' | 'z';
|
|
3
|
+
type Vec3 = {
|
|
4
|
+
x: number;
|
|
5
|
+
y: number;
|
|
6
|
+
z: number;
|
|
7
|
+
};
|
|
8
|
+
/** The size applied: the inputs evaluated with (null for a proportional figure), its occupancy, and the scale. */
|
|
9
|
+
export interface FigureAppliedSize {
|
|
10
|
+
/** Size inputs to evaluate with; null when the figure has none and is scaled as a whole. */
|
|
11
|
+
readonly inputs: Vec3 | null;
|
|
12
|
+
/** One scale on X, Y and Z from the authored occupancy; 1 for a figure evaluated at its inputs. */
|
|
13
|
+
readonly scale: number;
|
|
14
|
+
/** The evaluated occupancy, mm: X across (width), Y up (depth), Z deep (height). The instance's box. */
|
|
15
|
+
readonly occupancy: Vec3;
|
|
16
|
+
}
|
|
17
|
+
/** Whether the figure is resized with its proportions kept: no size inputs, or declared one ratio. */
|
|
18
|
+
export declare function figureIsProportional(asset: FigureAsset): boolean;
|
|
19
|
+
/** The authored occupancy (mm), the size a figure is placed at before anyone resizes it. */
|
|
20
|
+
export declare function figureAuthoredOccupancy(asset: FigureAsset): Vec3;
|
|
21
|
+
/**
|
|
22
|
+
* The size applied for a box the board asks for (mm: x = width, z = height, y = depth when given). `changed` names
|
|
23
|
+
* the axes the person changed; a proportional figure takes its scale from the first of them, else from the width.
|
|
24
|
+
*/
|
|
25
|
+
export declare function figureAppliedSize(asset: FigureAsset, asked: {
|
|
26
|
+
x: number;
|
|
27
|
+
z: number;
|
|
28
|
+
y?: number;
|
|
29
|
+
}, changed?: readonly FigureAxis[]): FigureAppliedSize;
|
|
30
|
+
export {};
|
|
31
|
+
//# sourceMappingURL=figure-size.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"figure-size.d.ts","sourceRoot":"","sources":["../../src/figure/figure-size.ts"],"names":[],"mappings":"AAiBA,OAAO,EAA0C,KAAK,WAAW,EAAE,MAAM,wBAAwB,CAAA;AAEjG,MAAM,MAAM,UAAU,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAA;AACxC,KAAK,IAAI,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA;AAI/C,kHAAkH;AAClH,MAAM,WAAW,iBAAiB;IAChC,4FAA4F;IAC5F,QAAQ,CAAC,MAAM,EAAE,IAAI,GAAG,IAAI,CAAA;IAC5B,mGAAmG;IACnG,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,wGAAwG;IACxG,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAA;CACzB;AAyFD,sGAAsG;AACtG,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAEhE;AAED,4FAA4F;AAC5F,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI,CAEhE;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,CAAC,EAAE,MAAM,CAAA;CAAE,EAAE,OAAO,GAAE,SAAS,UAAU,EAAO,GAAG,iBAAiB,CA+BzJ"}
|
|
@@ -4,12 +4,13 @@ export type { FigureTopShape, FigureTopView };
|
|
|
4
4
|
/** The outline of points on a plane: their convex hull, counter-clockwise. figure-model's own. */
|
|
5
5
|
export declare const convexHull: typeof figureConvexHull;
|
|
6
6
|
/**
|
|
7
|
-
* The figure's plan at a size (mm; null for its authored size). A
|
|
8
|
-
*
|
|
7
|
+
* The figure's plan at a size (mm; null for its authored size). A figure with no size inputs is drawn in proportion
|
|
8
|
+
* instead: its authored plan at one `scale` (ADR-0087, 2026-10-06), as the 3D object scales its whole group. A body the
|
|
9
|
+
* asset does not show, or a shape with no sample points, is left out.
|
|
9
10
|
*/
|
|
10
11
|
export declare function figureTopView(figure: RegisteredFigureFigure, size: {
|
|
11
12
|
x: number;
|
|
12
13
|
y: number;
|
|
13
14
|
z: number;
|
|
14
|
-
} | null): FigureTopView;
|
|
15
|
+
} | null, scale?: number): FigureTopView;
|
|
15
16
|
//# sourceMappingURL=figure-top-view.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"figure-top-view.d.ts","sourceRoot":"","sources":["../../src/figure/figure-top-view.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,gBAAgB,EAAqB,KAAK,cAAc,EAAE,KAAK,aAAa,EAAE,MAAM,wBAAwB,CAAA;AAGrH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAA;AAElE,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,CAAA;AAE7C,kGAAkG;AAClG,eAAO,MAAM,UAAU,yBAAmB,CAAA;AAE1C
|
|
1
|
+
{"version":3,"file":"figure-top-view.d.ts","sourceRoot":"","sources":["../../src/figure/figure-top-view.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,gBAAgB,EAAqB,KAAK,cAAc,EAAE,KAAK,aAAa,EAAE,MAAM,wBAAwB,CAAA;AAGrH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAA;AAElE,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,CAAA;AAE7C,kGAAkG;AAClG,eAAO,MAAM,UAAU,yBAAmB,CAAA;AAE1C;;;;GAIG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,sBAAsB,EAC9B,IAAI,EAAE;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,EAChD,KAAK,SAAI,GACR,aAAa,CAcf"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hatiolab/things-scene",
|
|
3
|
-
"version": "10.1.
|
|
3
|
+
"version": "10.1.76",
|
|
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",
|