@wandelbots/wandelbots-js-react-components 1.4.3 → 1.5.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/README.md +43 -8
- package/dist/components/robots/Robot.d.ts +2 -1
- package/dist/components/robots/Robot.d.ts.map +1 -1
- package/dist/components/robots/SupportedRobot.d.ts +2 -1
- package/dist/components/robots/SupportedRobot.d.ts.map +1 -1
- package/dist/icons/robot.d.ts.map +1 -1
- package/dist/index.cjs +29 -29
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2082 -2053
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/robots/Robot.tsx +3 -0
- package/src/components/robots/SupportedRobot.tsx +64 -7
- package/src/icons/robot.tsx +8 -4
package/README.md
CHANGED
|
@@ -28,7 +28,7 @@ import { WandelscriptEditor, ... } from '@wandelbots/wandelbots-js-react-compone
|
|
|
28
28
|
</ul>
|
|
29
29
|
<li><a href="#viewport">3D Viewport</a></li>
|
|
30
30
|
<ul>
|
|
31
|
-
<li><a href="#
|
|
31
|
+
<li><a href="#robot">Robot</a></li>
|
|
32
32
|
<li><a href="#lightning">Lightning</a></li>
|
|
33
33
|
<li><a href="#safety">Safety Zones</a></li>
|
|
34
34
|
</ul>
|
|
@@ -56,27 +56,62 @@ type WandelscriptEditorProps = {
|
|
|
56
56
|
|
|
57
57
|
### Viewport
|
|
58
58
|
|
|
59
|
-
####
|
|
59
|
+
#### Robot
|
|
60
60
|
|
|
61
|
-
This `
|
|
61
|
+
This `Robot` component adds the robot to the 3D viewport. Use it together with the `connectedMotionGroup` from `@wandelbots/wandelbots-js`.
|
|
62
62
|
|
|
63
63
|
```tsx
|
|
64
|
-
<
|
|
64
|
+
<Robot connectedMotionGroup={connectedMotionGroup} />
|
|
65
65
|
```
|
|
66
66
|
|
|
67
67
|
The robot model are loaded from the [jsdelivr CDN](https://cdn.jsdelivr.net/gh/wandelbotsgmbh/wandelbots-js-react-components/public/models/).
|
|
68
68
|
|
|
69
|
-
In case you want to use the application offline, you can download the models and host them locally. You can override the URL resolver of the `
|
|
69
|
+
In case you want to use the application offline, you can download the models and host them locally. You can override the URL resolver of the `Robot` component by passing a `getModel` function like:
|
|
70
|
+
|
|
71
|
+
```tsx
|
|
72
|
+
<Robot
|
|
73
|
+
getModel={() =>
|
|
74
|
+
`public/${connectedMotionGroup.modelFromController}.glb`
|
|
75
|
+
}
|
|
76
|
+
connectedMotionGroup={connectedMotionGroup}
|
|
77
|
+
/>
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
```tsx
|
|
81
|
+
export type ConnectecMotionGroupRobotProps = {
|
|
82
|
+
connectedMotionGroup: ConnectedMotionGroup // The connected motion group from wandelbots-js
|
|
83
|
+
getModel?: (modelFromController: string) => string // A function that returns the URL of the robot model
|
|
84
|
+
isGhost?: boolean // Whether the robot should be displayed transparently
|
|
85
|
+
} & GroupProps
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
##### SupportedRobot
|
|
89
|
+
|
|
90
|
+
The `SupportedRobot` can be used to display a robot model without the need for a `connectedMotionGroup` from `@wandelbots/wandelbots-js`.
|
|
70
91
|
|
|
71
92
|
```tsx
|
|
72
93
|
<SupportedRobot
|
|
94
|
+
rapidlyChangingMotionState={
|
|
95
|
+
rapidlyChangingMotionState
|
|
96
|
+
}
|
|
97
|
+
dhParameters={dhParameters as any}
|
|
98
|
+
modelFromController={modelFromController || ""}
|
|
73
99
|
getModel={() =>
|
|
74
|
-
|
|
100
|
+
`./robot-pad/models/${modelFromController}.glb`
|
|
75
101
|
}
|
|
76
|
-
connectedMotionGroup={activeRobot}
|
|
77
102
|
/>
|
|
78
103
|
```
|
|
79
104
|
|
|
105
|
+
```tsx
|
|
106
|
+
export type SupportedRobotProps = {
|
|
107
|
+
rapidlyChangingMotionState: MotionGroupStateResponse // The motion state of the robot
|
|
108
|
+
modelFromController: string // The model name of the robot
|
|
109
|
+
dhParameters: DHParameter[] // The DH parameters of the robot
|
|
110
|
+
getModel?: (modelFromController: string) => string // A function that returns the URL of the robot model
|
|
111
|
+
isGhost?: boolean // Whether the robot should be displayed transparently
|
|
112
|
+
} & GroupProps
|
|
113
|
+
```
|
|
114
|
+
|
|
80
115
|
#### Lightning
|
|
81
116
|
|
|
82
117
|
The `PresetEnvironment` component adds a default lighting setup to the 3D viewport.
|
|
@@ -90,7 +125,7 @@ The `PresetEnvironment` component adds a default lighting setup to the 3D viewpo
|
|
|
90
125
|
The `SafetyZonesRenderer` component visualizes the safety zones of the controller.
|
|
91
126
|
|
|
92
127
|
```tsx
|
|
93
|
-
<SafetyZonesRenderer safetyZones={
|
|
128
|
+
<SafetyZonesRenderer safetyZones={connectedMotionGroup.safetyZones||[]}/>
|
|
94
129
|
```
|
|
95
130
|
|
|
96
131
|
|
|
@@ -3,6 +3,7 @@ import type { ConnectedMotionGroup } from "@wandelbots/wandelbots-js";
|
|
|
3
3
|
export type ConnectecMotionGroupRobotProps = {
|
|
4
4
|
connectedMotionGroup: ConnectedMotionGroup;
|
|
5
5
|
getModel?: (modelFromController: string) => string;
|
|
6
|
+
isGhost?: boolean;
|
|
6
7
|
} & GroupProps;
|
|
7
8
|
/**
|
|
8
9
|
* The Robot component is a wrapper around the SupportedRobot component
|
|
@@ -15,5 +16,5 @@ export type ConnectecMotionGroupRobotProps = {
|
|
|
15
16
|
*
|
|
16
17
|
* @returns {JSX.Element} The rendered SupportedRobot component.
|
|
17
18
|
*/
|
|
18
|
-
export declare function Robot({ connectedMotionGroup, getModel, ...props }: ConnectecMotionGroupRobotProps): import("react/jsx-runtime").JSX.Element | null;
|
|
19
|
+
export declare function Robot({ connectedMotionGroup, getModel, isGhost, ...props }: ConnectecMotionGroupRobotProps): import("react/jsx-runtime").JSX.Element | null;
|
|
19
20
|
//# sourceMappingURL=Robot.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Robot.d.ts","sourceRoot":"","sources":["../../../src/components/robots/Robot.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAEpD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AAGrE,MAAM,MAAM,8BAA8B,GAAG;IAC3C,oBAAoB,EAAE,oBAAoB,CAAA;IAC1C,QAAQ,CAAC,EAAE,CAAC,mBAAmB,EAAE,MAAM,KAAK,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"Robot.d.ts","sourceRoot":"","sources":["../../../src/components/robots/Robot.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAEpD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AAGrE,MAAM,MAAM,8BAA8B,GAAG;IAC3C,oBAAoB,EAAE,oBAAoB,CAAA;IAC1C,QAAQ,CAAC,EAAE,CAAC,mBAAmB,EAAE,MAAM,KAAK,MAAM,CAAA;IAClD,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,GAAG,UAAU,CAAA;AAEd;;;;;;;;;;GAUG;AACH,wBAAgB,KAAK,CAAC,EACpB,oBAAoB,EACpB,QAA0B,EAC1B,OAAe,EACf,GAAG,KAAK,EACT,EAAE,8BAA8B,kDAiBhC"}
|
|
@@ -13,7 +13,8 @@ export type SupportedRobotProps = {
|
|
|
13
13
|
modelFromController: string;
|
|
14
14
|
dhParameters: DHParameter[];
|
|
15
15
|
getModel?: (modelFromController: string) => string;
|
|
16
|
+
isGhost?: boolean;
|
|
16
17
|
} & GroupProps;
|
|
17
18
|
export declare function defaultGetModel(modelFromController: string): string;
|
|
18
|
-
export declare function SupportedRobot({ rapidlyChangingMotionState, modelFromController, dhParameters, getModel, ...props }: SupportedRobotProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export declare function SupportedRobot({ rapidlyChangingMotionState, modelFromController, dhParameters, getModel, isGhost, ...props }: SupportedRobotProps): import("react/jsx-runtime").JSX.Element;
|
|
19
20
|
//# sourceMappingURL=SupportedRobot.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SupportedRobot.d.ts","sourceRoot":"","sources":["../../../src/components/robots/SupportedRobot.tsx"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,KAAK,EACV,wBAAwB,EACxB,WAAW,EACZ,MAAM,mCAAmC,CAAA;
|
|
1
|
+
{"version":3,"file":"SupportedRobot.d.ts","sourceRoot":"","sources":["../../../src/components/robots/SupportedRobot.tsx"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,KAAK,EACV,wBAAwB,EACxB,WAAW,EACZ,MAAM,mCAAmC,CAAA;AAK1C,MAAM,MAAM,YAAY,GAAG;IACzB,0BAA0B,EAAE,wBAAwB,CAAA;IACpD,YAAY,EAAE,KAAK,CAAC,WAAW,CAAC,CAAA;CACjC,GAAG,UAAU,CAAA;AAEd,MAAM,MAAM,UAAU,GAAG;IACvB,0BAA0B,EAAE,wBAAwB,CAAA;IACpD,QAAQ,EAAE,MAAM,CAAA;CACjB,GAAG,UAAU,CAAA;AAEd,MAAM,MAAM,mBAAmB,GAAG;IAChC,0BAA0B,EAAE,wBAAwB,CAAA;IACpD,mBAAmB,EAAE,MAAM,CAAA;IAC3B,YAAY,EAAE,WAAW,EAAE,CAAA;IAC3B,QAAQ,CAAC,EAAE,CAAC,mBAAmB,EAAE,MAAM,KAAK,MAAM,CAAA;IAClD,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,GAAG,UAAU,CAAA;AAEd,wBAAgB,eAAe,CAAC,mBAAmB,EAAE,MAAM,GAAG,MAAM,CAEnE;AAED,wBAAgB,cAAc,CAAC,EAC7B,0BAA0B,EAC1B,mBAAmB,EACnB,YAAY,EACZ,QAA0B,EAC1B,OAAe,EACf,GAAG,KAAK,EACT,EAAE,mBAAmB,2CA+IrB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"robot.d.ts","sourceRoot":"","sources":["../../src/icons/robot.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"robot.d.ts","sourceRoot":"","sources":["../../src/icons/robot.tsx"],"names":[],"mappings":"AAAA,wBAAgB,SAAS,4CAiBxB"}
|