@selvajs/visualization 1.6.0-beta.8 → 1.6.0
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-D66GqIWS.cjs +514 -0
- package/dist/gpu-dispose-D66GqIWS.cjs.map +1 -0
- package/dist/gpu-dispose-Di_nxeXF.js +382 -0
- package/dist/gpu-dispose-Di_nxeXF.js.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 +3036 -11
- package/dist/parse.cjs.map +1 -1
- package/dist/parse.d.cts +22 -3
- package/dist/parse.d.ts +22 -3
- package/dist/parse.js +3027 -11
- package/dist/parse.js.map +1 -1
- package/dist/render.cjs +4333 -6
- package/dist/render.cjs.map +1 -1
- package/dist/render.d.cts +43 -9
- package/dist/render.d.ts +43 -9
- package/dist/render.js +4312 -6
- package/dist/render.js.map +1 -1
- package/dist/scene.cjs +343 -1
- package/dist/scene.cjs.map +1 -1
- package/dist/scene.js +336 -1
- package/dist/scene.js.map +1 -1
- package/dist/{types-P5PyfYYE.d.ts → types-DW_qU4-Y.d.cts} +22 -3
- package/dist/{types-P5PyfYYE.d.cts → types-DW_qU4-Y.d.ts} +22 -3
- package/package.json +14 -8
- package/dist/gpu-dispose-Cestx__L.cjs +0 -2
- package/dist/gpu-dispose-Cestx__L.cjs.map +0 -1
- package/dist/gpu-dispose-gTGxGTL4.js +0 -2
- package/dist/gpu-dispose-gTGxGTL4.js.map +0 -1
- package/dist/gpu-ownership-DcHWbATk.js +0 -2
- package/dist/gpu-ownership-DcHWbATk.js.map +0 -1
- package/dist/gpu-ownership-ilj3JEdn.cjs +0 -2
- package/dist/gpu-ownership-ilj3JEdn.cjs.map +0 -1
- package/dist/merged-draw-DXJK-rdo.js +0 -2
- package/dist/merged-draw-DXJK-rdo.js.map +0 -1
- package/dist/merged-draw-oKAKlXCQ.cjs +0 -2
- package/dist/merged-draw-oKAKlXCQ.cjs.map +0 -1
package/dist/render.d.cts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { a as
|
|
1
|
+
import { a as LookPreset, i as LookMaterialOverride, n as LOOKS, o as MaterialAppearanceOptions, r as Look, t as BloomOptions } from "./types-DW_qU4-Y.cjs";
|
|
2
2
|
import * as THREE from "three";
|
|
3
3
|
import { OrbitControls } from "three/addons/controls/OrbitControls.js";
|
|
4
4
|
import "three/addons/lines/LineSegments2.js";
|
|
5
5
|
import { CSS2DObject } from "three/addons/renderers/CSS2DRenderer.js";
|
|
6
|
+
import "three/addons/postprocessing/Pass.js";
|
|
6
7
|
/**
|
|
7
8
|
* Errors for the visualization package. Replaces `@selvajs/compute`'s `RhinoComputeError`, which
|
|
8
9
|
* mis-named failures on paths (e.g. the plugin WebSocket) that never touch Rhino.Compute. `code`
|
|
@@ -121,8 +122,26 @@ type RenderConfig = {
|
|
|
121
122
|
toneMapping?: THREE.ToneMapping;
|
|
122
123
|
toneMappingExposure?: number;
|
|
123
124
|
preserveDrawingBuffer?: boolean;
|
|
125
|
+
/**
|
|
126
|
+
* Cuts what the look's `lowPower` fields name; only `night` has any. Default: on for a touch
|
|
127
|
+
* device with a phone-sized screen. Set it to force the tier on or off.
|
|
128
|
+
*/
|
|
129
|
+
lowPower?: boolean;
|
|
130
|
+
/**
|
|
131
|
+
* Frames averaged while the camera rests, for soft shadows and clean edges. Needs the composer,
|
|
132
|
+
* so looks without AO or bloom skip it. Costs nothing while orbiting. Default 32, or 0 on a
|
|
133
|
+
* `lowPower` device; 0 turns it off.
|
|
134
|
+
*/
|
|
135
|
+
idleRefineFrames?: number;
|
|
136
|
+
/**
|
|
137
|
+
* Orbit frames slower than this fade ambient occlusion out while the camera moves, its largest
|
|
138
|
+
* cost. Needs `idleRefineFrames` to fade back in. Default 22. 0 always does; `Infinity` never does.
|
|
139
|
+
*/
|
|
140
|
+
lightOrbitFrameMs?: number;
|
|
124
141
|
/** Default false — switches rendering from `renderer.render` to an EffectComposer, which costs more. */
|
|
125
142
|
ambientOcclusion?: boolean;
|
|
143
|
+
/** Glow around emissive parts. The look decides; `night` sets it. */
|
|
144
|
+
bloom?: BloomOptions;
|
|
126
145
|
/** AO strength 0–1 when {@link RenderConfig.ambientOcclusion} is on. Default 1. */
|
|
127
146
|
aoIntensity?: number;
|
|
128
147
|
/**
|
|
@@ -357,12 +376,13 @@ interface LabelLayer {
|
|
|
357
376
|
dispose(): void;
|
|
358
377
|
}
|
|
359
378
|
/**
|
|
360
|
-
*
|
|
361
|
-
* the
|
|
379
|
+
* Point-to-point distance measurement. Click a start point; a rubber band and live readout follow
|
|
380
|
+
* the cursor until the second click commits it. Committed measurements stay until Escape (which
|
|
381
|
+
* first drops an unfinished start point) or until the tool is disabled.
|
|
362
382
|
*
|
|
363
|
-
* Picking snaps to the nearest vertex
|
|
364
|
-
*
|
|
365
|
-
*
|
|
383
|
+
* Picking snaps to the nearest vertex of the struck triangle, segment or point within
|
|
384
|
+
* {@link MeasureOptions.snapPixels}; the hover marker turns solid when it has snapped. Meshes are
|
|
385
|
+
* picked through a BVH (`scene-pick.ts`), so hovering stays cheap on large models.
|
|
366
386
|
*
|
|
367
387
|
* Dormant until {@link MeasureTool.setEnabled}(true). While enabled it intercepts clicks (caller
|
|
368
388
|
* forwards them and swallows the event when {@link MeasureTool.handleClick} returns true) so
|
|
@@ -373,8 +393,10 @@ interface MeasureTool {
|
|
|
373
393
|
isEnabled(): boolean;
|
|
374
394
|
/** Returns true if the tool consumed the click (caller should not also select). */
|
|
375
395
|
handleClick(event: MouseEvent): boolean;
|
|
376
|
-
/** Preview the next snap point
|
|
396
|
+
/** Preview the next snap point and the rubber band. No-op when disabled; never consumes the event. */
|
|
377
397
|
handleMove(event: MouseEvent): void;
|
|
398
|
+
/** Drops the unfinished start point, or every measurement when there is none. Bound to Escape. */
|
|
399
|
+
cancel(): void;
|
|
378
400
|
clear(): void;
|
|
379
401
|
dispose(): void;
|
|
380
402
|
}
|
|
@@ -465,6 +487,13 @@ interface ViewGizmo {
|
|
|
465
487
|
isVisible(): boolean;
|
|
466
488
|
dispose(): void;
|
|
467
489
|
}
|
|
490
|
+
type SetLookOptions = {
|
|
491
|
+
/**
|
|
492
|
+
* Skips the sync, which walks every glowing part. The caller runs `syncEmissiveLights()` itself
|
|
493
|
+
* once visibility settles.
|
|
494
|
+
*/
|
|
495
|
+
deferEmissiveLights?: boolean;
|
|
496
|
+
};
|
|
468
497
|
/** One thing to select: a whole object, or one member of a merged mesh. */
|
|
469
498
|
interface SelectionTarget {
|
|
470
499
|
object: THREE.Object3D;
|
|
@@ -516,7 +545,12 @@ interface ThreeViewer {
|
|
|
516
545
|
* Retunes lighting/material (tone mapping, fill, IBL, AO) only — never edges/grid. Overwrites
|
|
517
546
|
* any granular lighting dials set earlier with the preset's values.
|
|
518
547
|
*/
|
|
519
|
-
setLook: (look: Look) => void;
|
|
548
|
+
setLook: (look: Look, options?: SetLookOptions) => void;
|
|
549
|
+
/**
|
|
550
|
+
* Call after showing or hiding objects, solve output included: a look that lights the scene from
|
|
551
|
+
* glowing parts reads what is drawn when it runs, so a hidden lamp would keep shining.
|
|
552
|
+
*/
|
|
553
|
+
syncEmissiveLights: () => void;
|
|
520
554
|
/**
|
|
521
555
|
* Raising `hemisphereIntensity` is the most effective way to lift shadowed surfaces a dark HDR
|
|
522
556
|
* leaves black. Lazily creates the hemisphere light if the viewer was built without one; `0` turns
|
|
@@ -591,5 +625,5 @@ export declare function isHostOwned(object: THREE.Object3D): boolean;
|
|
|
591
625
|
export declare function isOwnedBy(object: THREE.Object3D, id?: string): boolean;
|
|
592
626
|
/** Replaces scene content with `meshes`, rescales the camera frustum to fit, and (first call only) positions the camera/controls. */
|
|
593
627
|
export declare function updateScene(scene: THREE.Scene, meshes: THREE.Object3D[], camera: THREE.PerspectiveCamera, controls: OrbitControls, initialPositionSet: boolean): void;
|
|
594
|
-
export { type CameraConfig, type CameraController, type CameraProjection, type ControlsConfig, type EdgesConfig, type EnvironmentConfig, type ErrorCode, type EventConfig, type FloorConfig, type GizmoConfig, type Grid, type GridConfig, LOOKS, type LabelHandle, type LabelLayer, type LightingConfig, type Logger, type Look, type LookMaterialOverride, type LookPreset, type MaterialAppearanceOptions, type MeasureConfig, type MeasureTool, type PointerTool, type RenderConfig, type ThreeInitializerOptions, type ThreeViewer, type ToolRegistration, type ToolRegistry, type ViewGizmo, type ViewPreset };
|
|
628
|
+
export { type CameraConfig, type CameraController, type CameraProjection, type ControlsConfig, type EdgesConfig, type EnvironmentConfig, type ErrorCode, type EventConfig, type FloorConfig, type GizmoConfig, type Grid, type GridConfig, LOOKS, type LabelHandle, type LabelLayer, type LightingConfig, type Logger, type Look, type LookMaterialOverride, type LookPreset, type MaterialAppearanceOptions, type MeasureConfig, type MeasureTool, type PointerTool, type RenderConfig, type SetLookOptions, type ThreeInitializerOptions, type ThreeViewer, type ToolRegistration, type ToolRegistry, type ViewGizmo, type ViewPreset };
|
|
595
629
|
//# sourceMappingURL=render.d.cts.map
|
package/dist/render.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { a as
|
|
1
|
+
import { a as LookPreset, i as LookMaterialOverride, n as LOOKS, o as MaterialAppearanceOptions, r as Look, t as BloomOptions } from "./types-DW_qU4-Y.js";
|
|
2
2
|
import * as THREE from "three";
|
|
3
3
|
import { LineSegments2 } from "three/addons/lines/LineSegments2.js";
|
|
4
4
|
import { CSS2DObject } from "three/addons/renderers/CSS2DRenderer.js";
|
|
5
|
+
import { Pass } from "three/addons/postprocessing/Pass.js";
|
|
5
6
|
import { OrbitControls } from "three/addons/controls/OrbitControls.js";
|
|
6
7
|
/**
|
|
7
8
|
* Errors for the visualization package. Replaces `@selvajs/compute`'s `RhinoComputeError`, which
|
|
@@ -121,8 +122,26 @@ type RenderConfig = {
|
|
|
121
122
|
toneMapping?: THREE.ToneMapping;
|
|
122
123
|
toneMappingExposure?: number;
|
|
123
124
|
preserveDrawingBuffer?: boolean;
|
|
125
|
+
/**
|
|
126
|
+
* Cuts what the look's `lowPower` fields name; only `night` has any. Default: on for a touch
|
|
127
|
+
* device with a phone-sized screen. Set it to force the tier on or off.
|
|
128
|
+
*/
|
|
129
|
+
lowPower?: boolean;
|
|
130
|
+
/**
|
|
131
|
+
* Frames averaged while the camera rests, for soft shadows and clean edges. Needs the composer,
|
|
132
|
+
* so looks without AO or bloom skip it. Costs nothing while orbiting. Default 32, or 0 on a
|
|
133
|
+
* `lowPower` device; 0 turns it off.
|
|
134
|
+
*/
|
|
135
|
+
idleRefineFrames?: number;
|
|
136
|
+
/**
|
|
137
|
+
* Orbit frames slower than this fade ambient occlusion out while the camera moves, its largest
|
|
138
|
+
* cost. Needs `idleRefineFrames` to fade back in. Default 22. 0 always does; `Infinity` never does.
|
|
139
|
+
*/
|
|
140
|
+
lightOrbitFrameMs?: number;
|
|
124
141
|
/** Default false — switches rendering from `renderer.render` to an EffectComposer, which costs more. */
|
|
125
142
|
ambientOcclusion?: boolean;
|
|
143
|
+
/** Glow around emissive parts. The look decides; `night` sets it. */
|
|
144
|
+
bloom?: BloomOptions;
|
|
126
145
|
/** AO strength 0–1 when {@link RenderConfig.ambientOcclusion} is on. Default 1. */
|
|
127
146
|
aoIntensity?: number;
|
|
128
147
|
/**
|
|
@@ -357,12 +376,13 @@ interface LabelLayer {
|
|
|
357
376
|
dispose(): void;
|
|
358
377
|
}
|
|
359
378
|
/**
|
|
360
|
-
*
|
|
361
|
-
* the
|
|
379
|
+
* Point-to-point distance measurement. Click a start point; a rubber band and live readout follow
|
|
380
|
+
* the cursor until the second click commits it. Committed measurements stay until Escape (which
|
|
381
|
+
* first drops an unfinished start point) or until the tool is disabled.
|
|
362
382
|
*
|
|
363
|
-
* Picking snaps to the nearest vertex
|
|
364
|
-
*
|
|
365
|
-
*
|
|
383
|
+
* Picking snaps to the nearest vertex of the struck triangle, segment or point within
|
|
384
|
+
* {@link MeasureOptions.snapPixels}; the hover marker turns solid when it has snapped. Meshes are
|
|
385
|
+
* picked through a BVH (`scene-pick.ts`), so hovering stays cheap on large models.
|
|
366
386
|
*
|
|
367
387
|
* Dormant until {@link MeasureTool.setEnabled}(true). While enabled it intercepts clicks (caller
|
|
368
388
|
* forwards them and swallows the event when {@link MeasureTool.handleClick} returns true) so
|
|
@@ -373,8 +393,10 @@ interface MeasureTool {
|
|
|
373
393
|
isEnabled(): boolean;
|
|
374
394
|
/** Returns true if the tool consumed the click (caller should not also select). */
|
|
375
395
|
handleClick(event: MouseEvent): boolean;
|
|
376
|
-
/** Preview the next snap point
|
|
396
|
+
/** Preview the next snap point and the rubber band. No-op when disabled; never consumes the event. */
|
|
377
397
|
handleMove(event: MouseEvent): void;
|
|
398
|
+
/** Drops the unfinished start point, or every measurement when there is none. Bound to Escape. */
|
|
399
|
+
cancel(): void;
|
|
378
400
|
clear(): void;
|
|
379
401
|
dispose(): void;
|
|
380
402
|
}
|
|
@@ -465,6 +487,13 @@ interface ViewGizmo {
|
|
|
465
487
|
isVisible(): boolean;
|
|
466
488
|
dispose(): void;
|
|
467
489
|
}
|
|
490
|
+
type SetLookOptions = {
|
|
491
|
+
/**
|
|
492
|
+
* Skips the sync, which walks every glowing part. The caller runs `syncEmissiveLights()` itself
|
|
493
|
+
* once visibility settles.
|
|
494
|
+
*/
|
|
495
|
+
deferEmissiveLights?: boolean;
|
|
496
|
+
};
|
|
468
497
|
/** One thing to select: a whole object, or one member of a merged mesh. */
|
|
469
498
|
interface SelectionTarget {
|
|
470
499
|
object: THREE.Object3D;
|
|
@@ -516,7 +545,12 @@ interface ThreeViewer {
|
|
|
516
545
|
* Retunes lighting/material (tone mapping, fill, IBL, AO) only — never edges/grid. Overwrites
|
|
517
546
|
* any granular lighting dials set earlier with the preset's values.
|
|
518
547
|
*/
|
|
519
|
-
setLook: (look: Look) => void;
|
|
548
|
+
setLook: (look: Look, options?: SetLookOptions) => void;
|
|
549
|
+
/**
|
|
550
|
+
* Call after showing or hiding objects, solve output included: a look that lights the scene from
|
|
551
|
+
* glowing parts reads what is drawn when it runs, so a hidden lamp would keep shining.
|
|
552
|
+
*/
|
|
553
|
+
syncEmissiveLights: () => void;
|
|
520
554
|
/**
|
|
521
555
|
* Raising `hemisphereIntensity` is the most effective way to lift shadowed surfaces a dark HDR
|
|
522
556
|
* leaves black. Lazily creates the hemisphere light if the viewer was built without one; `0` turns
|
|
@@ -591,5 +625,5 @@ export declare function isHostOwned(object: THREE.Object3D): boolean;
|
|
|
591
625
|
export declare function isOwnedBy(object: THREE.Object3D, id?: string): boolean;
|
|
592
626
|
/** Replaces scene content with `meshes`, rescales the camera frustum to fit, and (first call only) positions the camera/controls. */
|
|
593
627
|
export declare function updateScene(scene: THREE.Scene, meshes: THREE.Object3D[], camera: THREE.PerspectiveCamera, controls: OrbitControls, initialPositionSet: boolean): void;
|
|
594
|
-
export { type CameraConfig, type CameraController, type CameraProjection, type ControlsConfig, type EdgesConfig, type EnvironmentConfig, type ErrorCode, type EventConfig, type FloorConfig, type GizmoConfig, type Grid, type GridConfig, LOOKS, type LabelHandle, type LabelLayer, type LightingConfig, type Logger, type Look, type LookMaterialOverride, type LookPreset, type MaterialAppearanceOptions, type MeasureConfig, type MeasureTool, type PointerTool, type RenderConfig, type ThreeInitializerOptions, type ThreeViewer, type ToolRegistration, type ToolRegistry, type ViewGizmo, type ViewPreset };
|
|
628
|
+
export { type CameraConfig, type CameraController, type CameraProjection, type ControlsConfig, type EdgesConfig, type EnvironmentConfig, type ErrorCode, type EventConfig, type FloorConfig, type GizmoConfig, type Grid, type GridConfig, LOOKS, type LabelHandle, type LabelLayer, type LightingConfig, type Logger, type Look, type LookMaterialOverride, type LookPreset, type MaterialAppearanceOptions, type MeasureConfig, type MeasureTool, type PointerTool, type RenderConfig, type SetLookOptions, type ThreeInitializerOptions, type ThreeViewer, type ToolRegistration, type ToolRegistry, type ViewGizmo, type ViewPreset };
|
|
595
629
|
//# sourceMappingURL=render.d.ts.map
|