@viamrobotics/motion-tools 1.34.4 → 1.34.6

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 (51) hide show
  1. package/dist/components/App.svelte +14 -2
  2. package/dist/components/App.svelte.d.ts +6 -2
  3. package/dist/components/AxesHelper.svelte +3 -1
  4. package/dist/components/AxesHelper.svelte.d.ts +1 -1
  5. package/dist/components/Entities/Arrows/Arrows.svelte +0 -9
  6. package/dist/components/Entities/AxesHelper.svelte +38 -0
  7. package/dist/components/Entities/AxesHelper.svelte.d.ts +8 -0
  8. package/dist/components/Entities/AxesHelpers.svelte +13 -0
  9. package/dist/{plugins/LLMSceneBuilder/AISettings.svelte.d.ts → components/Entities/AxesHelpers.svelte.d.ts} +6 -14
  10. package/dist/components/Entities/Boxes.svelte +290 -0
  11. package/dist/components/Entities/Boxes.svelte.d.ts +14 -0
  12. package/dist/components/Entities/Entities.svelte +10 -5
  13. package/dist/components/Entities/GLTF.svelte +0 -9
  14. package/dist/components/Entities/Line.svelte +0 -9
  15. package/dist/components/Entities/Mesh.svelte +5 -23
  16. package/dist/components/Entities/Points.svelte +1 -9
  17. package/dist/components/Entities/composeBoxMatrix.d.ts +12 -0
  18. package/dist/components/Entities/composeBoxMatrix.js +29 -0
  19. package/dist/components/Entities/hooks/useEntityEvents.svelte.d.ts +27 -0
  20. package/dist/components/Entities/hooks/useEntityEvents.svelte.js +87 -39
  21. package/dist/components/Scene.svelte +0 -1
  22. package/dist/components/Selected.svelte +14 -3
  23. package/dist/components/SelectedTransformControls.svelte +3 -5
  24. package/dist/components/overlay/Details.svelte +9 -4
  25. package/dist/hooks/plugins/bvh.svelte.js +9 -0
  26. package/dist/hooks/useConfigFrames.svelte.js +5 -3
  27. package/dist/hooks/useFragmentInfo.svelte.d.ts +24 -0
  28. package/dist/hooks/useFragmentInfo.svelte.js +86 -0
  29. package/dist/hooks/useFramelessComponents.svelte.js +3 -1
  30. package/dist/hooks/usePartConfig.svelte.d.ts +0 -6
  31. package/dist/hooks/usePartConfig.svelte.js +5 -60
  32. package/dist/index.d.ts +1 -0
  33. package/dist/index.js +1 -0
  34. package/dist/plugins/Focus/FocusBox.svelte +12 -1
  35. package/dist/plugins/LLMSceneBuilder/frameDeltaAdapter.d.ts +9 -2
  36. package/dist/plugins/LLMSceneBuilder/frameDeltaAdapter.js +65 -10
  37. package/dist/plugins/LLMSceneBuilder/useSceneBuilder.svelte.js +29 -5
  38. package/dist/plugins/Selection/Ellipse.svelte +9 -26
  39. package/dist/plugins/Selection/Ellipse.svelte.d.ts +2 -1
  40. package/dist/plugins/Selection/Lasso.svelte +9 -26
  41. package/dist/plugins/Selection/Lasso.svelte.d.ts +2 -1
  42. package/dist/plugins/Selection/SelectionTool.svelte +18 -3
  43. package/dist/plugins/Selection/SelectionTool.svelte.d.ts +2 -0
  44. package/dist/plugins/TopDownLock/TopDownLock.svelte +25 -0
  45. package/dist/plugins/TopDownLock/TopDownLock.svelte.d.ts +3 -0
  46. package/dist/plugins/index.d.ts +1 -0
  47. package/dist/plugins/index.js +1 -0
  48. package/dist/three/OBBHelper.d.ts +8 -1
  49. package/dist/three/OBBHelper.js +11 -1
  50. package/package.json +3 -2
  51. package/dist/plugins/LLMSceneBuilder/AISettings.svelte +0 -0
