@selvajs/visualization 1.0.0-beta.1 → 1.0.0-beta.2

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.
Files changed (43) hide show
  1. package/README.md +7 -7
  2. package/dist/gpu-dispose-Dkj-BKt4.js +2 -0
  3. package/dist/gpu-dispose-Dkj-BKt4.js.map +1 -0
  4. package/dist/gpu-dispose-DrN-ryj5.cjs +2 -0
  5. package/dist/gpu-dispose-DrN-ryj5.cjs.map +1 -0
  6. package/dist/index.cjs +0 -1
  7. package/dist/index.d.cts +1 -2
  8. package/dist/index.d.ts +1 -2
  9. package/dist/index.js +1 -1
  10. package/dist/parse.cjs +3 -3
  11. package/dist/parse.cjs.map +1 -1
  12. package/dist/parse.d.cts +117 -110
  13. package/dist/parse.d.ts +117 -110
  14. package/dist/parse.js +3 -3
  15. package/dist/parse.js.map +1 -1
  16. package/dist/render.cjs +5 -6
  17. package/dist/render.cjs.map +1 -1
  18. package/dist/render.d.cts +322 -312
  19. package/dist/render.d.ts +322 -312
  20. package/dist/render.js +5 -6
  21. package/dist/render.js.map +1 -1
  22. package/dist/rolldown-runtime-BocRIvOZ.cjs +1 -0
  23. package/dist/scene.cjs +1 -1
  24. package/dist/scene.cjs.map +1 -1
  25. package/dist/scene.d.cts +94 -89
  26. package/dist/scene.d.ts +94 -89
  27. package/dist/scene.js +1 -1
  28. package/dist/scene.js.map +1 -1
  29. package/dist/types-Di80Y609.d.cts +34 -0
  30. package/dist/types-Di80Y609.d.ts +34 -0
  31. package/package.json +13 -8
  32. package/dist/chunk-5XGN7UAV.js +0 -2
  33. package/dist/chunk-5XGN7UAV.js.map +0 -1
  34. package/dist/chunk-AZ4GBXXL.cjs +0 -2
  35. package/dist/chunk-AZ4GBXXL.cjs.map +0 -1
  36. package/dist/chunk-BYLIBOAU.cjs +0 -2
  37. package/dist/chunk-BYLIBOAU.cjs.map +0 -1
  38. package/dist/chunk-KRA5RVHM.js +0 -2
  39. package/dist/chunk-KRA5RVHM.js.map +0 -1
  40. package/dist/index.cjs.map +0 -1
  41. package/dist/index.js.map +0 -1
  42. package/dist/types-DCuos3gI.d.cts +0 -33
  43. package/dist/types-DCuos3gI.d.ts +0 -33
package/dist/parse.d.cts CHANGED
@@ -1,12 +1,13 @@
1
- import * as THREE from 'three';
2
- import { M as MaterialAppearanceOptions } from './types-DCuos3gI.cjs';
3
-
1
+ import { i as MaterialAppearanceOptions } from "./types-Di80Y609.cjs";
2
+ import * as THREE from "three";
3
+ //#region src/parse/mesh-policy.d.ts
4
4
  /** Structurally, not nominally, typed as `@selvajs/solve/client`'s `MeshPolicy<THREE.Object3D>` — avoids a dependency on solve. */
5
5
  declare const meshPolicy: {
6
- clone(meshes: THREE.Object3D[]): THREE.Object3D[];
7
- release(meshes: THREE.Object3D[]): void;
6
+ clone(meshes: THREE.Object3D[]): THREE.Object3D[];
7
+ release(meshes: THREE.Object3D[]): void;
8
8
  };
9
-
9
+ //#endregion
10
+ //#region src/parse/webdisplay/response-envelope.d.ts
10
11
  /**
11
12
  * Declared structurally rather than imported from `@selvajs/compute` — this package converts
12
13
  * meshes, it doesn't need a Rhino.Compute client dependency to describe the shape a caller hands
@@ -14,73 +15,75 @@ declare const meshPolicy: {
14
15
  * this, so {@link getThreeMeshesFromComputeResponse} keeps accepting one unchanged.
15
16
  */
16
17
  interface DisplayDataItem {
17
- /** Namespaced wire type token, e.g. `Selva.GH.Features.Display.Services.DisplayBatch`. */
18
- type: string;
19
- data: string;
18
+ /** Namespaced wire type token, e.g. `Selva.GH.Features.Display.Services.DisplayBatch`. */
19
+ type: string;
20
+ data: string;
20
21
  }
