0030428: Modeling Algorithms - BRepBndLib::AddOBB() throws exception on empty Compound
authorkgv <kgv@opencascade.com>
Sat, 29 Dec 2018 12:41:54 +0000 (15:41 +0300)
committerbugmaster <bugmaster@opencascade.com>
Thu, 10 Jan 2019 13:12:13 +0000 (16:12 +0300)
Added missing Bnd_Box::IsVoid() check.

src/BRepBndLib/BRepBndLib_1.cxx

index 4035a3b..c70c2df 100644 (file)
@@ -414,6 +414,10 @@ static void ComputePCA(const TopoDS_Shape& theS,
   {
     BRepBndLib::Add(aST, aShapeBox);
   }
+  if (aShapeBox.IsVoid())
+  {
+    return;
+  }
 
   gp_Pnt aPMin = aShapeBox.CornerMin();
   gp_Pnt aPMax = aShapeBox.CornerMax();