@wandelbots/wandelbots-js-react-components 1.4.3 → 1.5.1

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 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="#robots">Robots</a></li>
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,64 @@ type WandelscriptEditorProps = {
56
56
 
57
57
  ### Viewport
58
58
 
59
- #### Robots
59
+ #### Robot
60
60
 
61
- This `SupportedRobot` component adds the robot to the 3D viewport. Use it together with the `connectedMotionGroup` from `@wandelbots/wandelbots-js`.
61
+ <img width="20%" alt="Screenshot 2024-08-08 at 14 17 55" src="https://github.com/user-attachments/assets/da661136-8b53-48ba-85de-63b09e3b51f3">
62
+
63
+ This `Robot` component adds the robot to the 3D viewport. Use it together with the `connectedMotionGroup` from `@wandelbots/wandelbots-js`.
62
64
 
63
65
  ```tsx
64
- <SupportedRobot connectedMotionGroup={activeRobot} />
66
+ <Robot connectedMotionGroup={connectedMotionGroup} />
65
67
  ```
66
68
 
67
69
  The robot model are loaded from the [jsdelivr CDN](https://cdn.jsdelivr.net/gh/wandelbotsgmbh/wandelbots-js-react-components/public/models/).
68
70
 
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 `SupportedRobot` component by passing a `getModel` function like:
71
+ 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:
72
+
73
+ ```tsx
74
+ <Robot
75
+ getModel={() =>
76
+ `public/${connectedMotionGroup.modelFromController}.glb`
77
+ }
78
+ connectedMotionGroup={connectedMotionGroup}
79
+ />
80
+ ```
81
+
82
+ ```tsx
83
+ export type ConnectecMotionGroupRobotProps = {
84
+ connectedMotionGroup: ConnectedMotionGroup // The connected motion group from wandelbots-js
85
+ getModel?: (modelFromController: string) => string // A function that returns the URL of the robot model
86
+ isGhost?: boolean // Whether the robot should be displayed transparently
87
+ } & GroupProps
88
+ ```
89
+
90
+ ##### SupportedRobot
91
+
92
+ The `SupportedRobot` can be used to display a robot model without the need for a `connectedMotionGroup` from `@wandelbots/wandelbots-js`.
70
93
 
71
94
  ```tsx
72
95
  <SupportedRobot
96
+ rapidlyChangingMotionState={
97
+ rapidlyChangingMotionState
98
+ }
99
+ dhParameters={dhParameters as any}
100
+ modelFromController={modelFromController || ""}
73
101
  getModel={() =>
74
- `public/${activeRobot.modelFromController}.glb`
102
+ `./robot-pad/models/${modelFromController}.glb`
75
103
  }
76
- connectedMotionGroup={activeRobot}
77
104
  />
78
105
  ```
79
106
 
107
+ ```tsx
108
+ export type SupportedRobotProps = {
109
+ rapidlyChangingMotionState: MotionGroupStateResponse // The motion state of the robot
110
+ modelFromController: string // The model name of the robot
111
+ dhParameters: DHParameter[] // The DH parameters of the robot
112
+ getModel?: (modelFromController: string) => string // A function that returns the URL of the robot model
113
+ isGhost?: boolean // Whether the robot should be displayed transparently
114
+ } & GroupProps
115
+ ```
116
+
80
117
  #### Lightning
81
118
 
82
119
  The `PresetEnvironment` component adds a default lighting setup to the 3D viewport.
@@ -90,7 +127,7 @@ The `PresetEnvironment` component adds a default lighting setup to the 3D viewpo
90
127
  The `SafetyZonesRenderer` component visualizes the safety zones of the controller.
91
128
 
92
129
  ```tsx
93
- <SafetyZonesRenderer safetyZones={activeRobot.safetyZones||[]}/>
130
+ <SafetyZonesRenderer safetyZones={connectedMotionGroup.safetyZones||[]}/>
94
131
  ```
95
132
 
96
133
 
@@ -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;CACnD,GAAG,UAAU,CAAA;AAEd;;;;;;;;;;GAUG;AACH,wBAAgB,KAAK,CAAC,EACpB,oBAAoB,EACpB,QAA0B,EAC1B,GAAG,KAAK,EACT,EAAE,8BAA8B,kDAgBhC"}
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;AAG1C,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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kMrB"}
@@ -1 +1 @@
1
- {"version":3,"file":"robot.d.ts","sourceRoot":"","sources":["../../src/icons/robot.tsx"],"names":[],"mappings":"AAEA,wBAAgB,SAAS,4CAWxB"}
1
+ {"version":3,"file":"robot.d.ts","sourceRoot":"","sources":["../../src/icons/robot.tsx"],"names":[],"mappings":"AAAA,wBAAgB,SAAS,4CAiBxB"}