21
22
  interface DisplayResponseValue {
22
- InnerTree: {
23
- [branchPath: string]: DisplayDataItem[];
24
- };
23
+ InnerTree: {
24
+ [branchPath: string]: DisplayDataItem[];
25
+ };
25
26
  }
26
27
  interface DisplayComputeResponse {
27
- values: DisplayResponseValue[];
28
- /** Rhino `UnitSystem` name driving unit scaling (see `SCALE_FACTORS`); unrecognized/absent scales 1. */
29
- modelunits: string;
28
+ values: DisplayResponseValue[];
29
+ /** Rhino `UnitSystem` name driving unit scaling (see `SCALE_FACTORS`); unrecognized/absent scales 1. */
30
+ modelunits: string;
30
31
  }
31
-
32
+ //#endregion
33
+ //#region src/parse/display-items/types.d.ts
32
34
  interface DisplayIdentity {
33
- /** Stable pick key: `${sourceComponentId}:${originalIndex}`. Distinct from `name` so renaming doesn't change identity. */
34
- id: string;
35
- name: string;
36
- layer: string;
37
- /** Arbitrary key-value pairs from the GH Metadata input. */
38
- metadata?: Record<string, string>;
35
+ /** Stable pick key: `${sourceComponentId}:${originalIndex}`. Distinct from `name` so renaming doesn't change identity. */
36
+ id: string;
37
+ name: string;
38
+ layer: string;
39
+ /** Arbitrary key-value pairs from the GH Metadata input. */
40
+ metadata?: Record<string, string>;
39
41
  }
40
42
  interface DisplayItemBase extends DisplayIdentity {
41
- /** Hex/rgb/named color string, parsed by `parseColor`. Falls back to a viewer default. */
42
- color?: string;
43
- /** 0-1; omitted means fully opaque. */
44
- opacity?: number;
43
+ /** Hex/rgb/named color string, parsed by `parseColor`. Falls back to a viewer default. */
44
+ color?: string;
45
+ /** 0-1; omitted means fully opaque. */
46
+ opacity?: number;
45
47
  }
46
48
  /** Rhino's Z-up frame and `{X,Y,Z}` casing. */
47
49
  interface DisplayPosition {
48
- X: number;
49
- Y: number;
50
- Z: number;
50
+ X: number;
51
+ Y: number;
52
+ Z: number;
51
53
  }
52
54
  /** Rendered as a fat `Line2` straight from `points` — nothing decodes geometry in the browser. */
53
55
  interface DisplayCurve extends DisplayItemBase {
54
- kind: 'curve';
55
- /**
56
- * Backend-tessellated polyline, flat `[x,y,z, …]` in Rhino's Z-up frame.
57
- *
58
- * Typed as required even though the plugin still sends a legacy `json` field alongside it: a
59
- * payload without `points` came from a Display component too old to render, and parsing throws
60
- * rather than treating it as a shape this package supports.
61
- */
62
- points: number[];
63
- /** Screen-space CSS px, constant regardless of zoom. Omitted uses the viewer default. */
64
- width?: number;
56
+ kind: 'curve';
57
+ /**
58
+ * Backend-tessellated polyline, flat `[x,y,z, …]` in Rhino's Z-up frame.
59
+ *
60
+ * Typed as required even though the plugin still sends a legacy `json` field alongside it: a
61
+ * payload without `points` came from a Display component too old to render, and parsing throws
62
+ * rather than treating it as a shape this package supports.
63
+ */
64
+ points: number[];
65
+ /** Screen-space CSS px, constant regardless of zoom. Omitted uses the viewer default. */
66
+ width?: number;
65
67
  }
66
68
  interface DisplayPoint extends DisplayItemBase {
67
- kind: 'point';
68
- position: DisplayPosition;
69
+ kind: 'point';
70
+ position: DisplayPosition;
69
71
  }
70
72
  type DisplayItem = DisplayCurve | DisplayPoint;
