@wandelbots/wandelbots-js-react-components 1.3.1 → 1.3.2

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 (77) hide show
  1. package/package.json +18 -7
  2. package/src/components/3d-viewport/CoordinateSystemTransform.tsx +44 -0
  3. package/src/components/3d-viewport/PresetEnvironment.tsx +78 -0
  4. package/src/components/3d-viewport/SafetyZonesRenderer.tsx +54 -0
  5. package/src/components/LoadingButton.stories.tsx +61 -0
  6. package/src/components/LoadingButton.tsx +19 -0
  7. package/src/components/LoadingCover.tsx +75 -0
  8. package/src/components/ThemeSelect.tsx +49 -0
  9. package/src/components/VelocitySlider.stories.tsx +32 -0
  10. package/src/components/VelocitySlider.tsx +52 -0
  11. package/src/components/jogging/JoggingCartesianAxisControl.stories.tsx +41 -0
  12. package/src/components/jogging/JoggingCartesianAxisControl.tsx +127 -0
  13. package/src/components/jogging/JoggingCartesianTab.tsx +265 -0
  14. package/src/components/jogging/JoggingCartesianValues.tsx +45 -0
  15. package/src/components/jogging/JoggingFreedriveTab.tsx +9 -0
  16. package/src/components/jogging/JoggingJointLimitDetector.tsx +51 -0
  17. package/src/components/jogging/JoggingJointRotationControl.stories.tsx +38 -0
  18. package/src/components/jogging/JoggingJointRotationControl.tsx +197 -0
  19. package/src/components/jogging/JoggingJointTab.tsx +93 -0
  20. package/src/components/jogging/JoggingJointValues.tsx +45 -0
  21. package/src/components/jogging/JoggingOptions.tsx +96 -0
  22. package/src/components/jogging/JoggingPanel.stories.tsx +26 -0
  23. package/src/components/jogging/JoggingPanel.tsx +148 -0
  24. package/src/components/jogging/JoggingStore.tsx +294 -0
  25. package/src/components/jogging/JoggingVelocitySlider.tsx +56 -0
  26. package/src/components/robots/ABB_1200_07_7.tsx +123 -0
  27. package/src/components/robots/AxisConfig.ts +3 -0
  28. package/src/components/robots/DHRobot.tsx +129 -0
  29. package/src/components/robots/FANUC_ARC_Mate_100iD.tsx +187 -0
  30. package/src/components/robots/FANUC_ARC_Mate_120iD.tsx +187 -0
  31. package/src/components/robots/FANUC_CRX10iA.tsx +167 -0
  32. package/src/components/robots/FANUC_CRX25iA.tsx +167 -0
  33. package/src/components/robots/FANUC_CRX25iAL.tsx +178 -0
  34. package/src/components/robots/KUKA_KR210_R2700.tsx +291 -0
  35. package/src/components/robots/KUKA_KR270_R2700.tsx +244 -0
  36. package/src/components/robots/RobotAnimator.tsx +83 -0
  37. package/src/components/robots/SupportedRobot.tsx +131 -0
  38. package/src/components/robots/UniversalRobots_UR10.tsx +112 -0
  39. package/src/components/robots/UniversalRobots_UR10e.tsx +275 -0
  40. package/src/components/robots/UniversalRobots_UR3.tsx +112 -0
  41. package/src/components/robots/UniversalRobots_UR3e.tsx +112 -0
  42. package/src/components/robots/UniversalRobots_UR5.tsx +111 -0
  43. package/src/components/robots/UniversalRobots_UR5e.tsx +280 -0
  44. package/src/components/robots/Yaskawa_AR1440.tsx +152 -0
  45. package/src/components/robots/Yaskawa_AR1730.tsx +165 -0
  46. package/src/components/robots/Yaskawa_AR2010.tsx +159 -0
  47. package/src/components/robots/Yaskawa_AR3120.tsx +160 -0
  48. package/src/components/robots/Yaskawa_AR900.tsx +121 -0
  49. package/src/components/utils/converters.ts +23 -0
  50. package/src/components/utils/errorHandling.ts +30 -0
  51. package/src/components/utils/hooks.tsx +54 -0
  52. package/src/components/utils/robotTreeQuery.ts +27 -0
  53. package/src/components/wandelscript-editor/WandelscriptEditor.stories.tsx +45 -0
  54. package/src/components/wandelscript-editor/WandelscriptEditor.tsx +114 -0
  55. package/src/components/wandelscript-editor/wandelscript.tmLanguage.ts +62 -0
  56. package/src/declarations.d.ts +10 -0
  57. package/src/i18n/config.ts +27 -0
  58. package/src/i18n/locales/de/translations.json +12 -0
  59. package/src/i18n/locales/en/translations.json +12 -0
  60. package/src/icons/arrowForwardFilled.tsx +7 -0
  61. package/src/icons/axis-x.svg +3 -0
  62. package/src/icons/axis-y.svg +3 -0
  63. package/src/icons/axis-z.svg +3 -0
  64. package/src/icons/expandFilled.tsx +11 -0
  65. package/src/icons/home.tsx +12 -0
  66. package/src/icons/index.ts +6 -0
  67. package/src/icons/infoOutlined.tsx +10 -0
  68. package/src/icons/jogging.svg +3 -0
  69. package/src/icons/robot.svg +3 -0
  70. package/src/icons/robot.tsx +14 -0
  71. package/src/icons/rotation.svg +4 -0
  72. package/src/icons/wbLogo.tsx +21 -0
  73. package/src/index.ts +7 -0
  74. package/src/themes/color.tsx +74 -0
  75. package/src/themes/theme.ts +150 -0
  76. package/src/themes/wbTheme.stories.tsx +64 -0
  77. package/src/themes/wbTheme.ts +186 -0
