Wed, 01/14/2009 - 21:09
Forums:
//----------------------------------------------
TopoDS_Shape theShape = ##;
Bnd_Box B;
BRepBndLib::Add(theShape, B);
B.Get(Xmin, Ymin, Zmin, Xmax, Ymax, Zmax);
//----------------------------------------------
This result is for the aixs-aligned bounding box, not for oriented bounding box. Does anyone know how to compute the oriented bounding box of shape in OCC. THanks a lot.
Wed, 01/14/2009 - 21:27
The "oriented" bounding box can be an arbitrary concept. If you know your orientation, you can create a new shape that is a transformed version of your original and get the bounding box on that. Then, if necessary, you can transform the bounding box coordinates back to the original shape's coordinate system.
Wed, 01/14/2009 - 21:42
Dear Bachrach, Thanks for your reply. Actually the "oriented" is just used to differentiate from the "assigned" bounding box, not specific meaning. Please refer to: http://en.wikipedia.org/wiki/Bounding_box
Thanks a lot.
Wed, 01/14/2009 - 21:56
Ok. In that case, no. It does not exist to my knowledge. :-)
Rob
Thu, 01/15/2009 - 02:03
Anyway, thanks for your consideration.
Thu, 01/15/2009 - 09:36
Developing the idea of Rob, I suggest that you compute principal axes of inertia of your shape using BRepGProp functions, and transform the shape from that system before computing bnd box.