71
-
73
+ //#endregion
74
+ //#region src/parse/webdisplay/types.d.ts
72
75
  interface SerializableMaterial {
73
- color: string;
74
- metalness: number;
75
- roughness: number;
76
- opacity: number;
77
- transparent: boolean;
78
- /**
79
- * Optional color-map texture reference: http(s) URL, data URI, or plugin asset URL
80
- * (`http://localhost:{port}/assets/{hash}`). Omitted entirely (not just empty) when untextured.
81
- * When set, the mesh blob also carries per-vertex UVs (FLAG_HAS_UVS) for meshes using it.
82
- */
83
- map?: string;
76
+ color: string;
77
+ metalness: number;
78
+ roughness: number;
79
+ opacity: number;
80
+ transparent: boolean;
81
+ /**
82
+ * Optional color-map texture reference: http(s) URL, data URI, or plugin asset URL
83
+ * (`http://localhost:{port}/assets/{hash}`). Omitted entirely (not just empty) when untextured.
84
+ * When set, the mesh blob also carries per-vertex UVs (FLAG_HAS_UVS) for meshes using it.
85
+ */
86
+ map?: string;
84
87
  }
85
88
  /**
86
89
  * `vertexStart`/`vertexCount` and `indexStart`/`indexCount` are in **element units** of the
@@ -90,23 +93,23 @@ interface SerializableMaterial {
90
93
  * vertex components are 2 bytes (int16 quantized) or 4 bytes (`FLAG_FLOAT32`).
91
94
  */
92
95
  interface MeshMetadata {
93
- name: string;
94
- /** Layer path for grouping in the scene manager, e.g. 'Structure/Walls'. */
95
- layer: string;
96
- /** Index in the GH input tree before material grouping; combined with sourceComponentId
97
- * uniquely identifies the GH source geometry. */
98
- originalIndex: number;
99
- vertexCount: number;
100
- /** 3 per triangle. */
101
- indexCount: number;
102
- vertexStart: number;
103
- indexStart: number;
104
- /** Arbitrary key-value pairs from the GH Metadata input. */
105
- metadata?: Record<string, string>;
96
+ name: string;
97
+ /** Layer path for grouping in the scene manager, e.g. 'Structure/Walls'. */
98
+ layer: string;
99
+ /** Index in the GH input tree before material grouping; combined with sourceComponentId
100
+ * uniquely identifies the GH source geometry. */
101
+ originalIndex: number;
102
+ vertexCount: number;
103
+ /** 3 per triangle. */
104
+ indexCount: number;
105
+ vertexStart: number;
106
+ indexStart: number;
107
+ /** Arbitrary key-value pairs from the GH Metadata input. */
108
+ metadata?: Record<string, string>;
106
109
  }
107
110
  interface MaterialGroup {
108
- materialId: number;
109
- meshes: MeshMetadata[];
111
+ materialId: number;
112
+ meshes: MeshMetadata[];
110
113
  }
111
114
  /**
112
115
  * One Display component's payload, ready for Three.js rendering.
@@ -120,45 +123,45 @@ interface MaterialGroup {
120
123
  * blob (`items`), not inside it.
121
124
  */
122
125
  interface DisplayBatch {
123
- materials: SerializableMaterial[];
124
- groups: MaterialGroup[];
125
- compressedData: string;
126
- /** InstanceGuid of the WebDisplay GH component that produced this batch; combined with
127
- * MeshMetadata.originalIndex to backtrack any mesh to its GH source. */
128
- sourceComponentId?: string;
129
- /** Non-mesh display items — see {@link DisplayItem}. Parsed by the separate `display-items`
130
- * path, not the SLVA mesh parser. Omitted when there are none. */
131
- items?: DisplayItem[];
126
+ materials: SerializableMaterial[];
127
+ groups: MaterialGroup[];
128
+ compressedData: string;
129
+ /** InstanceGuid of the WebDisplay GH component that produced this batch; combined with
130
+ * MeshMetadata.originalIndex to backtrack any mesh to its GH source. */
131
+ sourceComponentId?: string;
132
+ /** Non-mesh display items — see {@link DisplayItem}. Parsed by the separate `display-items`
133
+ * path, not the SLVA mesh parser. Omitted when there are none. */
134
+ items?: DisplayItem[];
132
135
  }
133
136
  interface MeshBatchParsingOptions {
134
- /** Merge meshes sharing a material into a single geometry. Defaults to true. */
135
- mergeByMaterial?: boolean;
136
- debug?: boolean;
137
- /**
138
- * Appearance dials applied to every material built from this batch — set once at parse time
139
- * (materials are rebuilt per solve). Runtime restyling of an already-built scene lives in the
140
- * viewer's `setLook`.
141
- */
142
- material?: MaterialAppearanceOptions;
137
+ /** Merge meshes sharing a material into a single geometry. Defaults to true. */
138
+ mergeByMaterial?: boolean;
139
+ debug?: boolean;
140
+ /**
141
+ * Appearance dials applied to every material built from this batch — set once at parse time
142
+ * (materials are rebuilt per solve). Runtime restyling of an already-built scene lives in the
143
+ * viewer's `setLook`.
144
+ */
145
+ material?: MaterialAppearanceOptions;
143
146
  }
