Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

Wrong Bounding Box value

#1
Hey, I'm trying to retrieve the bounding box of an item but the maximum Z value seems to be wrong. Does it have something to do with my object file? I'd really appreciate if you could help me figure out what might be the cause.
Thanks!


Attached Files
.rdk   BoundingBox.rdk (Size: 1.75 KB / Downloads: 140)
#2
What is the coordinate that looks wrong to you?

The bounding box and the size are different. The bounding box max value contains the farthest coordinate along the XYZ coordinate system.
#3
It's the Zmax value that seems off to me... I use the measure tool to pick the points coordinates of the item. Still, the highest Z value I can get this way is 365.194, while the boundingbox function returns 385.956
All the other points seem to make sense to me, for example I expect the closest point to the XYZ coordinate system on the X axis to be the Xmin of the bounding box and that's exactly what happens, but I can't seem to find that 385.956 Z point on my item
#4
RoboDK uses axis aligned bounding boxes. I noticed the position of the object is not at the origin of its own coordinate system. This can affect the result a bit. One option is to use the relative bounding box by using the BoundingBoxRel parameter.

Example:
Code:
item.setParam('BoundingBoxRel')
#5
Hi Albert,
unfortunately that doesn't seem to fix my issue as i get the same coordinates as I did before.
The highest Z absolute value I can get from my model is at 365, while the box reaches 385.
In other projects it's the zMin value that seems wrong. All the other coordinates (xMin, xMax, yMin and yMax) seem to be always right. It's like I can't have both the zMin and zMax right at the same time.
I also tried with a .stp file from RoboDK Library ("Object Inspection") and the zMax of the bounding box looks wrong there too.
I attach this more streamlined test where the zero of the item is in the zero of the station.
I hope this can help troubleshooting my issue. Thanks for your attention!


Attached Files
.rdk   BoundingBox.rdk (Size: 2.48 KB / Downloads: 124)
#6
Thank you for your feedback. OK I better understand the issue now. The problem is that the RoboDK API actually includes hidden coordinate systems such as the tool (TCP). This happens because objects can also be tools.

We'll fix this issue with the next update this week. From now on, calculating the bounding box won't include the position of coordinate systems. RoboDK will provide the correct bounding box, purely based on the geometry. You can check here when a new update is released:
https://robodk.com/whatsnew
#7
Thank you a lot Albert! Have a good day
  




Users browsing this thread:
1 Guest(s)