]> OCCT Git - occt-copy.git/commitdiff
0031260: Geom2dGcc_Circ2d2TanRad fails in this case (720)
authorifv <ifv@opencascade.com>
Fri, 17 Jan 2020 08:30:50 +0000 (11:30 +0300)
committerifv <ifv@opencascade.com>
Fri, 17 Jan 2020 08:30:50 +0000 (11:30 +0300)
src/Adaptor2d/Adaptor2d_OffsetCurve.cxx

index 8805b4bccd6c3e489192fbdcf669e6184f0691b7..8eb020a913dc8444885255c2cefd7a38f363eb36 100644 (file)
@@ -656,19 +656,16 @@ static Standard_Integer nbPoints(const Handle(Adaptor2d_HCurve2d)& theCurve)
 
   Standard_Integer nbs = 20;
 
-  if (theCurve->GetType() == GeomAbs_Line)
-    nbs = 2;
-  else if (theCurve->GetType() == GeomAbs_BezierCurve)
+  if (theCurve->GetType() == GeomAbs_BezierCurve)
   {
-    nbs = 3 + theCurve->NbPoles();
+    nbs = Max(nbs, 3 + theCurve->NbPoles());
   }
   else if (theCurve->GetType() == GeomAbs_BSplineCurve) {
-    nbs = theCurve->NbKnots();
-    nbs *= theCurve->Degree();
+    nbs = Max(nbs, theCurve->NbKnots() * theCurve->Degree());
   }
 
-  if (nbs > 200)
-    nbs = 200;
+  if (nbs > 300)
+    nbs = 300;
   return nbs;
 
 }