0030269: Modeling Algorithms - unhandled Standard_NullObject within BRepBndLib::Add()
[occt.git] / src / BRepBndLib / BRepBndLib_1.cxx
index 4eea3f2..4035a3b 100644 (file)
@@ -165,14 +165,17 @@ static Standard_Integer PointsForOBB(const TopoDS_Shape& theS,
       for(anExpE.Init(aF, TopAbs_EDGE); anExpE.More(); anExpE.Next())
       {
         const TopoDS_Edge &anE = TopoDS::Edge(anExpE.Current());
-        const BRepAdaptor_Curve anAC(anE);
-        if (!IsLinear(anAC))
+        if (BRep_Tool::IsGeometric (anE))
         {
-          if (!theIsTriangulationUsed)
-            // not linear and triangulation usage disabled
-            return 0;
-
-          break;
+          const BRepAdaptor_Curve anAC(anE);
+          if (!IsLinear(anAC))
+          {
+            if (!theIsTriangulationUsed)
+              // not linear and triangulation usage disabled
+              return 0;
+
+            break;
+          }
         }
       }
 
@@ -212,11 +215,15 @@ static Standard_Integer PointsForOBB(const TopoDS_Shape& theS,
   for(anExpE.Init(theS, TopAbs_EDGE, TopAbs_FACE); anExpE.More(); anExpE.Next())
   {
     const TopoDS_Edge &anE = TopoDS::Edge(anExpE.Current());
-    const BRepAdaptor_Curve anAC(anE);
-
-    if (IsLinear(anAC))
-      // skip linear edge as its vertices have already been added
-      continue;
+    if (BRep_Tool::IsGeometric (anE))
+    {
+      const BRepAdaptor_Curve anAC(anE);
+      if (IsLinear(anAC))
+      {
+        // skip linear edge as its vertices have already been added
+        continue;
+      }
+    }
 
     if (!theIsTriangulationUsed)
       // not linear and triangulation usage disabled