Why is the result incorrect with the method above? The bound box is doesn't surround the TopoDS_Shape object. And there is a large difference in eigther location or size.
1. Why is the result incorrect with the method above?
-Please do not be a hurry with conclusions.
The answer is inside the code of the class BRepBndLib.
In order to get the result more preciely, try to triangulate your shape before the call
BRepBndLib::Add(theShape, B);
2. The bound box is doesn't surround the TopoDS_Shape object. And there is a large difference in eigther location or size.
- It is impossible to help you without a possibility to see data.
Upload your shape somewhere in order to have a look on it please.
Albert, u r right. The BRepBndLib::Get() can only get the bounding box, instead of MINIMAL bounding box. The minimal bounding box should be independent on the absolute XYZ coordinates of points on the 3D model so that the mininal bounding box would be still constant even if the 3D model has been transferred with another orientation. If you want to get the Minimal bounding box, you can refer to the paper: "Efficiently Approximating the Minimum-Volume Bounding Box of a Point Set in Three Dimensions".
Fri, 07/25/2008 - 07:25
double Xmin, Ymin, Zmin, Xmax, Ymax, Zmax;
//Compute the parameters
TopoDS_Shape theShape = ##;
Bnd_Box B;
BRepBndLib::Add(theShape, B);
B.Get(Xmin, Ymin, Zmin, Xmax, Ymax, Zmax);
Fri, 07/25/2008 - 07:55
I feel this is the 'global' bounding box - relative to
the Gloabl XYZ system.
Anybody has a solution to 'local/oriented' bounding box
i.e. minimum size of box (maybe the volume) to 'pack' it
in a box.
thanks
-PG
Fri, 07/25/2008 - 09:08
Thank all of you!
How to gain the 'local/oriented' bounding box? And, how to represent the minimum size of box(volume)?
Mon, 08/04/2008 - 20:52
Why is the result incorrect with the method above? The bound box is doesn't surround the TopoDS_Shape object. And there is a large difference in eigther location or size.
Tue, 08/05/2008 - 08:31
Dear Albert.
1. Why is the result incorrect with the method above?
-Please do not be a hurry with conclusions.
The answer is inside the code of the class BRepBndLib.
In order to get the result more preciely, try to triangulate your shape before the call
BRepBndLib::Add(theShape, B);
2. The bound box is doesn't surround the TopoDS_Shape object. And there is a large difference in eigther location or size.
- It is impossible to help you without a possibility to see data.
Upload your shape somewhere in order to have a look on it please.
Thu, 11/06/2008 - 20:42
Albert, u r right. The BRepBndLib::Get() can only get the bounding box, instead of MINIMAL bounding box. The minimal bounding box should be independent on the absolute XYZ coordinates of points on the 3D model so that the mininal bounding box would be still constant even if the 3D model has been transferred with another orientation. If you want to get the Minimal bounding box, you can refer to the paper: "Efficiently Approximating the Minimum-Volume Bounding Box of a Point Set in Three Dimensions".