]> OCCT Git - occt.git/commitdiff
0033689: Canonical Recognition - Circle construction problem
authorakaftasev <akaftasev@opencascade.com>
Thu, 18 Apr 2024 16:38:11 +0000 (17:38 +0100)
committerdpasukhi <dpasukhi@opencascade.com>
Fri, 12 Jul 2024 09:31:22 +0000 (10:31 +0100)
Fixed problem with creating null-length gp_Dir

src/gce/gce_MakeCirc.cxx

index 18ecf6b2b14dc9e1da9b969652916b79143508d1..0e7ffcda00cebdf43d23c21cdccd9eb05410a5de 100644 (file)
@@ -141,6 +141,13 @@ gce_MakeCirc::gce_MakeCirc(const gp_Pnt&  P1 ,
       dist2 = P2.Distance(pInt);
       dist3 = P3.Distance(pInt);
       pInt.Coord(x3,y3,z3);
+      if (dist1 < aResolution)
+      {
+        gp_Dir Dirx(1., 0., 0.);
+        gp_Dir Dirz(0., 0., 1.);
+        TheCirc = gp_Circ(gp_Ax2(pInt, Dirx, Dirz), 0.);
+        return;
+      }
       Dir1 = gp_Dir(x1-x3,y1-y3,z1-z3);
       //modified by NIZNHY-PKV Thu Mar  3 11:31:11 2005f
       //Dir2 = gp_Dir(x2-x3,y2-y3,z2-z3);