Hi, I am struggling with getting the correct BoundingBox in C++ of the spherical cap surface of the file in attach.
I wrote this code to evaluate the bounding box.
const CRhinoObject* p_object = RhinoApp().ActiveDoc()->LookupObject(srfId);
if (p_object != nullptr)
{
CRhinoObjRef ref(p_object);
const ON_Brep* p_brep = ref.Brep();
if (p_brep != nullptr)
{
ON_BoundingBox bb0 = p_brep->BoundingBox();
for (int i = 0; i < p_brep->m_F.Count(); i++)
{
const ON_BrepFace* p_face = p_brep->Face(i);
if (p_face != nullptr)
{
ON_BoundingBox face_bound;
p_face->GetTightBoundingBox(face_bound);
ON_BoundingBox bb1 = p_face->BoundingBox();
}
}
}
}
I noticed that bb0, bb1 and also face_bound return a wrong maximum Z bb value of 3.91 mm while I expected to have 0.0. The other bounding box values are correct.
I tried also to untrim the surface but I stil have the same results.
wrong_sphere_bb.3dm (7.4 MB)