@selvajs/visualization 1.6.0-beta.1 → 1.6.0-beta.10
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/gpu-dispose-BKp7iijv.js +355 -0
- package/dist/gpu-dispose-BKp7iijv.js.map +1 -0
- package/dist/gpu-dispose-Cxu3dFmA.cjs +469 -0
- package/dist/gpu-dispose-Cxu3dFmA.cjs.map +1 -0
- package/dist/gpu-ownership-ADRZBxxs.cjs +102 -0
- package/dist/gpu-ownership-ADRZBxxs.cjs.map +1 -0
- package/dist/gpu-ownership-Bs9l7hrU.js +40 -0
- package/dist/gpu-ownership-Bs9l7hrU.js.map +1 -0
- package/dist/index.js +1 -1
- package/dist/merged-draw-CO4rr2Co.js +129 -0
- package/dist/merged-draw-CO4rr2Co.js.map +1 -0
- package/dist/merged-draw-ma_2r4N8.cjs +171 -0
- package/dist/merged-draw-ma_2r4N8.cjs.map +1 -0
- package/dist/parse.cjs +2789 -11
- package/dist/parse.cjs.map +1 -1
- package/dist/parse.d.cts +15 -18
- package/dist/parse.d.ts +15 -18
- package/dist/parse.js +2780 -11
- package/dist/parse.js.map +1 -1
- package/dist/render.cjs +4021 -6
- package/dist/render.cjs.map +1 -1
- package/dist/render.d.cts +53 -37
- package/dist/render.d.ts +53 -37
- package/dist/render.js +4000 -6
- package/dist/render.js.map +1 -1
- package/dist/scene.cjs +343 -1
- package/dist/scene.cjs.map +1 -1
- package/dist/scene.d.cts +0 -12
- package/dist/scene.d.ts +0 -12
- package/dist/scene.js +336 -1
- package/dist/scene.js.map +1 -1
- package/dist/{types-DjPelPRM.d.ts → types-DW_qU4-Y.d.cts} +22 -5
- package/dist/{types-DjPelPRM.d.cts → types-DW_qU4-Y.d.ts} +22 -5
- package/package.json +16 -10
- package/dist/gpu-dispose-Dich0oW7.js +0 -2
- package/dist/gpu-dispose-Dich0oW7.js.map +0 -1
- package/dist/gpu-dispose-GZmNW-gK.cjs +0 -2
- package/dist/gpu-dispose-GZmNW-gK.cjs.map +0 -1
- package/dist/merged-draw-B75jHIzV.cjs +0 -2
- package/dist/merged-draw-B75jHIzV.cjs.map +0 -1
- package/dist/merged-draw-BPhBYH-v.js +0 -2
- package/dist/merged-draw-BPhBYH-v.js.map +0 -1
- package/dist/rolldown-runtime-BocRIvOZ.cjs +0 -1
package/dist/parse.d.cts
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { o as MaterialAppearanceOptions } from "./types-DW_qU4-Y.cjs";
|
|
2
2
|
import * as THREE from "three";
|
|
3
|
-
//#region src/parse/mesh-policy.d.ts
|
|
4
3
|
/** Structurally, not nominally, typed as `@selvajs/solve/client`'s `MeshPolicy<THREE.Object3D>` — avoids a dependency on solve. */
|
|
5
4
|
export declare const meshPolicy: {
|
|
6
5
|
clone(meshes: THREE.Object3D[]): THREE.Object3D[];
|
|
7
6
|
release(meshes: THREE.Object3D[]): void;
|
|
8
7
|
};
|
|
9
|
-
//#endregion
|
|
10
|
-
//#region src/parse/webdisplay/response-envelope.d.ts
|
|
11
8
|
/**
|
|
12
9
|
* Declared structurally rather than imported from `@selvajs/compute` — this package converts
|
|
13
10
|
* meshes, it doesn't need a Rhino.Compute client dependency to describe the shape a caller hands
|
|
@@ -29,8 +26,6 @@ interface GrasshopperComputeResponse {
|
|
|
29
26
|
/** Rhino `UnitSystem` name driving unit scaling (see `SCALE_FACTORS`); unrecognized/absent scales 1. */
|
|
30
27
|
modelunits: string;
|
|
31
28
|
}
|
|
32
|
-
//#endregion
|
|
33
|
-
//#region src/parse/display-items/types.d.ts
|
|
34
29
|
interface DisplayIdentity {
|
|
35
30
|
/** The item's identity — the writer-minted opaque id, same contract as mesh ids. Distinct from `name` so renaming doesn't change identity. */
|
|
36
31
|
id: string;
|
|
@@ -70,8 +65,6 @@ interface DisplayPoint extends DisplayItemBase {
|
|
|
70
65
|
position: DisplayPosition;
|
|
71
66
|
}
|
|
72
67
|
type DisplayItem = DisplayCurve | DisplayPoint;
|
|
73
|
-
//#endregion
|
|
74
|
-
//#region src/parse/webdisplay/types.d.ts
|
|
75
68
|
interface SerializableMaterial {
|
|
76
69
|
color: string;
|
|
77
70
|
metalness: number;
|
|
@@ -90,6 +83,12 @@ interface SerializableMaterial {
|
|
|
90
83
|
normalMap?: string;
|
|
91
84
|
/** Wins over the look's `envMapIntensity` (except in looks that override materials). */
|
|
92
85
|
envMapIntensity?: number;
|
|
86
|
+
/** Hex colour the surface emits. Omitted: no emission. */
|
|
87
|
+
emissive?: string;
|
|
88
|
+
/** Omitted: 1. Above 1 it blooms in looks with bloom. */
|
|
89
|
+
emissiveIntensity?: number;
|
|
90
|
+
/** Light the surface casts in the night look, in candela-scaled units. Omitted: scaled to the model. */
|
|
91
|
+
emissiveLight?: number;
|
|
93
92
|
/** Omitted: no coat. */
|
|
94
93
|
clearcoat?: number;
|
|
95
94
|
clearcoatRoughness?: number;
|
|
@@ -106,7 +105,7 @@ interface SerializableMaterial {
|
|
|
106
105
|
*/
|
|
107
106
|
mapSize?: number;
|
|
108
107
|
/** Procedural scratch fibres along the grain, from UVs in mm. */
|
|
109
|
-
finish?: 'brushed' | 'rolled';
|
|
108
|
+
finish?: 'brushed' | 'rolled' | 'wood' | 'concrete' | 'plaster' | 'brick' | 'corten';
|
|
110
109
|
/** Scales the finish's streaks; 0 draws none. Omitted: 1. */
|
|
111
110
|
finishStrength?: number;
|
|
112
111
|
/** Light passing through (glass); unlike `opacity` it keeps reflections. */
|
|
@@ -135,6 +134,8 @@ interface MeshMetadata {
|
|
|
135
134
|
indexStart: number;
|
|
136
135
|
/** Arbitrary key-value pairs from the GH Metadata input. */
|
|
137
136
|
metadata?: Record<string, string>;
|
|
137
|
+
/** The writer's closed-solid verdict (see `isClosedSolid`); absent means compute it here. */
|
|
138
|
+
closed?: boolean;
|
|
138
139
|
}
|
|
139
140
|
interface MaterialGroup {
|
|
140
141
|
materialId: number;
|
|
@@ -186,8 +187,6 @@ interface MeshExtractionOptions {
|
|
|
186
187
|
groundAxis?: 'x' | 'y' | 'z';
|
|
187
188
|
debug?: boolean;
|
|
188
189
|
}
|
|
189
|
-
//#endregion
|
|
190
|
-
//#region src/parse/webdisplay/webdisplay-parser.d.ts
|
|
191
190
|
/**
|
|
192
191
|
* Metres per model unit, keyed by Rhino `UnitSystem` name (the `modelunits` string on the compute
|
|
193
192
|
* response). Imperial factors are the exact international definitions. Units missing from this
|
|
@@ -204,8 +203,6 @@ export declare const SCALE_FACTORS: Record<string, number>;
|
|
|
204
203
|
* @throws Rethrows unexpected errors after attempting to dispose any created meshes.
|
|
205
204
|
*/
|
|
206
205
|
export declare function getThreeObjectsFromComputeResponse(data: GrasshopperComputeResponse, options?: MeshExtractionOptions): Promise<THREE.Object3D[]>;
|
|
207
|
-
//#endregion
|
|
208
|
-
//#region src/parse/webdisplay/batch-parser.d.ts
|
|
209
206
|
interface ParseTelemetry {
|
|
210
207
|
parseTime?: number;
|
|
211
208
|
perfStart?: number;
|
|
@@ -231,16 +228,17 @@ telemetry?: ParseTelemetry): Promise<THREE.Mesh[]>;
|
|
|
231
228
|
* @throws {VisualizationError} On a corrupt/truncated/unsupported mesh blob or malformed group metadata.
|
|
232
229
|
*/
|
|
233
230
|
export declare function parseMeshBatchBlob(blob: ArrayBuffer | Uint8Array, options?: MeshBatchParsingOptions): Promise<THREE.Mesh[]>;
|
|
234
|
-
|
|
235
|
-
|
|
231
|
+
/**
|
|
232
|
+
* Empties the cache and frees its geometries. The cache lives as long as the page, so a host calls
|
|
233
|
+
* this when its viewer goes away; a mesh still drawing one of them uploads it again.
|
|
234
|
+
*/
|
|
235
|
+
export declare function clearGeometryCache(): void;
|
|
236
236
|
/**
|
|
237
237
|
* Subscribed to the renderer's own report below, so no host wiring is needed; still exported for a
|
|
238
238
|
* host embedding a foreign renderer that wants to set it directly. Applies to textures loaded from
|
|
239
239
|
* here on — textures already decoded keep the value they were given.
|
|
240
240
|
*/
|
|
241
241
|
export declare function setTextureAnisotropy(value: number): void;
|
|
242
|
-
//#endregion
|
|
243
|
-
//#region src/parse/display-items/display-items-parser.d.ts
|
|
244
242
|
/**
|
|
245
243
|
* Builds THREE objects for the batch's non-mesh items.
|
|
246
244
|
*
|
|
@@ -249,6 +247,5 @@ export declare function setTextureAnisotropy(value: number): void;
|
|
|
249
247
|
* unrenderable item is logged and skipped.
|
|
250
248
|
*/
|
|
251
249
|
export declare function parseDisplayItems(items: DisplayItem[] | undefined): THREE.Object3D[];
|
|
252
|
-
//#endregion
|
|
253
250
|
export type { DisplayBatch, DisplayCurve, DisplayIdentity, DisplayItem, DisplayItemBase, DisplayPoint, DisplayPosition, MaterialGroup, MeshBatchParsingOptions, MeshExtractionOptions, MeshMetadata, SerializableMaterial };
|
|
254
251
|
//# sourceMappingURL=parse.d.cts.map
|
package/dist/parse.d.ts
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { o as MaterialAppearanceOptions } from "./types-DW_qU4-Y.js";
|
|
2
2
|
import * as THREE from "three";
|
|
3
|
-
//#region src/parse/mesh-policy.d.ts
|
|
4
3
|
/** Structurally, not nominally, typed as `@selvajs/solve/client`'s `MeshPolicy<THREE.Object3D>` — avoids a dependency on solve. */
|
|
5
4
|
export declare const meshPolicy: {
|
|
6
5
|
clone(meshes: THREE.Object3D[]): THREE.Object3D[];
|
|
7
6
|
release(meshes: THREE.Object3D[]): void;
|
|
8
7
|
};
|
|
9
|
-
//#endregion
|
|
10
|
-
//#region src/parse/webdisplay/response-envelope.d.ts
|
|
11
8
|
/**
|
|
12
9
|
* Declared structurally rather than imported from `@selvajs/compute` — this package converts
|
|
13
10
|
* meshes, it doesn't need a Rhino.Compute client dependency to describe the shape a caller hands
|
|
@@ -29,8 +26,6 @@ interface GrasshopperComputeResponse {
|
|
|
29
26
|
/** Rhino `UnitSystem` name driving unit scaling (see `SCALE_FACTORS`); unrecognized/absent scales 1. */
|
|
30
27
|
modelunits: string;
|
|
31
28
|
}
|
|
32
|
-
//#endregion
|
|
33
|
-
//#region src/parse/display-items/types.d.ts
|
|
34
29
|
interface DisplayIdentity {
|
|
35
30
|
/** The item's identity — the writer-minted opaque id, same contract as mesh ids. Distinct from `name` so renaming doesn't change identity. */
|
|
36
31
|
id: string;
|
|
@@ -70,8 +65,6 @@ interface DisplayPoint extends DisplayItemBase {
|
|
|
70
65
|
position: DisplayPosition;
|
|
71
66
|
}
|
|
72
67
|
type DisplayItem = DisplayCurve | DisplayPoint;
|
|
73
|
-
//#endregion
|
|
74
|
-
//#region src/parse/webdisplay/types.d.ts
|
|
75
68
|
interface SerializableMaterial {
|
|
76
69
|
color: string;
|
|
77
70
|
metalness: number;
|
|
@@ -90,6 +83,12 @@ interface SerializableMaterial {
|
|
|
90
83
|
normalMap?: string;
|
|
91
84
|
/** Wins over the look's `envMapIntensity` (except in looks that override materials). */
|
|
92
85
|
envMapIntensity?: number;
|
|
86
|
+
/** Hex colour the surface emits. Omitted: no emission. */
|
|
87
|
+
emissive?: string;
|
|
88
|
+
/** Omitted: 1. Above 1 it blooms in looks with bloom. */
|
|
89
|
+
emissiveIntensity?: number;
|
|
90
|
+
/** Light the surface casts in the night look, in candela-scaled units. Omitted: scaled to the model. */
|
|
91
|
+
emissiveLight?: number;
|
|
93
92
|
/** Omitted: no coat. */
|
|
94
93
|
clearcoat?: number;
|
|
95
94
|
clearcoatRoughness?: number;
|
|
@@ -106,7 +105,7 @@ interface SerializableMaterial {
|
|
|
106
105
|
*/
|
|
107
106
|
mapSize?: number;
|
|
108
107
|
/** Procedural scratch fibres along the grain, from UVs in mm. */
|
|
109
|
-
finish?: 'brushed' | 'rolled';
|
|
108
|
+
finish?: 'brushed' | 'rolled' | 'wood' | 'concrete' | 'plaster' | 'brick' | 'corten';
|
|
110
109
|
/** Scales the finish's streaks; 0 draws none. Omitted: 1. */
|
|
111
110
|
finishStrength?: number;
|
|
112
111
|
/** Light passing through (glass); unlike `opacity` it keeps reflections. */
|
|
@@ -135,6 +134,8 @@ interface MeshMetadata {
|
|
|
135
134
|
indexStart: number;
|
|
136
135
|
/** Arbitrary key-value pairs from the GH Metadata input. */
|
|
137
136
|
metadata?: Record<string, string>;
|
|
137
|
+
/** The writer's closed-solid verdict (see `isClosedSolid`); absent means compute it here. */
|
|
138
|
+
closed?: boolean;
|
|
138
139
|
}
|
|
139
140
|
interface MaterialGroup {
|
|
140
141
|
materialId: number;
|
|
@@ -186,8 +187,6 @@ interface MeshExtractionOptions {
|
|
|
186
187
|
groundAxis?: 'x' | 'y' | 'z';
|
|
187
188
|
debug?: boolean;
|
|
188
189
|
}
|
|
189
|
-
//#endregion
|
|
190
|
-
//#region src/parse/webdisplay/webdisplay-parser.d.ts
|
|
191
190
|
/**
|
|
192
191
|
* Metres per model unit, keyed by Rhino `UnitSystem` name (the `modelunits` string on the compute
|
|
193
192
|
* response). Imperial factors are the exact international definitions. Units missing from this
|
|
@@ -204,8 +203,6 @@ export declare const SCALE_FACTORS: Record<string, number>;
|
|
|
204
203
|
* @throws Rethrows unexpected errors after attempting to dispose any created meshes.
|
|
205
204
|
*/
|
|
206
205
|
export declare function getThreeObjectsFromComputeResponse(data: GrasshopperComputeResponse, options?: MeshExtractionOptions): Promise<THREE.Object3D[]>;
|
|
207
|
-
//#endregion
|
|
208
|
-
//#region src/parse/webdisplay/batch-parser.d.ts
|
|
209
206
|
interface ParseTelemetry {
|
|
210
207
|
parseTime?: number;
|
|
211
208
|
perfStart?: number;
|
|
@@ -231,16 +228,17 @@ telemetry?: ParseTelemetry): Promise<THREE.Mesh[]>;
|
|
|
231
228
|
* @throws {VisualizationError} On a corrupt/truncated/unsupported mesh blob or malformed group metadata.
|
|
232
229
|
*/
|
|
233
230
|
export declare function parseMeshBatchBlob(blob: ArrayBuffer | Uint8Array, options?: MeshBatchParsingOptions): Promise<THREE.Mesh[]>;
|
|
234
|
-
|
|
235
|
-
|
|
231
|
+
/**
|
|
232
|
+
* Empties the cache and frees its geometries. The cache lives as long as the page, so a host calls
|
|
233
|
+
* this when its viewer goes away; a mesh still drawing one of them uploads it again.
|
|
234
|
+
*/
|
|
235
|
+
export declare function clearGeometryCache(): void;
|
|
236
236
|
/**
|
|
237
237
|
* Subscribed to the renderer's own report below, so no host wiring is needed; still exported for a
|
|
238
238
|
* host embedding a foreign renderer that wants to set it directly. Applies to textures loaded from
|
|
239
239
|
* here on — textures already decoded keep the value they were given.
|
|
240
240
|
*/
|
|
241
241
|
export declare function setTextureAnisotropy(value: number): void;
|
|
242
|
-
//#endregion
|
|
243
|
-
//#region src/parse/display-items/display-items-parser.d.ts
|
|
244
242
|
/**
|
|
245
243
|
* Builds THREE objects for the batch's non-mesh items.
|
|
246
244
|
*
|
|
@@ -249,6 +247,5 @@ export declare function setTextureAnisotropy(value: number): void;
|
|
|
249
247
|
* unrenderable item is logged and skipped.
|
|
250
248
|
*/
|
|
251
249
|
export declare function parseDisplayItems(items: DisplayItem[] | undefined): THREE.Object3D[];
|
|
252
|
-
//#endregion
|
|
253
250
|
export type { DisplayBatch, DisplayCurve, DisplayIdentity, DisplayItem, DisplayItemBase, DisplayPoint, DisplayPosition, MaterialGroup, MeshBatchParsingOptions, MeshExtractionOptions, MeshMetadata, SerializableMaterial };
|
|
254
251
|
//# sourceMappingURL=parse.d.ts.map
|