@wandelbots/wandelbots-js-react-components 1.3.1 → 1.4.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.
Files changed (78) hide show
  1. package/package.json +18 -8
  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 +55 -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 +127 -0
  27. package/src/components/robots/AxisConfig.ts +3 -0
  28. package/src/components/robots/DHRobot.tsx +128 -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 +171 -0
  32. package/src/components/robots/FANUC_CRX25iA.tsx +171 -0
  33. package/src/components/robots/FANUC_CRX25iAL.tsx +182 -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/Robot.tsx +42 -0
  37. package/src/components/robots/RobotAnimator.tsx +82 -0
  38. package/src/components/robots/SupportedRobot.tsx +144 -0
  39. package/src/components/robots/UniversalRobots_UR10.tsx +112 -0
  40. package/src/components/robots/UniversalRobots_UR10e.tsx +275 -0
  41. package/src/components/robots/UniversalRobots_UR3.tsx +112 -0
  42. package/src/components/robots/UniversalRobots_UR3e.tsx +112 -0
  43. package/src/components/robots/UniversalRobots_UR5.tsx +111 -0
  44. package/src/components/robots/UniversalRobots_UR5e.tsx +280 -0
  45. package/src/components/robots/Yaskawa_AR1440.tsx +156 -0
  46. package/src/components/robots/Yaskawa_AR1730.tsx +169 -0
  47. package/src/components/robots/Yaskawa_AR2010.tsx +163 -0
  48. package/src/components/robots/Yaskawa_AR3120.tsx +164 -0
  49. package/src/components/robots/Yaskawa_AR900.tsx +125 -0
  50. package/src/components/utils/converters.ts +23 -0
  51. package/src/components/utils/errorHandling.ts +30 -0
  52. package/src/components/utils/hooks.tsx +54 -0
  53. package/src/components/utils/robotTreeQuery.ts +27 -0
  54. package/src/components/wandelscript-editor/WandelscriptEditor.stories.tsx +45 -0
  55. package/src/components/wandelscript-editor/WandelscriptEditor.tsx +114 -0
  56. package/src/components/wandelscript-editor/wandelscript.tmLanguage.ts +62 -0
  57. package/src/declarations.d.ts +10 -0
  58. package/src/i18n/config.ts +27 -0
  59. package/src/i18n/locales/de/translations.json +12 -0
  60. package/src/i18n/locales/en/translations.json +12 -0
  61. package/src/icons/arrowForwardFilled.tsx +7 -0
  62. package/src/icons/axis-x.svg +3 -0
  63. package/src/icons/axis-y.svg +3 -0
  64. package/src/icons/axis-z.svg +3 -0
  65. package/src/icons/expandFilled.tsx +11 -0
  66. package/src/icons/home.tsx +12 -0
  67. package/src/icons/index.ts +6 -0
  68. package/src/icons/infoOutlined.tsx +10 -0
  69. package/src/icons/jogging.svg +3 -0
  70. package/src/icons/robot.svg +3 -0
  71. package/src/icons/robot.tsx +14 -0
  72. package/src/icons/rotation.svg +4 -0
  73. package/src/icons/wbLogo.tsx +21 -0
  74. package/src/index.ts +8 -0
  75. package/src/themes/color.tsx +74 -0
  76. package/src/themes/theme.ts +150 -0
  77. package/src/themes/wbTheme.stories.tsx +64 -0
  78. package/src/themes/wbTheme.ts +186 -0
