@viamrobotics/motion-tools 1.30.0 → 1.32.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/components/App.svelte +51 -46
- package/dist/components/App.svelte.d.ts +1 -1
- package/dist/components/Entities/Arrows/Arrows.svelte +4 -7
- package/dist/components/Entities/hooks/useEntityEvents.svelte.d.ts +0 -1
- package/dist/components/Entities/hooks/useEntityEvents.svelte.js +30 -16
- package/dist/components/InputBindings.svelte +0 -43
- package/dist/components/KeyboardBindings.svelte +38 -0
- package/dist/components/KeyboardBindings.svelte.d.ts +18 -0
- package/dist/components/PointerMissBox.svelte +6 -3
- package/dist/components/Scene.svelte +34 -45
- package/dist/components/SceneProviders.svelte +2 -4
- package/dist/components/SceneProviders.svelte.d.ts +1 -3
- package/dist/components/Selected.svelte +20 -27
- package/dist/components/SelectedTransformControls.svelte +10 -8
- package/dist/components/StaticGeometries.svelte +3 -5
- package/dist/components/hover/HoveredEntities.svelte +15 -14
- package/dist/components/hover/HoveredEntities.svelte.d.ts +17 -2
- package/dist/components/hover/HoveredEntity.svelte +8 -5
- package/dist/components/hover/HoveredEntity.svelte.d.ts +5 -1
- package/dist/components/hover/LinkedHoveredEntity.svelte +7 -11
- package/dist/components/hover/LinkedHoveredEntity.svelte.d.ts +1 -0
- package/dist/components/overlay/Details.svelte +24 -38
- package/dist/components/overlay/Details.svelte.d.ts +3 -1
- package/dist/components/overlay/controls/Controls.svelte +0 -2
- package/dist/components/overlay/dashboard/Button.svelte +5 -3
- package/dist/components/overlay/dashboard/Button.svelte.d.ts +1 -1
- package/dist/components/overlay/left-pane/Tree.svelte +13 -10
- package/dist/components/overlay/left-pane/TreeContainer.svelte +9 -4
- package/dist/components/overlay/left-pane/TreeNode.svelte +6 -4
- package/dist/draw.d.ts +1 -0
- package/dist/draw.js +1 -1
- package/dist/ecs/index.d.ts +1 -0
- package/dist/ecs/index.js +1 -0
- package/dist/ecs/traits.d.ts +22 -5
- package/dist/ecs/traits.js +33 -4
- package/dist/ecs/useTag.svelte.d.ts +5 -0
- package/dist/ecs/useTag.svelte.js +43 -0
- package/dist/hooks/useConfigFrames.svelte.js +1 -1
- package/dist/hooks/useEnvironment.svelte.d.ts +1 -1
- package/dist/hooks/useLinked.svelte.js +7 -8
- package/dist/hooks/useMouseRaycaster.svelte.d.ts +4 -3
- package/dist/hooks/useMouseRaycaster.svelte.js +1 -0
- package/dist/hooks/useSettings.svelte.d.ts +1 -1
- package/dist/lib.d.ts +1 -0
- package/dist/lib.js +1 -0
- package/dist/loaders/pcd/worker.inline.d.ts +1 -1
- package/dist/loaders/pcd/worker.inline.js +1 -1
- package/dist/loaders/pcd/worker.js +3 -1
- package/dist/plugins/Focus/Focus.svelte +45 -0
- package/dist/plugins/Focus/Focus.svelte.d.ts +3 -0
- package/dist/plugins/Focus/FocusBox.svelte +75 -0
- package/dist/plugins/Focus/FocusBox.svelte.d.ts +3 -0
- package/dist/plugins/Focus/provideFocus.svelte.d.ts +1 -0
- package/dist/plugins/Focus/provideFocus.svelte.js +61 -0
- package/dist/{components → plugins}/MeasureTool/MeasureTool.svelte +6 -8
- package/dist/plugins/Selection/Ellipse.svelte +21 -16
- package/dist/plugins/Selection/Lasso.svelte +21 -16
- package/dist/plugins/Selection/SelectionTool.svelte +10 -3
- package/dist/plugins/Selection/relations.d.ts +6 -0
- package/dist/plugins/Selection/relations.js +7 -0
- package/dist/plugins/Selection/traits.d.ts +0 -5
- package/dist/plugins/Selection/traits.js +1 -6
- package/dist/plugins/index.d.ts +3 -0
- package/dist/plugins/index.js +3 -0
- package/dist/snapshot.d.ts +14 -0
- package/dist/snapshot.js +23 -0
- package/dist/three/arrow.d.ts +2 -0
- package/dist/three/arrow.js +3 -1
- package/package.json +17 -5
- package/dist/components/Focus.svelte +0 -46
- package/dist/components/Focus.svelte.d.ts +0 -7
- package/dist/hooks/useSelection.svelte.d.ts +0 -33
- package/dist/hooks/useSelection.svelte.js +0 -94
- /package/dist/{components → plugins}/MeasureTool/MeasurePoint.svelte +0 -0
- /package/dist/{components → plugins}/MeasureTool/MeasurePoint.svelte.d.ts +0 -0
- /package/dist/{components → plugins}/MeasureTool/MeasureTool.svelte.d.ts +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@viamrobotics/motion-tools",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.32.0",
|
|
4
4
|
"description": "Motion visualization with Viam",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
"@ag-grid-community/core": "32.3.9",
|
|
10
10
|
"@ag-grid-community/styles": "32.3.9",
|
|
11
11
|
"@changesets/cli": "2.29.6",
|
|
12
|
+
"@connectrpc/connect": "1.7.0",
|
|
13
|
+
"@connectrpc/connect-web": "1.7.0",
|
|
12
14
|
"@dimforge/rapier3d-compat": "0.18.2",
|
|
13
15
|
"@eslint/compat": "2.0.2",
|
|
14
16
|
"@eslint/js": "10.0.1",
|
|
@@ -17,7 +19,7 @@
|
|
|
17
19
|
"@skeletonlabs/skeleton": "3.2.0",
|
|
18
20
|
"@skeletonlabs/skeleton-svelte": "1.5.1",
|
|
19
21
|
"@sveltejs/adapter-static": "3.0.9",
|
|
20
|
-
"@sveltejs/kit": "2.
|
|
22
|
+
"@sveltejs/kit": "2.60.1",
|
|
21
23
|
"@sveltejs/package": "2.5.7",
|
|
22
24
|
"@sveltejs/vite-plugin-svelte": "6.1.4",
|
|
23
25
|
"@tailwindcss/forms": "0.5.10",
|
|
@@ -52,6 +54,7 @@
|
|
|
52
54
|
"@zag-js/tree-view": "1.22.1",
|
|
53
55
|
"camera-controls": "3.1.0",
|
|
54
56
|
"concurrently": "^9.2.1",
|
|
57
|
+
"earcut": "^3.0.2",
|
|
55
58
|
"esbuild": "^0.27.3",
|
|
56
59
|
"eslint": "10.0.2",
|
|
57
60
|
"eslint-config-prettier": "10.1.8",
|
|
@@ -87,6 +90,8 @@
|
|
|
87
90
|
"@ag-grid-community/client-side-row-model": ">=32.3.0",
|
|
88
91
|
"@ag-grid-community/core": ">=32.3.0",
|
|
89
92
|
"@ag-grid-community/styles": ">=32.3.0",
|
|
93
|
+
"@connectrpc/connect": ">=1",
|
|
94
|
+
"@connectrpc/connect-web": ">=1",
|
|
90
95
|
"@dimforge/rapier3d-compat": ">=0.17",
|
|
91
96
|
"@tanstack/svelte-query-devtools": ">=6",
|
|
92
97
|
"@threlte/core": ">=8",
|
|
@@ -105,6 +110,7 @@
|
|
|
105
110
|
"@zag-js/toggle-group": ">=1",
|
|
106
111
|
"@zag-js/tree-view": ">=1",
|
|
107
112
|
"camera-controls": ">=3",
|
|
113
|
+
"earcut": ">=3",
|
|
108
114
|
"idb-keyval": ">=6",
|
|
109
115
|
"lucide-svelte": ">=0.511",
|
|
110
116
|
"runed": ">=0.28",
|
|
@@ -113,8 +119,17 @@
|
|
|
113
119
|
"svelte-virtuallists": ">=1"
|
|
114
120
|
},
|
|
115
121
|
"peerDependenciesMeta": {
|
|
122
|
+
"@connectrpc/connect": {
|
|
123
|
+
"optional": true
|
|
124
|
+
},
|
|
125
|
+
"@connectrpc/connect-web": {
|
|
126
|
+
"optional": true
|
|
127
|
+
},
|
|
116
128
|
"@tanstack/svelte-query-devtools": {
|
|
117
129
|
"optional": true
|
|
130
|
+
},
|
|
131
|
+
"earcut": {
|
|
132
|
+
"optional": true
|
|
118
133
|
}
|
|
119
134
|
},
|
|
120
135
|
"engines": {
|
|
@@ -147,10 +162,7 @@
|
|
|
147
162
|
],
|
|
148
163
|
"dependencies": {
|
|
149
164
|
"@bufbuild/protobuf": "1.10.1",
|
|
150
|
-
"@connectrpc/connect": "1.7.0",
|
|
151
|
-
"@connectrpc/connect-web": "1.7.0",
|
|
152
165
|
"@neodrag/svelte": "^2.3.3",
|
|
153
|
-
"earcut": "^3.0.2",
|
|
154
166
|
"filtrex": "^3.1.0",
|
|
155
167
|
"koota": "0.6.5",
|
|
156
168
|
"lodash-es": "4.18.1",
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { T } from '@threlte/core'
|
|
3
|
-
import { Gizmo, TrackballControls } from '@threlte/extras'
|
|
4
|
-
import { Box3, type Object3D, Vector3 } from 'three'
|
|
5
|
-
|
|
6
|
-
import { useCameraControls } from '../hooks/useControls.svelte'
|
|
7
|
-
|
|
8
|
-
import Camera from './Camera.svelte'
|
|
9
|
-
|
|
10
|
-
interface Props {
|
|
11
|
-
object3d: Object3D
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
let { object3d }: Props = $props()
|
|
15
|
-
|
|
16
|
-
const cameraControls = useCameraControls()
|
|
17
|
-
|
|
18
|
-
const box = new Box3()
|
|
19
|
-
const vec = new Vector3()
|
|
20
|
-
|
|
21
|
-
let center = $state.raw<[number, number, number]>([0, 0, 0])
|
|
22
|
-
let size = $state.raw<[number, number, number]>([0, 0, 0])
|
|
23
|
-
|
|
24
|
-
$effect.pre(() => {
|
|
25
|
-
box.setFromObject(object3d)
|
|
26
|
-
size = box.getSize(vec).toArray()
|
|
27
|
-
center = box.getCenter(vec).toArray()
|
|
28
|
-
})
|
|
29
|
-
</script>
|
|
30
|
-
|
|
31
|
-
<Camera position={[size[0] + 1, size[0] + 1, size[0] + 1]}>
|
|
32
|
-
<TrackballControls
|
|
33
|
-
target={center}
|
|
34
|
-
oncreate={(ref) => cameraControls.set(ref)}
|
|
35
|
-
>
|
|
36
|
-
<Gizmo placement="bottom-right" />
|
|
37
|
-
</TrackballControls>
|
|
38
|
-
</Camera>
|
|
39
|
-
|
|
40
|
-
<T is={object3d} />
|
|
41
|
-
|
|
42
|
-
<T.BoxHelper
|
|
43
|
-
args={[object3d, 'red']}
|
|
44
|
-
bvh={{ enabled: false }}
|
|
45
|
-
raycast={() => null}
|
|
46
|
-
/>
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import type { Entity } from 'koota';
|
|
2
|
-
import { Object3D } from 'three';
|
|
3
|
-
interface SelectedEntityContext {
|
|
4
|
-
readonly current: Entity | undefined;
|
|
5
|
-
readonly instance: number | undefined;
|
|
6
|
-
set(entity?: Entity, instance?: number): void;
|
|
7
|
-
}
|
|
8
|
-
interface FocusedEntityContext {
|
|
9
|
-
readonly current: Entity | undefined;
|
|
10
|
-
readonly instance: number | undefined;
|
|
11
|
-
set(entity?: Entity, instance?: number): void;
|
|
12
|
-
}
|
|
13
|
-
export declare const provideSelection: () => {
|
|
14
|
-
selection: {
|
|
15
|
-
readonly current: Entity | undefined;
|
|
16
|
-
readonly instance: number | undefined;
|
|
17
|
-
set(entity: Entity, instance?: number): void;
|
|
18
|
-
};
|
|
19
|
-
focus: {
|
|
20
|
-
readonly current: Entity | undefined;
|
|
21
|
-
readonly instance: number | undefined;
|
|
22
|
-
set(entity: Entity, instance?: number): void;
|
|
23
|
-
};
|
|
24
|
-
};
|
|
25
|
-
export declare const useFocusedEntity: () => FocusedEntityContext;
|
|
26
|
-
export declare const useSelectedEntity: () => SelectedEntityContext;
|
|
27
|
-
export declare const useFocusedObject3d: () => {
|
|
28
|
-
current: Object3D | undefined;
|
|
29
|
-
};
|
|
30
|
-
export declare const useSelectedObject3d: () => {
|
|
31
|
-
current: Object3D | undefined;
|
|
32
|
-
};
|
|
33
|
-
export {};
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import { useThrelte } from '@threlte/core';
|
|
2
|
-
import { getContext, setContext, untrack } from 'svelte';
|
|
3
|
-
import { Object3D } from 'three';
|
|
4
|
-
import { traits, useWorld } from '../ecs';
|
|
5
|
-
import { useEnvironment } from './useEnvironment.svelte';
|
|
6
|
-
const selectedKey = Symbol('selected-frame-context');
|
|
7
|
-
const focusedKey = Symbol('focused-frame-context');
|
|
8
|
-
const focusedObject3dKey = Symbol('focused-object-3d-context');
|
|
9
|
-
export const provideSelection = () => {
|
|
10
|
-
const world = useWorld();
|
|
11
|
-
const { scene } = useThrelte();
|
|
12
|
-
const environment = useEnvironment();
|
|
13
|
-
let selected = $state.raw();
|
|
14
|
-
let selectedInstance = $state();
|
|
15
|
-
let focused = $state.raw();
|
|
16
|
-
let focusedInstance = $state();
|
|
17
|
-
$effect(() => {
|
|
18
|
-
return world.onRemove(traits.Name, (entity) => {
|
|
19
|
-
if (entity === selected)
|
|
20
|
-
selected = undefined;
|
|
21
|
-
if (entity === focused)
|
|
22
|
-
focused = undefined;
|
|
23
|
-
});
|
|
24
|
-
});
|
|
25
|
-
const selectedEntityContext = {
|
|
26
|
-
get current() {
|
|
27
|
-
return selected;
|
|
28
|
-
},
|
|
29
|
-
get instance() {
|
|
30
|
-
return selectedInstance;
|
|
31
|
-
},
|
|
32
|
-
set(entity, instance) {
|
|
33
|
-
selected = entity;
|
|
34
|
-
selectedInstance = instance;
|
|
35
|
-
},
|
|
36
|
-
};
|
|
37
|
-
setContext(selectedKey, selectedEntityContext);
|
|
38
|
-
const focusedEntityContext = {
|
|
39
|
-
get current() {
|
|
40
|
-
return focused;
|
|
41
|
-
},
|
|
42
|
-
get instance() {
|
|
43
|
-
return focusedInstance;
|
|
44
|
-
},
|
|
45
|
-
set(entity, instance) {
|
|
46
|
-
focused = entity;
|
|
47
|
-
focusedInstance = instance;
|
|
48
|
-
},
|
|
49
|
-
};
|
|
50
|
-
setContext(focusedKey, focusedEntityContext);
|
|
51
|
-
const focusedObject3d = $derived(focused ? scene.getObjectByName(focused)?.clone() : undefined);
|
|
52
|
-
$effect(() => {
|
|
53
|
-
const previousMode = untrack(() => environment.current.viewerMode);
|
|
54
|
-
if (focusedObject3d) {
|
|
55
|
-
environment.current.viewerMode = 'focus';
|
|
56
|
-
return () => {
|
|
57
|
-
environment.current.viewerMode = previousMode;
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
setContext(focusedObject3dKey, {
|
|
62
|
-
get current() {
|
|
63
|
-
return focusedObject3d;
|
|
64
|
-
},
|
|
65
|
-
});
|
|
66
|
-
return {
|
|
67
|
-
selection: selectedEntityContext,
|
|
68
|
-
focus: focusedEntityContext,
|
|
69
|
-
};
|
|
70
|
-
};
|
|
71
|
-
export const useFocusedEntity = () => {
|
|
72
|
-
return getContext(focusedKey);
|
|
73
|
-
};
|
|
74
|
-
export const useSelectedEntity = () => {
|
|
75
|
-
return getContext(selectedKey);
|
|
76
|
-
};
|
|
77
|
-
export const useFocusedObject3d = () => {
|
|
78
|
-
return getContext(focusedObject3dKey);
|
|
79
|
-
};
|
|
80
|
-
export const useSelectedObject3d = () => {
|
|
81
|
-
const selectedEntity = useSelectedEntity();
|
|
82
|
-
const { scene } = useThrelte();
|
|
83
|
-
const object = $derived.by(() => {
|
|
84
|
-
if (!selectedEntity.current) {
|
|
85
|
-
return;
|
|
86
|
-
}
|
|
87
|
-
return scene.getObjectByName(selectedEntity.current);
|
|
88
|
-
});
|
|
89
|
-
return {
|
|
90
|
-
get current() {
|
|
91
|
-
return object;
|
|
92
|
-
},
|
|
93
|
-
};
|
|
94
|
-
};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|