144
-
145
147
  interface MeshExtractionOptions {
146
- parsing?: MeshBatchParsingOptions;
147
- /** Scale geometry to model units. Defaults to true. */
148
- allowScaling?: boolean;
149
- /**
150
- * Drop geometry so its lowest point sits on the ground plane. **Defaults to `false`** — content
151
- * renders at its true Rhino coordinates, matching the Grasshopper definition. Setting `true`
152
- * shifts objects, so anything read back out of the scene (bounds, measured/picked positions) no
153
- * longer corresponds to Rhino coordinates.
154
- */
155
- allowAutoPosition?: boolean;
156
- /** Up axis for `allowAutoPosition` grounding. Defaults to `'z'` (Rhino's frame) — only set this
157
- * if the viewer is configured with a non-default `sceneUp`. */
158
- groundAxis?: 'x' | 'y' | 'z';
159
- debug?: boolean;
148
+ parsing?: MeshBatchParsingOptions;
149
+ /** Scale geometry to model units. Defaults to true. */
150
+ allowScaling?: boolean;
151
+ /**
152
+ * Drop geometry so its lowest point sits on the ground plane. **Defaults to `false`** — content
153
+ * renders at its true Rhino coordinates, matching the Grasshopper definition. Setting `true`
154
+ * shifts objects, so anything read back out of the scene (bounds, measured/picked positions) no
155
+ * longer corresponds to Rhino coordinates.
156
+ */
157
+ allowAutoPosition?: boolean;
158
+ /** Up axis for `allowAutoPosition` grounding. Defaults to `'z'` (Rhino's frame) — only set this
159
+ * if the viewer is configured with a non-default `sceneUp`. */
160
+ groundAxis?: 'x' | 'y' | 'z';
161
+ debug?: boolean;
160
162
  }
161
-
163
+ //#endregion
164
+ //#region src/parse/webdisplay/webdisplay-parser.d.ts
162
165
  /**
163
166
  * Metres per model unit, keyed by Rhino `UnitSystem` name (the `modelunits` string on the compute
164
167
  * response). Imperial factors are the exact international definitions. Units missing from this
@@ -175,10 +178,11 @@ declare const SCALE_FACTORS: Record<string, number>;
175
178
  * @throws Rethrows unexpected errors after attempting to dispose any created meshes.
176
179
  */
177
180
  declare function getThreeMeshesFromComputeResponse(data: DisplayComputeResponse, options?: MeshExtractionOptions): Promise<THREE.Object3D[]>;
178
-
181
+ //#endregion
182
+ //#region src/parse/webdisplay/batch-parser.d.ts
179
183
  interface ParseTelemetry {
180
- parseTime?: number;
181
- perfStart?: number;
184
+ parseTime?: number;
185
+ perfStart?: number;
182
186
  }
183
187
  /**
184
188
  * Parses a DisplayBatch object and creates Three.js meshes from its mesh blob.
@@ -188,7 +192,7 @@ interface ParseTelemetry {
188
192
  *
189
193
  * @throws {VisualizationError} On a corrupt/truncated/unsupported mesh blob or malformed group metadata.
190
194
  */
