
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
- 398 UpFeed
- 19 Tutorials
- 13 RobotApps
- 299 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 250 ScreenMaker
- 2.8K Robot Controller
- 324 IRC5
- 63 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 813 RAPID Programming
- 5 AppStudio
- 3 RobotStudio AR Viewer
- 19 Wizard Easy Programming
- 105 Collaborative Robots
- 5 Job listings