@@ -0,0 +1,165 @@
1
+ import { useGLTF } from "@react-three/drei"
2
+ import type * as THREE from "three"
3
+ import type { RobotProps } from "./SupportedRobot"
4
+ import { animated } from "@react-spring/three"
5
+ import RobotAnimator from "./RobotAnimator"
6
+
7
+ export function Yaskawa_AR1730({ modelURL, connectedMotionGroup, ...props }: RobotProps) {
8
+ const gltf = useGLTF(modelURL) as any
9
+
10
+ const nodes = gltf.nodes
11
+ const materials = gltf.materials
12
+ const rotationOffsets = [0, -Math.PI / 2, 0, 0, 0, 0]
13
+ const rotationSign = [1, -1, 1, 1, 1, 1]
14
+
15
+ function setRotation(jointObjects: THREE.Object3D[], jointValues: number[]) {
16
+ jointObjects.forEach(
17
+ (object, index) =>
18
+ (object.rotation.y =
19
+ rotationSign[index]! * jointValues[index]! + rotationOffsets[index]!),
20
+ )
21
+ }
22
+
23
+ return (
24
+ <>
25
+ <RobotAnimator
26
+ connectedMotionGroup={connectedMotionGroup}
27
+ robotRootObjectName="Scene"
28
+ onRotationChanged={setRotation}
29
+ />
30
+ <group {...props} dispose={null}>
31
+ <group name="Scene">
32
+ <animated.group name="AR1730_J00">
33
+ <animated.group
34
+ name="AR1730_J01"
35
+ position={[0.15, 0, 0]}
36
+ rotation={[-Math.PI / 2, -Math.PI / 2, 0]}
37
+ >
38
+ <animated.group
39
+ name="AR1730_J02"
40
+ position={[0.76, 0, 0]}
41
+ rotation={[-Math.PI, 0, 0]}
42
+ >
43
+ <animated.group
44
+ name="AR1730_J03"
45
+ position={[0.2, 0, 0]}
46
+ rotation={[-Math.PI / 2, 0, 0]}
47
+ >
48
+ <animated.group
49
+ name="AR1730_J04"
50
+ position={[0, -0.795, 0]}
51
+ rotation={[Math.PI / 2, 0, 0]}
52
+ >
53
+ <animated.group
54
+ name="AR1730_J05"
55
+ rotation={[-Math.PI / 2, 0, 0]}
56
+ >
57
+ <group
58
+ name="AR1730_FLG"
59
+ position={[0, -0.1, 0]}
60
+ rotation={[-Math.PI, 0, 0]}
61
+ />
62
+ <mesh
63
+ name="AR1730_L06"
64
+ castShadow
65
+ receiveShadow
66
+ geometry={nodes.AR1730_L06.geometry}
67
+ material={materials.Metal}
68
+ rotation={[Math.PI / 2, -Math.PI / 2, 0]}
69
+ />
70
+ </animated.group>
71
+ <mesh
72
+ name="AR1730_L05"
73
+ castShadow
74
+ receiveShadow
75
+ geometry={nodes.AR1730_L05.geometry}
76
+ material={materials.Blue}
77
+ rotation={[Math.PI / 2, 0, Math.PI / 2]}
78
+ />
79
+ </animated.group>
80
+ <group
81
+ name="AR1730_L04"
82
+ position={[0, -0.302, 0]}
83
+ rotation={[0, 0, -Math.PI / 2]}
84
+ >
85
+ <mesh
86
+ name="_R_AXIS_SW0001002"
87
+ castShadow
88
+ receiveShadow
89
+ geometry={nodes._R_AXIS_SW0001002.geometry}
90
+ material={materials.Blue}
91
+ />
92
+ <mesh
93
+ name="_R_AXIS_SW0001002_1"
94
+ castShadow
95
+ receiveShadow
96
+ geometry={nodes._R_AXIS_SW0001002_1.geometry}
97
+ material={materials.White}
98
+ />
99
+ </group>
100
+ </animated.group>
101
+ <group
102
+ name="AR1730_L03"
103
+ rotation={[Math.PI / 2, 0, -Math.PI / 2]}
104
+ >
105
+ <mesh
106
+ name="_U_AXIS_SW0001002"
107
+ castShadow
108
+ receiveShadow
109
+ geometry={nodes._U_AXIS_SW0001002.geometry}
110
+ material={materials.Blue}
111
+ />
112
+ <mesh
113
+ name="_U_AXIS_SW0001002_1"
114
+ castShadow
115
+ receiveShadow
116
+ geometry={nodes._U_AXIS_SW0001002_1.geometry}
117
+ material={materials.Black}
118
+ />
119
+ </group>
120
+ </animated.group>
121
+ <mesh
122
+ name="AR1730_L02"
123
+ castShadow
124
+ receiveShadow
125
+ geometry={nodes.AR1730_L02.geometry}
126
+ material={materials.Blue}
127
+ position={[0, -0.157, 0]}
128
+ rotation={[-Math.PI, -1.571, 0]}
129
+ />
130
+ </animated.group>
131
+ <group
132
+ name="AR1730_L01"
133
+ position={[0, -0.336, 0]}
134
+ rotation={[Math.PI / 2, 0, -Math.PI / 2]}
135
+ >
136
+ <mesh
137
+ name="_S_AXIS_SW0001002"
138
+ castShadow
139
+ receiveShadow
140
+ geometry={nodes._S_AXIS_SW0001002.geometry}
141
+ material={materials.Blue}
142
+ />
143
+ <mesh
144
+ name="_S_AXIS_SW0001002_1"
145
+ castShadow
146
+ receiveShadow
147
+ geometry={nodes._S_AXIS_SW0001002_1.geometry}
148
+ material={materials.Black}
149
+ />
150
+ </group>
151
+ </animated.group>
152
+ <mesh
153
+ name="AR1730_L00"
154
+ castShadow
155
+ receiveShadow
156
+ geometry={nodes.AR1730_L00.geometry}
157
+ material={materials.Blue}
158
+ position={[0, -0.505, 0]}
159
+ rotation={[Math.PI / 2, 0, -Math.PI / 2]}
160
+ />
161
+ </group>
162
+ </group>
163
+ </>
164
+ )
165
+ }
@@ -0,0 +1,159 @@
1
+ import { useGLTF } from "@react-three/drei"
2
+ import type * as THREE from "three"
3
+ import type { RobotProps } from "./SupportedRobot"
4
+ import { animated } from "@react-spring/three"
5
+ import RobotAnimator from "./RobotAnimator"
6
+
7
+ export function Yaskawa_AR2010({ modelURL, connectedMotionGroup, ...props }: RobotProps) {
8
+ const gltf = useGLTF(modelURL) as any
9
+ const nodes = gltf.nodes
10
+ const materials = gltf.materials
11
+ const rotationOffsets = [0, -Math.PI / 2, 0, 0, 0, 0]
12
+ const rotationSign = [1, -1, 1, 1, 1, 1]
13
+
14
+ function setRotation(jointObjects: THREE.Object3D[], jointValues: number[]) {
15
+ jointObjects.forEach(
16
+ (object, index) =>
17
+ (object.rotation.y =
18
+ rotationSign[index]! * jointValues[index]! + rotationOffsets[index]!),
19
+ )
20
+ }
21
+
22
+ return (
23
+ <>
24
+ <RobotAnimator
25
+ connectedMotionGroup={connectedMotionGroup}
26
+ robotRootObjectName="Scene"
27
+ onRotationChanged={setRotation}
28
+ />
29
+ <group {...props} dispose={null}>
30
+ <group name="Scene">
31
+ <group name="AR2010" rotation={[Math.PI / 2, 0, 0]}>
32
+ <animated.group name="AR2010_J01" rotation={[-Math.PI / 2, 0, 0]}>
33
+ <animated.group
34
+ name="AR2010_J02"
35
+ position={[0.15, 0, 0]}
36
+ rotation={[Math.PI / 2, 0, Math.PI]}
37
+ >
38
+ <animated.group
39
+ name="AR2010_J03"
40
+ position={[0.76, 0, 0]}
41
+ rotation={[Math.PI, 0, 0]}
42
+ >
43
+ <animated.group
44
+ name="AR2010_J04"
45
+ position={[0.2, 0, 0]}
46
+ rotation={[-Math.PI / 2, 0, 0]}
47
+ >
48
+ <animated.group
49
+ name="AR2010_J05"
50
+ position={[0, -1.082, 0]}
51
+ rotation={[Math.PI / 2, 0, 0]}
52
+ >
53
+ <animated.group
54
+ name="AR2010_J06"
55
+ rotation={[-Math.PI / 2, 0, 0]}
56
+ >
57
+ <group
58
+ name="AR2010_FLG"
59
+ position={[0, -0.1, 0]}
60
+ rotation={[-Math.PI, 0, 0]}
61
+ ></group>
62
+ <group name="AR2010_L06">
63
+ <mesh
64
+ name="AR2010_06001"
65
+ castShadow
66
+ receiveShadow
67
+ geometry={nodes.AR2010_06001.geometry}
68
+ material={materials.yaskawaBlueMetall}
69
+ />
70
+ <mesh
71
+ name="AR2010_06001_1"
72
+ castShadow
73
+ receiveShadow
74
+ geometry={nodes.AR2010_06001_1.geometry}
75
+ material={materials.metall}
76
+ />
77
+ </group>
78
+ </animated.group>
79
+ <mesh
80
+ name="AR2010_L05"
81
+ castShadow
82
+ receiveShadow
83
+ geometry={nodes.AR2010_L05.geometry}
84
+ material={materials.yaskawaBlueMetall}
85
+ />
86
+ </animated.group>
87
+ <group name="AR2010_L04">
88
+ <mesh
89
+ name="AR2010_04001"
90
+ castShadow
91
+ receiveShadow
92
+ geometry={nodes.AR2010_04001.geometry}
93
+ material={materials.yaskawaBlueMetall}
94
+ />
95
+ <mesh
96
+ name="AR2010_04001_1"
97
+ castShadow
98
+ receiveShadow
99
+ geometry={nodes.AR2010_04001_1.geometry}
100
+ material={materials.white}
101
+ />
102
+ </group>
103
+ </animated.group>
104
+ <group name="AR2010_L03">
105
+ <mesh
106
+ name="AR2010_03001"
107
+ castShadow
108
+ receiveShadow
109
+ geometry={nodes.AR2010_03001.geometry}
110
+ material={materials.yaskawaBlueMetall}
111
+ />
112
+ <mesh
113
+ name="AR2010_03001_1"
114
+ castShadow
115
+ receiveShadow
116
+ geometry={nodes.AR2010_03001_1.geometry}
117
+ material={materials.blackMetall}
118
+ />
119
+ </group>
120
+ </animated.group>
121
+ <mesh
122
+ name="AR2010_L02"
123
+ castShadow
124
+ receiveShadow
125
+ geometry={nodes.AR2010_L02.geometry}
126
+ material={materials.yaskawaBlueMetall}
127
+ />
128
+ </animated.group>
129
+ <group name="AR2010_L01">
130
+ <mesh
131
+ name="AR2010_01001"
132
+ castShadow
133
+ receiveShadow
134
+ geometry={nodes.AR2010_01001.geometry}
135
+ material={materials.yaskawaBlueMetall}
136
+ />
137
+ <mesh
138
+ name="AR2010_01001_1"
139
+ castShadow
140
+ receiveShadow
141
+ geometry={nodes.AR2010_01001_1.geometry}
142
+ material={materials.blackMetall}
143
+ />
144
+ </group>
145
+ </animated.group>
146
+ <mesh
147
+ name="AR2010_L00"
148
+ castShadow
149
+ receiveShadow
150
+ geometry={nodes.AR2010_L00.geometry}
151
+ material={materials.yaskawaBlueMetall}
152
+ rotation={[-Math.PI / 2, 0, 0]}
153
+ />
154
+ </group>
155
+ </group>
156
+ </group>
157
+ </>
158
+ )
159
+ }
@@ -0,0 +1,160 @@
1
+ import { useGLTF } from "@react-three/drei"
2
+ import type * as THREE from "three"
3
+ import type { RobotProps } from "./SupportedRobot"
4
+ import RobotAnimator from "./RobotAnimator"
5
+ import { animated } from "@react-spring/three"
6
+
7
+ export function Yaskawa_AR3120({ modelURL, connectedMotionGroup, ...props }: RobotProps) {
8
+ const gltf = useGLTF(modelURL) as any
9
+
10
+ const nodes = gltf.nodes
11
+ const materials = gltf.materials
12
+ const rotationOffsets = [0, -Math.PI / 2, 0, 0, 0, 0]
13
+ const rotationSign = [1, -1, 1, 1, 1, 1]
14
+
15
+ function setRotation(jointObjects: THREE.Object3D[], jointValues: number[]) {
16
+ jointObjects.forEach(
17
+ (object, index) =>
18
+ (object.rotation.y =
19
+ rotationSign[index]! * jointValues[index]! + rotationOffsets[index]!),
20
+ )
21
+ }
22
+
23
+ return (
24
+ <>
25
+ <RobotAnimator
26
+ connectedMotionGroup={connectedMotionGroup}
27
+ robotRootObjectName="Scene"
28
+ onRotationChanged={setRotation}
29
+ />
30
+ <group {...props} dispose={null}>
31
+ <group name="Scene">
32
+ <animated.group name="AR3120_J00">
33
+ <animated.group
34
+ name="AR3120_J01"
35
+ position={[0.145, 0, 0]}
36
+ rotation={[-Math.PI / 2, -Math.PI / 2, 0]}
37
+ >
38
+ <animated.group
39
+ name="AR3120_J02"
40
+ position={[1.15, 0, 0]}
41
+ rotation={[-Math.PI, 0, 0]}
42
+ >
43
+ <animated.group
44
+ name="AR3120_J03"
45
+ position={[0.25, 0, 0]}
46
+ rotation={[-Math.PI / 2, 0, 0]}
47
+ >
48
+ <animated.group
49
+ name="AR3120_J04"
50
+ position={[0, -1.812, 0]}
51
+ rotation={[Math.PI / 2, 0, 0]}
52
+ >
53
+ <animated.group
54
+ name="AR3120_J05"
55
+ rotation={[-Math.PI / 2, 0, 0]}
56
+ >
57
+ <group
58
+ name="AR3120_FLG"
59
+ position={[0, -0.1, 0]}
60
+ rotation={[-Math.PI, 0, 0]}
61
+ />
62
+ <mesh
63
+ name="AR3120_L06"
64
+ castShadow
65
+ receiveShadow
66
+ geometry={nodes.AR3120_L06.geometry}
67
+ material={materials["Metal.001"]}
68
+ rotation={[Math.PI / 2, -Math.PI / 2, 0]}
69
+ />
70
+ </animated.group>
71
+ <mesh
72
+ name="AR3120_L05"
73
+ castShadow
74
+ receiveShadow
75
+ geometry={nodes.AR3120_L05.geometry}
76
+ material={materials["Blue.001"]}
77
+ rotation={[Math.PI / 2, 0, Math.PI / 2]}
78
+ />
79
+ </animated.group>
80
+ <group
81
+ name="AR3120_L04"
82
+ rotation={[Math.PI / 2, -Math.PI / 2, 0]}
83
+ >
84
+ <mesh
85
+ name="R_AXIS_GP20HL001"
86
+ castShadow
87
+ receiveShadow
88
+ geometry={nodes.R_AXIS_GP20HL001.geometry}
89
+ material={materials["Blue.001"]}
90
+ />
91
+ <mesh
92
+ name="R_AXIS_GP20HL001_1"
93
+ castShadow
94
+ receiveShadow
95
+ geometry={nodes.R_AXIS_GP20HL001_1.geometry}
96
+ material={materials["White.001"]}
97
+ />
98
+ </group>
99
+ </animated.group>
100
+ <group name="AR3120_L03" rotation={[Math.PI, 0, -Math.PI / 2]}>
101
+ <mesh
102
+ name="Mesh_3001"
103
+ castShadow
104
+ receiveShadow
105
+ geometry={nodes.Mesh_3001.geometry}
106
+ material={materials["Blue.001"]}
107
+ />
108
+ <mesh
109
+ name="Mesh_3001_1"
110
+ castShadow
111
+ receiveShadow
112
+ geometry={nodes.Mesh_3001_1.geometry}
113
+ material={materials["Black.001"]}
114
+ />
115
+ </group>
116
+ </animated.group>
117
+ <mesh
118
+ name="AR3120_L02"
119
+ castShadow
120
+ receiveShadow
121
+ geometry={nodes.AR3120_L02.geometry}
122
+ material={materials["Blue.001"]}
123
+ position={[0, -0.146, 0]}
124
+ rotation={[Math.PI, 0, 0]}
125
+ />
126
+ </animated.group>
127
+ <group
128
+ name="AR3120_L01"
129
+ position={[0, -0.228, 0]}
130
+ rotation={[0, -1.571, 0]}
131
+ >
132
+ <mesh
133
+ name="S_AXIS_GP20HL001"
134
+ castShadow
135
+ receiveShadow
136
+ geometry={nodes.S_AXIS_GP20HL001.geometry}
137
+ material={materials["Blue.001"]}
138
+ />
139
+ <mesh
140
+ name="S_AXIS_GP20HL001_1"
141
+ castShadow
142
+ receiveShadow
143
+ geometry={nodes.S_AXIS_GP20HL001_1.geometry}
144
+ material={materials["Black.001"]}
145
+ />
146
+ </group>
147
+ </animated.group>
148
+ <mesh
149
+ name="AR3120_L00"
150
+ castShadow
151
+ receiveShadow
152
+ geometry={nodes.AR3120_L00.geometry}
153
+ material={materials["Blue.001"]}
154
+ position={[0, -0.54, 0]}
155
+ />
156
+ </group>
157
+ </group>
158
+ </>
159
+ )
160
+ }
@@ -0,0 +1,121 @@
1
+ import { useGLTF } from "@react-three/drei"
2
+ import type * as THREE from "three"
3
+ import type { RobotProps } from "./SupportedRobot"
4
+ import { animated } from "@react-spring/three"
5
+ import RobotAnimator from "./RobotAnimator"
6
+
7
+ export function Yaskawa_AR900({ modelURL, connectedMotionGroup, ...props }: RobotProps) {
8
+ const gltf = useGLTF(modelURL) as any
9
+ const nodes = gltf.nodes
10
+ const materials = gltf.materials
11
+ const rotationOffsets = [0, -Math.PI / 2, 0, 0, 0, 0]
12
+
13
+ function setRotation(jointObjects: THREE.Object3D[], jointValues: number[]) {
14
+ jointObjects.forEach(
15
+ (object, index) =>
16
+ (object.rotation.y = jointValues[index]! + rotationOffsets[index]!),
17
+ )
18
+ }
19
+
20
+ return (
21
+ <>
22
+ <RobotAnimator
23
+ connectedMotionGroup={connectedMotionGroup}
24
+ robotRootObjectName="Scene"
25
+ onRotationChanged={setRotation}
26
+ />
27
+ <group {...props} dispose={null}>
28
+ <group name="Scene">
29
+ <group name="AR900" rotation={[Math.PI / 2, 0, 0]}>
30
+ <animated.group name="AR900_J01" rotation={[-Math.PI / 2, 0, 0]}>
31
+ <animated.group
32
+ name="AR900_J02"
33
+ position={[0.04, 0, 0]}
34
+ rotation={[-Math.PI / 2, -Math.PI / 2, 0]}
35
+ >
36
+ <animated.group
37
+ name="AR900_J03"
38
+ position={[0.445, 0, 0]}
39
+ rotation={[-Math.PI, 0, 0]}
40
+ >
41
+ <animated.group
42
+ name="AR900_J04"
43
+ position={[0.04, 0, 0]}
44
+ rotation={[-Math.PI / 2, 0, 0]}
45
+ >
46
+ <animated.group
47
+ name="AR900_J05"
48
+ position={[0, -0.44, 0]}
49
+ rotation={[Math.PI / 2, 0, 0]}
50
+ >
51
+ <animated.group
52
+ name="AR900_J06"
53
+ rotation={[-Math.PI / 2, 0, 0]}
54
+ >
55
+ <group
56
+ name="AR900_FLG"
57
+ position={[0, -0.08, 0]}
58
+ rotation={[-Math.PI, 0, 0]}
59
+ />
60
+ <mesh
61
+ name="AR900_L06"
62
+ castShadow
63
+ receiveShadow
64
+ geometry={nodes.AR900_L06.geometry}
65
+ material={materials["#BBA474.001"]}
66
+ />
67
+ </animated.group>
68
+ <mesh
69
+ name="AR900_L05"
70
+ castShadow
71
+ receiveShadow
72
+ geometry={nodes.AR900_L05.geometry}
73
+ material={materials["#0056b9.001"]}
74
+ />
75
+ </animated.group>
76
+ <mesh
77
+ name="AR900_L04"
78
+ castShadow
79
+ receiveShadow
80
+ geometry={nodes.AR900_L04.geometry}
81
+ material={materials["#0056b9.001"]}
82
+ />
83
+ </animated.group>
84
+ <mesh
85
+ name="AR900_L03"
86
+ castShadow
87
+ receiveShadow
88
+ geometry={nodes.AR900_L03.geometry}
89
+ material={materials["#0056b9.001"]}
90
+ />
91
+ </animated.group>
92
+ <mesh
93
+ name="AR900_L02"
94
+ castShadow
95
+ receiveShadow
96
+ geometry={nodes.AR900_L02.geometry}
97
+ material={materials["#0056b9.001"]}
98
+ />
99
+ </animated.group>
100
+ <mesh
101
+ name="AR900_L01"
102
+ castShadow
103
+ receiveShadow
104
+ geometry={nodes.AR900_L01.geometry}
105
+ material={materials["#0056b9.001"]}
106
+ />
107
+ </animated.group>
108
+ <mesh
109
+ name="AR900_L00"
110
+ castShadow
111
+ receiveShadow
112
+ geometry={nodes.AR900_L00.geometry}
113
+ material={materials["#0056b9.001"]}
114
+ rotation={[-Math.PI / 2, 0, 0]}
115
+ />
116
+ </group>
117
+ </group>
118
+ </group>
119
+ </>
120
+ )
121
+ }
@@ -0,0 +1,23 @@
1
+ export function radiansToDegree(radians: number): number {
2
+ return radians * (180 / Math.PI)
3
+ }
4
+
5
+ export function degreesToRadians(degrees: number): number {
6
+ return degrees * (Math.PI / 180)
7
+ }
8
+
9
+ export function tryParseJson(json: unknown): any {
10
+ try {
11
+ return JSON.parse(json as string)
12
+ } catch {
13
+ return undefined
14
+ }
15
+ }
16
+
17
+ export function tryStringifyJson(json: unknown): string | undefined {
18
+ try {
19
+ return JSON.stringify(json)
20
+ } catch {
21
+ return undefined
22
+ }
23
+ }
@@ -0,0 +1,30 @@
1
+ import { AxiosError } from "axios"
2
+ import { tryStringifyJson } from "./converters"
3
+
4
+ export function delay(ms: number) {
5
+ return new Promise((resolve) => setTimeout(resolve, ms))
6
+ }
7
+
8
+ export function makeShortErrorMessage(err: unknown) {
9
+ if (err instanceof AxiosError && err.code === "ERR_NETWORK") {
10
+ return "Failed to connect to the server. Please check your internet connection."
11
+ } else if (err instanceof AxiosError && err.response) {
12
+ return `${err.response?.status} ${err.response?.statusText}: ${JSON.stringify(err.response?.data)}`
13
+ } else if (err instanceof Error) {
14
+ return err.message
15
+ } else {
16
+ return `Unexpected error: ${err}`
17
+ }
18
+ }
19
+
20
+ export function makeErrorMessage(err: unknown) {
21
+ if (err instanceof AxiosError && err.code === "ERR_NETWORK") {
22
+ return "Failed to connect to the server. Please check your internet connection."
23
+ } else if (err instanceof AxiosError && err.response) {
24
+ return `${err.response?.status} ${err.response?.statusText} from ${err.response?.config.url}: ${JSON.stringify(err.response?.data)}`
25
+ } else if (err instanceof Error) {
26
+ return err.message
27
+ } else {
28
+ return `Unexpected error: ${tryStringifyJson(err) || err}`
29
+ }
30
+ }