Selva Compute API Reference - v2.1.0
    Preparing search index...

    Function initThree

    • Initializes a Three.js environment with scene, camera, renderer, and event handling.

      Parameters

      Returns {
          applyEdges: (root: Object3D) => void;
          camera: PerspectiveCamera;
          cameraController: CameraController;
          clearSelection: () => void;
          controls: OrbitControls;
          dispose: () => void;
          fitToView: () => void;
          gizmo: ViewGizmo | null;
          grid: Grid | null;
          measureTool: MeasureTool | null;
          renderer: WebGLRenderer;
          scene: Scene;
          setAmbientOcclusion: (enabled: boolean) => void;
          updateShadowBounds: () => void;
      }

      • applyEdges: (root: Object3D) => void

        Attach edge overlays to the meshes under root (no-op unless edges.enabled). Call after loading meshes via updateScene, since meshes arrive after init.

      • camera: PerspectiveCamera
      • cameraController: CameraController
      • clearSelection: () => void
      • controls: OrbitControls
      • dispose: () => void
      • fitToView: () => void
      • gizmo: ViewGizmo | null
      • grid: Grid | null
      • measureTool: MeasureTool | null

        Two-click distance measurement tool. Null unless measure.enabled; setEnabled(true) to use.

      • renderer: WebGLRenderer
      • scene: Scene
      • setAmbientOcclusion: (enabled: boolean) => void

        Toggle ambient occlusion at runtime — builds or tears down the postprocessing pipeline.

      • updateShadowBounds: () => void

        Refit the sun's shadow frustum to the current scene content for crisp shadows. Call after loading or replacing geometry (e.g. after updateScene). No-op when sunlight/shadows are off.