@selvajs/compute 3.1.0-beta.4 → 3.1.0-beta.6
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/chunk-727SRM4E.cjs +62 -0
- package/dist/chunk-727SRM4E.cjs.map +1 -0
- package/dist/chunk-CUQQ3ZBV.cjs +4 -0
- package/dist/chunk-CUQQ3ZBV.cjs.map +1 -0
- package/dist/chunk-CWODTGNH.js +62 -0
- package/dist/chunk-CWODTGNH.js.map +1 -0
- package/dist/chunk-JNFNLKFO.js +2 -0
- package/dist/chunk-JNFNLKFO.js.map +1 -0
- package/dist/chunk-WPB2LKCD.js +4 -0
- package/dist/chunk-WPB2LKCD.js.map +1 -0
- package/dist/chunk-Y5E6RIEH.cjs +2 -0
- package/dist/chunk-Y5E6RIEH.cjs.map +1 -0
- package/dist/core.cjs +1 -1
- package/dist/core.d.cts +40 -3
- package/dist/core.d.ts +40 -3
- package/dist/core.js +1 -1
- package/dist/grasshopper.cjs +1 -1
- package/dist/grasshopper.cjs.map +1 -1
- package/dist/grasshopper.d.cts +222 -32
- package/dist/grasshopper.d.ts +222 -32
- package/dist/grasshopper.js +1 -1
- package/dist/{handle-files-9pkEgDIp.d.ts → handle-files-BISo_wob.d.cts} +51 -67
- package/dist/{handle-files-9pkEgDIp.d.cts → handle-files-BISo_wob.d.ts} +51 -67
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +1 -1
- package/dist/types-BGhtYxZ-.d.cts +45 -0
- package/dist/types-BGhtYxZ-.d.ts +45 -0
- package/dist/{types-BBSF_ISX.d.ts → types-C8XWc4Ab.d.cts} +62 -66
- package/dist/{types-DxPi5SEx.d.cts → types-Dtok-mVq.d.ts} +62 -66
- package/dist/visualization-36IV2CVU.cjs +2 -0
- package/dist/visualization-36IV2CVU.cjs.map +1 -0
- package/dist/visualization-QCI36RHC.js +2 -0
- package/dist/visualization.cjs +1 -1
- package/dist/visualization.d.cts +144 -48
- package/dist/visualization.d.ts +144 -48
- package/dist/visualization.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-33753HSV.cjs +0 -2
- package/dist/chunk-33753HSV.cjs.map +0 -1
- package/dist/chunk-4JNRO7TX.cjs +0 -62
- package/dist/chunk-4JNRO7TX.cjs.map +0 -1
- package/dist/chunk-6V6SUB4V.js +0 -62
- package/dist/chunk-6V6SUB4V.js.map +0 -1
- package/dist/chunk-D7A3YIYD.cjs +0 -4
- package/dist/chunk-D7A3YIYD.cjs.map +0 -1
- package/dist/chunk-EMXDP7KY.js +0 -4
- package/dist/chunk-EMXDP7KY.js.map +0 -1
- package/dist/chunk-MDFVHHH6.js +0 -2
- package/dist/chunk-MDFVHHH6.js.map +0 -1
- package/dist/types-V7G83j5m.d.cts +0 -100
- package/dist/types-V7G83j5m.d.ts +0 -100
- package/dist/visualization-3XYZHAIV.js +0 -2
- package/dist/visualization-DEAMRV7R.cjs +0 -2
- package/dist/visualization-DEAMRV7R.cjs.map +0 -1
- /package/dist/{visualization-3XYZHAIV.js.map → visualization-QCI36RHC.js.map} +0 -0
package/dist/visualization.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as THREE from 'three';
|
|
2
2
|
import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
|
|
3
|
-
import { M as MaterialAppearanceOptions, f as GrasshopperComputeResponse, m as MeshExtractionOptions, n as MeshBatchParsingOptions, o as DisplayBatch, p as DisplayItem } from './types-
|
|
4
|
-
export { q as DisplayCurve, r as DisplayIdentity, s as DisplayItemBase, t as DisplayPoint, u as DisplayPosition, v as MeshBatch } from './types-
|
|
3
|
+
import { M as MaterialAppearanceOptions, f as GrasshopperComputeResponse, m as MeshExtractionOptions, n as MeshBatchParsingOptions, o as DisplayBatch, p as DisplayItem } from './types-Dtok-mVq.js';
|
|
4
|
+
export { q as DisplayCurve, r as DisplayIdentity, s as DisplayItemBase, t as DisplayPoint, u as DisplayPosition, v as MeshBatch } from './types-Dtok-mVq.js';
|
|
5
5
|
import { CSS2DObject } from 'three/addons/renderers/CSS2DRenderer.js';
|
|
6
6
|
import { LineSegments2 } from 'three/addons/lines/LineSegments2.js';
|
|
7
7
|
import { RhinoModule } from 'rhino3dm';
|
|
8
|
-
import './types-
|
|
8
|
+
import './types-BGhtYxZ-.js';
|
|
9
9
|
|
|
10
10
|
type CameraConfig = {
|
|
11
11
|
position?: THREE.Vector3;
|
|
@@ -21,6 +21,20 @@ type LightingConfig = {
|
|
|
21
21
|
ambientLightColor?: THREE.Color;
|
|
22
22
|
ambientLightIntensity?: number;
|
|
23
23
|
sunlightColor?: THREE.Color | number;
|
|
24
|
+
/**
|
|
25
|
+
* Add a hemisphere fill light (sky color from above, ground color from below). Unlike the flat
|
|
26
|
+
* ambient, this gives soft *direction-aware* fill, so downward- and side-facing surfaces never
|
|
27
|
+
* collapse to black when the HDR's lower hemisphere is dark. The single biggest lever for keeping
|
|
28
|
+
* results well-lit regardless of which HDR is loaded. Default false (opt-in) — enabling it shifts
|
|
29
|
+
* the look. See {@link LightingConfig.hemisphereIntensity}.
|
|
30
|
+
*/
|
|
31
|
+
enableHemisphereLight?: boolean;
|
|
32
|
+
/** Hemisphere fill sky color (lights upward-facing surfaces). Default white. */
|
|
33
|
+
hemisphereSkyColor?: THREE.Color | number;
|
|
34
|
+
/** Hemisphere fill ground color (lights downward-facing surfaces). Default a mid grey. */
|
|
35
|
+
hemisphereGroundColor?: THREE.Color | number;
|
|
36
|
+
/** Hemisphere fill strength. Default 0.6. Only applies when {@link LightingConfig.enableHemisphereLight}. */
|
|
37
|
+
hemisphereIntensity?: number;
|
|
24
38
|
};
|
|
25
39
|
type EnvironmentConfig = {
|
|
26
40
|
hdrPath?: string;
|
|
@@ -28,6 +42,13 @@ type EnvironmentConfig = {
|
|
|
28
42
|
enableEnvironmentLighting?: boolean;
|
|
29
43
|
sceneUp?: THREE.Vector3;
|
|
30
44
|
showEnvironment?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Uniform multiplier on the HDR's image-based lighting contribution (`scene.environmentIntensity`).
|
|
47
|
+
* Normalizes brightness across HDRs of differing exposure — raise it to lift a dim HDR, lower it to
|
|
48
|
+
* tame a blown-out one — so the scene doesn't render dim-or-blown purely because of the HDR chosen.
|
|
49
|
+
* Default 1 (three.js default, unchanged look).
|
|
50
|
+
*/
|
|
51
|
+
environmentIntensity?: number;
|
|
31
52
|
};
|
|
32
53
|
type FloorConfig = {
|
|
33
54
|
enabled?: boolean;
|
|
@@ -52,17 +73,29 @@ type RenderConfig = {
|
|
|
52
73
|
ambientOcclusion?: boolean;
|
|
53
74
|
/** AO strength 0–1 when {@link RenderConfig.ambientOcclusion} is on. Default 1. */
|
|
54
75
|
aoIntensity?: number;
|
|
76
|
+
/**
|
|
77
|
+
* Device-pixel-ratio cap for the ambient-occlusion postprocessing buffers. AO is low-frequency, so
|
|
78
|
+
* rendering its buffers below the display DPR is nearly invisible but hugely cheaper — on a Retina
|
|
79
|
+
* display (DPR 2) full-resolution AO means 4× the pixels through GTAO's per-pixel sample loops,
|
|
80
|
+
* which can dominate frame time. Default 1 (AO buffers at 1× regardless of display DPR). Raise
|
|
81
|
+
* toward the display DPR for sharper AO at higher cost; only relevant when AO is enabled.
|
|
82
|
+
*/
|
|
83
|
+
aoPixelRatio?: number;
|
|
55
84
|
};
|
|
56
85
|
/**
|
|
57
|
-
* A
|
|
58
|
-
*
|
|
86
|
+
* A ready-to-go visual look. A `look` is a named bundle of LIGHTING/MATERIAL defaults only — it is
|
|
87
|
+
* deliberately decoupled from the CAD overlays (edges, grid), which are driven independently by
|
|
88
|
+
* {@link EdgesConfig}/{@link GridConfig}. Pick one and the viewer looks professional with zero other
|
|
89
|
+
* config; every individual `lighting`/`environment`/`render` option still overrides the preset. Seeds
|
|
90
|
+
* construction defaults and can be re-applied live via `setLook`.
|
|
59
91
|
*
|
|
60
|
-
* - 'technical': matte, drawing-like — neutral tone mapping, low IBL,
|
|
61
|
-
*
|
|
62
|
-
* - '
|
|
63
|
-
*
|
|
92
|
+
* - 'technical' (default): matte, drawing-like — neutral tone mapping, low IBL, no fill. Reads like a
|
|
93
|
+
* CAD shaded view (Rhino/Onshape).
|
|
94
|
+
* - 'studio': balanced presentation — ACES tone mapping, hemisphere fill + lifted HDR so results are
|
|
95
|
+
* well-lit regardless of the HDR, without washing colour out. The polished "product shot" look.
|
|
96
|
+
* - 'showcase': punchier presentation — ACES, stronger IBL/fill and a touch more exposure.
|
|
64
97
|
*/
|
|
65
|
-
type
|
|
98
|
+
type Look = 'studio' | 'technical' | 'showcase';
|
|
66
99
|
/** Crisp boundary/crease edge overlays on meshes. See `addEdges`. */
|
|
67
100
|
type EdgesConfig = {
|
|
68
101
|
/** Auto-attach edge overlays to meshes as they load. Default false (opt-in). */
|
|
@@ -133,12 +166,13 @@ type MeasureConfig = {
|
|
|
133
166
|
type ThreeInitializerOptions = {
|
|
134
167
|
sceneScale?: 'mm' | 'cm' | 'm' | 'inches' | 'feet';
|
|
135
168
|
/**
|
|
136
|
-
* Pick a
|
|
137
|
-
* IBL strength
|
|
138
|
-
* when set explicitly, so this only fills in what you
|
|
139
|
-
*
|
|
169
|
+
* Pick a ready-to-go visual look up front — seeds professional lighting/material defaults (tone
|
|
170
|
+
* mapping, AO, IBL strength, hemisphere fill; see {@link Look}). Individual `lighting`/
|
|
171
|
+
* `environment`/`render` options still win when set explicitly, so this only fills in what you
|
|
172
|
+
* leave unspecified. A look does NOT touch edges/grid (those are independent overlays). Defaults
|
|
173
|
+
* to 'technical'. Re-apply later via the init result's `setLook`.
|
|
140
174
|
*/
|
|
141
|
-
|
|
175
|
+
look?: Look;
|
|
142
176
|
camera?: CameraConfig;
|
|
143
177
|
lighting?: LightingConfig;
|
|
144
178
|
environment?: EnvironmentConfig;
|
|
@@ -210,12 +244,20 @@ interface CameraController {
|
|
|
210
244
|
* singularity.
|
|
211
245
|
*/
|
|
212
246
|
setViewDirection(direction: THREE.Vector3, animate?: boolean): void;
|
|
247
|
+
/**
|
|
248
|
+
* Frame an arbitrary world-space box (e.g. a double-clicked object) from the current view
|
|
249
|
+
* direction, moving the *active* camera — in 2D mode that means resizing the ortho frustum, not
|
|
250
|
+
* just translating. No-op on an empty box.
|
|
251
|
+
*/
|
|
252
|
+
frameBounds(box: THREE.Box3, animate?: boolean): void;
|
|
213
253
|
/** Enable/disable orbit rotation at runtime (pan/zoom unaffected). */
|
|
214
254
|
setRotateEnabled(enabled: boolean): void;
|
|
215
255
|
/** Whether rotation is currently enabled. */
|
|
216
256
|
isRotateEnabled(): boolean;
|
|
217
257
|
/** Keep the orthographic frustum aspect in sync on canvas resize. Called by the resize loop. */
|
|
218
258
|
updateAspect(width: number, height: number): void;
|
|
259
|
+
/** Cancel any in-flight camera tween. Call on viewer teardown so ticks can't touch disposed controls. */
|
|
260
|
+
dispose(): void;
|
|
219
261
|
}
|
|
220
262
|
interface CameraControllerDeps {
|
|
221
263
|
scene: THREE.Scene;
|
|
@@ -282,14 +324,24 @@ declare function createGrid(options?: GridOptions): Grid;
|
|
|
282
324
|
*
|
|
283
325
|
* Caller responsibilities (mirror ViewHelper's own contract):
|
|
284
326
|
* - call {@link ViewGizmo.render} *after* the main scene render each frame (overlay viewport),
|
|
285
|
-
* - call {@link ViewGizmo.update} each frame (no-op now; kept for API symmetry),
|
|
286
327
|
* - forward pointer clicks to {@link ViewGizmo.handleClick}.
|
|
287
328
|
*/
|
|
288
329
|
interface ViewGizmo {
|
|
289
330
|
render(renderer: THREE.WebGLRenderer): void;
|
|
331
|
+
/**
|
|
332
|
+
* @deprecated No-op, kept only for API stability. This wrapper never uses ViewHelper's
|
|
333
|
+
* click→animate path (see module comment) — view changes snap instantly through the camera
|
|
334
|
+
* controller — so there is never a gizmo animation to advance. Safe to stop calling.
|
|
335
|
+
*/
|
|
290
336
|
update(delta: number): void;
|
|
291
337
|
/** Hit-test a click. Returns true if it hit the gizmo (and a view change started). */
|
|
292
338
|
handleClick(event: MouseEvent): boolean;
|
|
339
|
+
/**
|
|
340
|
+
* @deprecated Always `false`, kept only for API stability. Gizmo clicks snap the view
|
|
341
|
+
* instantly rather than animating (deliberately — ViewHelper's built-in animation assumes a
|
|
342
|
+
* Y-up world and rolls the view in this Z-up scene), so there is no animation window to gate
|
|
343
|
+
* input on.
|
|
344
|
+
*/
|
|
293
345
|
readonly isAnimating: boolean;
|
|
294
346
|
/** Show/hide the gizmo at runtime. Hidden = not rendered and not click-hittable. */
|
|
295
347
|
setVisible(visible: boolean): void;
|
|
@@ -392,6 +444,14 @@ interface MeasureDeps {
|
|
|
392
444
|
canvas: HTMLCanvasElement;
|
|
393
445
|
scene: THREE.Scene;
|
|
394
446
|
getActiveCamera: () => THREE.Camera;
|
|
447
|
+
/**
|
|
448
|
+
* The current orbit target (e.g. `controls.target`). Used to scale the line/point pick
|
|
449
|
+
* threshold with the view: the tolerance is a fraction of the camera→target distance, so it
|
|
450
|
+
* stays roughly constant on screen wherever the user has framed the model. Optional for
|
|
451
|
+
* backward compatibility — without it the perspective fallback is the camera's distance to the
|
|
452
|
+
* world origin, which misjudges the threshold for off-origin content. Thread it in when you can.
|
|
453
|
+
*/
|
|
454
|
+
getViewTarget?: () => THREE.Vector3;
|
|
395
455
|
labelLayer: LabelLayer;
|
|
396
456
|
options?: MeasureOptions;
|
|
397
457
|
}
|
|
@@ -435,13 +495,40 @@ declare const initThree: (canvas: HTMLCanvasElement, options?: ThreeInitializerO
|
|
|
435
495
|
* edges). Retunes viewer-owned dials only; per-material parse choices are set via the batch
|
|
436
496
|
* parser's `material` option. Handy for comparing the two looks in a live viewer.
|
|
437
497
|
*/
|
|
438
|
-
setRenderStyle: (style: "technical" | "rendered") => void;
|
|
439
498
|
/**
|
|
440
|
-
*
|
|
441
|
-
*
|
|
442
|
-
*
|
|
499
|
+
* Switch the viewer to a ready-to-go look at runtime ('studio' | 'technical' | 'showcase'). Retunes
|
|
500
|
+
* lighting/material only (tone mapping, fill, IBL, AO) — never edges/grid. A straight preset apply:
|
|
501
|
+
* overwrites any granular lighting dials you set earlier.
|
|
502
|
+
*/
|
|
503
|
+
setLook: (look: "studio" | "technical" | "showcase") => void;
|
|
504
|
+
/**
|
|
505
|
+
* Retune the fill lights at runtime: the direction-aware hemisphere fill (sky/ground) and the flat
|
|
506
|
+
* ambient. Raising `hemisphereIntensity` is the most effective way to lift shadowed / under-facing
|
|
507
|
+
* surfaces a dark HDR leaves black. A positive `hemisphereIntensity` lazily creates the hemisphere
|
|
508
|
+
* light if the viewer was built without one; `0` switches it off.
|
|
443
509
|
*/
|
|
444
|
-
|
|
510
|
+
setFillLights: (opts: {
|
|
511
|
+
hemisphereIntensity?: number;
|
|
512
|
+
hemisphereSkyColor?: THREE.Color | number;
|
|
513
|
+
hemisphereGroundColor?: THREE.Color | number;
|
|
514
|
+
ambientIntensity?: number;
|
|
515
|
+
}) => void;
|
|
516
|
+
/**
|
|
517
|
+
* Set the uniform multiplier on the HDR's image-based lighting (`scene.environmentIntensity`) at
|
|
518
|
+
* runtime — normalizes brightness across HDRs of differing exposure so the scene isn't at the
|
|
519
|
+
* mercy of whichever HDR is loaded. Applies immediately, even before the HDR finishes decoding.
|
|
520
|
+
*/
|
|
521
|
+
setEnvironmentIntensity: (intensity: number) => void;
|
|
522
|
+
/** Set renderer tone-mapping exposure at runtime. Higher lifts shadows and overall brightness. */
|
|
523
|
+
setToneMappingExposure: (exposure: number) => void;
|
|
524
|
+
/** Set GTAO strength at runtime (0–1). No-op when ambient occlusion isn't active. */
|
|
525
|
+
setAoIntensity: (intensity: number) => void;
|
|
526
|
+
/**
|
|
527
|
+
* The parse-time material options (backface culling, IBL strength) matching the active look — feed
|
|
528
|
+
* into the batch parser's `material` option so freshly-loaded meshes are built to match it. See
|
|
529
|
+
* `setLook`.
|
|
530
|
+
*/
|
|
531
|
+
getMaterialAppearance: () => MaterialAppearanceOptions;
|
|
445
532
|
/**
|
|
446
533
|
* Refit the sun's shadow frustum to the current scene content for crisp shadows. Call after
|
|
447
534
|
* loading or replacing geometry (e.g. after `updateScene`). No-op when sunlight/shadows are off.
|
|
@@ -462,25 +549,9 @@ declare const initThree: (canvas: HTMLCanvasElement, options?: ThreeInitializerO
|
|
|
462
549
|
clearUserGeometry: () => void;
|
|
463
550
|
};
|
|
464
551
|
|
|
465
|
-
/**
|
|
466
|
-
* Updates the scene with the given meshes and camera settings.
|
|
467
|
-
* If initialPositionSet is false, it positions the camera and sets the controls target based on the bounding boxes of the meshes.
|
|
468
|
-
* @param scene - The THREE.Scene object to update.
|
|
469
|
-
* @param meshes - An array of THREE.Mesh objects to add to the scene.
|
|
470
|
-
* @param camera - The THREE.PerspectiveCamera object to position.
|
|
471
|
-
* @param controls - The OrbitControls object to update.
|
|
472
|
-
* @param initialPositionSet - A boolean indicating whether the initial position of the camera and controls have been set.
|
|
473
|
-
*/
|
|
552
|
+
/** Updates scene with meshes and positions camera on first call. */
|
|
474
553
|
declare function updateScene(scene: THREE.Scene, meshes: THREE.Object3D[], camera: THREE.PerspectiveCamera, controls: OrbitControls, initialPositionSet: boolean): void;
|
|
475
|
-
/**
|
|
476
|
-
* Parses a color string in multiple formats to a THREE.Color object.
|
|
477
|
-
* Supported formats:
|
|
478
|
-
* - Hex: "#C7A5A5", "C7A5A5"
|
|
479
|
-
* - RGB: "199, 165, 165"
|
|
480
|
-
* - CSS named colors: "red", "blue", etc.
|
|
481
|
-
* @param colorString - The color string to parse.
|
|
482
|
-
* @returns A THREE.Color object.
|
|
483
|
-
*/
|
|
554
|
+
/** Parses color strings (hex, RGB, CSS names). */
|
|
484
555
|
declare function parseColor(colorString: string): THREE.Color;
|
|
485
556
|
/**
|
|
486
557
|
* Shift objects along one world axis. Defaults to `z` — the up axis of the unified Z-up scene
|
|
@@ -500,6 +571,8 @@ declare const PLASTIC_MATERIAL: THREE.MeshPhysicalMaterial;
|
|
|
500
571
|
declare const GLASS_MATERIAL: THREE.MeshPhysicalMaterial;
|
|
501
572
|
declare const RUBBER_MATERIAL: THREE.MeshPhysicalMaterial;
|
|
502
573
|
declare const WOOD_MATERIAL: THREE.MeshPhysicalMaterial;
|
|
574
|
+
/** Shared singleton materials; must not be disposed (rebuilds shaders, frees textures). */
|
|
575
|
+
declare const SHARED_MATERIALS: ReadonlySet<THREE.Material>;
|
|
503
576
|
|
|
504
577
|
declare const threeMaterials_CONCRETE_MATERIAL: typeof CONCRETE_MATERIAL;
|
|
505
578
|
declare const threeMaterials_EMISSIVE_MATERIAL: typeof EMISSIVE_MATERIAL;
|
|
@@ -507,9 +580,10 @@ declare const threeMaterials_GLASS_MATERIAL: typeof GLASS_MATERIAL;
|
|
|
507
580
|
declare const threeMaterials_METAL_MATERIAL: typeof METAL_MATERIAL;
|
|
508
581
|
declare const threeMaterials_PLASTIC_MATERIAL: typeof PLASTIC_MATERIAL;
|
|
509
582
|
declare const threeMaterials_RUBBER_MATERIAL: typeof RUBBER_MATERIAL;
|
|
583
|
+
declare const threeMaterials_SHARED_MATERIALS: typeof SHARED_MATERIALS;
|
|
510
584
|
declare const threeMaterials_WOOD_MATERIAL: typeof WOOD_MATERIAL;
|
|
511
585
|
declare namespace threeMaterials {
|
|
512
|
-
export { threeMaterials_CONCRETE_MATERIAL as CONCRETE_MATERIAL, threeMaterials_EMISSIVE_MATERIAL as EMISSIVE_MATERIAL, threeMaterials_GLASS_MATERIAL as GLASS_MATERIAL, threeMaterials_METAL_MATERIAL as METAL_MATERIAL, threeMaterials_PLASTIC_MATERIAL as PLASTIC_MATERIAL, threeMaterials_RUBBER_MATERIAL as RUBBER_MATERIAL, threeMaterials_WOOD_MATERIAL as WOOD_MATERIAL };
|
|
586
|
+
export { threeMaterials_CONCRETE_MATERIAL as CONCRETE_MATERIAL, threeMaterials_EMISSIVE_MATERIAL as EMISSIVE_MATERIAL, threeMaterials_GLASS_MATERIAL as GLASS_MATERIAL, threeMaterials_METAL_MATERIAL as METAL_MATERIAL, threeMaterials_PLASTIC_MATERIAL as PLASTIC_MATERIAL, threeMaterials_RUBBER_MATERIAL as RUBBER_MATERIAL, threeMaterials_SHARED_MATERIALS as SHARED_MATERIALS, threeMaterials_WOOD_MATERIAL as WOOD_MATERIAL };
|
|
513
587
|
}
|
|
514
588
|
|
|
515
589
|
/**
|
|
@@ -585,9 +659,21 @@ interface RenderPipelineOptions {
|
|
|
585
659
|
toneMappingExposure: number;
|
|
586
660
|
/** AO strength 0–1. Default 1. */
|
|
587
661
|
aoIntensity?: number;
|
|
662
|
+
/**
|
|
663
|
+
* Cap on the device-pixel-ratio used for the composer's (AO) buffers. AO is low-frequency, so
|
|
664
|
+
* rendering below the display DPR is nearly invisible but far cheaper. `setSize`'s incoming
|
|
665
|
+
* pixelRatio is clamped to this. Default 1.
|
|
666
|
+
*/
|
|
667
|
+
aoPixelRatio?: number;
|
|
588
668
|
}
|
|
589
669
|
declare function createRenderPipeline(renderer: THREE.WebGLRenderer, scene: THREE.Scene, camera: THREE.Camera, width: number, height: number, options: RenderPipelineOptions): RenderPipeline;
|
|
590
670
|
|
|
671
|
+
/**
|
|
672
|
+
* Metres per model unit, keyed by Rhino `UnitSystem` name (the `modelunits` string on the compute
|
|
673
|
+
* response). Imperial factors are the exact international definitions (1 in = 0.0254 m,
|
|
674
|
+
* 1 ft = 0.3048 m, 1 mi = 1609.344 m). Units not in this table scale 1 and log a one-time warning
|
|
675
|
+
* — see {@link getScaleFactor}.
|
|
676
|
+
*/
|
|
591
677
|
declare const SCALE_FACTORS: Record<string, number>;
|
|
592
678
|
/**
|
|
593
679
|
* Extracts and processes display meshes from a ComputePointerResponse using the Grasshopper WebDisplay component.
|
|
@@ -595,7 +681,9 @@ declare const SCALE_FACTORS: Record<string, number>;
|
|
|
595
681
|
* This is the primary entry point for extracting mesh geometry from Grasshopper compute responses.
|
|
596
682
|
* It handles all aspects of mesh processing: decompression, coordinate transformation, scaling, and positioning.
|
|
597
683
|
*
|
|
598
|
-
* **Note:**
|
|
684
|
+
* **Note:** The entire pipeline (base64 decode, inflate, dequantization, mesh construction) runs
|
|
685
|
+
* synchronously on the calling thread — large batches will block the UI for their duration. The
|
|
686
|
+
* function is `async` only so its shape can stay stable if parsing moves off-thread later.
|
|
599
687
|
*
|
|
600
688
|
* @param data - The ComputePointerResponse containing Grasshopper output trees.
|
|
601
689
|
* @param options - Configuration for mesh extraction and parsing behavior. All options are optional with sensible defaults.
|
|
@@ -606,7 +694,7 @@ declare const SCALE_FACTORS: Record<string, number>;
|
|
|
606
694
|
* - Only works with the WebDisplay component of GHHeadless.
|
|
607
695
|
* - Requires changes to Rhino.Compute (see https://github.com/TheVessen/compute.rhino3d).
|
|
608
696
|
* - Provides a performant way to display mesh data in Three.js.
|
|
609
|
-
* -
|
|
697
|
+
* - All decoding is synchronous on the main thread; there is no Web Worker offload today.
|
|
610
698
|
* - Supports mesh metadata (names, user data) if provided in the compute response.
|
|
611
699
|
*
|
|
612
700
|
* @internal Internal helper: high-level extraction remains public via visualization module, but this
|
|
@@ -635,11 +723,7 @@ declare const SCALE_FACTORS: Record<string, number>;
|
|
|
635
723
|
*/
|
|
636
724
|
declare function getThreeMeshesFromComputeResponse(data: GrasshopperComputeResponse, options?: MeshExtractionOptions): Promise<THREE.Object3D[]>;
|
|
637
725
|
|
|
638
|
-
/**
|
|
639
|
-
* Internal-only telemetry threaded from an outer entry point (e.g. the JSON
|
|
640
|
-
* `parseMeshBatch` measuring its own `JSON.parse` cost) into the shared build
|
|
641
|
-
* step. Never part of any public options surface — callers don't supply timings.
|
|
642
|
-
*/
|
|
726
|
+
/** Internal telemetry only (not exposed in public options). */
|
|
643
727
|
interface ParseTelemetry {
|
|
644
728
|
parseTime?: number;
|
|
645
729
|
perfStart?: number;
|
|
@@ -651,9 +735,14 @@ interface ParseTelemetry {
|
|
|
651
735
|
* over the blob. The function stays `async` so callers don't have to change shape if we move
|
|
652
736
|
* parsing into a worker later.
|
|
653
737
|
*
|
|
738
|
+
* A batch with no `compressedData` (genuinely empty/absent geometry) resolves to `[]`. A corrupt,
|
|
739
|
+
* truncated, or unsupported blob throws so callers get a signal instead of a silent empty scene —
|
|
740
|
+
* `getThreeMeshesFromComputeResponse` documents (and now delivers) exactly that rethrow.
|
|
741
|
+
*
|
|
654
742
|
* @param batch - DisplayBatch object
|
|
655
743
|
* @param options - Rendering options
|
|
656
744
|
* @returns Promise resolving to array of Three.js mesh objects
|
|
745
|
+
* @throws {RhinoComputeError} On a corrupt/truncated/unsupported mesh blob or malformed group metadata.
|
|
657
746
|
*/
|
|
658
747
|
declare function parseMeshBatchObject(batch: DisplayBatch, options?: MeshBatchParsingOptions,
|
|
659
748
|
/** @internal Timings threaded from an outer entry point; not a caller option. */
|
|
@@ -669,13 +758,20 @@ telemetry?: ParseTelemetry): Promise<THREE.Mesh[]>;
|
|
|
669
758
|
* @param blob - Raw blob bytes from a binary WebSocket frame.
|
|
670
759
|
* @param options - Rendering options.
|
|
671
760
|
* @returns Promise resolving to array of Three.js mesh objects.
|
|
761
|
+
* @throws {RhinoComputeError} On a corrupt/truncated/unsupported mesh blob or malformed group metadata.
|
|
672
762
|
*/
|
|
673
763
|
declare function parseMeshBatchBlob(blob: ArrayBuffer | Uint8Array, options?: MeshBatchParsingOptions): Promise<THREE.Mesh[]>;
|
|
674
764
|
|
|
675
765
|
interface DisplayItemParseOptions {
|
|
676
766
|
/** rhino3dm instance for decoding curve JSON. Omit to skip curves (points still render). */
|
|
677
767
|
rhino?: RhinoModule;
|
|
678
|
-
/**
|
|
768
|
+
/**
|
|
769
|
+
* No-op. Historically toggled the Rhino Z-up → Three Y-up rotation, but the pipeline now keeps
|
|
770
|
+
* one coordinate frame end to end ({@link rhinoToThree} is the identity), so this flag no longer
|
|
771
|
+
* changes the result. Do NOT pre-rotate your own geometry to compensate — none is applied.
|
|
772
|
+
*
|
|
773
|
+
* @deprecated Retained only so existing call sites compile unchanged; has no effect.
|
|
774
|
+
*/
|
|
679
775
|
applyTransforms?: boolean;
|
|
680
776
|
}
|
|
681
777
|
/**
|
package/dist/visualization.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{J as h,K as c,L as v,M as j,a as e,b as r,c as t,d as o,e as i,f as a,g as s,h as p,i as n,j as l,k as f,l as m,m as y,n as u,o as d,p as x,u as C,v as g}from"./chunk-CWODTGNH.js";import"./chunk-WPB2LKCD.js";export{n as EDGE_USERDATA_KIND,e as Materials,v as SCALE_FACTORS,l as addEdges,o as applyOffset,i as computeCombinedBoundingBox,a as createCameraController,s as createGrid,u as createLabelLayer,x as createMeasureTool,y as createRenderPipeline,p as createViewGizmo,j as getThreeMeshesFromComputeResponse,C as initThree,f as isEdgeOverlay,t as parseColor,g as parseDisplayItems,c as parseMeshBatchBlob,h as parseMeshBatchObject,m as removeEdges,d as snapToVertex,r as updateScene};
|
|
2
2
|
//# sourceMappingURL=visualization.js.map
|
package/package.json
CHANGED
package/dist/chunk-33753HSV.cjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkD7A3YIYDcjs = require('./chunk-D7A3YIYD.cjs');function p(t,e){if(!t||typeof t!="object")return;let r=t;if(e in r)return r[e];let n=J(r).get(e.toLowerCase());return n===void 0?void 0:r[n]}function L(t,e){if(!t||typeof t!="object")return!1;let r=t;return e in r?!0:J(r).has(e.toLowerCase())}var H=new WeakMap;function J(t){let e=H.get(t);if(!e){e=new Map;for(let r of Object.keys(t)){let n=r.toLowerCase();e.has(n)||e.set(n,r)}H.set(t,e)}return e}function C(t,e){e||typeof window<"u"&&_chunkD7A3YIYDcjs.e.call(void 0, ).warn(`Warning: ${t} is running on the client side. For better performance and security, consider running this on the server side.`)}var Se="Unable to load grasshopper definition";function Ie(t){return t instanceof _chunkD7A3YIYDcjs.d?t.code===_chunkD7A3YIYDcjs.c.DEFINITION_NOT_CACHED||t.message.includes(Se):!1}function xe(t,e){if(!e)return;let r=p(t,"values");if(!Array.isArray(r)||r.length===0)return;let n=[];for(let a of r){let o=p(a,"innerTree");(!o||Object.keys(o).length===0)&&n.push(_nullishCoalesce(p(a,"paramName"), () => ("<unnamed>")))}if(n.length===0)return;let s=n.length===r.length?"all":`${n.length}/${r.length}`;_chunkD7A3YIYDcjs.e.call(void 0, ).warn(`Solve returned empty output(s) (${s}): ${n.join(", ")}. These parameters produced no data \u2014 check the definition's inputs and the branch feeding each.`)}async function D(t,e,r){r.debug&&C("solveGrasshopperDefinition",_nullishCoalesce(r.suppressBrowserWarning, () => (r.suppressClientSideWarning)));let{response:n}=await O(P(e,t),r);return n}async function Y(t,e,r){return r.debug&&C("solveGrasshopperDefinitionWithCacheKey",_nullishCoalesce(r.suppressBrowserWarning, () => (r.suppressClientSideWarning))),O(P(e,t),r)}async function Q(t,e,r,n){n.debug&&C("solveByCacheKey",_nullishCoalesce(n.suppressBrowserWarning, () => (n.suppressClientSideWarning)));let s={algo:null,pointer:e,values:t};try{return{...await O(s,n),missed:!1}}catch(a){if(!Ie(a))throw a;return{...await O(P(r,t),n),missed:!0}}}async function O(t,e){De(t,e);let r=await _chunkD7A3YIYDcjs.l.call(void 0, "grasshopper",t,e),{pointer:n,algo:s,...a}=r,o=a;return xe(o,e.debug),{response:o,cacheKey:typeof n=="string"?n:null}}function P(t,e){let r={algo:null,pointer:null,values:e};return t instanceof Uint8Array?r.algo=_chunkD7A3YIYDcjs.k.call(void 0, t):/^https?:\/\//i.test(t)?r.pointer=t:_chunkD7A3YIYDcjs.i.call(void 0, t)?r.algo=t:r.algo=_chunkD7A3YIYDcjs.h.call(void 0, t),r}function De(t,e){e.cachesolve!=null&&(t.cachesolve=e.cachesolve),e.cacheerroredsolves!=null&&(t.cacheerroredsolves=e.cacheerroredsolves),e.modelunits!=null&&(t.modelunits=e.modelunits),e.angletolerance!=null&&(t.angletolerance=e.angletolerance),e.absolutetolerance!=null&&(t.absolutetolerance=e.absolutetolerance),e.dataversion!=null&&(t.dataversion=e.dataversion)}function Pe(t){let e=new WeakSet,r=n=>{if(n==null)return JSON.stringify(n);if(typeof n=="number")return Number.isFinite(n)?String(n):JSON.stringify(null);if(typeof n=="string"||typeof n=="boolean")return JSON.stringify(n);if(typeof n=="bigint")return JSON.stringify(n.toString());if(n instanceof Uint8Array){let s=n.length>64?Array.from(n.slice(0,32)).concat(Array.from(n.slice(-32))):Array.from(n);return JSON.stringify({__u8:!0,len:n.length,sample:s})}return Array.isArray(n)?`[${n.map(r).join(",")}]`:typeof n=="object"?e.has(n)?JSON.stringify("[Circular]"):(e.add(n),`{${Object.keys(n).sort().map(o=>`${JSON.stringify(o)}:${r(n[o])}`).join(",")}}`):JSON.stringify(null)};return r(t)}function X(t,e){let r=2166136261;for(let n=0;n<t;n++)r^=e(n),r=r+((r<<1)+(r<<4)+(r<<7)+(r<<8)+(r<<24))>>>0;return r.toString(16).padStart(8,"0")}function Z(t){return X(t.length,e=>t.charCodeAt(e))}function we(t){return X(t.length,e=>t[e])}function ee(t,e){return Z(`${W(t)}|${Pe(e)}`)}function W(t){return typeof t=="string"?`s:${t.length}:${Z(t)}`:`u8:${t.length}:${we(t)}`}var Re=100;function Ee(t){return t instanceof Uint8Array?!0:!/^https?:\/\//i.test(t)}var S=class{constructor(e,r,n={},s){_chunkD7A3YIYDcjs.b.call(void 0, this,"executor");_chunkD7A3YIYDcjs.b.call(void 0, this,"baseConfig");_chunkD7A3YIYDcjs.b.call(void 0, this,"mode");_chunkD7A3YIYDcjs.b.call(void 0, this,"maxConcurrent");_chunkD7A3YIYDcjs.b.call(void 0, this,"timeoutMs");_chunkD7A3YIYDcjs.b.call(void 0, this,"retry");_chunkD7A3YIYDcjs.b.call(void 0, this,"cacheEnabled");_chunkD7A3YIYDcjs.b.call(void 0, this,"cacheMax");_chunkD7A3YIYDcjs.b.call(void 0, this,"cacheTtl");_chunkD7A3YIYDcjs.b.call(void 0, this,"cache",new Map);_chunkD7A3YIYDcjs.b.call(void 0, this,"cacheKeyExecutor");_chunkD7A3YIYDcjs.b.call(void 0, this,"reuseServerDefinitionCache");_chunkD7A3YIYDcjs.b.call(void 0, this,"serverCacheKeys",new Map);_chunkD7A3YIYDcjs.b.call(void 0, this,"onStart");_chunkD7A3YIYDcjs.b.call(void 0, this,"onSettle");_chunkD7A3YIYDcjs.b.call(void 0, this,"onSuperseded");_chunkD7A3YIYDcjs.b.call(void 0, this,"subscribers",new Set);_chunkD7A3YIYDcjs.b.call(void 0, this,"inFlight",new Set);_chunkD7A3YIYDcjs.b.call(void 0, this,"pendingForLatestWins",null);_chunkD7A3YIYDcjs.b.call(void 0, this,"fifoQueue",[]);_chunkD7A3YIYDcjs.b.call(void 0, this,"_lastResult",null);_chunkD7A3YIYDcjs.b.call(void 0, this,"_lastError",null);_chunkD7A3YIYDcjs.b.call(void 0, this,"_lastDurationMs",null);_chunkD7A3YIYDcjs.b.call(void 0, this,"disposed",!1);this.executor=e,this.cacheKeyExecutor=s,this.baseConfig=r,this.mode=_nullishCoalesce(n.mode, () => ("latest-wins")),this.maxConcurrent=Math.max(1,_nullishCoalesce(n.maxConcurrent, () => ((this.mode==="parallel"?4:1)))),this.timeoutMs=n.timeoutMs,this.retry=n.retry;let a=n.cache;this.cacheEnabled=a!==void 0&&a!==!1;let o=typeof a=="object"?a:{};this.cacheMax=_nullishCoalesce(o.maxEntries, () => (50)),this.cacheTtl=_nullishCoalesce(o.ttlMs, () => (0)),this.reuseServerDefinitionCache=!!s&&(_nullishCoalesce(n.reuseServerDefinitionCache, () => (!0))),this.onStart=n.onStart,this.onSettle=n.onSettle,this.onSuperseded=n.onSuperseded}get isSolving(){return this.inFlight.size>0}get hasPending(){return this.pendingForLatestWins!==null||this.fifoQueue.length>0}get inFlightCount(){return this.inFlight.size}get queueDepth(){return this.fifoQueue.length+(this.pendingForLatestWins?1:0)}get lastResult(){return this._lastResult}get lastError(){return this._lastError}get lastDurationMs(){return this._lastDurationMs}subscribe(e){return this.subscribers.add(e),()=>this.subscribers.delete(e)}notify(){for(let e of this.subscribers)try{e()}catch(r){_chunkD7A3YIYDcjs.e.call(void 0, ).error("[SolveScheduler] subscriber threw:",r)}}solve(e,r,n){if(this.disposed)return Promise.reject(new (0, _chunkD7A3YIYDcjs.d)("SolveScheduler has been disposed and cannot be used",_chunkD7A3YIYDcjs.c.INVALID_STATE));let s=ee(e,r),a={key:s,enqueuedAt:Date.now(),startedAt:null};if(this.cacheEnabled){let o=this.readCache(s);if(o){let i={status:"success",response:o,durationMs:0,fromCache:!0};return this._lastResult=o,this._lastError=null,this._lastDurationMs=0,this.runHook(this.onStart,a),this.runHook(this.onSettle,a,i),this.notify(),Promise.resolve(o)}}return new Promise((o,i)=>{let u={definition:e,dataTree:r,ctx:a,resolve:o,reject:i,externalSignal:_optionalChain([n, 'optionalAccess', _2 => _2.signal])};if(_optionalChain([u, 'access', _3 => _3.externalSignal, 'optionalAccess', _4 => _4.aborted])){this.settleError(u,this.makeAbortError(a));return}this.enqueue(u)})}enqueue(e){switch(this.mode){case"latest-wins":{this.pendingForLatestWins&&(this.supersede(this.pendingForLatestWins),this.pendingForLatestWins=null);for(let r of this.inFlight)this.supersede(r),r.controller.abort();this.inFlight.size===0?this.execute(e):this.pendingForLatestWins=e;break}case"queue":case"parallel":{this.inFlight.size<this.maxConcurrent?this.execute(e):this.fifoQueue.push(e);break}}this.notify()}async execute(e){let r=new AbortController,n=e;n.controller=r,this.inFlight.add(n),e.ctx.startedAt=Date.now();let s=()=>r.abort();_optionalChain([e, 'access', _5 => _5.externalSignal, 'optionalAccess', _6 => _6.addEventListener, 'call', _7 => _7("abort",s,{once:!0})]),this.runHook(this.onStart,e.ctx),this.notify();let a=performance.now();try{let o={...this.baseConfig,signal:r.signal,...this.timeoutMs!==void 0&&{timeoutMs:this.timeoutMs},...this.retry!==void 0&&{retry:this.retry}},{response:i,definitionReuploaded:u}=await this.runExecutor(e.definition,e.dataTree,o),c=performance.now()-a;if(this.cacheEnabled&&this.writeCache(e.ctx.key,i),!this.settleSuccess(e,i))return;this._lastResult=i,this._lastError=null,this._lastDurationMs=c,this.runHook(this.onSettle,e.ctx,{status:"success",response:i,durationMs:c,fromCache:!1,definitionReuploaded:u})}catch(o){let i=performance.now()-a,u=this.normalizeExecutionError(o,n);this._lastError=u,this._lastDurationMs=i,this.settleError(e,u)&&this.runHook(this.onSettle,e.ctx,{status:"error",error:u,durationMs:i})}finally{_optionalChain([e, 'access', _8 => _8.externalSignal, 'optionalAccess', _9 => _9.removeEventListener, 'call', _10 => _10("abort",s)]),this.inFlight.delete(n),this.drainNext(),this.notify()}}async runExecutor(e,r,n){if(!this.cacheKeyExecutor||!this.reuseServerDefinitionCache||!Ee(e))return{response:await this.executor(e,r,n)};let s=W(e),a=_nullishCoalesce(this.serverCacheKeys.get(s), () => (null)),o=await this.cacheKeyExecutor(e,r,a,n);if(o.cacheKey)for(this.serverCacheKeys.delete(s),this.serverCacheKeys.set(s,o.cacheKey);this.serverCacheKeys.size>Re;){let i=this.serverCacheKeys.keys().next().value;if(i===void 0)break;this.serverCacheKeys.delete(i)}else this.serverCacheKeys.delete(s);return{response:o.response,definitionReuploaded:o.missed}}drainNext(){if(!this.disposed){if(this.mode==="latest-wins"){if(this.pendingForLatestWins&&this.inFlight.size===0){let e=this.pendingForLatestWins;this.pendingForLatestWins=null,this.execute(e)}return}for(;this.fifoQueue.length>0&&this.inFlight.size<this.maxConcurrent;){let e=this.fifoQueue.shift();this.execute(e)}}}supersede(e){let r=new (0, _chunkD7A3YIYDcjs.d)("Superseded by newer solve",_chunkD7A3YIYDcjs.c.SUPERSEDED,{context:{key:e.ctx.key,enqueuedAt:e.ctx.enqueuedAt}});this.settleError(e,r)&&this.runHook(this.onSuperseded,e.ctx)}makeAbortError(e){return new (0, _chunkD7A3YIYDcjs.d)("Request aborted by caller",_chunkD7A3YIYDcjs.c.ABORTED,{context:{key:e.key,enqueuedAt:e.enqueuedAt}})}settleError(e,r){return e.settled?!1:(e.settled={error:r},e.reject(r),!0)}settleSuccess(e,r){return e.settled?!1:(e.settled={ok:!0},e.resolve(r),!0)}isAbortLikeError(e){if(e instanceof Error){if(e.name==="AbortError")return!0;if(typeof DOMException<"u"&&e instanceof DOMException)return e.name==="AbortError"}return!1}normalizeExecutionError(e,r){return r.settled&&"error"in r.settled?r.settled.error:e instanceof _chunkD7A3YIYDcjs.d?e:this.isAbortLikeError(e)?this.makeAbortError(r.ctx):new (0, _chunkD7A3YIYDcjs.d)(e instanceof Error?e.message:String(e),_chunkD7A3YIYDcjs.c.UNKNOWN_ERROR,{originalError:e instanceof Error?e:new Error(String(e))})}cancelAll(){for(this.pendingForLatestWins&&(this.rejectAsAborted(this.pendingForLatestWins),this.pendingForLatestWins=null);this.fifoQueue.length>0;){let e=this.fifoQueue.shift();this.rejectAsAborted(e)}for(let e of this.inFlight){let r=this.makeAbortError(e.ctx);this.settleError(e,r)&&this.runHook(this.onSettle,e.ctx,{status:"error",error:r,durationMs:e.ctx.startedAt?performance.now()-e.ctx.startedAt:0}),e.controller.abort()}this.notify()}rejectAsAborted(e){this.settleError(e,this.makeAbortError(e.ctx))}readCache(e){if(!this.cacheEnabled)return null;let r=this.cache.get(e);return r?this.cacheTtl>0&&Date.now()-r.insertedAt>this.cacheTtl?(this.cache.delete(e),null):(this.cache.delete(e),this.cache.set(e,r),r.response):null}writeCache(e,r){if(this.cacheEnabled)for(this.cache.set(e,{response:r,insertedAt:Date.now()});this.cache.size>this.cacheMax;){let n=this.cache.keys().next().value;if(n===void 0)break;this.cache.delete(n)}}clearCache(){this.cache.clear()}dispose(){this.disposed||(this.disposed=!0,this.cancelAll(),this.subscribers.clear(),this.cache.clear())}runHook(e,...r){if(e)try{e(...r)}catch(n){_chunkD7A3YIYDcjs.e.call(void 0, ).error("[SolveScheduler] hook threw:",n)}}};var w=class t{constructor(e){_chunkD7A3YIYDcjs.b.call(void 0, this,"config");_chunkD7A3YIYDcjs.b.call(void 0, this,"serverStats");_chunkD7A3YIYDcjs.b.call(void 0, this,"disposed",!1);this.config=this.normalizeComputeConfig(e),this.serverStats=new (0, _chunkD7A3YIYDcjs.n)(this.config.serverUrl,this.config.apiKey)}static async create(e){let r=new t(e),n=Math.max(1,(_nullishCoalesce(_optionalChain([e, 'access', _11 => _11.retry, 'optionalAccess', _12 => _12.attempts]), () => (2)))+1),s=_nullishCoalesce(_optionalChain([e, 'access', _13 => _13.retry, 'optionalAccess', _14 => _14.baseDelayMs]), () => (250)),a=_nullishCoalesce(_optionalChain([e, 'access', _15 => _15.retry, 'optionalAccess', _16 => _16.maxDelayMs]), () => (1e3));for(let o=0;o<n;o++){if(await r.serverStats.isServerOnline())return r;if(o<n-1){let i=Math.min(s*2**o,a);await new Promise(u=>setTimeout(u,i))}}throw await r.dispose(),new (0, _chunkD7A3YIYDcjs.d)("Rhino Compute server is not online",_chunkD7A3YIYDcjs.c.NETWORK_ERROR,{context:{serverUrl:r.config.serverUrl,attempts:n}})}getConfig(){return this.ensureNotDisposed(),{...this.config}}async getIO(e){return this.ensureNotDisposed(),F(e,this.config)}async getRawIO(e){return this.ensureNotDisposed(),R(e,this.config)}async solve(e,r,n){this.ensureNotDisposed();try{if(typeof e=="string"&&!_optionalChain([e, 'optionalAccess', _17 => _17.trim, 'call', _18 => _18()]))throw new (0, _chunkD7A3YIYDcjs.d)("Definition URL/content is required",_chunkD7A3YIYDcjs.c.INVALID_INPUT,{context:{receivedUrl:e}});if(e instanceof Uint8Array&&e.length===0)throw new (0, _chunkD7A3YIYDcjs.d)("Definition content is empty",_chunkD7A3YIYDcjs.c.INVALID_INPUT);let s={...this.config,..._optionalChain([n, 'optionalAccess', _19 => _19.signal])!==void 0&&{signal:n.signal},..._optionalChain([n, 'optionalAccess', _20 => _20.timeoutMs])!==void 0&&{timeoutMs:n.timeoutMs},..._optionalChain([n, 'optionalAccess', _21 => _21.retry])!==void 0&&{retry:n.retry}},a=await D(r,e,s);if(_optionalChain([a, 'optionalAccess', _22 => _22.errors])&&a.errors.length>0)throw new (0, _chunkD7A3YIYDcjs.d)(a.errors.join("; ")||"Computation failed",_chunkD7A3YIYDcjs.c.COMPUTATION_ERROR,{context:{definition:typeof e=="string"&&e.length<200?e:"...content...",inputs:r,errors:a.errors,warnings:a.warnings}});return a}catch(s){throw this.config.debug&&_chunkD7A3YIYDcjs.e.call(void 0, ).error("Compute failed:",s),s instanceof _chunkD7A3YIYDcjs.d?s:new (0, _chunkD7A3YIYDcjs.d)(s instanceof Error?s.message:String(s),_chunkD7A3YIYDcjs.c.COMPUTATION_ERROR,{context:{definition:typeof e=="string"&&e.length<200?e:"...content...",inputs:r},originalError:s instanceof Error?s:new Error(String(s))})}}createScheduler(e){this.ensureNotDisposed();let r=(s,a,o)=>D(a,s,o),n=(s,a,o,i)=>o===null?Y(a,s,i).then(u=>({...u,missed:!1})):Q(a,o,s,i);return new S(r,this.config,e,n)}async dispose(){this.disposed||(this.disposed=!0,await this.serverStats.dispose())}ensureNotDisposed(){if(this.disposed)throw new (0, _chunkD7A3YIYDcjs.d)("GrasshopperClient has been disposed and cannot be used",_chunkD7A3YIYDcjs.c.INVALID_STATE)}normalizeComputeConfig(e){return{...e,serverUrl:_chunkD7A3YIYDcjs.m.call(void 0, e.serverUrl),apiKey:e.apiKey,authToken:e.authToken,debug:_nullishCoalesce(e.debug, () => (!1)),suppressBrowserWarning:_nullishCoalesce(e.suppressBrowserWarning, () => (e.suppressClientSideWarning))}}};var k=new Map;function te(t,e){k.set(t,e)}te("Rhino.Geometry.Point3d",(t,e)=>{let r=e;return!r||typeof r.X!="number"?null:new t.Point([r.X,r.Y,r.Z])});te("Rhino.Geometry.Line",(t,e)=>{let r=e;return!r||!r.From||!r.To?null:new t.Line([r.From.X,r.From.Y,r.From.Z],[r.To.X,r.To.Y,r.To.Z])});function Ae(t){if(k.has(t))return k.get(t);for(let[e,r]of k)if(t.startsWith(e))return r}function ve(t){return!!(t&&typeof t=="object"&&typeof t.data=="string")}function re(t,e,r){let n=Ae(e);if(n)try{return n(r,t)}catch(s){_chunkD7A3YIYDcjs.e.call(void 0, ).warn(`Failed to decode Rhino type ${e}:`,s)}try{if(ve(t))return r.CommonObject.decode(t)}catch(s){return _chunkD7A3YIYDcjs.e.call(void 0, ).warn(`Failed to decode ${e} with CommonObject:`,s),{__decodeError:!0,type:e,raw:t}}return t}var I={STRING:"System.String",INT:"System.Int32",DOUBLE:"System.Double",BOOL:"System.Boolean"},Ne="Rhino.Geometry.",Oe=["WebDisplay"],Fe="FileData";function ne(t){return Oe.some(e=>t.includes(e))}function se(t){if(typeof t!="string")return t;let e=t.trim();if(!(e.startsWith("{")||e.startsWith("[")||e.startsWith('"')))return t;try{let n=JSON.parse(e);if(typeof n=="string")try{return JSON.parse(n)}catch (e2){return n}return n}catch (e3){return t}}function ke(t,e,r){switch(e){case I.STRING:return typeof t!="string"?t:t.replace(/^"(.*)"$/,"$1");case I.INT:return Number.parseInt(t,10);case I.DOUBLE:return Number.parseFloat(t);case I.BOOL:return String(t).toLowerCase()==="true";default:return r&&e.startsWith(Ne)?re(t,e,r):t}}function oe(t,e,r,n){if(typeof t!="string")return t;let s=r?se(t):t;return ke(s,e,n)}function Ge(t){if(!t||typeof t!="object")return!1;let e=t;return typeof e.fileName=="string"&&typeof e.fileType=="string"&&"data"in e&&typeof e.isBase64Encoded=="boolean"&&typeof e.subFolder=="string"}function G(t,e){for(let r of Object.values(t))if(Array.isArray(r))for(let n of r)e(n)}function ae(t,e=!1,r={}){let{parseValues:n=!0,rhino:s,stringOnly:a=!1}=r,o={},i=new Set;for(let u of t.values)G(u.InnerTree,c=>{if(ne(c.type)||a&&c.type!==I.STRING)return;let m=e?c.id:u.ParamName;if(!m)return;let y=oe(c.data,c.type,n,s);m in o?i.has(m)?o[m].push(y):(o[m]=[o[m],y],i.add(m)):o[m]=y});return{values:o}}function ie(t){let e=[];for(let r of t.values)G(r.InnerTree,n=>{if(!n.type.includes(Fe))return;let s=se(n.data);Ge(s)&&e.push(s)});return e}function ue(t,e,r={}){let{parseValues:n=!0,rhino:s,stringOnly:a=!1}=r,o;if("byName"in e?o=t.values.find(u=>u.ParamName===e.byName):o=t.values.find(u=>{let c=!1;return G(u.InnerTree,m=>{m.id===e.byId&&(c=!0)}),c}),!o)return;let i=[];if(G(o.InnerTree,u=>{if("byId"in e&&u.id!==e.byId||ne(u.type)||a&&u.type!==I.STRING)return;let c=oe(u.data,u.type,n,s);i.push(c)}),i.length!==0)return i.length===1?i[0]:i}var E=class{constructor(e,r=!1){this.response=e;this.debug=r}getValues(e=!1,r={}){return ae(this.response,e,r)}getValue(e,r){return ue(this.response,e,r)}async extractMeshesFromResponse(e){let r={debug:this.debug,...e},n;try{({getThreeMeshesFromComputeResponse:n}=await Promise.resolve().then(() => _interopRequireWildcard(require("./visualization-DEAMRV7R.cjs"))))}catch(s){throw new (0, _chunkD7A3YIYDcjs.d)("Failed to load three.js visualization module. Ensure three.js is installed as a peer dependency.",_chunkD7A3YIYDcjs.c.INVALID_STATE,{context:{originalError:s instanceof Error?s.message:String(s)}})}return n(this.response,r)}getFileData(){return ie(this.response)}async getAndDownloadFiles(e,r){let n=this.getFileData();await _chunkD7A3YIYDcjs.r.call(void 0, n,e,r)}};function pe(t){return p(t,"data")}function Me(t){return p(t,"type")}function le(t){if(typeof t.default!="object"||t.default===null)return{schema:t};if(!L(t.default,"innerTree")){let n=`Input "${_nullishCoalesce(t.name, () => ("unknown"))}" default had an unrecognized shape (no innerTree key); the default was dropped.`;return _chunkD7A3YIYDcjs.e.call(void 0, ).warn("Unexpected structure in input.default:",t.default),{schema:{...t,default:null},warning:{code:"MALFORMED_DEFAULT",message:n}}}let e=_nullishCoalesce(p(t.default,"innerTree"), () => ({}));if(Object.keys(e).length===0)return{schema:{...t,default:void 0}};if(t.treeAccess||t.atMost&&t.atMost>1){let n={};for(let[s,a]of Object.entries(e)){if(!Array.isArray(a)){let o=`Input "${_nullishCoalesce(t.name, () => ("unknown"))}" default had a non-array innerTree branch ("${s}"); the default was dropped.`;return _chunkD7A3YIYDcjs.e.call(void 0, ).warn("Unexpected structure in input.default innerTree:",t.default),{schema:{...t,default:null},warning:{code:"MALFORMED_DEFAULT",message:o}}}n[s]=a.map(o=>{let i=pe(o),u=Me(o);if(typeof i=="string"){if(u==="System.Double"||u==="System.Int32"){let c=Number(i);return Number.isNaN(c)?i:c}if(u==="System.Boolean")return i.toLowerCase()==="true";if(_optionalChain([u, 'optionalAccess', _23 => _23.startsWith, 'call', _24 => _24("Rhino.Geometry")]))try{return JSON.parse(i)}catch (e4){return i}}return i})}return{schema:{...t,default:n}}}let r=[];for(let n of Object.values(e))Array.isArray(n)&&n.forEach(s=>{s&&typeof s=="object"&&L(s,"data")&&r.push(pe(s))});return r.length===0?{schema:{...t,default:void 0}}:r.length===1?{schema:{...t,default:r[0]}}:{schema:{...t,default:r}}}var B=/^\{(\d+(?:;\d+)*)?\}$/;function A(t){if(typeof t!="object"||t===null||Array.isArray(t))return!1;let e=Object.entries(t);return e.length>0&&e.every(([r,n])=>B.test(r)&&Array.isArray(n))}function x(t,e,r){if(t==null)return t;if(Array.isArray(t)){let s=t.map(e).filter(a=>a!==null);return s.length>0?s:void 0}let n=e(t);return n!==null?n:r?void 0:t}var Ve=t=>{if(typeof t=="number")return t;if(typeof t=="string"){let e=t.trim();if(e==="")return null;let r=Number(e);return Number.isNaN(r)?null:r}return null},Le=t=>{if(typeof t=="boolean")return t;if(typeof t=="string"){let e=t.toLowerCase();if(e==="true")return!0;if(e==="false")return!1;throw new Error(`Invalid boolean string: "${t}"`)}return null},We=t=>typeof t=="string"?t.length>=2&&t.startsWith('"')&&t.endsWith('"')?t.slice(1,-1):t.startsWith('"')?t.slice(1):t:null,Be=t=>{if(typeof t=="string"){let e=t.trim();return e.startsWith('"')&&e.endsWith('"')&&(e=e.slice(1,-1).trim()),e}return null};function fe(t){return e=>{if(typeof e=="object"&&e!==null)return e;if(typeof e=="string"&&e.trim()!=="")try{let r=JSON.parse(e);return typeof r=="object"&&r!==null?r:(_chunkD7A3YIYDcjs.e.call(void 0, ).warn(`Parsed value for input ${t} is not an object`),null)}catch(r){return _chunkD7A3YIYDcjs.e.call(void 0, ).warn(`Failed to parse object value "${e}" for input ${t}`,r),null}return null}}function ce(t,e,r){let n=Number(t.toFixed(e));return Math.abs(t-n)<r?n:t}function je(t,e){if(!Number.isFinite(t)||t===0)return .1;let r=Math.abs(t);if(r>=1){let g=String(t).split(".")[1];if(g&&g.length>0){let b=Math.min(g.length,12),T=Math.pow(10,-b),U=Number(T.toFixed(b));return Math.abs(U-T)<e?U:T}return 1}let n=String(t),s=n.toLowerCase().match(/e(-?\d+)/);if(s){let y=Number(s[1]);if(y<0||n.toLowerCase().includes("e-")){let g=Math.abs(y),b=Math.pow(10,-g),T=Number(b.toFixed(g));return Math.abs(T-b)<e?T:b}return .1}let a=12,i=r.toFixed(a).replace(/0+$/,""),u=Math.min((i.split(".")[1]||"").length,a);if(u===0)return .1;let c=Math.pow(10,-u),m=Number(c.toFixed(u));return Math.abs(m-c)<e?m:c}function Ue(t,e=1e-8){let r=t.paramType==="Integer";if(A(t.default))return{default:t.default,stepSize:r?1:.1};let n=x(t.default,Ve,!0);if(r)return Array.isArray(n)?n=n.map(m=>typeof m=="number"?Math.round(m):m):typeof n=="number"&&(n=Math.round(n)),{default:n,stepSize:1};let s=Array.isArray(n)?n[0]:n,a;typeof s=="number"&&Number.isFinite(s)&&s!==0?a=s:typeof t.minimum=="number"&&Number.isFinite(t.minimum)&&t.minimum!==0?a=t.minimum:typeof t.maximum=="number"&&Number.isFinite(t.maximum)&&t.maximum!==0&&(a=t.maximum);let o=a!==void 0?je(a,e):.1,i=0,u=String(o),c=u.toLowerCase().match(/e(-?\d+)/);if(c?i=Math.abs(Number(c[1])):i=_nullishCoalesce(_optionalChain([u, 'access', _25 => _25.split, 'call', _26 => _26("."), 'access', _27 => _27[1], 'optionalAccess', _28 => _28.length]), () => (0)),i===0&&typeof s=="number"&&s!==0&&Math.abs(s)<1){let m=Math.ceil(-Math.log10(Math.abs(s)));Number.isFinite(m)&&m>0&&(i=m)}return i=Math.min(Math.max(i,0),12),Array.isArray(n)?n=n.map(m=>typeof m=="number"?ce(m,i,e):m):typeof n=="number"&&(n=ce(n,i,e)),{default:n,stepSize:o}}var Ke={types:["Number","Integer"],parse(t,e){let{default:r,stepSize:n}=Ue(t);return{...e,paramType:t.paramType,minimum:t.minimum,maximum:t.maximum,atLeast:t.atLeast,atMost:t.atMost,stepSize:n,default:r}},fallback(t,e){let r=(_nullishCoalesce(t.atMost, () => (1)))>1;return{...e,paramType:t.paramType,minimum:t.minimum,maximum:t.maximum,atLeast:t.atLeast,atMost:t.atMost,default:r?[0]:0}}},ze={types:["Boolean"],parse(t,e){let r;try{r=x(t.default,Le,!1)}catch(n){throw n instanceof Error?new (0, _chunkD7A3YIYDcjs.d)(n.message):n}return{...e,paramType:"Boolean",default:r}},fallback(t,e){let r=(_nullishCoalesce(t.atMost, () => (1)))>1;return{...e,paramType:"Boolean",default:r?[!1]:!1}}},$e={types:["Text"],parse(t,e){let r=x(t.default,We,!1);return{...e,paramType:"Text",default:r}},fallback(t,e){let r=(_nullishCoalesce(t.atMost, () => (1)))>1;return{...e,paramType:"Text",default:r?[""]:""}}},_e={types:["ValueList"],parse(t,e){if(!t.values||typeof t.values!="object"||Object.keys(t.values).length===0)throw _chunkD7A3YIYDcjs.d.missingValues(t.nickname||"unnamed","ValueList");if(t.default!==void 0&&t.default!==null){let r=String(t.default).toLowerCase();Object.keys(t.values).some(s=>s.toLowerCase()===r)||_chunkD7A3YIYDcjs.e.call(void 0, ).warn(`ValueList input "${t.nickname||"unnamed"}" default value "${t.default}" is not in available values`)}return{...e,paramType:"ValueList",values:t.values,default:t.default}},fallback(t,e){let r=(_nullishCoalesce(t.atMost, () => (1)))>1;return{...e,paramType:"ValueList",values:_nullishCoalesce(t.values, () => ({})),default:r?[t.default]:t.default}}},me={types:["Geometry"],parse(t,e){let r=x(t.default,fe(t.nickname||"unnamed"),!0);return{...e,paramType:"Geometry",default:r}},fallback(t,e){let r=(_nullishCoalesce(t.atMost, () => (1)))>1;return{...e,paramType:"Geometry",default:r?[null]:null}}},qe={types:["File"],parse(t,e){let r=x(t.default,fe(t.nickname||"unnamed"),!0);return{...e,paramType:"File",acceptedFormats:t.acceptedFormats,default:r}},fallback(t,e){let r=(_nullishCoalesce(t.atMost, () => (1)))>1;return{...e,paramType:"File",default:r?[null]:null}}},He={types:["Color"],parse(t,e){let r=x(t.default,Be,!1);return{...e,paramType:"Color",default:r}},fallback(t,e){let r=(_nullishCoalesce(t.atMost, () => (1)))>1;return{...e,paramType:"Color",default:r?["0, 0, 0"]:"0, 0, 0"}}},Je=[Ke,ze,$e,_e,me,qe,He],j=new Map(Je.flatMap(t=>t.types.map(e=>[e,t]))),de=me;var Ye=new Map([...j.keys()].map(t=>[t.toLowerCase(),t]));function Qe(t){return _nullishCoalesce(Ye.get(_optionalChain([t, 'optionalAccess', _29 => _29.toLowerCase, 'call', _30 => _30()])), () => (t))}function he(t){return ye(t).input}function ye(t){let e={description:t.description,name:t.name,nickname:t.nickname,treeAccess:t.treeAccess,groupName:_nullishCoalesce(t.groupName, () => ("")),id:t.id},r=Qe(t.paramType),n={...t,paramType:r},s;try{let{schema:o,warning:i}=le(n);n=o,s=i&&{inputName:t.name||"unknown",paramType:r,message:i.message,code:i.code}}catch(o){n={...n,default:null},s={inputName:t.name||"unknown",paramType:r,message:`Input "${_nullishCoalesce(t.name, () => ("unknown"))}" default could not be normalized and was dropped: ${o instanceof Error?o.message:String(o)}`,code:"MALFORMED_DEFAULT"}}let a=j.get(r);try{if(!a)throw _chunkD7A3YIYDcjs.d.unknownParamType(r,t.name);return{input:a.parse(n,e),error:s}}catch(o){if(o instanceof _chunkD7A3YIYDcjs.d)return _chunkD7A3YIYDcjs.e.call(void 0, ).error(`Validation error for input ${t.name||"unknown"}:`,o.message),{input:(_nullishCoalesce(a, () => (de))).fallback(n,e),error:{inputName:t.name||"unknown",paramType:r,message:o.message,code:o.code}};throw new (0, _chunkD7A3YIYDcjs.d)(o instanceof Error?o.message:String(o),"VALIDATION_ERROR",{context:{paramName:t.name,paramType:r},originalError:o instanceof Error?o:new Error(String(o))})}}function ge(t){return M(t).inputs}function M(t){let e=[],r=[];for(let n of t){let{input:s,error:a}=ye(n);e.push(s),a&&r.push(a)}return{inputs:e,parseErrors:r}}function be(t){return{id:p(t,"id"),name:p(t,"name"),nickname:_nullishCoalesce(p(t,"nickname"), () => (null)),description:p(t,"description"),paramType:p(t,"paramType"),treeAccess:p(t,"treeAccess"),minimum:_nullishCoalesce(p(t,"minimum"), () => (null)),maximum:_nullishCoalesce(p(t,"maximum"), () => (null)),atLeast:p(t,"atLeast"),atMost:p(t,"atMost"),stepSize:p(t,"stepSize"),default:p(t,"default"),values:p(t,"values"),acceptedFormats:p(t,"acceptedFormats"),groupName:_nullishCoalesce(p(t,"groupName"), () => (""))}}function Te(t){return{name:p(t,"name"),nickname:_nullishCoalesce(p(t,"nickname"), () => (null)),paramType:p(t,"paramType"),id:p(t,"id")}}async function R(t,e){let r=P(t,[]),n={};if(r.algo&&(n.algo=r.algo),r.pointer&&(n.pointer=r.pointer),!n.algo&&!n.pointer)throw new (0, _chunkD7A3YIYDcjs.d)("Definition must resolve to either a URL pointer or base64 algo",_chunkD7A3YIYDcjs.c.INVALID_INPUT,{context:{definition:t}});let s=await _chunkD7A3YIYDcjs.l.call(void 0, "io",n,e);if(!s||typeof s!="object")throw new (0, _chunkD7A3YIYDcjs.d)("Invalid IO response structure",_chunkD7A3YIYDcjs.c.INVALID_INPUT,{context:{response:s,definition:t}});let a=Ce(p(s,"warnings")),o=Ce(p(s,"errors")),i=p(s,"inputs"),u=p(s,"outputs");return{inputs:Array.isArray(i)?i.map(be):[],outputs:Array.isArray(u)?u.map(Te):[],...a&&{loadWarnings:a},...o&&{loadErrors:o}}}function Ce(t){if(!Array.isArray(t))return;let e=t.filter(r=>typeof r=="string"&&r.trim().length>0);return e.length>0?e:void 0}async function F(t,e){C("fetchParsedDefinitionIO",_nullishCoalesce(e.suppressBrowserWarning, () => (e.suppressClientSideWarning)));let{inputs:r,outputs:n,loadWarnings:s,loadErrors:a}=await R(t,e),{inputs:o,parseErrors:i}=M(r);return{inputs:o,outputs:n,...i.length>0&&{parseErrors:i},...s&&{loadWarnings:s},...a&&{loadErrors:a}}}var V=class t{constructor(e){_chunkD7A3YIYDcjs.b.call(void 0, this,"innerTree");_chunkD7A3YIYDcjs.b.call(void 0, this,"paramName");this.paramName=e,this.innerTree={}}append(e,r){let n=t.formatPathString(e);this.innerTree[n]||(this.innerTree[n]=[]);let s=r.map(a=>({data:t.serializeValue(a)}));return this.innerTree[n].push(...s),this}appendSingle(e,r){return this.append(e,[r])}fromDataTreeDefault(e){this.innerTree={};for(let[r,n]of Object.entries(e)){if(!Array.isArray(n))continue;let s=t.parsePathString(r);this.append(s,n)}return this}appendFlat(e){let r=Array.isArray(e)?e:[e];return this.append([0],r)}flatten(){let e=[];for(let r of Object.values(this.innerTree))if(Array.isArray(r))for(let n of r)e.push(t.deserializeValue(n.data));return e}getPaths(){return Object.keys(this.innerTree)}getPath(e){let r=t.formatPathString(e),n=this.innerTree[r];if(n)return n.map(s=>t.deserializeValue(s.data))}toComputeFormat(){return{ParamName:this.paramName,InnerTree:this.innerTree}}getInnerTree(){return this.innerTree}getParamName(){return this.paramName}static fromInputParams(e){return e.filter(r=>t.hasValidValue(r.default)).map(r=>{let n=new t(r.nickname||"unnamed"),s=r.default;if(r.treeAccess&&A(s))n.fromDataTreeDefault(s),t.isNumericInput(r)&&n.applyNumericConstraints(r.minimum,r.maximum,r.nickname||"unnamed");else{let a=Array.isArray(s)?s:[s],o=t.processValues(a,r);n.appendFlat(o)}return n.toComputeFormat()})}static fromInputParam(e){return t.hasValidValue(e.default)?t.fromInputParams([e])[0]:void 0}static replaceTreeValue(e,r,n){let s=e.length>0&&e[0]instanceof t,a=t.buildFromValue(r,n);if(s){let c=e,m=c.findIndex(y=>y.getParamName()===r);return m!==-1?c[m]=a:c.push(a),c}let o=e,i=a.toComputeFormat(),u=o.findIndex(c=>c.ParamName===r);return u!==-1?o[u]=i:o.push(i),o}static buildFromValue(e,r){let n=new t(e);return A(r)?n.fromDataTreeDefault(r):n.appendFlat(r),n}static getTreeValue(e,r){let s=e.length>0&&e[0]instanceof t?t.readFromBuilders(e,r):t.readFromDataTrees(e,r);return s===null||s.length===0?null:s.length===1?s[0]:s}static readFromBuilders(e,r){let n=e.find(s=>s.getParamName()===r);return n?n.flatten():null}static readFromDataTrees(e,r){let n=e.find(o=>o.ParamName===r);if(!_optionalChain([n, 'optionalAccess', _31 => _31.InnerTree]))return null;let s=Object.keys(n.InnerTree)[0];if(!s)return null;let a=n.InnerTree[s];return Array.isArray(a)?a.map(o=>_optionalChain([o, 'optionalAccess', _32 => _32.data])!==void 0?t.deserializeValue(o.data):null).filter(o=>o!==null):_optionalChain([a, 'optionalAccess', _33 => _33.data])!==void 0?[t.deserializeValue(a.data)]:a!==void 0?[a]:null}static parsePathString(e){let r=e.match(B);return r?r[1]?r[1].split(";").map(Number):[]:(_chunkD7A3YIYDcjs.e.call(void 0, ).warn(`Invalid TreeBuilder path format: ${e}, using [0]`),[0])}static formatPathString(e){return`{${e.join(";")}}`}applyNumericConstraints(e,r,n){for(let s of Object.values(this.innerTree))if(Array.isArray(s))for(let a of s){let o=t.deserializeValue(a.data);if(typeof o=="number"){let i=t.clampValue(o,e,r,n);a.data=t.serializeValue(i)}}}static serializeValue(e){return typeof e=="boolean"||typeof e=="number"||typeof e=="string"?e:typeof e=="object"&&e!==null?JSON.stringify(e):String(e)}static deserializeValue(e){if(typeof e=="boolean"||typeof e=="number"||typeof e!="string")return e;if(e.startsWith("{")||e.startsWith("["))try{return JSON.parse(e)}catch (e5){return e}return e.trim()!==""&&!isNaN(Number(e))?Number(e):e==="true"?!0:e==="false"?!1:e}static hasValidValue(e){return e==null?!1:typeof e=="string"?!0:!(Array.isArray(e)&&e.length===0||typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0)}static isNumericInput(e){return e.paramType==="Number"||e.paramType==="Integer"}static processValues(e,r){return e.map(n=>t.isNumericInput(r)&&typeof n=="number"?t.clampValue(n,r.minimum,r.maximum,r.nickname||"unnamed"):n).filter(n=>n!=null)}static clampValue(e,r,n,s){let a=e;return r!=null&&a<r&&(_chunkD7A3YIYDcjs.e.call(void 0, ).warn(`${s}: ${e} below min ${r}, clamping`),a=r),n!=null&&a>n&&(_chunkD7A3YIYDcjs.e.call(void 0, ).warn(`${s}: ${e} above max ${n}, clamping`),a=n),a}};exports.a = D; exports.b = S; exports.c = w; exports.d = E; exports.e = he; exports.f = ge; exports.g = R; exports.h = F; exports.i = V;
|
|
2
|
-
//# sourceMappingURL=chunk-33753HSV.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/selva-compute/selva-compute/dist/chunk-33753HSV.cjs","../src/core/utils/read-field.ts","../src/core/utils/warnings.ts","../src/features/grasshopper/solve.ts"],"names":["readField","obj","name","record","key","lowerKeyMap","hasField","lowerKeyCache","map","lower","warnIfClientSide","functionName","suppress","getLogger","DEFINITION_LOAD_FAILED","isDefinitionLoadMiss","error","RhinoComputeError","ErrorCodes","warnOnEmptyInnerTrees","response","debug","values","empty","param","innerTree","scope"],"mappings":"AAAA,2/BAA8G,SCyB9FA,CAAAA,CAAuBC,CAAAA,CAAcC,CAAAA,CAA6B,CACjF,EAAA,CAAI,CAACD,CAAAA,EAAO,OAAOA,CAAAA,EAAQ,QAAA,CAAU,MAAA,CAErC,IAAME,CAAAA,CAASF,CAAAA,CACf,EAAA,CAAIC,EAAAA,GAAQC,CAAAA,CAAQ,OAAOA,CAAAA,CAAOD,CAAI,CAAA,CAEtC,IAAME,CAAAA,CAAMC,CAAAA,CAAYF,CAAM,CAAA,CAAE,GAAA,CAAID,CAAAA,CAAK,WAAA,CAAY,CAAC,CAAA,CACtD,OAAOE,CAAAA,GAAQ,KAAA,CAAA,CAAY,KAAA,CAAA,CAAaD,CAAAA,CAAOC,CAAG,CACnD,CAOO,SAASE,CAAAA,CAASL,CAAAA,CAAcC,CAAAA,CAAuB,CAC7D,EAAA,CAAI,CAACD,CAAAA,EAAO,OAAOA,CAAAA,EAAQ,QAAA,CAAU,MAAO,CAAA,CAAA,CAC5C,IAAME,CAAAA,CAASF,CAAAA,CACf,OAAIC,EAAAA,GAAQC,CAAAA,CAAe,CAAA,CAAA,CACpBE,CAAAA,CAAYF,CAAM,CAAA,CAAE,GAAA,CAAID,CAAAA,CAAK,WAAA,CAAY,CAAC,CAClD,CASA,IAAMK,CAAAA,CAAgB,IAAI,OAAA,CAE1B,SAASF,CAAAA,CAAYF,CAAAA,CAAsD,CAC1E,IAAIK,CAAAA,CAAMD,CAAAA,CAAc,GAAA,CAAIJ,CAAM,CAAA,CAClC,EAAA,CAAI,CAACK,CAAAA,CAAK,CACTA,CAAAA,CAAM,IAAI,GAAA,CACV,GAAA,CAAA,IAAWJ,EAAAA,GAAO,MAAA,CAAO,IAAA,CAAKD,CAAM,CAAA,CAAG,CACtC,IAAMM,CAAAA,CAAQL,CAAAA,CAAI,WAAA,CAAY,CAAA,CACzBI,CAAAA,CAAI,GAAA,CAAIC,CAAK,CAAA,EAAGD,CAAAA,CAAI,GAAA,CAAIC,CAAAA,CAAOL,CAAG,CACxC,CACAG,CAAAA,CAAc,GAAA,CAAIJ,CAAAA,CAAQK,CAAG,CAC9B,CACA,OAAOA,CACR,CCjEO,SAASE,CAAAA,CAAiBC,CAAAA,CAAsBC,CAAAA,CAA0B,CAC5EA,CAAAA,EAIA,OAAO,MAAA,CAAW,GAAA,EACrBC,iCAAAA,CAAU,CAAE,IAAA,CACX,CAAA,SAAA,EAAYF,CAAY,CAAA,8GAAA,CACzB,CAEF,CCeA,IAAMG,EAAAA,CAAyB,uCAAA,CAG/B,SAASC,EAAAA,CAAqBC,CAAAA,CAAyB,CACtD,OAAMA,EAAAA,WAAiBC,mBAAAA,CAEtBD,CAAAA,CAAM,IAAA,GAASE,mBAAAA,CAAW,qBAAA,EAC1BF,CAAAA,CAAM,OAAA,CAAQ,QAAA,CAASF,EAAsB,CAAA,CAHI,CAAA,CAKnD,CAeO,SAASK,EAAAA,CAAsBC,CAAAA,CAAsCC,CAAAA,CAAuB,CAClG,EAAA,CAAI,CAACA,CAAAA,CAAO,MAAA,CAEZ,IAAMC,CAAAA,CAAStB,CAAAA,CAAqBoB,CAAAA,CAAU,QAAQ,CAAA,CACtD,EAAA,CAAI,CAAC,KAAA,CAAM,OAAA,CAAQE,CAAM,CAAA,EAAKA,CAAAA,CAAO,MAAA,GAAW,CAAA,CAAG,MAAA,CAEnD,IAAMC,CAAAA,CAAkB,CAAC,CAAA,CACzB,GAAA,CAAA,IAAWC,EAAAA,GAASF,CAAAA,CAAQ,CAC3B,IAAMG,CAAAA,CAAYzB,CAAAA,CAAmCwB,CAAAA,CAAO,WAAW,CAAA,CAAA,CAEnE,CAACC,CAAAA,EAAa,MAAA,CAAO,IAAA,CAAKA,CAAS,CAAA,CAAE,MAAA,GAAW,CAAA,CAAA,EACnDF,CAAAA,CAAM,IAAA,kBAAKvB,CAAAA,CAAkBwB,CAAAA,CAAO,WAAW,CAAA,SAAK,aAAW,CAEjE,CAEA,EAAA,CAAID,CAAAA,CAAM,MAAA,GAAW,CAAA,CAAG,MAAA,CAExB,IAAMG,CAAAA,CAAQH,CAAAA,CAAM,MAAA,GAAWD,CAAAA,CAAO,MAAA,CAAS,KAAA,CAAQ,CAAA,EAAA","file":"/home/runner/work/selva-compute/selva-compute/dist/chunk-33753HSV.cjs","sourcesContent":[null,"/**\n * Case-insensitive single-key reader for wire payloads.\n *\n * The Rhino Compute family serializes the same logical field with different\n * casing depending on the server branch:\n *\n * - mcneel 8.x / 9.x: the IO schema is PascalCase (`ParamType`, `Default`,\n * `InnerTree`, …) because those C# classes carry no `[JsonProperty]`.\n * - VektorNode Compute8: the IO schema is camelCase (`paramType`, `default`,\n * …) because the fork added `[JsonProperty(\"camelCase\")]`, BUT the nested\n * `default` DataTree wrapper stays PascalCase (`ParamName` / `InnerTree`)\n * since `Resthopper.IO.DataTree` is an external type the fork can't attribute.\n *\n * So a single response can mix casings, and which casing a given field uses\n * depends on the server branch. Rather than deep-camelCasing the whole payload\n * (the old `camelcaseKeys` approach — which corrupted user-authored value-list\n * label keys and item `data` JSON), read the specific fields we care about\n * case-insensitively and leave everything else verbatim.\n *\n * Prefers an exact-case match when present, then falls back to the first\n * case-insensitive match. Returns `undefined` when no key matches.\n *\n * @param obj - The source object (any non-object input yields `undefined`).\n * @param name - The logical field name, in any casing.\n */\nexport function readField<T = unknown>(obj: unknown, name: string): T | undefined {\n\tif (!obj || typeof obj !== 'object') return undefined;\n\n\tconst record = obj as Record<string, unknown>;\n\tif (name in record) return record[name] as T;\n\n\tconst key = lowerKeyMap(record).get(name.toLowerCase());\n\treturn key === undefined ? undefined : (record[key] as T);\n}\n\n/**\n * True when `obj` has a key matching `name` (case-insensitively). Distinguishes\n * \"field present but value is null/undefined\" from \"field absent\" — needed where\n * presence itself carries meaning (e.g. an `innerTree` that exists but is empty).\n */\nexport function hasField(obj: unknown, name: string): boolean {\n\tif (!obj || typeof obj !== 'object') return false;\n\tconst record = obj as Record<string, unknown>;\n\tif (name in record) return true;\n\treturn lowerKeyMap(record).has(name.toLowerCase());\n}\n\n/**\n * Per-object cache of `lowercased key → actual key`, so reading N fields off\n * the same payload object costs one `Object.keys` scan instead of N. Keyed by\n * object identity (WeakMap), which assumes payloads are immutable wire data —\n * keys added to an object after its first read are not seen. First matching\n * key wins, preserving the original linear-scan order.\n */\nconst lowerKeyCache = new WeakMap<object, Map<string, string>>();\n\nfunction lowerKeyMap(record: Record<string, unknown>): Map<string, string> {\n\tlet map = lowerKeyCache.get(record);\n\tif (!map) {\n\t\tmap = new Map();\n\t\tfor (const key of Object.keys(record)) {\n\t\t\tconst lower = key.toLowerCase();\n\t\t\tif (!map.has(lower)) map.set(lower, key);\n\t\t}\n\t\tlowerKeyCache.set(record, map);\n\t}\n\treturn map;\n}\n","import { getLogger } from './logger';\n\nexport function warnIfClientSide(functionName: string, suppress?: boolean): void {\n\tif (suppress) {\n\t\treturn;\n\t}\n\n\tif (typeof window !== 'undefined') {\n\t\tgetLogger().warn(\n\t\t\t`Warning: ${functionName} is running on the client side. For better performance and security, consider running this on the server side.`\n\t\t);\n\t}\n}\n","import { fetchRhinoCompute, RhinoComputeError, ErrorCodes } from '@/core';\nimport { base64ByteArray, encodeStringToBase64, isBase64 } from '@/core/utils/encoding';\nimport { getLogger } from '@/core/utils/logger';\nimport { readField } from '@/core/utils/read-field';\nimport { warnIfClientSide } from '@/core/utils/warnings';\n\nimport {\n\tGrasshopperRequestSchema,\n\tGrasshopperComputeConfig,\n\tGrasshopperComputeResponse,\n\tDataTree\n} from './types';\n\n/**\n * The exact message the server throws when it can neither resolve a `pointer`\n * nor a base64 `algo` to a definition (ResthopperEndpoints.cs). This is the\n * signal that a cache-key pointer missed the server's definition cache (GC'd, or\n * a different child in the pool), so the caller should retry with the full\n * definition. Matched as a substring because the server wraps it with a category\n * prefix in its exception handler.\n *\n * NOTE: the server only includes this message when running in debug mode; its\n * production exception handler scrubs the message to a generic string. The\n * reliable signal is therefore {@link ErrorCodes.DEFINITION_NOT_CACHED}, derived\n * from the server's machine `code` (which isn't scrubbed). The string match is\n * kept as a fallback for debug-mode servers and forks that don't yet emit a code.\n */\nconst DEFINITION_LOAD_FAILED = 'Unable to load grasshopper definition';\n\n/** Does this error look like a server-side definition-load miss? */\nfunction isDefinitionLoadMiss(error: unknown): boolean {\n\tif (!(error instanceof RhinoComputeError)) return false;\n\treturn (\n\t\terror.code === ErrorCodes.DEFINITION_NOT_CACHED ||\n\t\terror.message.includes(DEFINITION_LOAD_FAILED)\n\t);\n}\n\n/**\n * Debug aid: a solve can return successfully yet hand back outputs whose\n * `InnerTree` is empty (`{}`), meaning that parameter produced nothing — often a\n * sign the definition didn't actually compute (wrong/missing inputs, a guarded\n * branch). The names tell you exactly which output was empty so you can trace it\n * back to the responsible branch.\n *\n * Only logs when `debug` is set: an empty output can be legitimate, so this is a\n * diagnostic, never a hard failure. Reads `ParamName` / `InnerTree`\n * case-insensitively to stay robust across server-branch casing.\n *\n * @internal Exported for testing.\n */\nexport function warnOnEmptyInnerTrees(response: GrasshopperComputeResponse, debug?: boolean): void {\n\tif (!debug) return;\n\n\tconst values = readField<unknown[]>(response, 'values');\n\tif (!Array.isArray(values) || values.length === 0) return;\n\n\tconst empty: string[] = [];\n\tfor (const param of values) {\n\t\tconst innerTree = readField<Record<string, unknown>>(param, 'innerTree');\n\t\t// Treat a missing or empty innerTree as \"produced nothing\".\n\t\tif (!innerTree || Object.keys(innerTree).length === 0) {\n\t\t\tempty.push(readField<string>(param, 'paramName') ?? '<unnamed>');\n\t\t}\n\t}\n\n\tif (empty.length === 0) return;\n\n\tconst scope = empty.length === values.length ? 'all' : `${empty.length}/${values.length}`;\n\tgetLogger().warn(\n\t\t`Solve returned empty output(s) (${scope}): ${empty.join(', ')}. ` +\n\t\t\t`These parameters produced no data — check the definition's inputs and the branch feeding each.`\n\t);\n}\n\n/**\n * Result of a solve that also reports the definition's server-side cache key.\n *\n * `cacheKey` is the `md5_…` identifier the server assigned to the (base64)\n * definition — stable for identical content. A caller that holds it can solve\n * the same definition again by reference (`pointer: cacheKey`) instead of\n * re-uploading the full base64, which matters a lot for large (multi-MB)\n * definitions on a live UI. `null` when the server didn't return one (e.g. a\n * URL-pointer solve).\n */\nexport interface SolveWithCacheKey {\n\tresponse: GrasshopperComputeResponse;\n\tcacheKey: string | null;\n}\n\n/**\n * Runs a Rhino Compute job using the provided tree prototypes and Grasshopper definition.\n *\n * @public Use this for direct compute control. For high-level API, use `GrasshopperClient.solve()`.\n *\n * @param dataTree - An array of `DataTree` objects representing the input data for the compute job.\n * @param definition - The Grasshopper definition, which can be:\n * - A URL string (e.g., 'https://example.com/definition.gh')\n * - A base64-encoded string of the .gh file\n * - A plain string (will be base64-encoded)\n * - A Uint8Array of the .gh file (will be base64-encoded)\n * @param config - Compute configuration (server URL, API key, etc. along with optional timeout, units, etc.)\n * @returns An object containing the compute result and extracted file data.\n *\n * @example\n * // Using a URL\n * await solveGrasshopperDefinition(trees, 'https://example.com/definition.gh', config);\n *\n * // Using a base64 string\n * await solveGrasshopperDefinition(trees, 'UEsDBBQAAAAIAL...', config);\n *\n * // Using binary data\n * const fileData = new Uint8Array([...]);\n * await solveGrasshopperDefinition(trees, fileData, config);\n */\nexport async function solveGrasshopperDefinition(\n\tdataTree: DataTree[],\n\tdefinition: string | Uint8Array,\n\tconfig: GrasshopperComputeConfig\n): Promise<GrasshopperComputeResponse> {\n\tif (config.debug) {\n\t\twarnIfClientSide(\n\t\t\t'solveGrasshopperDefinition',\n\t\t\tconfig.suppressBrowserWarning ?? config.suppressClientSideWarning\n\t\t);\n\t}\n\n\tconst { response } = await runSolve(prepareGrasshopperArgs(definition, dataTree), config);\n\treturn response;\n}\n\n/**\n * Solve while reporting the server's definition cache key.\n *\n * Behaves like {@link solveGrasshopperDefinition} but returns the `cacheKey` the\n * server assigned, so a caller (e.g. the scheduler) can later solve the same\n * definition by reference instead of re-uploading it. The cache key is only\n * meaningful for base64/binary definitions; a URL-pointer solve returns the URL.\n *\n * @internal\n */\nexport async function solveGrasshopperDefinitionWithCacheKey(\n\tdataTree: DataTree[],\n\tdefinition: string | Uint8Array,\n\tconfig: GrasshopperComputeConfig\n): Promise<SolveWithCacheKey> {\n\tif (config.debug) {\n\t\twarnIfClientSide(\n\t\t\t'solveGrasshopperDefinitionWithCacheKey',\n\t\t\tconfig.suppressBrowserWarning ?? config.suppressClientSideWarning\n\t\t);\n\t}\n\n\treturn runSolve(prepareGrasshopperArgs(definition, dataTree), config);\n}\n\n/**\n * Solve a definition by its server-side cache key (`pointer: cacheKey`),\n * skipping the (potentially multi-MB) base64 upload. If the key has been evicted\n * from the server's definition cache — `DEFINITION_LOAD_FAILED` — transparently\n * retry once with the full `definition` and report the fresh cache key so the\n * caller can update its mapping.\n *\n * @returns The solve result plus the (possibly refreshed) cache key, and whether\n * the fast path missed (so callers can record the new key / track hit rate).\n * @internal\n */\nexport async function solveByCacheKey(\n\tdataTree: DataTree[],\n\tcacheKey: string,\n\tdefinition: string | Uint8Array,\n\tconfig: GrasshopperComputeConfig\n): Promise<SolveWithCacheKey & { missed: boolean }> {\n\tif (config.debug) {\n\t\twarnIfClientSide(\n\t\t\t'solveByCacheKey',\n\t\t\tconfig.suppressBrowserWarning ?? config.suppressClientSideWarning\n\t\t);\n\t}\n\n\tconst pointerArgs: GrasshopperRequestSchema = { algo: null, pointer: cacheKey, values: dataTree };\n\n\ttry {\n\t\tconst fast = await runSolve(pointerArgs, config);\n\t\treturn { ...fast, missed: false };\n\t} catch (error) {\n\t\tif (!isDefinitionLoadMiss(error)) throw error;\n\t\t// Cache miss — fall back to the full upload and capture the fresh key.\n\t\tconst full = await runSolve(prepareGrasshopperArgs(definition, dataTree), config);\n\t\treturn { ...full, missed: true };\n\t}\n}\n\n/**\n * Shared solve body: apply optional settings, POST, and split the server's\n * `pointer` (its cache key) off the response. `algo` — the request's full\n * base64 definition echoed back on every solve — is stripped too: keeping it\n * pins a multi-MB copy per response, multiplied by every cache holding\n * responses (the scheduler's LRU alone up to `maxEntries` times). Stripping via\n * shallow copy rather than `delete` keeps any already-observed response object\n * unmutated.\n */\nasync function runSolve(\n\targs: GrasshopperRequestSchema,\n\tconfig: GrasshopperComputeConfig\n): Promise<SolveWithCacheKey> {\n\tapplyOptionalComputeSettings(args, config);\n\n\tconst result = await fetchRhinoCompute<GrasshopperComputeResponse>('grasshopper', args, config);\n\n\tconst {\n\t\tpointer,\n\t\talgo: _algo,\n\t\t...rest\n\t} = result as GrasshopperComputeResponse & { pointer?: unknown; algo?: unknown };\n\tconst response = rest as GrasshopperComputeResponse;\n\twarnOnEmptyInnerTrees(response, config.debug);\n\treturn {\n\t\tresponse,\n\t\tcacheKey: typeof pointer === 'string' ? pointer : null\n\t};\n}\n\n// ============================================================================\n// Grasshopper Arguments\n// ============================================================================\n\n/**\n * Prepares Grasshopper arguments from a definition and data tree.\n * Automatically detects the definition format and converts it appropriately.\n *\n * @param definition - Can be a URL, base64 string, plain string, or Uint8Array\n * @param dataTree - Array of DataTree objects for compute inputs\n * @internal\n */\nexport function prepareGrasshopperArgs(\n\tdefinition: string | Uint8Array,\n\tdataTree: DataTree[]\n): GrasshopperRequestSchema {\n\tconst args: GrasshopperRequestSchema = {\n\t\talgo: null,\n\t\tpointer: null,\n\t\tvalues: dataTree\n\t};\n\n\tif (definition instanceof Uint8Array) {\n\t\t// Binary data → convert to base64\n\t\targs.algo = base64ByteArray(definition);\n\t} else if (/^https?:\\/\\//i.test(definition)) {\n\t\t// URL → use as pointer reference\n\t\targs.pointer = definition;\n\t} else if (isBase64(definition)) {\n\t\t// Already base64 → use as-is\n\t\targs.algo = definition;\n\t} else {\n\t\t// Plain string → encode to base64\n\t\targs.algo = encodeStringToBase64(definition);\n\t}\n\n\treturn args;\n}\n\n/**\n * @internal\n */\nexport function applyOptionalComputeSettings(\n\targlist: GrasshopperRequestSchema,\n\toptions: GrasshopperComputeConfig\n): void {\n\tif (options.cachesolve != null) arglist.cachesolve = options.cachesolve;\n\tif (options.cacheerroredsolves != null) arglist.cacheerroredsolves = options.cacheerroredsolves;\n\tif (options.modelunits != null) arglist.modelunits = options.modelunits;\n\tif (options.angletolerance != null) arglist.angletolerance = options.angletolerance;\n\tif (options.absolutetolerance != null) arglist.absolutetolerance = options.absolutetolerance;\n\tif (options.dataversion != null) arglist.dataversion = options.dataversion;\n}\n"]}
|