@selvajs/visualization 1.6.0-beta.8 → 1.6.0-beta.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/dist/gpu-dispose-Cl3RXm-v.js +355 -0
  2. package/dist/gpu-dispose-Cl3RXm-v.js.map +1 -0
  3. package/dist/gpu-dispose-fRI12OCL.cjs +469 -0
  4. package/dist/gpu-dispose-fRI12OCL.cjs.map +1 -0
  5. package/dist/gpu-ownership-ADRZBxxs.cjs +102 -0
  6. package/dist/gpu-ownership-ADRZBxxs.cjs.map +1 -0
  7. package/dist/gpu-ownership-Bs9l7hrU.js +40 -0
  8. package/dist/gpu-ownership-Bs9l7hrU.js.map +1 -0
  9. package/dist/index.js +1 -1
  10. package/dist/merged-draw-CO4rr2Co.js +129 -0
  11. package/dist/merged-draw-CO4rr2Co.js.map +1 -0
  12. package/dist/merged-draw-ma_2r4N8.cjs +171 -0
  13. package/dist/merged-draw-ma_2r4N8.cjs.map +1 -0
  14. package/dist/parse.cjs +2789 -11
  15. package/dist/parse.cjs.map +1 -1
  16. package/dist/parse.d.cts +8 -2
  17. package/dist/parse.d.ts +8 -2
  18. package/dist/parse.js +2780 -11
  19. package/dist/parse.js.map +1 -1
  20. package/dist/render.cjs +3713 -6
  21. package/dist/render.cjs.map +1 -1
  22. package/dist/render.d.cts +23 -3
  23. package/dist/render.d.ts +23 -3
  24. package/dist/render.js +3692 -6
  25. package/dist/render.js.map +1 -1
  26. package/dist/scene.cjs +343 -1
  27. package/dist/scene.cjs.map +1 -1
  28. package/dist/scene.js +336 -1
  29. package/dist/scene.js.map +1 -1
  30. package/dist/{types-P5PyfYYE.d.ts → types-DW_qU4-Y.d.cts} +22 -3
  31. package/dist/{types-P5PyfYYE.d.cts → types-DW_qU4-Y.d.ts} +22 -3
  32. package/package.json +2 -2
  33. package/dist/gpu-dispose-Cestx__L.cjs +0 -2
  34. package/dist/gpu-dispose-Cestx__L.cjs.map +0 -1
  35. package/dist/gpu-dispose-gTGxGTL4.js +0 -2
  36. package/dist/gpu-dispose-gTGxGTL4.js.map +0 -1
  37. package/dist/gpu-ownership-DcHWbATk.js +0 -2
  38. package/dist/gpu-ownership-DcHWbATk.js.map +0 -1
  39. package/dist/gpu-ownership-ilj3JEdn.cjs +0 -2
  40. package/dist/gpu-ownership-ilj3JEdn.cjs.map +0 -1
  41. package/dist/merged-draw-DXJK-rdo.js +0 -2
  42. package/dist/merged-draw-DXJK-rdo.js.map +0 -1
  43. package/dist/merged-draw-oKAKlXCQ.cjs +0 -2
  44. package/dist/merged-draw-oKAKlXCQ.cjs.map +0 -1
package/dist/render.d.cts CHANGED
@@ -1,8 +1,9 @@
1
- import { a as MaterialAppearanceOptions, i as LookPreset, n as Look, r as LookMaterialOverride, t as LOOKS } from "./types-P5PyfYYE.cjs";
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,15 @@ 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;
124
130
  /** Default false — switches rendering from `renderer.render` to an EffectComposer, which costs more. */
125
131
  ambientOcclusion?: boolean;
132
+ /** Glow around emissive parts. The look decides; `night` sets it. */
133
+ bloom?: BloomOptions;
126
134
  /** AO strength 0–1 when {@link RenderConfig.ambientOcclusion} is on. Default 1. */
127
135
  aoIntensity?: number;
128
136
  /**
@@ -465,6 +473,13 @@ interface ViewGizmo {
465
473
  isVisible(): boolean;
466
474
  dispose(): void;
467
475
  }
476
+ type SetLookOptions = {
477
+ /**
478
+ * Skips the sync, which walks every glowing part. The caller runs `syncEmissiveLights()` itself
479
+ * once visibility settles.
480
+ */
481
+ deferEmissiveLights?: boolean;
482
+ };
468
483
  /** One thing to select: a whole object, or one member of a merged mesh. */
