Find the middle of a box
in RobotStudio
Is there a method to find the middle of a box using the SDK? I have a addin that randomly creates variously sized boxes and i want to ensure they are laid flat and that i can align the center of the bag with a frame.
Tagged:
0
Comments
-
Hello,You can compute it.☑️2024 - RobotStudio® User Group0
-
I am no math wiz, but could you clarify the question? As I see it, box implies a cube, 3D, while you mention lay flat, which makes me think of a 2d square.Lee Justice0
-
lemster68 said:I am no math wiz, but could you clarify the question? As I see it, box implies a cube, 3D, while you mention lay flat, which makes me think of a 2d square.
To do this I've created the box (Body.CreateSolidBox), then using Body.CenterOfGravity & Transformation(s) I am able to calculate where the nearest edge is on a 3D object to place a frame in the centre of the surface ensuring the frame created at the centre of the box is alway aligned with a frame. End result shown below;
0 -
So it looks like you have found a satisfactory solution? I realize reading what I posted how dumb I made myself look, half of width and half of length is center, duh!Lee Justice0
Categories
- All Categories
- 5.5K RobotStudio
- 396 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 250 ScreenMaker
- 2.8K Robot Controller
- 316 IRC5
- 61 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 798 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 5 Job listings