About bounding box?

//----------------------------------------------
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.

Rob Bachrach's picture

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.

Jun WANG's picture

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.

Rob Bachrach's picture

Ok. In that case, no. It does not exist to my knowledge. :-)

Rob

Jun WANG's picture

Anyway, thanks for your consideration.

Bearloga's picture

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.