@viamrobotics/motion-tools 1.14.0 → 1.15.1
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/FrameConfigUpdater.svelte.d.ts +2 -2
- package/dist/HoverUpdater.svelte.d.ts +1 -1
- package/dist/attribute.js +1 -1
- package/dist/buf/common/v1/common_pb.d.ts +45 -0
- package/dist/buf/common/v1/common_pb.js +65 -0
- package/dist/color.d.ts +1 -1
- package/dist/color.js +2 -2
- package/dist/components/App.svelte +27 -21
- package/dist/components/App.svelte.d.ts +1 -1
- package/dist/components/BatchedArrows.svelte +5 -3
- package/dist/components/Camera.svelte +1 -0
- package/dist/components/CameraControls.svelte +5 -3
- package/dist/components/Entities/Arrows/ArrowGroups.svelte +6 -3
- package/dist/components/Entities/Arrows/Arrows.svelte +6 -3
- package/dist/components/Entities/Entities.svelte +7 -5
- package/dist/components/Entities/Frame.svelte +8 -5
- package/dist/components/Entities/Frame.svelte.d.ts +2 -2
- package/dist/components/Entities/GLTF.svelte +8 -5
- package/dist/components/Entities/GLTF.svelte.d.ts +2 -2
- package/dist/components/Entities/Geometry.svelte +13 -6
- package/dist/components/Entities/Line.svelte +8 -5
- package/dist/components/Entities/Line.svelte.d.ts +1 -1
- package/dist/components/Entities/LineDots.svelte +1 -1
- package/dist/components/Entities/LineGeometry.svelte +1 -1
- package/dist/components/Entities/Mesh.svelte +8 -5
- package/dist/components/Entities/Points.svelte +9 -6
- package/dist/components/Entities/Points.svelte.d.ts +2 -2
- package/dist/components/Entities/Pose.svelte +4 -3
- package/dist/components/Entities/hooks/useEntityEvents.svelte.d.ts +1 -1
- package/dist/components/Entities/hooks/useEntityEvents.svelte.js +2 -2
- package/dist/components/FileDrop/FileDrop.svelte +10 -6
- package/dist/components/FileDrop/file-dropper.d.ts +1 -1
- package/dist/components/FileDrop/pcd-dropper.js +1 -1
- package/dist/components/FileDrop/ply-dropper.js +1 -1
- package/dist/components/FileDrop/snapshot-dropper.js +1 -1
- package/dist/components/Focus.svelte +4 -2
- package/dist/components/KeyboardControls.svelte +4 -2
- package/dist/components/Lasso/Debug.svelte +5 -2
- package/dist/components/Lasso/Lasso.svelte +9 -6
- package/dist/components/Lasso/Tool.svelte +10 -7
- package/dist/components/MeasureTool/MeasurePoint.svelte +2 -1
- package/dist/components/MeasureTool/MeasurePoint.svelte.d.ts +1 -1
- package/dist/components/MeasureTool/MeasureTool.svelte +7 -5
- package/dist/components/PCD.svelte +4 -3
- package/dist/components/PointerMissBox.svelte +3 -2
- package/dist/components/Scene.svelte +12 -9
- package/dist/components/SceneProviders.svelte +20 -18
- package/dist/components/Selected.svelte +6 -20
- package/dist/components/Snapshot.svelte +8 -5
- package/dist/components/StaticGeometries.svelte +10 -7
- package/dist/components/hover/HoveredEntities.svelte +2 -1
- package/dist/components/hover/HoveredEntity.svelte +2 -1
- package/dist/components/hover/HoveredEntityTooltip.svelte +1 -0
- package/dist/components/hover/LinkedHoveredEntity.svelte +7 -5
- package/dist/components/overlay/AddFrames.svelte +64 -0
- package/dist/components/overlay/AddFrames.svelte.d.ts +3 -0
- package/dist/components/overlay/AddRelationship.svelte +4 -2
- package/dist/components/overlay/Details.svelte +23 -21
- package/dist/components/overlay/FloatingPanel.svelte +47 -5
- package/dist/components/overlay/FloatingPanel.svelte.d.ts +1 -0
- package/dist/components/overlay/LiveUpdatesBanner.svelte +1 -0
- package/dist/components/overlay/Logs.svelte +4 -2
- package/dist/components/overlay/Popover.svelte +3 -2
- package/dist/components/overlay/RefreshRate.svelte +4 -2
- package/dist/components/overlay/dashboard/Button.svelte +2 -1
- package/dist/components/overlay/dashboard/Button.svelte.d.ts +1 -1
- package/dist/components/overlay/dashboard/Dashboard.svelte +3 -1
- package/dist/components/overlay/left-pane/Drawer.svelte +3 -2
- package/dist/components/overlay/left-pane/Tree.svelte +27 -38
- package/dist/components/overlay/left-pane/TreeContainer.svelte +17 -47
- package/dist/components/overlay/left-pane/TreeContainer.svelte.d.ts +1 -1
- package/dist/components/overlay/settings/Settings.svelte +37 -10
- package/dist/components/overlay/settings/Tabs.svelte +2 -1
- package/dist/components/overlay/widgets/ArmPositions.svelte +3 -2
- package/dist/components/overlay/widgets/Camera.svelte +6 -5
- package/dist/components/weblab/WeblabActive.svelte +2 -1
- package/dist/components/xr/ArmTeleop.svelte +7 -6
- package/dist/components/xr/BentPlaneGeometry.svelte +3 -2
- package/dist/components/xr/CameraFeed.svelte +2 -0
- package/dist/components/xr/Controllers.svelte +5 -3
- package/dist/components/xr/Draggable.svelte +4 -3
- package/dist/components/xr/HandCollider.svelte +2 -1
- package/dist/components/xr/JointLimitsWidget.svelte +1 -0
- package/dist/components/xr/OriginMarker.svelte +2 -1
- package/dist/components/xr/PointDistance.svelte +3 -2
- package/dist/components/xr/XR.svelte +8 -6
- package/dist/components/xr/XRConfigPanel.svelte +4 -3
- package/dist/components/xr/XRControllerSettings.svelte +2 -1
- package/dist/components/xr/XRToast.svelte +4 -3
- package/dist/ecs/traits.d.ts +1 -1
- package/dist/ecs/traits.js +1 -1
- package/dist/ecs/useQuery.svelte.js +1 -1
- package/dist/frame.js +1 -1
- package/dist/hooks/use3DModels.svelte.js +3 -3
- package/dist/hooks/useConfigFrames.svelte.js +3 -3
- package/dist/hooks/useDrawAPI.svelte.js +9 -9
- package/dist/hooks/useFramelessComponents.svelte.js +1 -1
- package/dist/hooks/useFrames.svelte.js +7 -7
- package/dist/hooks/useGeometries.svelte.js +8 -8
- package/dist/hooks/useMouseRaycaster.svelte.d.ts +1 -1
- package/dist/hooks/useMouseRaycaster.svelte.js +1 -1
- package/dist/hooks/usePartConfig.svelte.d.ts +1 -1
- package/dist/hooks/usePartConfig.svelte.js +3 -3
- package/dist/hooks/usePointcloudObjects.svelte.js +6 -6
- package/dist/hooks/usePointclouds.svelte.js +5 -5
- package/dist/hooks/usePose.svelte.js +7 -7
- package/dist/hooks/useSelection.svelte.d.ts +1 -1
- package/dist/hooks/useWeblabs.svelte.d.ts +1 -0
- package/dist/hooks/useWeblabs.svelte.js +15 -3
- package/dist/hooks/useWorldState.svelte.js +8 -8
- package/dist/plugins/bvh.svelte.js +2 -2
- package/dist/snapshot.d.ts +2 -2
- package/dist/snapshot.js +4 -4
- package/dist/three/BatchedArrow.d.ts +1 -1
- package/dist/three/BatchedArrow.js +1 -1
- package/dist/three/InstancedArrows/InstancedArrows.d.ts +1 -1
- package/dist/three/InstancedArrows/InstancedArrows.js +3 -3
- package/dist/three/InstancedArrows/box.js +1 -1
- package/dist/three/InstancedArrows/geometry.js +1 -1
- package/dist/three/InstancedArrows/raycast.d.ts +1 -1
- package/dist/three/InstancedArrows/raycast.js +1 -1
- package/dist/three/OBBHelper.d.ts +2 -3
- package/dist/three/OBBHelper.js +64 -43
- package/dist/three/OrientationVector.js +1 -1
- package/dist/transform.js +1 -1
- package/package.json +7 -6
- package/dist/components/overlay/left-pane/AddFrames.svelte +0 -30
- package/dist/components/overlay/left-pane/AddFrames.svelte.d.ts +0 -18
- package/dist/hooks/__tests__/fixtures/ResizableTestWrapper.svelte +0 -41
- package/dist/hooks/__tests__/fixtures/ResizableTestWrapper.svelte.d.ts +0 -6
- package/dist/hooks/useResizable.svelte.d.ts +0 -12
- package/dist/hooks/useResizable.svelte.js +0 -46
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { HTMLAttributes } from 'svelte/elements'
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
import
|
|
3
|
+
|
|
4
|
+
import { ToastVariant, useToast } from '@viamrobotics/prime-core'
|
|
5
|
+
|
|
6
|
+
import { createBufferGeometry } from '../../attribute'
|
|
7
7
|
import { traits } from '../../ecs'
|
|
8
|
-
import {
|
|
8
|
+
import { useWorld } from '../../ecs/useWorld'
|
|
9
9
|
import { useCameraControls } from '../../hooks/useControls.svelte'
|
|
10
|
-
import {
|
|
10
|
+
import { spawnSnapshotEntities } from '../../snapshot'
|
|
11
|
+
|
|
12
|
+
import type { FileDropperSuccess } from './file-dropper'
|
|
13
|
+
|
|
14
|
+
import { useFileDrop } from './useFileDrop.svelte'
|
|
11
15
|
|
|
12
16
|
const props: HTMLAttributes<HTMLDivElement> = $props()
|
|
13
17
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import type { BufferGeometry } from 'three';
|
|
1
2
|
import type { Snapshot } from '../../buf/draw/v1/snapshot_pb';
|
|
2
3
|
import type { SuccessMessage } from '../../loaders/pcd/messages';
|
|
3
|
-
import type { BufferGeometry } from 'three';
|
|
4
4
|
interface FileDropSuccess {
|
|
5
5
|
success: true;
|
|
6
6
|
name: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isArrayBuffer } from 'lodash-es';
|
|
2
|
-
import { FileDropperError } from './file-dropper';
|
|
3
2
|
import { parsePcdInWorker } from '../../loaders/pcd';
|
|
3
|
+
import { FileDropperError } from './file-dropper';
|
|
4
4
|
export const pcdDropper = async (params) => {
|
|
5
5
|
const { name, content } = params;
|
|
6
6
|
if (!isArrayBuffer(content)) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isArrayBuffer } from 'lodash-es';
|
|
2
|
-
import { FileDropperError } from './file-dropper';
|
|
3
2
|
import { PLYLoader } from 'three/examples/jsm/loaders/PLYLoader.js';
|
|
3
|
+
import { FileDropperError } from './file-dropper';
|
|
4
4
|
export const plyDropper = async (params) => {
|
|
5
5
|
const { name, content } = params;
|
|
6
6
|
if (!isArrayBuffer(content)) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Snapshot } from '../../buf/draw/v1/snapshot_pb';
|
|
2
1
|
import { isArrayBuffer, isString } from 'lodash-es';
|
|
2
|
+
import { Snapshot } from '../../buf/draw/v1/snapshot_pb';
|
|
3
3
|
import { FileDropperError, } from './file-dropper';
|
|
4
4
|
import { Extensions } from './file-names';
|
|
5
5
|
const decodeJson = (params) => {
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { T } from '@threlte/core'
|
|
3
|
-
import {
|
|
3
|
+
import { Gizmo, Portal, TrackballControls } from '@threlte/extras'
|
|
4
4
|
import { Box3, type Object3D, Vector3 } from 'three'
|
|
5
5
|
import { TrackballControls as ThreeTrackballControls } from 'three/examples/jsm/controls/TrackballControls.js'
|
|
6
|
-
|
|
6
|
+
|
|
7
7
|
import Button from './overlay/dashboard/Button.svelte'
|
|
8
8
|
|
|
9
|
+
import Camera from './Camera.svelte'
|
|
10
|
+
|
|
9
11
|
interface Props {
|
|
10
12
|
object3d: Object3D
|
|
11
13
|
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { MathUtils } from 'three'
|
|
3
|
-
import { useTask } from '@threlte/core'
|
|
4
2
|
import type { CameraControlsRef } from '@threlte/extras'
|
|
3
|
+
|
|
4
|
+
import { useTask } from '@threlte/core'
|
|
5
5
|
import { PressedKeys } from 'runed'
|
|
6
|
+
import { MathUtils } from 'three'
|
|
7
|
+
|
|
6
8
|
import { useFocusedEntity, useSelectedEntity } from '../hooks/useSelection.svelte'
|
|
7
9
|
import { useSettings } from '../hooks/useSettings.svelte'
|
|
8
10
|
import { useVisibility } from '../hooks/useVisibility.svelte'
|
|
@@ -4,10 +4,13 @@
|
|
|
4
4
|
Shows all steps for querying points within a lasso selection
|
|
5
5
|
-->
|
|
6
6
|
<script lang="ts">
|
|
7
|
+
import type { Entity } from 'koota'
|
|
8
|
+
|
|
7
9
|
import { T } from '@threlte/core'
|
|
8
10
|
import { Box3, BufferAttribute, BufferGeometry, Vector3 } from 'three'
|
|
9
|
-
|
|
10
|
-
import
|
|
11
|
+
|
|
12
|
+
import { traits, useTrait } from '../../ecs'
|
|
13
|
+
|
|
11
14
|
import * as lassoTraits from './traits'
|
|
12
15
|
|
|
13
16
|
const box3 = new Box3()
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import type { ShapecastCallbacks } from 'three-mesh-bvh'
|
|
3
|
+
|
|
3
4
|
import { useThrelte } from '@threlte/core'
|
|
4
|
-
import { Not } from 'koota'
|
|
5
|
-
import { useCameraControls } from '../../hooks/useControls.svelte'
|
|
6
5
|
import earcut from 'earcut'
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
6
|
+
import { Not } from 'koota'
|
|
7
|
+
import { Box3, Plane, Raycaster, Triangle, Vector2, Vector3 } from 'three'
|
|
8
|
+
|
|
9
9
|
import { createBufferGeometry } from '../../attribute'
|
|
10
|
-
import
|
|
10
|
+
import { traits, useQuery, useWorld } from '../../ecs'
|
|
11
|
+
import { useCameraControls } from '../../hooks/useControls.svelte'
|
|
12
|
+
|
|
11
13
|
import Debug from './Debug.svelte'
|
|
14
|
+
import * as lassoTraits from './traits'
|
|
12
15
|
|
|
13
16
|
interface Props {
|
|
14
17
|
debug?: boolean
|
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import type { BufferGeometry } from 'three'
|
|
3
|
+
|
|
4
|
+
import { useThrelte } from '@threlte/core'
|
|
2
5
|
import { Portal } from '@threlte/extras'
|
|
3
6
|
import { Button } from '@viamrobotics/prime-core'
|
|
4
|
-
import
|
|
7
|
+
import { ElementRect } from 'runed'
|
|
8
|
+
import { BufferGeometryUtils } from 'three/examples/jsm/Addons.js'
|
|
9
|
+
|
|
5
10
|
import DashboardButton from '../overlay/dashboard/Button.svelte'
|
|
11
|
+
import { traits, useWorld } from '../../ecs'
|
|
6
12
|
import { useSettings } from '../../hooks/useSettings.svelte'
|
|
13
|
+
import { createBinaryPCD } from '../../pcd'
|
|
14
|
+
|
|
7
15
|
import FloatingPanel from '../overlay/FloatingPanel.svelte'
|
|
8
|
-
import
|
|
16
|
+
import Lasso from './Lasso.svelte'
|
|
9
17
|
import * as lassoTraits from './traits'
|
|
10
|
-
import { BufferGeometryUtils } from 'three/examples/jsm/Addons.js'
|
|
11
|
-
import { createBinaryPCD } from '../../pcd'
|
|
12
|
-
import type { BufferGeometry } from 'three'
|
|
13
|
-
import { useThrelte } from '@threlte/core'
|
|
14
|
-
import { ElementRect } from 'runed'
|
|
15
18
|
|
|
16
19
|
interface Props {
|
|
17
20
|
/** Whether to auto-enable lasso mode when the component mounts */
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import type { Group, Vector3Tuple } from 'three'
|
|
3
|
+
|
|
2
4
|
import { T, type Props as ThrelteProps } from '@threlte/core'
|
|
3
|
-
import type { Vector3Tuple, Group } from 'three'
|
|
4
5
|
import { HTML } from '@threlte/extras'
|
|
5
6
|
|
|
6
7
|
interface Props extends ThrelteProps<typeof Group> {
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { untrack } from 'svelte'
|
|
3
|
-
import { Vector3, type Intersection } from 'three'
|
|
4
2
|
import { T } from '@threlte/core'
|
|
5
3
|
import { HTML, MeshLineGeometry, MeshLineMaterial, Portal } from '@threlte/extras'
|
|
6
|
-
import {
|
|
4
|
+
import { untrack } from 'svelte'
|
|
5
|
+
import { type Intersection, Vector3 } from 'three'
|
|
6
|
+
|
|
7
7
|
import Button from '../overlay/dashboard/Button.svelte'
|
|
8
|
-
import MeasurePoint from './MeasurePoint.svelte'
|
|
9
8
|
import { useMouseRaycaster } from '../../hooks/useMouseRaycaster.svelte'
|
|
10
9
|
import { useFocusedEntity } from '../../hooks/useSelection.svelte'
|
|
11
|
-
import
|
|
10
|
+
import { useSettings } from '../../hooks/useSettings.svelte'
|
|
11
|
+
|
|
12
12
|
import Popover from '../overlay/Popover.svelte'
|
|
13
|
+
import ToggleGroup from '../overlay/ToggleGroup.svelte'
|
|
14
|
+
import MeasurePoint from './MeasurePoint.svelte'
|
|
13
15
|
|
|
14
16
|
const focusedEntity = useFocusedEntity()
|
|
15
17
|
const settings = useSettings()
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { parsePcdInWorker } from '../lib'
|
|
3
|
-
import { traits, useWorld } from '../ecs'
|
|
4
|
-
import { createBufferGeometry } from '../attribute'
|
|
5
2
|
import type { ConfigurableTrait, Entity } from 'koota'
|
|
6
3
|
|
|
4
|
+
import { createBufferGeometry } from '../attribute'
|
|
5
|
+
import { traits, useWorld } from '../ecs'
|
|
6
|
+
import { parsePcdInWorker } from '../lib'
|
|
7
|
+
|
|
7
8
|
interface Props {
|
|
8
9
|
data: Uint8Array
|
|
9
10
|
name?: string
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { BackSide, Mesh, Vector3 } from 'three'
|
|
3
2
|
import { T, useThrelte } from '@threlte/core'
|
|
4
3
|
import { MeshDiscardMaterial } from '@threlte/extras'
|
|
5
|
-
import {
|
|
4
|
+
import { BackSide, Mesh, Vector3 } from 'three'
|
|
5
|
+
|
|
6
6
|
import { useTransformControls } from '../hooks/useControls.svelte'
|
|
7
|
+
import { useSelectedEntity } from '../hooks/useSelection.svelte'
|
|
7
8
|
import { useSettings } from '../hooks/useSettings.svelte'
|
|
8
9
|
|
|
9
10
|
const { camera } = useThrelte()
|
|
@@ -1,23 +1,26 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import type { Snippet } from 'svelte'
|
|
3
|
+
|
|
3
4
|
import { T } from '@threlte/core'
|
|
4
5
|
import { Environment, Grid, interactivity, PerfMonitor, PortalTarget } from '@threlte/extras'
|
|
6
|
+
import { useXR } from '@threlte/xr'
|
|
7
|
+
import { ShaderMaterial, Vector3 } from 'three'
|
|
8
|
+
|
|
9
|
+
import Camera from './Camera.svelte'
|
|
5
10
|
import Entities from './Entities/Entities.svelte'
|
|
6
|
-
import Selected from './Selected.svelte'
|
|
7
11
|
import Focus from './Focus.svelte'
|
|
12
|
+
import Selected from './Selected.svelte'
|
|
8
13
|
import StaticGeometries from './StaticGeometries.svelte'
|
|
9
|
-
import Camera from './Camera.svelte'
|
|
10
14
|
import { useFocusedObject3d } from '../hooks/useSelection.svelte'
|
|
11
|
-
import type { Snippet } from 'svelte'
|
|
12
|
-
import { useXR } from '@threlte/xr'
|
|
13
|
-
import { bvh } from '../plugins/bvh.svelte'
|
|
14
|
-
import { useOrigin } from './xr/useOrigin.svelte'
|
|
15
15
|
import { useSettings } from '../hooks/useSettings.svelte'
|
|
16
|
+
import { bvh } from '../plugins/bvh.svelte'
|
|
17
|
+
|
|
18
|
+
import hdrImage from '../assets/ferndale_studio_11_1k.hdr'
|
|
19
|
+
import BatchedArrows from './BatchedArrows.svelte'
|
|
16
20
|
import CameraControls from './CameraControls.svelte'
|
|
17
21
|
import MeasureTool from './MeasureTool/MeasureTool.svelte'
|
|
18
22
|
import PointerMissBox from './PointerMissBox.svelte'
|
|
19
|
-
import
|
|
20
|
-
import hdrImage from '../assets/ferndale_studio_11_1k.hdr'
|
|
23
|
+
import { useOrigin } from './xr/useOrigin.svelte'
|
|
21
24
|
|
|
22
25
|
interface Props {
|
|
23
26
|
children?: Snippet
|
|
@@ -1,29 +1,31 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { Snippet } from 'svelte'
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { provideVisibility } from '../hooks/useVisibility.svelte'
|
|
9
|
-
import { provideDrawAPI } from '../hooks/useDrawAPI.svelte'
|
|
10
|
-
import { provideMachineSettings } from '../hooks/useMachineSettings.svelte'
|
|
3
|
+
|
|
4
|
+
import { provide3DModels } from '../hooks/use3DModels.svelte'
|
|
5
|
+
import { provideArmClient } from '../hooks/useArmClient.svelte'
|
|
6
|
+
import { provideArmKinematics } from '../hooks/useArmKinematics.svelte'
|
|
7
|
+
import { provideConfigFrames } from '../hooks/useConfigFrames.svelte'
|
|
11
8
|
import {
|
|
9
|
+
type CameraPose,
|
|
12
10
|
provideCameraControls,
|
|
13
11
|
provideTransformControls,
|
|
14
|
-
type CameraPose,
|
|
15
12
|
} from '../hooks/useControls.svelte'
|
|
16
|
-
import {
|
|
17
|
-
import { provideOrigin } from './xr/useOrigin.svelte'
|
|
18
|
-
import { provideWorldStates } from '../hooks/useWorldState.svelte'
|
|
19
|
-
import { provideArmClient } from '../hooks/useArmClient.svelte'
|
|
20
|
-
import { provideArmKinematics } from '../hooks/useArmKinematics.svelte'
|
|
13
|
+
import { provideDrawAPI } from '../hooks/useDrawAPI.svelte'
|
|
21
14
|
import { provideFramelessComponents } from '../hooks/useFramelessComponents.svelte'
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import { providePointcloudObjects } from '../hooks/usePointcloudObjects.svelte'
|
|
15
|
+
import { provideFrames } from '../hooks/useFrames.svelte'
|
|
16
|
+
import { provideGeometries } from '../hooks/useGeometries.svelte'
|
|
25
17
|
import { provideLinkedEntities } from '../hooks/useLinked.svelte'
|
|
26
|
-
import {
|
|
18
|
+
import { provideLogs } from '../hooks/useLogs.svelte'
|
|
19
|
+
import { provideMachineSettings } from '../hooks/useMachineSettings.svelte'
|
|
20
|
+
import { usePartID } from '../hooks/usePartID.svelte'
|
|
21
|
+
import { providePointcloudObjects } from '../hooks/usePointcloudObjects.svelte'
|
|
22
|
+
import { providePointclouds } from '../hooks/usePointclouds.svelte'
|
|
23
|
+
import { provideResourceByName } from '../hooks/useResourceByName.svelte'
|
|
24
|
+
import { provideSelection } from '../hooks/useSelection.svelte'
|
|
25
|
+
import { provideVisibility } from '../hooks/useVisibility.svelte'
|
|
26
|
+
import { provideWorldStates } from '../hooks/useWorldState.svelte'
|
|
27
|
+
|
|
28
|
+
import { provideOrigin } from './xr/useOrigin.svelte'
|
|
27
29
|
|
|
28
30
|
interface Props {
|
|
29
31
|
cameraPose?: CameraPose
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { isInstanceOf, T, useTask, useThrelte } from '@threlte/core'
|
|
3
|
-
import { useSelectedEntity, useSelectedObject3d } from '../hooks/useSelection.svelte'
|
|
4
|
-
import { OBBHelper } from '../three/OBBHelper'
|
|
5
|
-
import { OBB } from 'three/addons/math/OBB.js'
|
|
6
3
|
import { BatchedMesh, Box3 } from 'three'
|
|
4
|
+
import { OBB } from 'three/addons/math/OBB.js'
|
|
5
|
+
|
|
7
6
|
import type { InstancedArrows } from '../three/InstancedArrows/InstancedArrows'
|
|
8
7
|
|
|
8
|
+
import { useSelectedEntity, useSelectedObject3d } from '../hooks/useSelection.svelte'
|
|
9
|
+
import { OBBHelper } from '../three/OBBHelper'
|
|
10
|
+
|
|
9
11
|
const box3 = new Box3()
|
|
10
12
|
const obb = new OBB()
|
|
11
13
|
const obbHelper = new OBBHelper()
|
|
@@ -14,19 +16,7 @@
|
|
|
14
16
|
const selectedEntity = useSelectedEntity()
|
|
15
17
|
const selectedObject3d = useSelectedObject3d()
|
|
16
18
|
|
|
17
|
-
const object = $derived.
|
|
18
|
-
if (!selectedObject3d.current) {
|
|
19
|
-
return
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
// Create a clone in the case of meshes, which could be frames with geometries,
|
|
23
|
-
// so that our bounding box doesn't include children
|
|
24
|
-
if (isInstanceOf(selectedObject3d.current, 'Mesh')) {
|
|
25
|
-
return selectedObject3d.current?.clone(false)
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
return selectedObject3d.current
|
|
29
|
-
})
|
|
19
|
+
const object = $derived(selectedObject3d.current)
|
|
30
20
|
|
|
31
21
|
const { start, stop } = useTask(
|
|
32
22
|
() => {
|
|
@@ -42,10 +32,6 @@
|
|
|
42
32
|
mesh.getBoundingBoxAt(selectedEntity.instance, box3)
|
|
43
33
|
obb.fromBox3(box3)
|
|
44
34
|
obbHelper.setFromOBB(obb)
|
|
45
|
-
} else if (isInstanceOf(selectedObject3d.current, 'Mesh')) {
|
|
46
|
-
selectedObject3d.current?.getWorldPosition(object.position)
|
|
47
|
-
selectedObject3d.current?.getWorldQuaternion(object.quaternion)
|
|
48
|
-
obbHelper.setFromObject(object)
|
|
49
35
|
} else {
|
|
50
36
|
obbHelper.setFromObject(object)
|
|
51
37
|
}
|
|
@@ -14,15 +14,18 @@ Renders a Snapshot protobuf by spawning its transforms and drawings as entities
|
|
|
14
14
|
```
|
|
15
15
|
-->
|
|
16
16
|
<script lang="ts">
|
|
17
|
-
import type { Snapshot as SnapshotProto } from '../buf/draw/v1/snapshot_pb'
|
|
18
|
-
import { useWorld } from '../ecs'
|
|
19
|
-
import { useSettings } from '../hooks/useSettings.svelte'
|
|
20
|
-
import { spawnSnapshotEntities, destroyEntities, applySceneMetadata } from '../snapshot'
|
|
21
|
-
import { useCameraControls } from '../hooks/useControls.svelte'
|
|
22
17
|
import type { Entity } from 'koota'
|
|
18
|
+
|
|
23
19
|
import { untrack } from 'svelte'
|
|
24
20
|
import { onDestroy } from 'svelte'
|
|
25
21
|
|
|
22
|
+
import type { Snapshot as SnapshotProto } from '../buf/draw/v1/snapshot_pb'
|
|
23
|
+
|
|
24
|
+
import { useWorld } from '../ecs'
|
|
25
|
+
import { useCameraControls } from '../hooks/useControls.svelte'
|
|
26
|
+
import { useSettings } from '../hooks/useSettings.svelte'
|
|
27
|
+
import { applySceneMetadata, destroyEntities, spawnSnapshotEntities } from '../snapshot'
|
|
28
|
+
|
|
26
29
|
interface Props {
|
|
27
30
|
snapshot: SnapshotProto
|
|
28
31
|
}
|
|
@@ -6,17 +6,20 @@
|
|
|
6
6
|
</script>
|
|
7
7
|
|
|
8
8
|
<script lang="ts">
|
|
9
|
+
import type { Entity } from 'koota'
|
|
10
|
+
|
|
9
11
|
import { TransformControls } from '@threlte/extras'
|
|
10
|
-
import { useSelectedEntity } from '../hooks/useSelection.svelte'
|
|
11
|
-
import { useTransformControls } from '../hooks/useControls.svelte'
|
|
12
12
|
import { PressedKeys } from 'runed'
|
|
13
|
-
import {
|
|
13
|
+
import { SvelteSet } from 'svelte/reactivity'
|
|
14
14
|
import { Quaternion, Vector3 } from 'three'
|
|
15
|
-
|
|
15
|
+
|
|
16
|
+
import { traits, useWorld } from '../ecs'
|
|
17
|
+
import { useTransformControls } from '../hooks/useControls.svelte'
|
|
18
|
+
import { useSelectedEntity } from '../hooks/useSelection.svelte'
|
|
16
19
|
import { useSettings } from '../hooks/useSettings.svelte'
|
|
17
|
-
import {
|
|
18
|
-
|
|
19
|
-
import
|
|
20
|
+
import { quaternionToPose, vector3ToPose } from '../transform'
|
|
21
|
+
|
|
22
|
+
import Frame from './Entities/Frame.svelte'
|
|
20
23
|
|
|
21
24
|
const world = useWorld()
|
|
22
25
|
const settings = useSettings()
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { traits, useTrait } from '../../ecs'
|
|
3
|
+
import { useLinkedEntities } from '../../hooks/useLinked.svelte'
|
|
3
4
|
import { useSelectedEntity } from '../../hooks/useSelection.svelte'
|
|
4
5
|
import { useFocusedEntity } from '../../hooks/useSelection.svelte'
|
|
6
|
+
|
|
5
7
|
import HoveredEntity from './HoveredEntity.svelte'
|
|
6
8
|
import LinkedHoveredEntity from './LinkedHoveredEntity.svelte'
|
|
7
|
-
import { useLinkedEntities } from '../../hooks/useLinked.svelte'
|
|
8
9
|
|
|
9
10
|
const selectedEntity = useSelectedEntity()
|
|
10
11
|
const focusedEntity = useFocusedEntity()
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { traits, useTrait } from '../../ecs'
|
|
3
|
-
import HoveredEntityTooltip from './HoveredEntityTooltip.svelte'
|
|
4
3
|
import { useFocusedEntity, useSelectedEntity } from '../../hooks/useSelection.svelte'
|
|
5
4
|
|
|
5
|
+
import HoveredEntityTooltip from './HoveredEntityTooltip.svelte'
|
|
6
|
+
|
|
6
7
|
const selectedEntity = useSelectedEntity()
|
|
7
8
|
const focusedEntity = useFocusedEntity()
|
|
8
9
|
|
|
@@ -8,14 +8,16 @@
|
|
|
8
8
|
</script>
|
|
9
9
|
|
|
10
10
|
<script lang="ts">
|
|
11
|
-
import { relations, traits } from '../../ecs'
|
|
12
11
|
import type { Entity } from 'koota'
|
|
13
|
-
|
|
14
|
-
import {
|
|
15
|
-
import { useSelectedEntity } from '../../hooks/useSelection.svelte'
|
|
16
|
-
import { useFocusedEntity } from '../../hooks/useSelection.svelte'
|
|
12
|
+
|
|
13
|
+
import { relations, traits } from '../../ecs'
|
|
17
14
|
import { useTrait } from '../../ecs'
|
|
18
15
|
import { SubEntityLinkType } from '../../ecs/relations'
|
|
16
|
+
import { useSelectedEntity } from '../../hooks/useSelection.svelte'
|
|
17
|
+
import { useFocusedEntity } from '../../hooks/useSelection.svelte'
|
|
18
|
+
import { getLinkedHoverInfo, type HoverInfo } from '../../HoverUpdater.svelte'
|
|
19
|
+
|
|
20
|
+
import HoveredEntityTooltip from './HoveredEntityTooltip.svelte'
|
|
19
21
|
|
|
20
22
|
interface Props {
|
|
21
23
|
linkedEntity: Entity
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Portal } from '@threlte/extras'
|
|
3
|
+
import { Button } from '@viamrobotics/prime-core'
|
|
4
|
+
|
|
5
|
+
import { useFramelessComponents } from '../../hooks/useFramelessComponents.svelte'
|
|
6
|
+
import { usePartConfig } from '../../hooks/usePartConfig.svelte'
|
|
7
|
+
import { usePartID } from '../../hooks/usePartID.svelte'
|
|
8
|
+
|
|
9
|
+
import DashboardButton from './dashboard/Button.svelte'
|
|
10
|
+
import FloatingPanel from './FloatingPanel.svelte'
|
|
11
|
+
|
|
12
|
+
const partID = usePartID()
|
|
13
|
+
const framelessComponents = useFramelessComponents()
|
|
14
|
+
const partConfig = usePartConfig()
|
|
15
|
+
|
|
16
|
+
let selectedComponent = $derived(framelessComponents.current[0] ?? '')
|
|
17
|
+
|
|
18
|
+
let isOpen = $state(false)
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
{#if partID.current && partConfig.hasEditPermissions}
|
|
22
|
+
<Portal id="dashboard">
|
|
23
|
+
<fieldset>
|
|
24
|
+
<DashboardButton
|
|
25
|
+
active
|
|
26
|
+
icon="axis-arrow"
|
|
27
|
+
description="Add frames"
|
|
28
|
+
onclick={() => {
|
|
29
|
+
isOpen = !isOpen
|
|
30
|
+
}}
|
|
31
|
+
/>
|
|
32
|
+
</fieldset>
|
|
33
|
+
</Portal>
|
|
34
|
+
|
|
35
|
+
<FloatingPanel
|
|
36
|
+
{isOpen}
|
|
37
|
+
defaultSize={{ width: 300, height: 150 }}
|
|
38
|
+
>
|
|
39
|
+
<div class="flex h-full flex-col items-center justify-center gap-2 overflow-auto p-3 text-xs">
|
|
40
|
+
{#if framelessComponents.current.length > 0}
|
|
41
|
+
<select
|
|
42
|
+
class="border-light hover:border-gray-6 focus:border-gray-9 h-7.5 w-full appearance-none border bg-white px-2 py-1.5 text-xs leading-tight"
|
|
43
|
+
bind:value={selectedComponent}
|
|
44
|
+
>
|
|
45
|
+
{#each framelessComponents.current as component (component)}
|
|
46
|
+
<option>{component}</option>
|
|
47
|
+
{/each}
|
|
48
|
+
</select>
|
|
49
|
+
|
|
50
|
+
<Button
|
|
51
|
+
icon="plus"
|
|
52
|
+
onclick={() => {
|
|
53
|
+
partConfig.createFrame(selectedComponent)
|
|
54
|
+
isOpen = false
|
|
55
|
+
}}
|
|
56
|
+
>
|
|
57
|
+
Add frame
|
|
58
|
+
</Button>
|
|
59
|
+
{:else}
|
|
60
|
+
<p class="text-center">No components without frames</p>
|
|
61
|
+
{/if}
|
|
62
|
+
</div>
|
|
63
|
+
</FloatingPanel>
|
|
64
|
+
{/if}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { Entity } from 'koota'
|
|
3
|
-
|
|
4
|
-
import {
|
|
3
|
+
|
|
4
|
+
import { Button, Input, Select } from '@viamrobotics/prime-core'
|
|
5
|
+
|
|
6
|
+
import { relations, traits, useQuery, useTrait } from '../../ecs'
|
|
5
7
|
import { SubEntityLinkType } from '../../ecs/relations'
|
|
6
8
|
|
|
7
9
|
interface Props {
|