@@ -0,0 +1,169 @@
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({
8
+ modelURL,
9
+ rapidlyChangingMotionState,
10
+ ...props
11
+ }: RobotProps) {
12
+ const gltf = useGLTF(modelURL) as any
13
+
14
+ const nodes = gltf.nodes
15
+ const materials = gltf.materials
16
+ const rotationOffsets = [0, -Math.PI / 2, 0, 0, 0, 0]
17
+ const rotationSign = [1, -1, 1, 1, 1, 1]
18
+
19
+ function setRotation(jointObjects: THREE.Object3D[], jointValues: number[]) {
20
+ jointObjects.forEach(
21
+ (object, index) =>
22
+ (object.rotation.y =
23
+ rotationSign[index]! * jointValues[index]! + rotationOffsets[index]!),
24
+ )
25
+ }
26
+
27
+ return (
28
+ <>
29
+ <RobotAnimator
30
+ rapidlyChangingMotionState={rapidlyChangingMotionState}
31
+ robotRootObjectName="Scene"
32
+ onRotationChanged={setRotation}
33
+ />
34
+ <group {...props} dispose={null}>
35
+ <group name="Scene">
36
+ <animated.group name="AR1730_J00">
37
+ <animated.group
38
+ name="AR1730_J01"
39
+ position={[0.15, 0, 0]}
40
+ rotation={[-Math.PI / 2, -Math.PI / 2, 0]}
41
+ >
42
+ <animated.group
43
+ name="AR1730_J02"
44
+ position={[0.76, 0, 0]}
45
+ rotation={[-Math.PI, 0, 0]}
46
+ >
47
+ <animated.group
48
+ name="AR1730_J03"
49
+ position={[0.2, 0, 0]}
50
+ rotation={[-Math.PI / 2, 0, 0]}
51
+ >
52
+ <animated.group
53
+ name="AR1730_J04"
54
+ position={[0, -0.795, 0]}
55
+ rotation={[Math.PI / 2, 0, 0]}
56
+ >
57
+ <animated.group
58
+ name="AR1730_J05"
59
+ rotation={[-Math.PI / 2, 0, 0]}
60
+ >
61
+ <group
62
+ name="AR1730_FLG"
63
+ position={[0, -0.1, 0]}
64
+ rotation={[-Math.PI, 0, 0]}
65
+ />
66
+ <mesh
67
+ name="AR1730_L06"
68
+ castShadow
69
+ receiveShadow
70
+ geometry={nodes.AR1730_L06.geometry}
71
+ material={materials.Metal}
72
+ rotation={[Math.PI / 2, -Math.PI / 2, 0]}
73
+ />
74
+ </animated.group>
75
+ <mesh
76
+ name="AR1730_L05"
77
+ castShadow
78
+ receiveShadow
79
+ geometry={nodes.AR1730_L05.geometry}
80
+ material={materials.Blue}
81
+ rotation={[Math.PI / 2, 0, Math.PI / 2]}
82
+ />
83
+ </animated.group>
84
+ <group
85
+ name="AR1730_L04"
86
+ position={[0, -0.302, 0]}
87
+ rotation={[0, 0, -Math.PI / 2]}
88
+ >
89
+ <mesh
90
+ name="_R_AXIS_SW0001002"
91
+ castShadow
92
+ receiveShadow
93
+ geometry={nodes._R_AXIS_SW0001002.geometry}
94
+ material={materials.Blue}
95
+ />
96
+ <mesh
97
+ name="_R_AXIS_SW0001002_1"
98
+ castShadow
99
+ receiveShadow
100
+ geometry={nodes._R_AXIS_SW0001002_1.geometry}
101
+ material={materials.White}
102
+ />
103
+ </group>
104
+ </animated.group>
105
+ <group
106
+ name="AR1730_L03"
107
+ rotation={[Math.PI / 2, 0, -Math.PI / 2]}
108
+ >
109
+ <mesh
110
+ name="_U_AXIS_SW0001002"
111
+ castShadow
112
+ receiveShadow
113
+ geometry={nodes._U_AXIS_SW0001002.geometry}
114
+ material={materials.Blue}
115
+ />
116
+ <mesh
117
+ name="_U_AXIS_SW0001002_1"
118
+ castShadow
119
+ receiveShadow
120
+ geometry={nodes._U_AXIS_SW0001002_1.geometry}
121
+ material={materials.Black}
122
+ />
123
+ </group>
124
+ </animated.group>
125
+ <mesh
126
+ name="AR1730_L02"
127
+ castShadow
128
+ receiveShadow
129
+ geometry={nodes.AR1730_L02.geometry}
130
+ material={materials.Blue}
131
+ position={[0, -0.157, 0]}
132
+ rotation={[-Math.PI, -1.571, 0]}
133
+ />
134
+ </animated.group>
135
+ <group
136
+ name="AR1730_L01"
137
+ position={[0, -0.336, 0]}
138
+ rotation={[Math.PI / 2, 0, -Math.PI / 2]}
139
+ >
140
+ <mesh
141
+ name="_S_AXIS_SW0001002"
142
+ castShadow
143
+ receiveShadow
144
+ geometry={nodes._S_AXIS_SW0001002.geometry}
145
+ material={materials.Blue}
146
+ />
147
+ <mesh
148
+ name="_S_AXIS_SW0001002_1"
149
+ castShadow
150
+ receiveShadow
151
+ geometry={nodes._S_AXIS_SW0001002_1.geometry}
152
+ material={materials.Black}
153
+ />
154
+ </group>
155
+ </animated.group>
156
+ <mesh
157
+ name="AR1730_L00"
158
+ castShadow
159
+ receiveShadow
160
+ geometry={nodes.AR1730_L00.geometry}
161
+ material={materials.Blue}
162
+ position={[0, -0.505, 0]}
163
+ rotation={[Math.PI / 2, 0, -Math.PI / 2]}
164
+ />
165
+ </group>
166
+ </group>
167
+ </>
168
+ )
169
+ }
@@ -0,0 +1,163 @@
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({
8
+ modelURL,
9
+ rapidlyChangingMotionState,
10
+ ...props
11
+ }: RobotProps) {
12
+ const gltf = useGLTF(modelURL) as any
13
+ const nodes = gltf.nodes
14
+ const materials = gltf.materials
15
+ const rotationOffsets = [0, -Math.PI / 2, 0, 0, 0, 0]
16
+ const rotationSign = [1, -1, 1, 1, 1, 1]
17
+
18
+ function setRotation(jointObjects: THREE.Object3D[], jointValues: number[]) {
19
+ jointObjects.forEach(
20
+ (object, index) =>
21
+ (object.rotation.y =
22
+ rotationSign[index]! * jointValues[index]! + rotationOffsets[index]!),
23
+ )
24
+ }
25
+
26
+ return (
27
+ <>
28
+ <RobotAnimator
29
+ rapidlyChangingMotionState={rapidlyChangingMotionState}
30
+ robotRootObjectName="Scene"
31
+ onRotationChanged={setRotation}
32
+ />
33
+ <group {...props} dispose={null}>
34
+ <group name="Scene">
35
+ <group name="AR2010" rotation={[Math.PI / 2, 0, 0]}>
36
+ <animated.group name="AR2010_J01" rotation={[-Math.PI / 2, 0, 0]}>
37
+ <animated.group
38
+ name="AR2010_J02"
39
+ position={[0.15, 0, 0]}
40
+ rotation={[Math.PI / 2, 0, Math.PI]}
41
+ >
42
+ <animated.group
43
+ name="AR2010_J03"
44
+ position={[0.76, 0, 0]}
45
+ rotation={[Math.PI, 0, 0]}
46
+ >
47
+ <animated.group
48
+ name="AR2010_J04"
49
+ position={[0.2, 0, 0]}
50
+ rotation={[-Math.PI / 2, 0, 0]}
51
+ >
52
+ <animated.group
53
+ name="AR2010_J05"
54
+ position={[0, -1.082, 0]}
55
+ rotation={[Math.PI / 2, 0, 0]}
56
+ >
57
+ <animated.group
58
+ name="AR2010_J06"
59
+ rotation={[-Math.PI / 2, 0, 0]}
60
+ >
61
+ <group
62
+ name="AR2010_FLG"
63
+ position={[0, -0.1, 0]}
64
+ rotation={[-Math.PI, 0, 0]}
65
+ ></group>
66
+ <group name="AR2010_L06">
67
+ <mesh
68
+ name="AR2010_06001"
69
+ castShadow
70
+ receiveShadow
71
+ geometry={nodes.AR2010_06001.geometry}
72
+ material={materials.yaskawaBlueMetall}
73
+ />
74
+ <mesh
75
+ name="AR2010_06001_1"
76
+ castShadow
77
+ receiveShadow
78
+ geometry={nodes.AR2010_06001_1.geometry}
79
+ material={materials.metall}
80
+ />
81
+ </group>
82
+ </animated.group>
83
+ <mesh
84
+ name="AR2010_L05"
85
+ castShadow
86
+ receiveShadow
87
+ geometry={nodes.AR2010_L05.geometry}
88
+ material={materials.yaskawaBlueMetall}
89
+ />
90
+ </animated.group>
91
+ <group name="AR2010_L04">
92
+ <mesh
93
+ name="AR2010_04001"
94
+ castShadow
95
+ receiveShadow
96
+ geometry={nodes.AR2010_04001.geometry}
97
+ material={materials.yaskawaBlueMetall}
98
+ />
99
+ <mesh
100
+ name="AR2010_04001_1"
101
+ castShadow
102
+ receiveShadow
103
+ geometry={nodes.AR2010_04001_1.geometry}
104
+ material={materials.white}
105
+ />
106
+ </group>
107
+ </animated.group>
108
+ <group name="AR2010_L03">
109
+ <mesh
110
+ name="AR2010_03001"
111
+ castShadow
112
+ receiveShadow
113
+ geometry={nodes.AR2010_03001.geometry}
114
+ material={materials.yaskawaBlueMetall}
115
+ />
116
+ <mesh
117
+ name="AR2010_03001_1"
118
+ castShadow
119
+ receiveShadow
120
+ geometry={nodes.AR2010_03001_1.geometry}
121
+ material={materials.blackMetall}
122
+ />
123
+ </group>
124
+ </animated.group>
125
+ <mesh
126
+ name="AR2010_L02"
127
+ castShadow
128
+ receiveShadow
129
+ geometry={nodes.AR2010_L02.geometry}
130
+ material={materials.yaskawaBlueMetall}
131
+ />
132
+ </animated.group>
133
+ <group name="AR2010_L01">
134
+ <mesh
135
+ name="AR2010_01001"
136
+ castShadow
137
+ receiveShadow
138
+ geometry={nodes.AR2010_01001.geometry}
139
+ material={materials.yaskawaBlueMetall}
140
+ />
141
+ <mesh
142
+ name="AR2010_01001_1"
143
+ castShadow
144
+ receiveShadow
145
+ geometry={nodes.AR2010_01001_1.geometry}
146
+ material={materials.blackMetall}
147
+ />
148
+ </group>
149
+ </animated.group>
150
+ <mesh
151
+ name="AR2010_L00"
152
+ castShadow
153
+ receiveShadow
154
+ geometry={nodes.AR2010_L00.geometry}
155
+ material={materials.yaskawaBlueMetall}
156
+ rotation={[-Math.PI / 2, 0, 0]}
157
+ />
158
+ </group>
159
+ </group>
160
+ </group>
161
+ </>
162
+ )
163
+ }
@@ -0,0 +1,164 @@
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({
8
+ modelURL,
9
+ rapidlyChangingMotionState,
10
+ ...props
11
+ }: RobotProps) {
12
+ const gltf = useGLTF(modelURL) as any
13
+
14
+ const nodes = gltf.nodes
15
+ const materials = gltf.materials
16
+ const rotationOffsets = [0, -Math.PI / 2, 0, 0, 0, 0]
17
+ const rotationSign = [1, -1, 1, 1, 1, 1]
18
+
19
+ function setRotation(jointObjects: THREE.Object3D[], jointValues: number[]) {
20
+ jointObjects.forEach(
21
+ (object, index) =>
22
+ (object.rotation.y =
23
+ rotationSign[index]! * jointValues[index]! + rotationOffsets[index]!),
24
+ )
25
+ }
26
+
27
+ return (
28
+ <>
29
+ <RobotAnimator
30
+ rapidlyChangingMotionState={rapidlyChangingMotionState}
31
+ robotRootObjectName="Scene"
32
+ onRotationChanged={setRotation}
33
+ />
34
+ <group {...props} dispose={null}>
35
+ <group name="Scene">
36
+ <animated.group name="AR3120_J00">
37
+ <animated.group
38
+ name="AR3120_J01"
39
+ position={[0.145, 0, 0]}
40
+ rotation={[-Math.PI / 2, -Math.PI / 2, 0]}
41
+ >
42
+ <animated.group
43
+ name="AR3120_J02"
44
+ position={[1.15, 0, 0]}
45
+ rotation={[-Math.PI, 0, 0]}
46
+ >
47
+ <animated.group
48
+ name="AR3120_J03"
49
+ position={[0.25, 0, 0]}
50
+ rotation={[-Math.PI / 2, 0, 0]}
51
+ >
52
+ <animated.group
53
+ name="AR3120_J04"
54
+ position={[0, -1.812, 0]}
55
+ rotation={[Math.PI / 2, 0, 0]}
56
+ >
57
+ <animated.group
58
+ name="AR3120_J05"
59
+ rotation={[-Math.PI / 2, 0, 0]}
60
+ >
61
+ <group
62
+ name="AR3120_FLG"
63
+ position={[0, -0.1, 0]}
64
+ rotation={[-Math.PI, 0, 0]}
65
+ />
66
+ <mesh
67
+ name="AR3120_L06"
68
+ castShadow
69
+ receiveShadow
70
+ geometry={nodes.AR3120_L06.geometry}
71
+ material={materials["Metal.001"]}
72
+ rotation={[Math.PI / 2, -Math.PI / 2, 0]}
73
+ />
74
+ </animated.group>
75
+ <mesh
76
+ name="AR3120_L05"
77
+ castShadow
78
+ receiveShadow
79
+ geometry={nodes.AR3120_L05.geometry}
80
+ material={materials["Blue.001"]}
81
+ rotation={[Math.PI / 2, 0, Math.PI / 2]}
82
+ />
83
+ </animated.group>
84
+ <group
85
+ name="AR3120_L04"
86
+ rotation={[Math.PI / 2, -Math.PI / 2, 0]}
87
+ >
88
+ <mesh
89
+ name="R_AXIS_GP20HL001"
90
+ castShadow
91
+ receiveShadow
92
+ geometry={nodes.R_AXIS_GP20HL001.geometry}
93
+ material={materials["Blue.001"]}
94
+ />
95
+ <mesh
96
+ name="R_AXIS_GP20HL001_1"
97
+ castShadow
98
+ receiveShadow
99
+ geometry={nodes.R_AXIS_GP20HL001_1.geometry}
100
+ material={materials["White.001"]}
101
+ />
102
+ </group>
103
+ </animated.group>
104
+ <group name="AR3120_L03" rotation={[Math.PI, 0, -Math.PI / 2]}>
105
+ <mesh
106
+ name="Mesh_3001"
107
+ castShadow
108
+ receiveShadow
109
+ geometry={nodes.Mesh_3001.geometry}
110
+ material={materials["Blue.001"]}
111
+ />
112
+ <mesh
113
+ name="Mesh_3001_1"
114
+ castShadow
115
+ receiveShadow
116
+ geometry={nodes.Mesh_3001_1.geometry}
117
+ material={materials["Black.001"]}
118
+ />
119
+ </group>
120
+ </animated.group>
121
+ <mesh
122
+ name="AR3120_L02"
123
+ castShadow
124
+ receiveShadow
125
+ geometry={nodes.AR3120_L02.geometry}
126
+ material={materials["Blue.001"]}
127
+ position={[0, -0.146, 0]}
128
+ rotation={[Math.PI, 0, 0]}
129
+ />
130
+ </animated.group>
131
+ <group
132
+ name="AR3120_L01"
133
+ position={[0, -0.228, 0]}
134
+ rotation={[0, -1.571, 0]}
135
+ >
136
+ <mesh
137
+ name="S_AXIS_GP20HL001"
138
+ castShadow
139
+ receiveShadow
140
+ geometry={nodes.S_AXIS_GP20HL001.geometry}
141
+ material={materials["Blue.001"]}
142
+ />
143
+ <mesh
144
+ name="S_AXIS_GP20HL001_1"
145
+ castShadow
146
+ receiveShadow
147
+ geometry={nodes.S_AXIS_GP20HL001_1.geometry}
148
+ material={materials["Black.001"]}
149
+ />
150
+ </group>
151
+ </animated.group>
152
+ <mesh
153
+ name="AR3120_L00"
154
+ castShadow
155
+ receiveShadow
156
+ geometry={nodes.AR3120_L00.geometry}
157
+ material={materials["Blue.001"]}
158
+ position={[0, -0.54, 0]}
159
+ />
160
+ </group>
161
+ </group>
162
+ </>
163
+ )
164
+ }
@@ -0,0 +1,125 @@
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({
8
+ modelURL,
9
+ rapidlyChangingMotionState,
10
+ ...props
11
+ }: RobotProps) {
12
+ const gltf = useGLTF(modelURL) as any
13
+ const nodes = gltf.nodes
14
+ const materials = gltf.materials
15
+ const rotationOffsets = [0, -Math.PI / 2, 0, 0, 0, 0]
16
+
17
+ function setRotation(jointObjects: THREE.Object3D[], jointValues: number[]) {
18
+ jointObjects.forEach(
19
+ (object, index) =>
20
+ (object.rotation.y = jointValues[index]! + rotationOffsets[index]!),
21
+ )
22
+ }
23
+
24
+ return (
25
+ <>
26
+ <RobotAnimator
27
+ rapidlyChangingMotionState={rapidlyChangingMotionState}
28
+ robotRootObjectName="Scene"
29
+ onRotationChanged={setRotation}
30
+ />
31
+ <group {...props} dispose={null}>
32
+ <group name="Scene">
33
+ <group name="AR900" rotation={[Math.PI / 2, 0, 0]}>
34
+ <animated.group name="AR900_J01" rotation={[-Math.PI / 2, 0, 0]}>
35
+ <animated.group
36
+ name="AR900_J02"
37
+ position={[0.04, 0, 0]}
38
+ rotation={[-Math.PI / 2, -Math.PI / 2, 0]}
39
+ >
40
+ <animated.group
41
+ name="AR900_J03"
42
+ position={[0.445, 0, 0]}
43
+ rotation={[-Math.PI, 0, 0]}
44
+ >
45
+ <animated.group
46
+ name="AR900_J04"
47
+ position={[0.04, 0, 0]}
48
+ rotation={[-Math.PI / 2, 0, 0]}
49
+ >
50
+ <animated.group
51
+ name="AR900_J05"
52
+ position={[0, -0.44, 0]}
53
+ rotation={[Math.PI / 2, 0, 0]}
54
+ >
55
+ <animated.group
56
+ name="AR900_J06"
57
+ rotation={[-Math.PI / 2, 0, 0]}
58
+ >
59
+ <group
60
+ name="AR900_FLG"
61
+ position={[0, -0.08, 0]}
62
+ rotation={[-Math.PI, 0, 0]}
63
+ />
64
+ <mesh
65
+ name="AR900_L06"
66
+ castShadow
67
+ receiveShadow
68
+ geometry={nodes.AR900_L06.geometry}
69
+ material={materials["#BBA474.001"]}
70
+ />
71
+ </animated.group>
72
+ <mesh
73
+ name="AR900_L05"
74
+ castShadow
75
+ receiveShadow
76
+ geometry={nodes.AR900_L05.geometry}
77
+ material={materials["#0056b9.001"]}
78
+ />
79
+ </animated.group>
80
+ <mesh
81
+ name="AR900_L04"
82
+ castShadow
83
+ receiveShadow
84
+ geometry={nodes.AR900_L04.geometry}
85
+ material={materials["#0056b9.001"]}
86
+ />
87
+ </animated.group>
88
+ <mesh
89
+ name="AR900_L03"
90
+ castShadow
91
+ receiveShadow
92
+ geometry={nodes.AR900_L03.geometry}
93
+ material={materials["#0056b9.001"]}
94
+ />
95
+ </animated.group>
96
+ <mesh
97
+ name="AR900_L02"
98
+ castShadow
99
+ receiveShadow
100
+ geometry={nodes.AR900_L02.geometry}
101
+ material={materials["#0056b9.001"]}
102
+ />
103
+ </animated.group>
104
+ <mesh
105
+ name="AR900_L01"
106
+ castShadow
107
+ receiveShadow
108
+ geometry={nodes.AR900_L01.geometry}
109
+ material={materials["#0056b9.001"]}
110
+ />
111
+ </animated.group>
112
+ <mesh
113
+ name="AR900_L00"
114
+ castShadow
115
+ receiveShadow
116
+ geometry={nodes.AR900_L00.geometry}
117
+ material={materials["#0056b9.001"]}
118
+ rotation={[-Math.PI / 2, 0, 0]}
119
+ />
120
+ </group>
121
+ </group>
122
+ </group>
123
+ </>
124
+ )
125
+ }
@@ -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
+ }