@hatiolab/things-scene 10.1.22 → 10.1.24

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 +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;AAO7D,OAAO,EAAyD,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4E9G,qBAAa,cAAe,SAAQ,mBAAe;IACjD;;;;;OAKG;IACH,MAAM,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,GAAE,SAAS,MAAM,EAAO,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI;IAwBjG;;;;;;;;;OASG;IACH,MAAM,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;IAEzB;;;;;OAKG;IACH,IAAI,aAAa,IAAI,aAAa,CAUjC;IAED,IAAI,eAAe,IAAI,OAAO,CAE7B;IAED,OAAO,IAAI,OAAO;IAIlB,IAAI,MAAM,IAAI,eAAe,CAE5B;IAED,eAAe,IAAI,WA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AO,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI;IAwBjG;;;;;;;;;OASG;IACH,MAAM,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;IAEzB;;;;;OAKG;IACH,IAAI,aAAa,IAAI,aAAa,CAUjC;IAED,IAAI,eAAe,IAAI,OAAO,CAE7B;IAED,OAAO,IAAI,OAAO;IAIlB,IAAI,MAAM,IAAI,eAAe,CAE5B;IAED,eAAe,IAAI,WAAW,GAAG,SAAS;IAM1C,0CAA0C;IAC1C,IAAI,MAAM,yDAET;IAED,MAAM,CAAC,GAAG,EAAE,kBAAkB;IAoC9B;;;;OAIG;IACH,OAAO,CAAC,UAAU;IAQlB;;;;;;;;;;;;;;OAcG;IACH,OAAO,CAAC,SAAS;IAuDjB;;;;;OAKG;IACH,OAAO,CAAC,QAAQ;IA2ChB,0DAA0D;IAC1D,OAAO,CAAC,UAAU;IAgFlB;;;OAGG;IACH,OAAO,CAAC,aAAa;IAiBrB;;;;;OAKG;IACM,UAAU,CAAC,OAAO,EAAE,kBAAkB,GAAG,IAAI;CAGvD;AAMD,eAAe,cAAc,CAAA"}
@@ -366,7 +366,7 @@ export declare class FigureRealObject extends RealObject {
366
366
  *
367
367
  * 청사진의 `placement` 는 좌표를 뒤집으라는 말이 아니라 **어느 면에 붙느냐**다. 컨베이어는
368
368
  * 바닥에 서고 OHT 는 천장에 매달린다. 높이 값 자체는 도형이 모르고 현장이 안다
369
- * (`sceneHeights`). ADR-0045(`operato-twin/design/04-decisions.md`).
369
+ * (`sceneHeights`). ADR-0045(`operato-application/adr/ADR-0045.md`).
370
370
  *
371
371
  * 한동안 이 길이 없었다. `compile()` 이 `blueprint.placement` 를 적는데 이 폴더 전체에서
372
372
  * 그 낱말을 읽는 곳이 0 건이었고, 천정 기준으로 저작한 OHT 를 도면에 놓으면 바닥에 섰다.
@@ -53,6 +53,12 @@ export declare function registerFigure(blueprint: FigureBlueprint): PreparedFigu
53
53
  *
54
54
  * 팔레트가 바뀌었으면 색을 다시 푼 것을 돌려준다.
55
55
  */
56
+ /**
57
+ * Registers the component type for a figure with its capability names and placement, through the class
58
+ * `useFigureComponent` supplied. `registerFigure` does this for a V2 blueprint; the V3 registry does it for a V3
59
+ * asset. One seam, two callers (ADR-0087 decision 5).
60
+ */
61
+ export declare function registerFigureType(type: string, capabilities?: readonly string[], placement?: string): void;
56
62
  export declare function getFigure(type: string): PreparedFigure | null;
57
63
  /** 등록된 Figure 타입 이름들. */
58
64
  export declare function figureTypes(): string[];
@@ -1 +1 @@
1
- {"version":3,"file":"figure-registry.d.ts","sourceRoot":"","sources":["../../src/figure/figure-registry.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,eAAe,EACf,oBAAoB,EACpB,qBAAqB,EACtB,MAAM,uBAAuB,CAAA;AAI9B;;;;;;;;;;;GAWG;AAEH,4CAA4C;AAC5C,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,qBAAqB,CAAA;IAC7B,KAAK,EAAE,oBAAoB,CAAA;IAC3B,mBAAmB;IACnB,KAAK,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,oBAAoB,CAAA;IAC3B,KAAK,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,eAAe,CAAA;IAC1B;;;;;;;;OAQG;IACH,UAAU,EAAE,YAAY,EAAE,CAAA;IAC1B,wBAAwB;IACxB,MAAM,EAAE,aAAa,EAAE,CAAA;IACvB,+BAA+B;IAC/B,cAAc,EAAE,MAAM,CAAA;CACvB;AAUD,iEAAiE;AACjE,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAEvD;AA4BD;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,eAAe,GAAG,cAAc,CAyBzE;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,GAAG,IAAI,CAW7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AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,GAAG,IAAI,CAW7D;AAED,yBAAyB;AACzB,wBAAgB,WAAW,IAAI,MAAM,EAAE,CAEtC;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE/C;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEtD;AAED,qBAAqB;AACrB,wBAAgB,YAAY,IAAI,IAAI,CAEnC"}
@@ -26,6 +26,16 @@ export interface FigureProfile {
26
26
  * 하나라는 규약을 지켜야 한다.
27
27
  */
28
28
  export declare function profileGeometry(profile: FigureProfile): THREE.BufferGeometry | null;
29
+ /**
30
+ * 단면을 세워서 민다.
31
+ *
32
+ * `rotateX(+90°)` 는 (x, y, zz) → (x, −zz, y) 이므로 단면의 y 가 world z 로 가고
33
+ * (평면도가 맞다), 밀린 두께는 −Y 로 간다 — 즉 [−depth, 0] 에 놓인다.
34
+ *
35
+ * `lift` 는 그것을 어디로 올릴지다. 통짜는 반만 올려 가운데를 맞추고, 속을 판 것은
36
+ * 바닥과 벽을 따로 올려 포갠다.
37
+ */
38
+ export declare function pushed(shape: THREE.Shape, depth: number, lift: number): THREE.BufferGeometry;
29
39
  /** 바깥 테. **부품 중심을 원점으로** 만든다 — 자리는 부르는 쪽이 든다. */
30
40
  export declare function outlineOf(profile: FigureProfile): THREE.Shape | null;
31
41
  /**
@@ -37,6 +47,12 @@ export declare function outlineOf(profile: FigureProfile): THREE.Shape | null;
37
47
  * 속을 판 것의 안쪽 테도 이것으로 만든다 — 같은 식으로 만들어야 바깥과 안쪽 모서리가
38
48
  * 같은 모양으로 따라온다.
39
49
  */
50
+ /**
51
+ * A rounded rectangle whose corners have two semi-axes (V3 `rounded-box@2`, shape-dimension contract §1): each
52
+ * corner is the quadratic Bézier from the end of one edge to the start of the next with the corner as control
53
+ * point, `roundX` along X and `roundZ` along Z. `roundedRect` is the equal case.
54
+ */
55
+ export declare function roundedRectXZ(width: number, depth: number, roundX: number, roundZ: number): THREE.Shape | null;
40
56
  export declare function roundedRect(width: number, depth: number, round: number): THREE.Shape | null;
41
57
  /**
42
58
  * 안쪽 테 — 바깥 테에서 벽 두께만큼 안으로 들어온 선.
@@ -1 +1 @@
1
- {"version":3,"file":"figure-shape.d.ts","sourceRoot":"","sources":["../../src/figure/figure-shape.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAK9B,2DAA2D;AAC3D,MAAM,WAAW,aAAa;IAC5B,2CAA2C;IAC3C,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,eAAe;IACf,KAAK,EAAE,MAAM,CAAA;IACb,eAAe;IACf,KAAK,EAAE,MAAM,CAAA;IACb,gBAAgB;IAChB,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,SAAS;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;IAC1C,MAAM,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CAC1C;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,aAAa,GAAG,KAAK,CAAC,cAAc,GAAG,IAAI,CA2BnF;AAkBD,iDAAiD;AACjD,wBAAgB,SAAS,CAAC,OAAO,EAAE,aAAa,GAAG,KAAK,CAAC,KAAK,GAAG,IAAI,CAYpE;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,KAAK,CAAC,KAAK,GAAG,IAAI,CA4B3F;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,MAA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M,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,KAAK,CAAC,KAAK,GAAG,IAAI,CA0B9G;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,KAAK,CAAC,KAAK,GAAG,IAAI,CA4B3F;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC,OAAO,EAAE,GAAG,IAAI,CA+C3F;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,aAAa,GAAG,KAAK,CAAC,OAAO,EAAE,EAAE,GAAG,IAAI,CAa9E"}
@@ -0,0 +1,29 @@
1
+ import { type V3Appearance, type V3Asset, type V3CompiledAsset, type V3CompiledCapabilities } from '@hatiolab/figure-model';
2
+ /** FNV-1a over the canonical JSON, twice with different seeds, as 16 hex characters. Content only, no identity. */
3
+ export declare function fingerprintV3Asset(asset: V3Asset): string;
4
+ export interface CompiledV3 {
5
+ key: string;
6
+ fingerprint: string;
7
+ kernel: string;
8
+ /** The asset compiled at its stored inputs: what `compileV3Asset` gives, validated as a whole. */
9
+ compiled: V3CompiledAsset;
10
+ /**
11
+ * The document compiled on its own, evaluated with **every** input (size and state) per instance. The asset
12
+ * level fixes the design inputs at compile time, which is right for storage and wrong for a board where one
13
+ * asset stands at many sizes; the document level is what the renderer evaluates.
14
+ */
15
+ document: V3CompiledCapabilities;
16
+ /** Appearance by placing node id (a `place@1` id or a repeated `member@1` id). */
17
+ looks: Map<string, V3Appearance>;
18
+ /** Value reference → the node that writes it, for mapping a repeated copy's `key` to its member. */
19
+ writers: Map<string, string>;
20
+ /** A frozen copy of the source the result was compiled from; the caller's object may go on changing. */
21
+ asset: V3Asset;
22
+ }
23
+ /** The cache key for an asset with this kernel: fingerprint and kernel version, nothing about the instance. */
24
+ export declare function v3CompileKey(asset: V3Asset): string;
25
+ /** The compiled asset for this content under this kernel, compiled once. Throws what `compileV3Asset` throws. */
26
+ export declare function compiledV3Of(asset: V3Asset): CompiledV3;
27
+ export declare function v3CompileCacheSize(): number;
28
+ export declare function resetV3CompileCache(): void;
29
+ //# sourceMappingURL=figure-v3-compile-cache.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"figure-v3-compile-cache.d.ts","sourceRoot":"","sources":["../../../src/figure/v3/figure-v3-compile-cache.ts"],"names":[],"mappings":"AAcA,OAAO,EAAwD,KAAK,YAAY,EAAE,KAAK,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,sBAAsB,EAAE,MAAM,wBAAwB,CAAA;AAejL,mHAAmH;AACnH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAWzD;AAED,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,MAAM,CAAA;IACX,WAAW,EAAE,MAAM,CAAA;IACnB,MAAM,EAAE,MAAM,CAAA;IACd,kGAAkG;IAClG,QAAQ,EAAE,eAAe,CAAA;IACzB;;;;OAIG;IACH,QAAQ,EAAE,sBAAsB,CAAA;IAChC,kFAAkF;IAClF,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAAA;IAChC,oGAAoG;IACpG,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC5B,wGAAwG;IACxG,KAAK,EAAE,OAAO,CAAA;CACf;AAKD,+GAA+G;AAC/G,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAEnD;AAED,iHAAiH;AACjH,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,UAAU,CA0BvD;AAED,wBAAgB,kBAAkB,IAAI,MAAM,CAE3C;AAED,wBAAgB,mBAAmB,IAAI,IAAI,CAE1C"}
@@ -0,0 +1,11 @@
1
+ import * as THREE from 'three';
2
+ import type { V3Shape } from '@hatiolab/figure-model';
3
+ /** The shared geometry for a body. Call `releaseV3Geometry` with the same shape when the mesh goes away. */
4
+ export declare function acquireV3Geometry(shape: V3Shape, segments?: number): THREE.BufferGeometry;
5
+ export declare function releaseV3Geometry(geometry: THREE.BufferGeometry): void;
6
+ /** How many distinct bodies are held. For tests and for the maturity numbers. */
7
+ export declare function v3GeometryCount(): number;
8
+ export declare function resetV3Geometry(): void;
9
+ /** Builds a body centred in its own frame, as the contract defines it. Not cached; use `acquireV3Geometry`. */
10
+ export declare function buildV3Geometry(shape: V3Shape, segments?: number): THREE.BufferGeometry;
11
+ //# sourceMappingURL=figure-v3-geometry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"figure-v3-geometry.d.ts","sourceRoot":"","sources":["../../../src/figure/v3/figure-v3-geometry.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;AAiBrD,4GAA4G;AAC5G,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,GAAE,MAAyB,GAAG,KAAK,CAAC,cAAc,CAW3G;AAED,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,KAAK,CAAC,cAAc,GAAG,IAAI,CAStE;AAED,iFAAiF;AACjF,wBAAgB,eAAe,IAAI,MAAM,CAExC;AAED,wBAAgB,eAAe,IAAI,IAAI,CAGtC;AAED,+GAA+G;AAC/G,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,GAAE,MAAyB,GAAG,KAAK,CAAC,cAAc,CA6DzG"}
@@ -0,0 +1,41 @@
1
+ import * as THREE from 'three';
2
+ import { RealObject } from '../../threed/real-object.js';
3
+ import type { Properties } from '../../interfaces/types.js';
4
+ import { type RegisteredV3Figure } from './figure-v3-registry.js';
5
+ export declare class FigureV3RealObject extends RealObject<THREE.Group> {
6
+ private rig;
7
+ private unsubscribe?;
8
+ get figure(): RegisteredV3Figure | null;
9
+ protected getObject3dInstance(): THREE.Group;
10
+ build(): void;
11
+ /** The instance's external state values: `state.parameters`, name → value in the input's unit. */
12
+ get parameters(): Record<string, number>;
13
+ /** The instance's playback speeds: `state.clips`, clip name → speed, 0 or absent stops the clip. */
14
+ get clipSpeeds(): Record<string, number>;
15
+ /** The playback time of one clip in seconds, as the rig holds it. */
16
+ clipTime(clip: string): number;
17
+ onchange(after: Properties, before: Properties): void;
18
+ /** The instance size in mm from the component's bounds and depth, or the authored size when it is not resizable. */
19
+ instanceSize(): {
20
+ x: number;
21
+ y: number;
22
+ z: number;
23
+ } | null;
24
+ get effectiveDepth(): number;
25
+ updateDimension(): void;
26
+ /** Re-reads the external state values. Clip times are untouched: a value written or withdrawn does not restart a clip. */
27
+ updateParameters(): void;
28
+ /** Re-reads the speeds. They are read every frame, so this only asks for a redraw once something may move again. */
29
+ updateClips(): void;
30
+ private refresh;
31
+ private startTicking;
32
+ /**
33
+ * One frame: every playing clip's time advances once by dt milliseconds × its speed, then the rig evaluates each
34
+ * driver at its clip's time. Nothing the drivers compute is written back as external state. Public so a test can
35
+ * step frames without the frame clock.
36
+ */
37
+ tick(dt: number): void;
38
+ private advance;
39
+ clear(): THREE.Group;
40
+ }
41
+ //# sourceMappingURL=figure-v3-real-object.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"figure-v3-real-object.d.ts","sourceRoot":"","sources":["../../../src/figure/v3/figure-v3-real-object.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AACxD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAA;AAE3D,OAAO,EAAe,KAAK,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAG9E,qBAAa,kBAAmB,SAAQ,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC;IAC7D,OAAO,CAAC,GAAG,CAA2B;IACtC,OAAO,CAAC,WAAW,CAAC,CAAa;IAEjC,IAAI,MAAM,IAAI,kBAAkB,GAAG,IAAI,CAEtC;cAEkB,mBAAmB,IAAI,KAAK,CAAC,KAAK;IAI5C,KAAK,IAAI,IAAI;IAYtB,kGAAkG;IAClG,IAAI,UAAU,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAGvC;IAED,oGAAoG;IACpG,IAAI,UAAU,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAGvC;IAED,qEAAqE;IACrE,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAIrB,QAAQ,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,GAAG,IAAI;IAM9D,oHAAoH;IACpH,YAAY,IAAI;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI;IAO1D,IAAa,cAAc,IAAI,MAAM,CASpC;IAEQ,eAAe,IAAI,IAAI;IAMhC,0HAA0H;IAC1H,gBAAgB,IAAI,IAAI;IAMxB,oHAAoH;IACpH,WAAW,IAAI,IAAI;IAMnB,OAAO,CAAC,OAAO;IAMf,OAAO,CAAC,YAAY;IAUpB;;;;OAIG;IACH,IAAI,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAgBtB,OAAO,CAAC,OAAO;IAIN,KAAK,IAAI,KAAK,CAAC,KAAK;CAO9B"}
@@ -0,0 +1,13 @@
1
+ import { type V3Asset } from '@hatiolab/figure-model';
2
+ import { type CompiledV3 } from './figure-v3-compile-cache.js';
3
+ export interface RegisteredV3Figure {
4
+ type: string;
5
+ compiled: CompiledV3;
6
+ }
7
+ /** Registers a V3 asset under a figure type. Compiles it (or reuses the cache) so a bad asset fails here, not on a board. */
8
+ export declare function registerFigureV3(type: string, asset: V3Asset): RegisteredV3Figure;
9
+ export declare function getFigureV3(type: string): RegisteredV3Figure | null;
10
+ export declare function hasFigureV3(type: string): boolean;
11
+ export declare function unregisterFigureV3(type: string): boolean;
12
+ export declare function resetFiguresV3(): void;
13
+ //# sourceMappingURL=figure-v3-registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"figure-v3-registry.d.ts","sourceRoot":"","sources":["../../../src/figure/v3/figure-v3-registry.ts"],"names":[],"mappings":"AAaA,OAAO,EAAkB,KAAK,OAAO,EAAE,MAAM,wBAAwB,CAAA;AAErE,OAAO,EAAgB,KAAK,UAAU,EAAE,MAAM,8BAA8B,CAAA;AAE5E,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,UAAU,CAAA;CACrB;AAID,6HAA6H;AAC7H,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,kBAAkB,CAOjF;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,kBAAkB,GAAG,IAAI,CAEnE;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEjD;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAExD;AAED,wBAAgB,cAAc,IAAI,IAAI,CAErC"}
@@ -0,0 +1,67 @@
1
+ import * as THREE from 'three';
2
+ import { type V3Asset, type V3AssetEvaluation, type V3Driver } from '@hatiolab/figure-model';
3
+ import { type CompiledV3 } from './figure-v3-compile-cache.js';
4
+ export interface FigureV3RigOptions {
5
+ /**
6
+ * A theme mapping: token → colour, replacing the asset's own snapshot where a token is present (designer's
7
+ * ruling 5). Tokens the mapping does not name keep the asset's default.
8
+ */
9
+ theme?: Record<string, string>;
10
+ }
11
+ export interface Vec3Like {
12
+ x: number;
13
+ y: number;
14
+ z: number;
15
+ }
16
+ export declare class FigureV3Rig {
17
+ readonly group: THREE.Group<THREE.Object3DEventMap>;
18
+ readonly compiled: CompiledV3;
19
+ private readonly meshes;
20
+ private size;
21
+ /** External control sources, kept apart from what drivers compute: a connector's values, never a driver's. */
22
+ private external;
23
+ /** Playback seconds per clip. A driver belongs to the clip its id starts with (`<clip>/<part>/<path>`). */
24
+ private clipTimes;
25
+ private theme;
26
+ /** The last evaluation, for readers that want the numbers behind the meshes. */
27
+ last: V3AssetEvaluation | null;
28
+ constructor(asset: V3Asset, options?: FigureV3RigOptions);
29
+ get asset(): V3Asset;
30
+ /** The size the asset was authored at: its stored `size.*` design inputs, or null when it is not resizable. */
31
+ get base(): Vec3Like | null;
32
+ /** The instance size in mm; null returns to the authored size. */
33
+ setSize(size: Vec3Like | null): void;
34
+ /** External control sources: state values a connector or the board wrote. These win over drivers. */
35
+ setState(values: Record<string, number>): void;
36
+ /** The clip a driver belongs to: the first segment of its id. */
37
+ static clipOf(driver: V3Driver): string;
38
+ /** The asset's clip names, in driver order. */
39
+ get clips(): string[];
40
+ /** Playback time in seconds of one clip. Each driver is evaluated at its own clip's time. */
41
+ setClipTime(clip: string, seconds: number): void;
42
+ /** The playback time of one clip, 0 before it has moved. */
43
+ clipTime(clip: string): number;
44
+ /** One time for every clip, for readers that have a single clock. */
45
+ setTime(seconds: number): void;
46
+ /**
47
+ * The state overrides for this moment: each driver at its clip's time, then the external values over them. One
48
+ * active source per state: an external value masks the driver, and the clip's time keeps its own count, so when
49
+ * the external value is withdrawn the driver's value at the clip's current time shows again.
50
+ */
51
+ stateOverrides(): Record<string, number>;
52
+ /** The external values as last set, for readers that want to know what masks the drivers. */
53
+ get externalState(): Record<string, number>;
54
+ /** Evaluate at the current size, state and time, and bring the meshes up to date. */
55
+ update(): V3AssetEvaluation;
56
+ /**
57
+ * The evaluation only, without touching meshes. The document is compiled once per content and kernel; the
58
+ * instance's size and state are inputs to the evaluation, never a reason to compile again.
59
+ */
60
+ evaluate(): V3AssetEvaluation;
61
+ private colourOf;
62
+ private materialFor;
63
+ /** Meshes by body id, for tests and for bindings that need a part's mesh. */
64
+ meshOf(id: string): THREE.Mesh | undefined;
65
+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MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI;IAI9C,iEAAiE;IACjE,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,GAAG,MAAM;IAIvC,+CAA+C;IAC/C,IAAI,KAAK,IAAI,MAAM,EAAE,CAEpB;IAED,6FAA6F;IAC7F,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI;IAIhD,4DAA4D;IAC5D,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAI9B,qEAAqE;IACrE,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAI9B;;;;OAIG;IACH,cAAc,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAYxC,6FAA6F;IAC7F,IAAI,aAAa,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAE1C;IAED,qFAAqF;IACrF,MAAM,IAAI,iBAAiB;IAsC3B;;;OAGG;IACH,QAAQ,IAAI,iBAAiB;IAoB7B,OAAO,CAAC,QAAQ;IAIhB,OAAO,CAAC,WAAW;IAqBnB,6EAA6E;IAC7E,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,KAAK,CAAC,IAAI,GAAG,SAAS;IAI1C,OAAO,IAAI,IAAI;CAOhB"}
@@ -225,7 +225,7 @@ export declare abstract class RealObject<T extends THREE.Object3D = THREE.Object
225
225
  * 부착면의 **높이** — 씬(현장)의 사실이다.
226
226
  *
227
227
  * 도형은 「나는 천장에 매달린다」까지만 안다. 그 천장이 3m 인지 6m 인지는 도형이 알 수
228
- * 없고 현장이 안다. ADR-0045(`operato-twin/design/04-decisions.md`) — archetype 은 청사진의
228
+ * 없고 현장이 안다. ADR-0045(`operato-application/adr/ADR-0045.md`) — archetype 은 청사진의
229
229
  * 사실이고 높이 값은 씬의 사실이라, 둘을 갈라서 나른다.
230
230
  *
231
231
  * **여기는 자리(slot)이고 값은 공급자가 댄다.** things-scene 은 figure 가 쓰는 둘만 안다 —
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hatiolab/things-scene",
3
- "version": "10.1.22",
3
+ "version": "10.1.24",
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",
@@ -45,6 +45,7 @@
45
45
  ],
46
46
  "scripts": {
47
47
  "test": "mocha --exit --require should --require ./test/setup.js --node-option import=tsx test/**/test-*.js",
48
+ "test:figure-v3": "TSX_TSCONFIG_PATH=./test/tsconfig.figure-model-src.json mocha --exit --require should --require ./test/setup.js --node-option import=./test/resolve-figure-model.mjs test/v3/figure-v3-rig.check.js",
48
49
  "test:case": "mocha --require should --require ./test/setup.js --node-option import=tsx",
49
50
  "clean": "rimraf dist-types things-scene*.js *.js.map",
50
51
  "build": "yarn clean && yarn build:types && yarn build:rollup:prod",
@@ -90,7 +91,7 @@
90
91
  },
91
92
  "homepage": "https://github.com/hatiolab/things-scene#readme",
92
93
  "dependencies": {
93
- "@hatiolab/figure-model": "^0.1.24",
94
+ "@hatiolab/figure-model": "^0.1.36",
94
95
  "@wizpanda/super-gif": "^0.0.6",
95
96
  "dompurify": "^3.3.1",
96
97
  "jsonata": "^1.8.6",