@selvajs/visualization 1.8.0-beta.4 → 1.8.0-beta.5

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/render.cjs CHANGED
@@ -4591,6 +4591,7 @@ exports.isOwnedBy = isOwnedBy;
4591
4591
  exports.materialAppearanceForLook = require_gpu_dispose.materialAppearanceForLook;
4592
4592
  exports.pickThreshold = pickThreshold;
4593
4593
  exports.pointerToNdc = pointerToNdc;
4594
+ exports.raycastVisible = raycastVisible;
4594
4595
  exports.setLogger = require_gpu_dispose.setLogger;
4595
4596
  exports.snapToVertex = snapToVertex;
4596
4597
  exports.updateScene = updateScene;
package/dist/render.d.cts CHANGED
@@ -4,6 +4,7 @@ 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
6
  import "three/addons/postprocessing/Pass.js";
7
+ import "three-mesh-bvh";
7
8
  /**
8
9
  * Errors for the visualization package. Replaces `@selvajs/compute`'s `RhinoComputeError`, which
9
10
  * mis-named failures on paths (e.g. the plugin WebSocket) that never touch Rhino.Compute. `code`
@@ -607,6 +608,11 @@ interface ThreeViewer {
607
608
  clearUserGeometry: (appId?: string) => void;
608
609
  }
609
610
  export declare const initThree: (canvas: HTMLCanvasElement, options?: ThreeInitializerOptions) => ThreeViewer;
611
+ /**
612
+ * Every hit along `raycaster`'s ray over the visible content of `scene`, nearest first. Meshes use
613
+ * the BVH; lines, points and instanced meshes fall back to their own `raycast`.
614
+ */
615
+ export declare function raycastVisible(scene: THREE.Object3D, raycaster: THREE.Raycaster): THREE.Intersection[];
610
616
  /** Geometry produced by a solve. Replaced wholesale on the next one. */
611
617
  export declare const SOURCE_COMPUTE = "compute";
612
618
  /**
package/dist/render.d.ts CHANGED
@@ -2,6 +2,7 @@ import { a as LookPreset, i as LookMaterialOverride, n as LOOKS, o as MaterialAp
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 { MeshBVH } from "three-mesh-bvh";
5
6
  import { Pass } from "three/addons/postprocessing/Pass.js";
6
7
  import { OrbitControls } from "three/addons/controls/OrbitControls.js";
7
8
  /**
@@ -607,6 +608,11 @@ interface ThreeViewer {
607
608
  clearUserGeometry: (appId?: string) => void;
608
609
  }
609
610
  export declare const initThree: (canvas: HTMLCanvasElement, options?: ThreeInitializerOptions) => ThreeViewer;
611
+ /**
612
+ * Every hit along `raycaster`'s ray over the visible content of `scene`, nearest first. Meshes use
613
+ * the BVH; lines, points and instanced meshes fall back to their own `raycast`.
614
+ */
615
+ export declare function raycastVisible(scene: THREE.Object3D, raycaster: THREE.Raycaster): THREE.Intersection[];
610
616
  /** Geometry produced by a solve. Replaced wholesale on the next one. */
611
617
  export declare const SOURCE_COMPUTE = "compute";
612
618
  /**
package/dist/render.js CHANGED
@@ -4572,6 +4572,6 @@ const initThree = function(canvas, options) {
4572
4572
  clearUserGeometry
4573
4573
  };
4574
4574
  };
4575
- export { DEFAULT_LOOK, ErrorCodes, LOOKS, LOOK_PRESETS, SOURCE_COMPUTE, SOURCE_USER, VisualizationError, appIdFromSource, appSource, enableDebugLogging, getLogger, initThree, isHostOwned, isOwnedBy, materialAppearanceForLook, pickThreshold, pointerToNdc, setLogger, snapToVertex, updateScene };
4575
+ export { DEFAULT_LOOK, ErrorCodes, LOOKS, LOOK_PRESETS, SOURCE_COMPUTE, SOURCE_USER, VisualizationError, appIdFromSource, appSource, enableDebugLogging, getLogger, initThree, isHostOwned, isOwnedBy, materialAppearanceForLook, pickThreshold, pointerToNdc, raycastVisible, setLogger, snapToVertex, updateScene };
4576
4576
 
4577
4577
  //# sourceMappingURL=render.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@selvajs/visualization",
3
- "version": "1.8.0-beta.4",
3
+ "version": "1.8.0-beta.5",
4
4
  "description": "Headless, extensible viewer core for Selva — parse, render and scene layers over Three.js",
5
5
  "author": "VektorNode",
6
6
  "license": "MIT",