469
484
  interface SelectionTarget {
470
485
  object: THREE.Object3D;
@@ -516,7 +531,12 @@ interface ThreeViewer {
516
531
  * Retunes lighting/material (tone mapping, fill, IBL, AO) only — never edges/grid. Overwrites
517
532
  * any granular lighting dials set earlier with the preset's values.
518
533
  */
519
- setLook: (look: Look) => void;
534
+ setLook: (look: Look, options?: SetLookOptions) => void;
535
+ /**
536
+ * Call after showing or hiding objects, solve output included: a look that lights the scene from
537
+ * glowing parts reads what is drawn when it runs, so a hidden lamp would keep shining.
538
+ */
539
+ syncEmissiveLights: () => void;
520
540
  /**
521
541
  * Raising `hemisphereIntensity` is the most effective way to lift shadowed surfaces a dark HDR
522
542
  * leaves black. Lazily creates the hemisphere light if the viewer was built without one; `0` turns
@@ -591,5 +611,5 @@ export declare function isHostOwned(object: THREE.Object3D): boolean;
591
611
  export declare function isOwnedBy(object: THREE.Object3D, id?: string): boolean;
592
612
  /** Replaces scene content with `meshes`, rescales the camera frustum to fit, and (first call only) positions the camera/controls. */
593
613
  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 };
614
+ 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
615
  //# sourceMappingURL=render.d.cts.map
package/dist/render.d.ts CHANGED
@@ -1,7 +1,8 @@
1
- import { a as MaterialAppearanceOptions, i as LookPreset, n as Look, r as LookMaterialOverride, t as LOOKS } from "./types-P5PyfYYE.js";
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,15 @@ 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;
124
130
  /** Default false — switches rendering from `renderer.render` to an EffectComposer, which costs more. */
125
131
  ambientOcclusion?: boolean;
132
+ /** Glow around emissive parts. The look decides; `night` sets it. */
133
+ bloom?: BloomOptions;
126
134
  /** AO strength 0–1 when {@link RenderConfig.ambientOcclusion} is on. Default 1. */
127
135
  aoIntensity?: number;
128
136
  /**
@@ -465,6 +473,13 @@ interface ViewGizmo {
465
473
  isVisible(): boolean;
466
474
  dispose(): void;
467
475
  }
476
+ type SetLookOptions = {
477
+ /**
478
+ * Skips the sync, which walks every glowing part. The caller runs `syncEmissiveLights()` itself
479
+ * once visibility settles.
480
+ */
481
+ deferEmissiveLights?: boolean;
482
+ };
468
483
  /** One thing to select: a whole object, or one member of a merged mesh. */
469
484
  interface SelectionTarget {
470
485
  object: THREE.Object3D;
@@ -516,7 +531,12 @@ interface ThreeViewer {
516
531
  * Retunes lighting/material (tone mapping, fill, IBL, AO) only — never edges/grid. Overwrites
517
532
  * any granular lighting dials set earlier with the preset's values.
518
533
  */
519
- setLook: (look: Look) => void;
534
+ setLook: (look: Look, options?: SetLookOptions) => void;
535
+ /**
536
+ * Call after showing or hiding objects, solve output included: a look that lights the scene from
537
+ * glowing parts reads what is drawn when it runs, so a hidden lamp would keep shining.
538
+ */
539
+ syncEmissiveLights: () => void;
520
540
  /**
521
541
  * Raising `hemisphereIntensity` is the most effective way to lift shadowed surfaces a dark HDR
522
542
  * leaves black. Lazily creates the hemisphere light if the viewer was built without one; `0` turns
@@ -591,5 +611,5 @@ export declare function isHostOwned(object: THREE.Object3D): boolean;
591
611
  export declare function isOwnedBy(object: THREE.Object3D, id?: string): boolean;
592
612
  /** Replaces scene content with `meshes`, rescales the camera frustum to fit, and (first call only) positions the camera/controls. */
593
613
  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 };
614
+ 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
615
  //# sourceMappingURL=render.d.ts.map