@@ -0,0 +1,25 @@
1
+ <script lang="ts">
2
+ import { useCameraControls } from '../../hooks/useControls.svelte'
3
+
4
+ const controls = useCameraControls()
5
+
6
+ $effect(() => {
7
+ if (!controls.current) return
8
+
9
+ const currentControls = controls.current
10
+
11
+ if ('minPolarAngle' in currentControls) {
12
+ const { minPolarAngle, maxPolarAngle } = currentControls
13
+
14
+ // Locks the camera to top down while this component is mounted
15
+ currentControls.polarAngle = 0
16
+ currentControls.minPolarAngle = 0
17
+ currentControls.maxPolarAngle = 0
18
+
19
+ return () => {
20
+ currentControls.minPolarAngle = minPolarAngle
21
+ currentControls.maxPolarAngle = maxPolarAngle
22
+ }
23
+ }
24
+ })
25
+ </script>
@@ -0,0 +1,3 @@
1
+ declare const TopDownLock: import("svelte").Component<Record<string, never>, {}, "">;
2
+ type TopDownLock = ReturnType<typeof TopDownLock>;
3
+ export default TopDownLock;
@@ -3,6 +3,7 @@ export * as selectionTraits from './Selection/traits';
3
3
  export * as selectionRelations from './Selection/relations';
4
4
  export { useSelectionPlugin } from './Selection/useSelectionPlugin.svelte';
5
5
  export { default as MeasureTool } from './MeasureTool/MeasureTool.svelte';
6
+ export { default as TopDownLock } from './TopDownLock/TopDownLock.svelte';
6
7
  export { default as DrawService } from './DrawService/DrawService.svelte';
7
8
  export { default as Skybox } from './Skybox/Skybox.svelte';
8
9
  export { default as Debug } from './Debug/Debug.svelte';
@@ -4,6 +4,7 @@ export * as selectionTraits from './Selection/traits';
4
4
  export * as selectionRelations from './Selection/relations';
5
5
  export { useSelectionPlugin } from './Selection/useSelectionPlugin.svelte';
6
6
  export { default as MeasureTool } from './MeasureTool/MeasureTool.svelte';
7
+ export { default as TopDownLock } from './TopDownLock/TopDownLock.svelte';
7
8
  // DrawService
8
9
  export { default as DrawService } from './DrawService/DrawService.svelte';
9
10
  // Skybox
@@ -1,7 +1,14 @@
1
- import { Object3D, Vector3 } from 'three';
1
+ import { Box3, Matrix4, Object3D, Vector3 } from 'three';
2
2
  import { LineSegments2 } from 'three/examples/jsm/lines/LineSegments2.js';
3
+ export declare const expandBoxByTransformedBox: (box: Box3, childBox: Box3, matrix: Matrix4) => void;
3
4
  export declare class OBBHelper extends LineSegments2 {
4
5
  constructor(color?: number, linewidth?: number);
6
+ /**
7
+ * Drive the helper with a composed world transform whose scale holds the
8
+ * box extents in meters — the helper's unit-box edges span ±0.5, so the
9
+ * matrix maps them onto the box's faces directly.
10
+ */
11
+ setFromMatrix4(matrix: Matrix4): this;
5
12
  setFromOBB(obb: {
6
13
  center: Vector3;
7
14
  halfSize: Vector3;
@@ -22,7 +22,7 @@ const corners = [
22
22
  new Vector3(),
23
23
  new Vector3(),
24
24
  ];
25
- const expandBoxByTransformedBox = (box, childBox, matrix) => {
25
+ export const expandBoxByTransformedBox = (box, childBox, matrix) => {
26
26
  const min = childBox.min;
27
27
  const max = childBox.max;
28
28
  corners[0].set(min.x, min.y, min.z).applyMatrix4(matrix);
@@ -58,6 +58,16 @@ export class OBBHelper extends LineSegments2 {
58
58
  this.frustumCulled = false;
59
59
  this.renderOrder = 999;
60
60
  }
61
+ /**
62
+ * Drive the helper with a composed world transform whose scale holds the
63
+ * box extents in meters — the helper's unit-box edges span ±0.5, so the
64
+ * matrix maps them onto the box's faces directly.
65
+ */
66
+ setFromMatrix4(matrix) {
67
+ this.matrix.copy(matrix);
68
+ this.matrixWorld.copy(this.matrix);
69
+ return this;
70
+ }
61
71
  setFromOBB(obb) {
62
72
  basis.setFromMatrix3(obb.rotation);
63
73
  quaternion.setFromRotationMatrix(basis);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@viamrobotics/motion-tools",
3
- "version": "1.34.4",
3
+ "version": "1.34.6",
4
4
  "description": "Motion visualization with Viam",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -29,8 +29,9 @@
29
29
  "@testing-library/jest-dom": "6.8.0",
30
30
  "@testing-library/svelte": "5.2.8",
31
31
  "@testing-library/user-event": "^14.6.1",
32
+ "@three.ez/instanced-mesh": "^0.3.15",
32
33
  "@threlte/core": "8.5.14",
33
- "@threlte/extras": "9.17.0",
34
+ "@threlte/extras": "9.21.0",
34
35
  "@threlte/rapier": "3.4.1",
35
36
  "@threlte/xr": "1.6.0",
36
37
  "@types/bun": "1.2.21",
File without changes