I've ran into this very strange problem when trying to get the bounding box of a cylinder. For a design, I was trying to create a very flat cylinder, of radius 52 and height 5. When getting the bounding box of the cylinder, the x/y dimensions were reported as 112.568 instead of 104 (basically, there seems to be an extra space of 4.284 on each side of the cylinder on the x/y axis). When writing the design into a brep file and opening it some other place, the cylinder is displayed correctly having a diameter of 104.
Here's the code:
double radius = 52;
double height = 5;
BRepPrimAPI_MakeCylinder mkcy(radius, height);
TopoDS_Solid _solid = mkcy.Solid();
double xmin, xmax, ymin, ymax, zmin, zmax;
// print them.
I'm using Opencascade 6.3. Does anyone have an idea about what's going wrong here? I'm using the bounding box of these solids to do some further computations on the shape of the system, and an incorrect one creates some big problems down the line.