191
- declare function parseMeshBatchObject(batch: DisplayBatch, options?: MeshBatchParsingOptions,
195
+ declare function parseMeshBatchObject(batch: DisplayBatch, options?: MeshBatchParsingOptions,
192
196
  /** @internal Timings threaded from an outer entry point — not a caller option. */
193
197
  telemetry?: ParseTelemetry): Promise<THREE.Mesh[]>;
194
198
  /**
@@ -201,14 +205,16 @@ telemetry?: ParseTelemetry): Promise<THREE.Mesh[]>;
201
205
  * @throws {VisualizationError} On a corrupt/truncated/unsupported mesh blob or malformed group metadata.
202
206
  */
203
207
  declare function parseMeshBatchBlob(blob: ArrayBuffer | Uint8Array, options?: MeshBatchParsingOptions): Promise<THREE.Mesh[]>;
204
-
208
+ //#endregion
209
+ //#region src/parse/webdisplay/apply-texture.d.ts
205
210
  /**
206
211
  * Subscribed to the renderer's own report below, so no host wiring is needed; still exported for a
207
212
  * host embedding a foreign renderer that wants to set it directly. Applies to textures loaded from
208
213
  * here on — textures already decoded keep the value they were given.
209
214
  */
210
215
  declare function setTextureAnisotropy(value: number): void;
211
-
216
+ //#endregion
217
+ //#region src/parse/display-items/display-items-parser.d.ts
212
218
  /**
213
219
  * Builds THREE objects for the batch's non-mesh items.
214
220
  *
@@ -217,5 +223,6 @@ declare function setTextureAnisotropy(value: number): void;
217
223
  * unrenderable item is logged and skipped.
218
224
  */
219
225
  declare function parseDisplayItems(items: DisplayItem[] | undefined): THREE.Object3D[];
220
-
226
+ //#endregion
221
227
  export { type DisplayBatch, type DisplayComputeResponse, type DisplayCurve, type DisplayDataItem, type DisplayIdentity, type DisplayItem, type DisplayItemBase, type DisplayPoint, type DisplayPosition, type DisplayResponseValue, type MaterialGroup, type MeshBatchParsingOptions, type MeshExtractionOptions, type MeshMetadata, SCALE_FACTORS, type SerializableMaterial, getThreeMeshesFromComputeResponse, meshPolicy, parseDisplayItems, parseMeshBatchBlob, parseMeshBatchObject, setTextureAnisotropy };
228
+ //# sourceMappingURL=parse.d.cts.map
package/dist/parse.d.ts CHANGED
@@ -1,12 +1,13 @@
1
- import * as THREE from 'three';
2
- import { M as MaterialAppearanceOptions } from './types-DCuos3gI.js';
3
-
1
+ import { i as MaterialAppearanceOptions } from "./types-Di80Y609.js";
2
+ import * as THREE from "three";
3
+ //#region src/parse/mesh-policy.d.ts
4
4
  /** Structurally, not nominally, typed as `@selvajs/solve/client`'s `MeshPolicy<THREE.Object3D>` — avoids a dependency on solve. */
5
5
  declare const meshPolicy: {
6
- clone(meshes: THREE.Object3D[]): THREE.Object3D[];
7
- release(meshes: THREE.Object3D[]): void;
6
+ clone(meshes: THREE.Object3D[]): THREE.Object3D[];
7
+ release(meshes: THREE.Object3D[]): void;
8
8
  };
9
-
9
+ //#endregion
10
+ //#region src/parse/webdisplay/response-envelope.d.ts
10
11
  /**
11
12
  * Declared structurally rather than imported from `@selvajs/compute` — this package converts
12
13
  * meshes, it doesn't need a Rhino.Compute client dependency to describe the shape a caller hands
@@ -14,73 +15,75 @@ declare const meshPolicy: {
14
15
  * this, so {@link getThreeMeshesFromComputeResponse} keeps accepting one unchanged.
15
16
  */
16
17
  interface DisplayDataItem {
17
- /** Namespaced wire type token, e.g. `Selva.GH.Features.Display.Services.DisplayBatch`. */
18
- type: string;
19
- data: string;
18
+ /** Namespaced wire type token, e.g. `Selva.GH.Features.Display.Services.DisplayBatch`. */
19
+ type: string;
20
+ data: string;
20
21
  }
21
22
  interface DisplayResponseValue {
22
- InnerTree: {
23
- [branchPath: string]: DisplayDataItem[];
24
- };
23
+ InnerTree: {
24
+ [branchPath: string]: DisplayDataItem[];
25
+ };
25
26
  }
26
27
  interface DisplayComputeResponse {
27
- values: DisplayResponseValue[];
28
- /** Rhino `UnitSystem` name driving unit scaling (see `SCALE_FACTORS`); unrecognized/absent scales 1. */
29
- modelunits: string;
28
+ values: DisplayResponseValue[];
29
+ /** Rhino `UnitSystem` name driving unit scaling (see `SCALE_FACTORS`); unrecognized/absent scales 1. */
30
+ modelunits: string;
30
31
  }
31
-
32
+ //#endregion
33
+ //#region src/parse/display-items/types.d.ts
32
34
  interface DisplayIdentity {
33
- /** Stable pick key: `${sourceComponentId}:${originalIndex}`. Distinct from `name` so renaming doesn't change identity. */
34
- id: string;
35
- name: string;
36
- layer: string;
37
- /** Arbitrary key-value pairs from the GH Metadata input. */
38
- metadata?: Record<string, string>;
35
+ /** Stable pick key: `${sourceComponentId}:${originalIndex}`. Distinct from `name` so renaming doesn't change identity. */
36
+ id: string;
37
+ name: string;
38
+ layer: string;
39
+ /** Arbitrary key-value pairs from the GH Metadata input. */
40
+ metadata?: Record<string, string>;
39
41
  }
40
42
  interface DisplayItemBase extends DisplayIdentity {
41
- /** Hex/rgb/named color string, parsed by `parseColor`. Falls back to a viewer default. */
42
- color?: string;
43
- /** 0-1; omitted means fully opaque. */
44
- opacity?: number;
43
+ /** Hex/rgb/named color string, parsed by `parseColor`. Falls back to a viewer default. */
44
+ color?: string;
45
+ /** 0-1; omitted means fully opaque. */
46
+ opacity?: number;
45
47
  }
46
48
  /** Rhino's Z-up frame and `{X,Y,Z}` casing. */
47
49
  interface DisplayPosition {
48
- X: number;
49
- Y: number;
50
- Z: number;
50
+ X: number;
51
+ Y: number;
52
+ Z: number;
51
53
  }
52
54
  /** Rendered as a fat `Line2` straight from `points` — nothing decodes geometry in the browser. */
53
55
  interface DisplayCurve extends DisplayItemBase {
54
- kind: 'curve';
55
- /**
56
- * Backend-tessellated polyline, flat `[x,y,z, …]` in Rhino's Z-up frame.
57
- *
58
- * Typed as required even though the plugin still sends a legacy `json` field alongside it: a
59
- * payload without `points` came from a Display component too old to render, and parsing throws
60
- * rather than treating it as a shape this package supports.
61
- */
62
- points: number[];
63
- /** Screen-space CSS px, constant regardless of zoom. Omitted uses the viewer default. */
64
- width?: number;
56
+ kind: 'curve';
57
+ /**
58
+ * Backend-tessellated polyline, flat `[x,y,z, …]` in Rhino's Z-up frame.
59
+ *
60
+ * Typed as required even though the plugin still sends a legacy `json` field alongside it: a
61
+ * payload without `points` came from a Display component too old to render, and parsing throws
62
+ * rather than treating it as a shape this package supports.
63
+ */
64
+ points: number[];
65
+ /** Screen-space CSS px, constant regardless of zoom. Omitted uses the viewer default. */
66
+ width?: number;
65
67
  }
66
68
  interface DisplayPoint extends DisplayItemBase {
67
- kind: 'point';
68
- position: DisplayPosition;
69
+ kind: 'point';
70
+ position: DisplayPosition;
69
71
  }
70
72
  type DisplayItem = DisplayCurve | DisplayPoint;
71
-
73
+ //#endregion
74
+ //#region src/parse/webdisplay/types.d.ts
72
75
  interface SerializableMaterial {
73
- color: string;
74
- metalness: number;
75
- roughness: number;
76
- opacity: number;
77
- transparent: boolean;
78
- /**
79
- * Optional color-map texture reference: http(s) URL, data URI, or plugin asset URL
80
- * (`http://localhost:{port}/assets/{hash}`). Omitted entirely (not just empty) when untextured.
81
- * When set, the mesh blob also carries per-vertex UVs (FLAG_HAS_UVS) for meshes using it.
82
- */
83
- map?: string;
76
+ color: string;
77
+ metalness: number;
78
+ roughness: number;
79
+ opacity: number;
80
+ transparent: boolean;
81
+ /**
82
+ * Optional color-map texture reference: http(s) URL, data URI, or plugin asset URL
83
+ * (`http://localhost:{port}/assets/{hash}`). Omitted entirely (not just empty) when untextured.
84
+ * When set, the mesh blob also carries per-vertex UVs (FLAG_HAS_UVS) for meshes using it.
85
+ */
86
+ map?: string;
84
87
  }
85
88
  /**
86
89
  * `vertexStart`/`vertexCount` and `indexStart`/`indexCount` are in **element units** of the
@@ -90,23 +93,23 @@ interface SerializableMaterial {
90
93
  * vertex components are 2 bytes (int16 quantized) or 4 bytes (`FLAG_FLOAT32`).
91
94
  */
92
95
  interface MeshMetadata {
93
- name: string;
94
- /** Layer path for grouping in the scene manager, e.g. 'Structure/Walls'. */
95
- layer: string;
96
- /** Index in the GH input tree before material grouping; combined with sourceComponentId
97
- * uniquely identifies the GH source geometry. */
98
- originalIndex: number;
99
- vertexCount: number;
100
- /** 3 per triangle. */
101
- indexCount: number;
102
- vertexStart: number;
103
- indexStart: number;
104
- /** Arbitrary key-value pairs from the GH Metadata input. */
105
- metadata?: Record<string, string>;
96
+ name: string;
97
+ /** Layer path for grouping in the scene manager, e.g. 'Structure/Walls'. */
98
+ layer: string;
99
+ /** Index in the GH input tree before material grouping; combined with sourceComponentId
100
+ * uniquely identifies the GH source geometry. */
101
+ originalIndex: number;
102
+ vertexCount: number;
103
+ /** 3 per triangle. */
104
+ indexCount: number;
105
+ vertexStart: number;
106
+ indexStart: number;
107
+ /** Arbitrary key-value pairs from the GH Metadata input. */
108
+ metadata?: Record<string, string>;
106
109
  }
107
110
  interface MaterialGroup {
108
- materialId: number;
109
- meshes: MeshMetadata[];
111
+ materialId: number;
112
+ meshes: MeshMetadata[];
110
113
  }
111
114
  /**
112
115
  * One Display component's payload, ready for Three.js rendering.
@@ -120,45 +123,45 @@ interface MaterialGroup {
120
123
  * blob (`items`), not inside it.
121
124
  */
122
125
  interface DisplayBatch {
123
- materials: SerializableMaterial[];
124
- groups: MaterialGroup[];
125
- compressedData: string;
126
- /** InstanceGuid of the WebDisplay GH component that produced this batch; combined with
127
- * MeshMetadata.originalIndex to backtrack any mesh to its GH source. */
128
- sourceComponentId?: string;
129
- /** Non-mesh display items — see {@link DisplayItem}. Parsed by the separate `display-items`
130
- * path, not the SLVA mesh parser. Omitted when there are none. */
131
- items?: DisplayItem[];
126
+ materials: SerializableMaterial[];
127
+ groups: MaterialGroup[];
128
+ compressedData: string;
129
+ /** InstanceGuid of the WebDisplay GH component that produced this batch; combined with
130
+ * MeshMetadata.originalIndex to backtrack any mesh to its GH source. */
131
+ sourceComponentId?: string;
132
+ /** Non-mesh display items — see {@link DisplayItem}. Parsed by the separate `display-items`
133
+ * path, not the SLVA mesh parser. Omitted when there are none. */
134
+ items?: DisplayItem[];
132
135
  }
133
136
  interface MeshBatchParsingOptions {
134
- /** Merge meshes sharing a material into a single geometry. Defaults to true. */
135
- mergeByMaterial?: boolean;
136
- debug?: boolean;
137
- /**
138
- * Appearance dials applied to every material built from this batch — set once at parse time
139
- * (materials are rebuilt per solve). Runtime restyling of an already-built scene lives in the
140
- * viewer's `setLook`.
141
- */
142
- material?: MaterialAppearanceOptions;
137
+ /** Merge meshes sharing a material into a single geometry. Defaults to true. */
138
+ mergeByMaterial?: boolean;
139
+ debug?: boolean;
140
+ /**
141
+ * Appearance dials applied to every material built from this batch — set once at parse time
142
+ * (materials are rebuilt per solve). Runtime restyling of an already-built scene lives in the
143
+ * viewer's `setLook`.
144
+ */
145
+ material?: MaterialAppearanceOptions;
143
146
  }
144
-
145
147
  interface MeshExtractionOptions {
146
- parsing?: MeshBatchParsingOptions;
147
- /** Scale geometry to model units. Defaults to true. */
148
- allowScaling?: boolean;
149
- /**
150
- * Drop geometry so its lowest point sits on the ground plane. **Defaults to `false`** — content
151
- * renders at its true Rhino coordinates, matching the Grasshopper definition. Setting `true`
152
- * shifts objects, so anything read back out of the scene (bounds, measured/picked positions) no
153
- * longer corresponds to Rhino coordinates.
154
- */
155
- allowAutoPosition?: boolean;
156
- /** Up axis for `allowAutoPosition` grounding. Defaults to `'z'` (Rhino's frame) — only set this
157
- * if the viewer is configured with a non-default `sceneUp`. */
158
- groundAxis?: 'x' | 'y' | 'z';
159
- debug?: boolean;
148
+ parsing?: MeshBatchParsingOptions;
149
+ /** Scale geometry to model units. Defaults to true. */
150
+ allowScaling?: boolean;
151
+ /**
152
+ * Drop geometry so its lowest point sits on the ground plane. **Defaults to `false`** — content
153
+ * renders at its true Rhino coordinates, matching the Grasshopper definition. Setting `true`
154
+ * shifts objects, so anything read back out of the scene (bounds, measured/picked positions) no
155
+ * longer corresponds to Rhino coordinates.
156
+ */
157
+ allowAutoPosition?: boolean;
158
+ /** Up axis for `allowAutoPosition` grounding. Defaults to `'z'` (Rhino's frame) — only set this
159
+ * if the viewer is configured with a non-default `sceneUp`. */
160
+ groundAxis?: 'x' | 'y' | 'z';
161
+ debug?: boolean;
160
162
  }
161
-
163
+ //#endregion
164
+ //#region src/parse/webdisplay/webdisplay-parser.d.ts
162
165
  /**
163
166
  * Metres per model unit, keyed by Rhino `UnitSystem` name (the `modelunits` string on the compute
164
167
  * response). Imperial factors are the exact international definitions. Units missing from this
@@ -175,10 +178,11 @@ declare const SCALE_FACTORS: Record<string, number>;
175
178
  * @throws Rethrows unexpected errors after attempting to dispose any created meshes.
176
179
  */
177
180
  declare function getThreeMeshesFromComputeResponse(data: DisplayComputeResponse, options?: MeshExtractionOptions): Promise<THREE.Object3D[]>;
178
-
181
+ //#endregion
182
+ //#region src/parse/webdisplay/batch-parser.d.ts
179
183
  interface ParseTelemetry {
180
- parseTime?: number;
181
- perfStart?: number;
184
+ parseTime?: number;
185
+ perfStart?: number;
182
186
  }
183
187
  /**
184
188
  * Parses a DisplayBatch object and creates Three.js meshes from its mesh blob.
@@ -188,7 +192,7 @@ interface ParseTelemetry {
188
192
  *
189
193
  * @throws {VisualizationError} On a corrupt/truncated/unsupported mesh blob or malformed group metadata.
190
194
  */
191
- declare function parseMeshBatchObject(batch: DisplayBatch, options?: MeshBatchParsingOptions,
195
+ declare function parseMeshBatchObject(batch: DisplayBatch, options?: MeshBatchParsingOptions,
192
196
  /** @internal Timings threaded from an outer entry point — not a caller option. */
193
197
  telemetry?: ParseTelemetry): Promise<THREE.Mesh[]>;
194
198
  /**
@@ -201,14 +205,16 @@ telemetry?: ParseTelemetry): Promise<THREE.Mesh[]>;
201
205
  * @throws {VisualizationError} On a corrupt/truncated/unsupported mesh blob or malformed group metadata.
202
206
  */
203
207
  declare function parseMeshBatchBlob(blob: ArrayBuffer | Uint8Array, options?: MeshBatchParsingOptions): Promise<THREE.Mesh[]>;
204
-
208
+ //#endregion
209
+ //#region src/parse/webdisplay/apply-texture.d.ts
205
210
  /**
206
211
  * Subscribed to the renderer's own report below, so no host wiring is needed; still exported for a
207
212
  * host embedding a foreign renderer that wants to set it directly. Applies to textures loaded from
208
213
  * here on — textures already decoded keep the value they were given.
209
214
  */
210
215
  declare function setTextureAnisotropy(value: number): void;
211
-
216
+ //#endregion
217
+ //#region src/parse/display-items/display-items-parser.d.ts
212
218
  /**
213
219
  * Builds THREE objects for the batch's non-mesh items.
214
220
  *
@@ -217,5 +223,6 @@ declare function setTextureAnisotropy(value: number): void;
217
223
  * unrenderable item is logged and skipped.
218
224
  */
219
225
  declare function parseDisplayItems(items: DisplayItem[] | undefined): THREE.Object3D[];
220
-
226
+ //#endregion
221
227
  export { type DisplayBatch, type DisplayComputeResponse, type DisplayCurve, type DisplayDataItem, type DisplayIdentity, type DisplayItem, type DisplayItemBase, type DisplayPoint, type DisplayPosition, type DisplayResponseValue, type MaterialGroup, type MeshBatchParsingOptions, type MeshExtractionOptions, type MeshMetadata, SCALE_FACTORS, type SerializableMaterial, getThreeMeshesFromComputeResponse, meshPolicy, parseDisplayItems, parseMeshBatchBlob, parseMeshBatchObject, setTextureAnisotropy };
228
+ //# sourceMappingURL=parse.d.ts.map