0029694: Geom2dGcc_Circ2dTanCenGeo crash
authornbv <nbv@opencascade.com>
Tue, 22 May 2018 09:15:27 +0000 (12:15 +0300)
committerbugmaster <bugmaster@opencascade.com>
Thu, 14 Jun 2018 11:03:06 +0000 (14:03 +0300)
The reason of this issue is in incorrectly interpreted the generic class "TheExtPC" (eliminated after the fix 0024773) as Extrema_ExtPC2d. Correct interpretation must be "Extrema_EPCOfExtPC2d" class.

Now this problem has been fixed in the class Geom2dGcc_Circ2dTanCenGeo.

New testgrid "lowalgos 2dgcc" has been created.

26 files changed:
dox/user_guides/draw_test_harness/draw_test_harness.md
src/Geom2dGcc/Geom2dGcc_Circ2dTanCenGeo.cxx
src/GeometryTest/GeometryTest_ConstraintCommands.cxx
tests/bugs/moddata_1/buc60607_1 [deleted file]
tests/bugs/moddata_1/buc60607_2 [deleted file]
tests/bugs/moddata_1/buc60607_3 [deleted file]
tests/bugs/moddata_1/buc60607_4 [deleted file]
tests/bugs/moddata_1/buc60618 [deleted file]
tests/bugs/moddata_1/buc60622_1 [deleted file]
tests/bugs/moddata_1/buc60622_2 [deleted file]
tests/bugs/moddata_1/buc60622_3 [deleted file]
tests/bugs/moddata_1/buc60941 [deleted file]
tests/bugs/moddata_3/bug23866 [deleted file]
tests/lowalgos/2dgcc/buc60607_1 [new file with mode: 0644]
tests/lowalgos/2dgcc/buc60607_2 [new file with mode: 0644]
tests/lowalgos/2dgcc/buc60607_3 [new file with mode: 0644]
tests/lowalgos/2dgcc/buc60607_4 [new file with mode: 0644]
tests/lowalgos/2dgcc/buc60618 [new file with mode: 0644]
tests/lowalgos/2dgcc/buc60622_1 [new file with mode: 0644]
tests/lowalgos/2dgcc/buc60622_2 [new file with mode: 0644]
tests/lowalgos/2dgcc/buc60622_3 [new file with mode: 0644]
tests/lowalgos/2dgcc/buc60941 [new file with mode: 0644]
tests/lowalgos/2dgcc/bug23866 [new file with mode: 0644]
tests/lowalgos/2dgcc/bug29694 [new file with mode: 0644]
tests/lowalgos/2dgcc/doc001 [new file with mode: 0644]
tests/lowalgos/grids.list

index 587c562..ce6aee1 100644 (file)
@@ -5684,18 +5684,33 @@ projponf f pnt
 
 Syntax: 
 ~~~~~
-cirtang cname curve/point/radius curve/point/radius curve/point/radius 
+cirtang result [-t <Tolerance>] -c <curve> -p <point> -r <Radius>...
 ~~~~~
 
-Builds all circles satisfying the three constraints which are either a curve (the circle must be tangent to that curve), a point (the circle must pass through that point), or a radius for the circle. Only one constraint can be a radius. The solutions will be stored in variables *name_1*, *name_2*, etc. 
+Builds all circles satisfying the condition: 
+1. the circle must be tangent to every given curve;
+2. the circle must pass through every given point;
+3. the radius of the circle must be equal to the requested one. 
+
+Only following set of input data is supported: Curve-Curve-Curve, Curve-Curve-Point, Curve-Curve-Radius, Curve-Point-Point, Curve-Point-Radius, Point-Point-Point, Point-Point-Radius. The solutions will be stored in variables *result_1*, *result_2*, etc.
 
 **Example:** 
 ~~~~~
-# a point, a line and a radius. 2 solutions 
+# a point, a line and a radius. 2 solutions of type Curve-Point-Radius (C-P-R)
 point p 0 0 
-line 1 10 0 -1 1 
-cirtang c p 1 4 
-== c_1 c_2 
+line l 10 0 -1 1 
+cirtang c -p p -c l -r 4 
+== Solution of type C-P-R is: c_1 c_2
+~~~~~
+
+Additionally it is possible to create a circle(s) with given center and tangent to the given curve (Curve-Point type).
+
+**Example:** 
+~~~~~
+point pp 1 1
+2dbsplinecurve cc 1 2 0 2 1 2 -10 -5 1 10 -5 1
+cirtang r -p pp -c cc 
+== Solution of type C-P is: r_1 r_2 
 ~~~~~
 
 @subsubsection occt_draw_6_10_2  lintan
index d7487d3..44d8700 100644 (file)
@@ -41,12 +41,13 @@ Geom2dGcc_Circ2dTanCenGeo (const Geom2dGcc_QCurve&  Qualified1,
 //========================================================================
 //   Initialisation des champs.                                          +
 //========================================================================
-
-  cirsol(1,2)    ,
-  qualifier1(1,2),
-  pnttg1sol(1,2) ,
-  par1sol(1,2)   ,
-  pararg1(1,2)   
+  WellDone(Standard_False),
+  NbrSol(0),
+  cirsol(1, 2),
+  qualifier1(1, 2),
+  pnttg1sol(1, 2),
+  par1sol(1, 2),
+  pararg1(1, 2)
 {
   Standard_Real Tol = Abs(Tolerance);
   TColgp_Array1OfPnt2d pTan(1,2);
@@ -60,23 +61,19 @@ Geom2dGcc_Circ2dTanCenGeo (const Geom2dGcc_QCurve&  Qualified1,
   gp_Dir2d dirx(1.0,0.0);
   Standard_Real thePar;
   Geom2dAdaptor_Curve curve = Qualified1.Qualified();
-  Extrema_ExtPC2d distmin(Pcenter,curve,Geom2dGcc_CurveTool::NbSamples(curve),
-    Geom2dGcc_CurveTool::EpsX(curve,Tol),Tol);
+  Extrema_ExtPC2d distmin(Pcenter, curve, Geom2dGcc_CurveTool::FirstParameter(curve),
+                          Geom2dGcc_CurveTool::LastParameter(curve), Tol);
   if (!distmin.IsDone() ) { throw Standard_Failure(); }
   Standard_Integer nbext = distmin.NbExt();
   if(nbext==0) { throw Standard_Failure(); }
   while (i<=nbext) {
     thePar = distmin.Point(i).Parameter();
-    if (distmin.SquareDistance(i)<theDist2(1) && 
-      thePar>=Geom2dGcc_CurveTool::FirstParameter(curve) && 
-      thePar <= Geom2dGcc_CurveTool::LastParameter(curve)) {
+    if (distmin.SquareDistance(i)<theDist2(1)) {
         theDist2(1) = distmin.SquareDistance(i);
         theParam(1) = thePar;
         pTan(1) = distmin.Point(i).Value();
     }
-    if (distmin.SquareDistance(i)>theDist2(2) && 
-      thePar>=Geom2dGcc_CurveTool::FirstParameter(curve) && 
-      thePar <= Geom2dGcc_CurveTool::LastParameter(curve)) {
+    if (distmin.SquareDistance(i)>theDist2(2)) {
         theDist2(2) = distmin.SquareDistance(i);
         theParam(2) = thePar;
         pTan(2) = distmin.Point(i).Value();
index 7dd9cca..de80e10 100644 (file)
@@ -83,8 +83,7 @@ static Standard_Integer solutions(Draw_Interpretor& di,
     for (Standard_Integer i = 1 ; i <= ct3.NbSolutions() ; i++) {
       Handle(Geom2d_Circle) C = new Geom2d_Circle(ct3.ThisSolution(i));
       Sprintf(solname,"%s_%d",name,i);
-      char* temp = solname; // pour portage WNT
-      DrawTrSurf::Set(temp,C);
+      DrawTrSurf::Set(solname, C);
       di << solname << " ";
     }
     return 0;
@@ -107,8 +106,7 @@ static Standard_Integer solutions(Draw_Interpretor& di,
     for (Standard_Integer i = 1 ; i <= ct3.NbSolutions() ; i++) {
       Handle(Geom2d_Circle) C = new Geom2d_Circle(ct3.ThisSolution(i));
       Sprintf(solname,"%s_%d",name,i);
-      char* temp = solname; // pour portage WNT
-      DrawTrSurf::Set(temp,C);
+      DrawTrSurf::Set(solname, C);
       di << solname << " ";
     }
     return 0;
@@ -120,260 +118,211 @@ static Standard_Integer solutions(Draw_Interpretor& di,
 }
 
 //=======================================================================
-//function : cirtang
+//function : solutions
 //purpose  : 
 //=======================================================================
-
-static Standard_Integer cirtang (Draw_Interpretor& di,Standard_Integer n, const char** a)
+static Standard_Integer solutions(Draw_Interpretor& theDI,
+                                  Geom2dGcc_Circ2dTanCen& theCt2,
+                                  const char* theName)
 {
-  if (n < 5) return 1;
-
-  Handle(Geom2d_Curve) C1 = DrawTrSurf::GetCurve2d(a[2]);
-  Handle(Geom2d_Curve) C2 = DrawTrSurf::GetCurve2d(a[3]);
-  Handle(Geom2d_Curve) C3 = DrawTrSurf::GetCurve2d(a[4]);
-  gp_Pnt2d P1,P2,P3;
-  Standard_Boolean ip1 = DrawTrSurf::GetPoint2d(a[2],P1);
-  Standard_Boolean ip2 = DrawTrSurf::GetPoint2d(a[3],P2);
-  Standard_Boolean ip3 = DrawTrSurf::GetPoint2d(a[4],P3);
-
-  Standard_Real tol = Precision::Confusion();
-  if (n > 5) tol = Draw::Atof(a[5]);
-
-
-  if (!C1.IsNull()) {
-    // C-...
-    if (!C2.IsNull()) {
-      // C-C-...
-      if (!C3.IsNull()) {
-        // C-C-C
-        Geom2dGcc_Circ2d3Tan ct3(Geom2dGcc::Unqualified(C1),
-          Geom2dGcc::Unqualified(C2),
-          Geom2dGcc::Unqualified(C3),
-          tol,0,0,0);
-        return solutions(di,ct3,a[1]);
-      }
-
-      else if (ip3) {
-        // C-C-P
-        Geom2dGcc_Circ2d3Tan ct3(Geom2dGcc::Unqualified(C1),
-          Geom2dGcc::Unqualified(C2),
-          new Geom2d_CartesianPoint(P3),
-          tol,0,0);
-        return solutions(di,ct3,a[1]);
-      }
-
-      else {
-        // C-C-R
-        Geom2dGcc_Circ2d2TanRad ct3(Geom2dGcc::Unqualified(C1),
-          Geom2dGcc::Unqualified(C2),
-          Draw::Atof(a[4]),tol);
-        return solutions(di,ct3,a[1]);
-      }
-    }
-    else if (ip2) {
-      // C-P-..
-      if (!C3.IsNull()) {
-        // C-P-C
-        Geom2dGcc_Circ2d3Tan ct3(Geom2dGcc::Unqualified(C1),
-          Geom2dGcc::Unqualified(C3),
-          new Geom2d_CartesianPoint(P2),
-          tol,0,0);
-        return solutions(di,ct3,a[1]);
-      }
+  char solname[200];
 
-      else if (ip3) {
-        // C-P-P
-        Geom2dGcc_Circ2d3Tan ct3(Geom2dGcc::Unqualified(C1),
-          new Geom2d_CartesianPoint(P2),
-          new Geom2d_CartesianPoint(P3),
-          tol,0);
-        return solutions(di,ct3,a[1]);
-      }
+  Draw_Color col = DrawTrSurf_CurveColor(Draw_Color(Draw_vert));
+  DrawTrSurf_CurveColor(col);
 
-      else {
-        // C-P-R
-        Geom2dGcc_Circ2d2TanRad ct3(Geom2dGcc::Unqualified(C1),
-          new Geom2d_CartesianPoint(P2),
-          Draw::Atof(a[4]),tol);
-        return solutions(di,ct3,a[1]);
-      }
+  if (theCt2.IsDone())
+  {
+    for (Standard_Integer i = 1; i <= theCt2.NbSolutions(); i++)
+    {
+      Handle(Geom2d_Circle) C = new Geom2d_Circle(theCt2.ThisSolution(i));
+      Sprintf(solname, "%s_%d", theName, i);
+      DrawTrSurf::Set(solname, C);
+      theDI << solname << " ";
     }
+    return 0;
+  }
+  else
+  {
+    theDI << "Circ2dTanCen Not done";
+    return 1;
+  }
+}
 
-    else {
-      // C-R-..
-      if (!C3.IsNull()) {
-        // C-R-C
-        Geom2dGcc_Circ2d2TanRad ct3(Geom2dGcc::Unqualified(C1),
-          Geom2dGcc::Unqualified(C3),
-          Draw::Atof(a[3]),
-          tol);
-        return solutions(di,ct3,a[1]);
-      }
-
-      else if (ip3) {
-        // C-R-P
-        Geom2dGcc_Circ2d2TanRad ct3(Geom2dGcc::Unqualified(C1),
-          new Geom2d_CartesianPoint(P3),
-          Draw::Atof(a[3]),
-          tol);
-        return solutions(di,ct3,a[1]);
-      }
-
-      else {
-        // C-R-R
-        di << "Curve, radius, radius ???\n";
-        return 1;
-      }
-    }
+//=======================================================================
+//function : Cirtang
+//purpose  : 
+//=======================================================================
+static Standard_Integer Cirtang(Draw_Interpretor& theDI,
+                                Standard_Integer theNArgs,
+                                const char** theArgVals)
+{
+  if (theNArgs < 3)
+  {
+    theDI << "Use: " << theArgVals[0] << "result [-t <Tolerance>] -c <curve> -p <point> -r <Radius>...\n";
+    return 1;
   }
 
-  else if (ip1) {
-    // P-...
-    if (!C2.IsNull()) {
-      // P-C-...
-      if (!C3.IsNull()) {
-        // P-C-C
-        Geom2dGcc_Circ2d3Tan ct3(Geom2dGcc::Unqualified(C2),
-          Geom2dGcc::Unqualified(C3),
-          new Geom2d_CartesianPoint(P1),
-          tol,0,0);
-        return solutions(di,ct3,a[1]);
-      }
+  Standard_Real aTol = Precision::Confusion();
+  Handle(Geom2d_Curve) aC[3];
+  gp_Pnt2d aP[3];
+  Standard_Real aRadius = -1.0;
 
-      else if (ip3) {
-        // P-C-P
-        Geom2dGcc_Circ2d3Tan ct3(Geom2dGcc::Unqualified(C2),
-          new Geom2d_CartesianPoint(P1),
-          new Geom2d_CartesianPoint(P3),
-          tol,0);
-        return solutions(di,ct3,a[1]);
-      }
+  Standard_Integer aNbCurves = 0, aNbPnts = 0;
 
-      else {
-        // P-C-R
-        Geom2dGcc_Circ2d2TanRad ct3(Geom2dGcc::Unqualified(C2),
-          new Geom2d_CartesianPoint(P1),
-          Draw::Atof(a[4]),tol);
-        return solutions(di,ct3,a[1]);
-      }
+  for (Standard_Integer anArgID = 2; anArgID < theNArgs; anArgID++)
+  {
+    if (theArgVals[anArgID][0] != '-')
+    {
+      theDI << "Cannot interpret the argument #" << anArgID << " (" << theArgVals[anArgID] << ")\n";
+      return 1;
     }
-    else if (ip2) {
-      // P-P-..
-      if (!C3.IsNull()) {
-        // P-P-C
-        Geom2dGcc_Circ2d3Tan ct3(Geom2dGcc::Unqualified(C3),
-          new Geom2d_CartesianPoint(P1),
-          new Geom2d_CartesianPoint(P2),
-          tol,0);
-        return solutions(di,ct3,a[1]);
+    else if (!strcmp(theArgVals[anArgID], "-c"))
+    {
+      if (aNbCurves >= 3)
+      {
+        theDI << "A lot of curves are given (not greater than 3 ones are expected)\n";
+        return 1;
       }
 
-      else if (ip3) {
-        // P-P-P
-        Geom2dGcc_Circ2d3Tan ct3(new Geom2d_CartesianPoint(P1),
-          new Geom2d_CartesianPoint(P2),
-          new Geom2d_CartesianPoint(P3),
-          tol);
-        return solutions(di,ct3,a[1]);
+      aC[aNbCurves] = DrawTrSurf::GetCurve2d(theArgVals[++anArgID]);
+      if (aC[aNbCurves].IsNull())
+      {
+        theDI << "Error: " << theArgVals[anArgID] << " is not a curve\n";
+        return 1;
       }
 
-      else {
-        // P-P-R
-        Geom2dGcc_Circ2d2TanRad ct3(new Geom2d_CartesianPoint(P1),
-          new Geom2d_CartesianPoint(P2),
-          Draw::Atof(a[4]),tol);
-        return solutions(di,ct3,a[1]);
-      }
+      aNbCurves++;
     }
-
-    else {
-      // P-R-..
-      if (!C3.IsNull()) {
-        // P-R-C
-        Geom2dGcc_Circ2d2TanRad ct3(Geom2dGcc::Unqualified(C3),
-          new Geom2d_CartesianPoint(P1),
-          Draw::Atof(a[3]),
-          tol);
-        return solutions(di,ct3,a[1]);
-      }
-
-      else if (ip3) {
-        // P-R-P
-        Geom2dGcc_Circ2d2TanRad ct3(new Geom2d_CartesianPoint(P1),
-          new Geom2d_CartesianPoint(P3),
-          Draw::Atof(a[3]),
-          tol);
-        return solutions(di,ct3,a[1]);
+    else if (!strcmp(theArgVals[anArgID], "-p"))
+    {
+      if (aNbPnts >= 3)
+      {
+        theDI << "A lot of points are given (not greater than 3 ones are expected)\n";
+        return 1;
       }
 
-      else {
-        // P-R-R
-        di << "Point, radius, radius ???\n";
+      if (!DrawTrSurf::GetPoint2d(theArgVals[++anArgID], aP[aNbPnts]))
+      {
+        theDI << "Error: " << theArgVals[anArgID] << " is not a point\n";
         return 1;
       }
+
+      aNbPnts++;
+    }
+    else if (!strcmp(theArgVals[anArgID], "-r"))
+    {
+      aRadius = Draw::Atof(theArgVals[++anArgID]);
+    }
+    else if (!strcmp(theArgVals[anArgID], "-t"))
+    {
+      aTol = Draw::Atof(theArgVals[++anArgID]);
+    }
+    else
+    {
+      theDI << "Unknown option " << theArgVals[anArgID] << "\n";
+      return 1;
     }
   }
 
-  else {
-    // R-...
-    if (!C2.IsNull()) {
-      // R-C-...
-      if (!C3.IsNull()) {
-        // R-C-C
-        Geom2dGcc_Circ2d2TanRad ct3(Geom2dGcc::Unqualified(C2),
-          Geom2dGcc::Unqualified(C3),
-          Draw::Atof(a[2]),
-          tol);
-        return solutions(di,ct3,a[1]);
-      }
-
-      else if (ip3) {
-        // R-C-P
-        Geom2dGcc_Circ2d2TanRad ct3(Geom2dGcc::Unqualified(C2),
-          new Geom2d_CartesianPoint(P3),
-          Draw::Atof(a[2]),
-          tol);
-        return solutions(di,ct3,a[1]);
-      }
-
-      else {
-        // R-C-R
-        di << "Radius - Curve - Radius ??\n";
-        return 1;
-      }
+  if (aNbCurves == 3)
+  {
+    // C-C-C
+    Geom2dGcc_Circ2d3Tan aCt3(Geom2dGcc::Unqualified(aC[0]),
+                              Geom2dGcc::Unqualified(aC[1]),
+                              Geom2dGcc::Unqualified(aC[2]),
+                              aTol, 0, 0, 0);
+    theDI << "Solution of type C-C-C is: ";
+    return solutions(theDI, aCt3, theArgVals[1]);
+  }
+  else if (aNbCurves == 2)
+  {
+    if (aNbPnts >= 1)
+    {
+      // C-C-P
+      Geom2dGcc_Circ2d3Tan aCt3(Geom2dGcc::Unqualified(aC[0]),
+                                Geom2dGcc::Unqualified(aC[1]),
+                                new Geom2d_CartesianPoint(aP[0]),
+                                aTol, 0, 0);
+      theDI << "Solution of type C-C-P is: ";
+      return solutions(theDI, aCt3, theArgVals[1]);
+    }
+    else if (aRadius > 0)
+    {
+      // C-C-R
+      Geom2dGcc_Circ2d2TanRad aCt3(Geom2dGcc::Unqualified(aC[0]),
+                                   Geom2dGcc::Unqualified(aC[1]),
+                                   aRadius, aTol);
+      theDI << "Solution of type C-C-R is: ";
+      return solutions(theDI, aCt3, theArgVals[1]);
     }
-    else if (ip2) {
-      // R-P-..
-      if (!C3.IsNull()) {
-        // R-P-C
-        Geom2dGcc_Circ2d2TanRad ct3(Geom2dGcc::Unqualified(C3),
-          new Geom2d_CartesianPoint(P2),
-          Draw::Atof(a[2]),
-          tol);
-        return solutions(di,ct3,a[1]);
-      }
 
-      else if (ip3) 
+    theDI << "Error: Unsupported set of input data!\n";
+    return 1;
+  }
+  else if (aNbCurves == 1)
+  {
+    if (aNbPnts == 2)
+    {
+      //C-P-P
+      Geom2dGcc_Circ2d3Tan aCt3(Geom2dGcc::Unqualified(aC[0]),
+                                new Geom2d_CartesianPoint(aP[0]),
+                                new Geom2d_CartesianPoint(aP[1]),
+                                aTol,0);
+      theDI << "Solution of type C-P-P is: ";
+      return solutions(theDI, aCt3, theArgVals[1]);
+    }
+    else if (aNbPnts == 1)
+    {
+      if (aRadius > 0.0)
       {
-        // R-P-P
-        Geom2dGcc_Circ2d2TanRad ct3(new Geom2d_CartesianPoint(P2),
-          new Geom2d_CartesianPoint(P3),
-          Draw::Atof(a[2]),
-          tol);
-        return solutions(di,ct3,a[1]);
-      }      
-      else {
-        // R-P-R
-        di << "Radius - Point - Radius ??\n";
-        return 1;
+        //C-P-R
+        Geom2dGcc_Circ2d2TanRad aCt3(Geom2dGcc::Unqualified(aC[0]),
+                                     new Geom2d_CartesianPoint(aP[0]),
+                                     aRadius, aTol);
+        theDI << "Solution of type C-P-R is: ";
+        return solutions(theDI, aCt3, theArgVals[1]);
+      }
+      else
+      {
+        // C-P
+        Geom2dGcc_Circ2dTanCen aCt2(Geom2dGcc::Unqualified(aC[0]),
+                                    new Geom2d_CartesianPoint(aP[0]), aTol);
+        theDI << "Solution of type C-P is: ";
+        return solutions(theDI, aCt2, theArgVals[1]);
       }
     }
-    else {
-      // R-R-..
-      di << "radius, radius ???\n";
-      return 1;
+
+    theDI << "Error: Unsupported set of input data!\n";
+    return 1;
+  }
+  else if (aNbPnts >= 2)
+  {
+    if (aNbPnts == 3)
+    {
+      //P-P-P
+      Geom2dGcc_Circ2d3Tan aCt3(new Geom2d_CartesianPoint(aP[0]),
+                                new Geom2d_CartesianPoint(aP[1]),
+                                new Geom2d_CartesianPoint(aP[2]),
+                                aTol);
+      theDI << "Solution of type P-P-P is: ";
+      return solutions(theDI, aCt3, theArgVals[1]);
+    }
+    else if (aRadius > 0)
+    {
+      //P-P-R
+      Geom2dGcc_Circ2d2TanRad aCt3(new Geom2d_CartesianPoint(aP[0]),
+                                   new Geom2d_CartesianPoint(aP[1]),
+                                   aRadius, aTol);
+      theDI << "Solution of type P-P-R is: ";
+      return solutions(theDI, aCt3, theArgVals[1]);
     }
+
+    theDI << "Error: Unsupported set of input data!\n";
+    return 1;
   }
+
+  theDI << "Error: Unsupported set of input data!\n";
+  return 1;
 }
 
 
@@ -805,9 +754,9 @@ void  GeometryTest::ConstraintCommands(Draw_Interpretor& theCommands)
   g = "GEOMETRY Constraints";
 
   theCommands.Add("cirtang",
-    "cirtang cname curve/point/radius curve/point/radius curve/point/radius",
+    "cirtang cname [-t <Tolerance>] -c <curve> -p <point> -r <Radius>...",
     __FILE__,
-    cirtang,g);
+    Cirtang, g);
 
   theCommands.Add("lintan",
     "lintan lname curve1 curve2 [angle]",
diff --git a/tests/bugs/moddata_1/buc60607_1 b/tests/bugs/moddata_1/buc60607_1
deleted file mode 100755 (executable)
index 5c30838..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-puts "======================="
-puts "BUC60607"
-puts "It takes visual check for this BUC"
-puts "======================="
-
-set len_ch 2513
-
-point p 1600 300
-line l 0 500 2000 500
-cirtang c p l 400
-checklength c_1 -l 2513.2741228718346
-checklength c_2 -l 2513.2741228718346
\ No newline at end of file
diff --git a/tests/bugs/moddata_1/buc60607_2 b/tests/bugs/moddata_1/buc60607_2
deleted file mode 100755 (executable)
index f602def..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-puts "======================="
-puts "BUC60607"
-puts "It takes visual check for this BUC"
-puts "======================="
-
-point p 1600 300
-line l 0 500 2000 500
-cirtang c1 p l 200
diff --git a/tests/bugs/moddata_1/buc60607_3 b/tests/bugs/moddata_1/buc60607_3
deleted file mode 100755 (executable)
index e4a5088..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-puts "======================="
-puts "BUC60607"
-puts "It takes visual check for this BUC"
-puts "======================="
-
-point p2 1400 1400
-line l2 3000 1700 1000 1550
-cirtang c3 p2 l2 300
diff --git a/tests/bugs/moddata_1/buc60607_4 b/tests/bugs/moddata_1/buc60607_4
deleted file mode 100755 (executable)
index b461cb1..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-puts "======================="
-puts "BUC60607"
-puts "It takes visual check for this BUC"
-puts "======================="
-
-point p2 1400 1400
-line l2 3000 1700 1000 1550
-cirtang result p2 l2 150
diff --git a/tests/bugs/moddata_1/buc60618 b/tests/bugs/moddata_1/buc60618
deleted file mode 100755 (executable)
index 6cb3626..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-puts "=================================="
-puts "BUC60618"
-puts "=================================="
-puts "There was a problem filter of solutions. Several solutions were skipped."
-puts ""
-puts "It takes visual check for this BUG"
-puts "=================================="
-puts ""
-
-circle c1 0 0 100 
-circle c2 500 -400 300 
-circle c3 300 200 200 
-cirtang result c1 c2 c3
-checklength result_1 -l 3568.9587306060739
-checklength result_2 -l 9964.7111736227271
-checklength result_3 -l 2082.9371204466097
-checklength result_4 -l 32696.069757517998
-checklength result_5 -l 1681.9298517645602
-checklength result_6 -l 3097.3731840080009
-checklength result_7 -l 1545.2428620020787
-checklength result_8 -l 772.26646380656518
\ No newline at end of file
diff --git a/tests/bugs/moddata_1/buc60622_1 b/tests/bugs/moddata_1/buc60622_1
deleted file mode 100755 (executable)
index 2bbee56..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-puts "=========="
-puts "BUC60622"
-puts "=========="
-puts ""
-puts "=================================="
-puts "It takes visual check for this BUG"
-puts "=================================="
-puts ""
-
-circle c1 2900 800 500 
-circle c2 2900 900 400 
-circle c3 2900 1000 300 
-catch {cirtang result c1 c2 c3}
-
diff --git a/tests/bugs/moddata_1/buc60622_2 b/tests/bugs/moddata_1/buc60622_2
deleted file mode 100755 (executable)
index 0e7586d..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-puts "=================================="
-puts "BUC60622"
-puts "=================================="
-puts "There was an infinity of solutions and also c1, c2 and c3 are solutions"
-puts ""
-puts "It takes visual check for this BUG"
-puts "=================================="
-puts ""
-
-circle c1 500 1800 500 
-circle c2 500 1900 400 
-circle c3 700 1900 200 
-cirtang result c1 c2 c3
-
-checklength result_1 -l 2513.2741228703289
-checklength result_2 -l 837.75804095727631
-checklength result_3 -l 279.2526803190928
\ No newline at end of file
diff --git a/tests/bugs/moddata_1/buc60622_3 b/tests/bugs/moddata_1/buc60622_3
deleted file mode 100755 (executable)
index 6861fe6..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-puts "=================================="
-puts "BUC60622"
-puts "=================================="
-puts "There was an infinity of solutions and also c1, c2 and c3 are solutions"
-puts ""
-puts "It takes visual check for this BUG"
-puts "=================================="
-puts ""
-
-circle c3 500 3000 250
-circle c2 375 3000 125
-circle c1 625 3000 125
-cirtang result c1 c2 c3
-
-checklength result_1 -l 1570.7963267948965
-checklength result_2 -l 785.39816339744868
-checklength result_3 -l 785.39816339744823
-checklength result_4 -l 523.59877559829806
-checklength result_5 -l 523.59877559829806
\ No newline at end of file
diff --git a/tests/bugs/moddata_1/buc60941 b/tests/bugs/moddata_1/buc60941
deleted file mode 100755 (executable)
index 2129b5c..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-puts "========"
-puts "BUC60941"
-puts "========"
-puts ""
-############################################################
-## When try to use Geom2dGcc_Circ2d2TanRad with two curves it rise exception. 
-############################################################
-
-circle curve_1 1.79356127430613 -11.9148900515605 12.0491272292007
-
-set poles { { 0 0 1 } { -2.14533906935467 4.92056269221697 1 } { -0.537398638327716 10.0937503357781 1 } { 10.3564232507092 8.73929826869582 1 } { 16.6366922939454 3.11858911810943 1 } { 16.39 -0.262 1 } }
-set knots { { 0 4 } { 8.6971225126475 1 } { 16.903955884905 1 } { 28.0087167558108 4 } }
-
-eval 2dbsplinecurve curve_2 3 [ llength $knots ] [ join $knots ] [ join $poles ]
-
-if [catch {cirtang result curve_1 curve_2 2} catch_result] {
-    puts "Faulty BUC60941: function cirtang works wrongly"
-} else {
-    puts "BUC60941  OK: function cirtang works properly"
-}
diff --git a/tests/bugs/moddata_3/bug23866 b/tests/bugs/moddata_3/bug23866
deleted file mode 100644 (file)
index 18b3086..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-puts "========"
-puts "OCC23866"
-puts "========"
-puts ""
-########################################
-#  GccAna_Circ2d3Tan does not find a circle
-########################################
-
-restore [locate_data_file bug23866_3curves.brep] 3curves
-
-explode 3curves
-
-mkcurve 3d_curve_1 3curves_1
-mkcurve 3d_curve_2 3curves_2
-mkcurve 3d_curve_3 3curves_3
-
-to2d 2d_curve_1 3d_curve_1
-to2d 2d_curve_2 3d_curve_2
-to2d 2d_curve_3 3d_curve_3
-
-set circles_Nb [llength [cirtang cir 2d_curve_1 2d_curve_2 2d_curve_3] ]
-
-if { ${circles_Nb} != 8 } {
-   puts "Error: GccAna_Circ2d3Tan does not find a circle"
-} else {
-   puts "OK: GccAna_Circ2d3Tan find a circle"
-   checklength cir_1 -l 9429.8727947293246
-   checklength cir_2 -l 888.65915068757909
-   checklength cir_3 -l 8.5227983514817236
-   checklength cir_4 -l 6.2260879234386
-   checklength cir_5 -l 14054.240322333564
-   checklength cir_6 -l 596.25725451268329
-   checklength cir_7 -l 7.6941358383928531
-   checklength cir_8 -l 6.8966408969867814
-}
diff --git a/tests/lowalgos/2dgcc/buc60607_1 b/tests/lowalgos/2dgcc/buc60607_1
new file mode 100644 (file)
index 0000000..e0b9acb
--- /dev/null
@@ -0,0 +1,12 @@
+puts "======================="
+puts "BUC60607"
+puts "It takes visual check for this BUC"
+puts "======================="
+
+set len_ch 2513
+
+point p 1600 300
+line l 0 500 2000 500
+cirtang c -p p -c l -r 400
+checklength c_1 -l 2513.2741228718346
+checklength c_2 -l 2513.2741228718346
\ No newline at end of file
diff --git a/tests/lowalgos/2dgcc/buc60607_2 b/tests/lowalgos/2dgcc/buc60607_2
new file mode 100644 (file)
index 0000000..cc9af48
--- /dev/null
@@ -0,0 +1,8 @@
+puts "======================="
+puts "BUC60607"
+puts "It takes visual check for this BUC"
+puts "======================="
+
+point p 1600 300
+line l 0 500 2000 500
+cirtang c1 -p p -c l -r 200
diff --git a/tests/lowalgos/2dgcc/buc60607_3 b/tests/lowalgos/2dgcc/buc60607_3
new file mode 100644 (file)
index 0000000..b23daa2
--- /dev/null
@@ -0,0 +1,8 @@
+puts "======================="
+puts "BUC60607"
+puts "It takes visual check for this BUC"
+puts "======================="
+
+point p2 1400 1400
+line l2 3000 1700 1000 1550
+cirtang c3 -p p2 -c l2 -r 300
diff --git a/tests/lowalgos/2dgcc/buc60607_4 b/tests/lowalgos/2dgcc/buc60607_4
new file mode 100644 (file)
index 0000000..85c033e
--- /dev/null
@@ -0,0 +1,8 @@
+puts "======================="
+puts "BUC60607"
+puts "It takes visual check for this BUC"
+puts "======================="
+
+point p2 1400 1400
+line l2 3000 1700 1000 1550
+cirtang result -p p2 -c l2 -r 150
diff --git a/tests/lowalgos/2dgcc/buc60618 b/tests/lowalgos/2dgcc/buc60618
new file mode 100644 (file)
index 0000000..17b68cf
--- /dev/null
@@ -0,0 +1,21 @@
+puts "=================================="
+puts "BUC60618"
+puts "=================================="
+puts "There was a problem filter of solutions. Several solutions were skipped."
+puts ""
+puts "It takes visual check for this BUG"
+puts "=================================="
+puts ""
+
+circle c1 0 0 100 
+circle c2 500 -400 300 
+circle c3 300 200 200 
+cirtang result -c c1 -c c2 -c c3
+checklength result_1 -l 3568.9587306060739
+checklength result_2 -l 9964.7111736227271
+checklength result_3 -l 2082.9371204466097
+checklength result_4 -l 32696.069757517998
+checklength result_5 -l 1681.9298517645602
+checklength result_6 -l 3097.3731840080009
+checklength result_7 -l 1545.2428620020787
+checklength result_8 -l 772.26646380656518
\ No newline at end of file
diff --git a/tests/lowalgos/2dgcc/buc60622_1 b/tests/lowalgos/2dgcc/buc60622_1
new file mode 100644 (file)
index 0000000..846561d
--- /dev/null
@@ -0,0 +1,14 @@
+puts "=========="
+puts "BUC60622"
+puts "=========="
+puts ""
+puts "=================================="
+puts "It takes visual check for this BUG"
+puts "=================================="
+puts ""
+
+circle c1 2900 800 500 
+circle c2 2900 900 400 
+circle c3 2900 1000 300 
+catch {cirtang result -c c1 -c c2 -c c3}
+
diff --git a/tests/lowalgos/2dgcc/buc60622_2 b/tests/lowalgos/2dgcc/buc60622_2
new file mode 100644 (file)
index 0000000..1a6b3fe
--- /dev/null
@@ -0,0 +1,17 @@
+puts "=================================="
+puts "BUC60622"
+puts "=================================="
+puts "There was an infinity of solutions and also c1, c2 and c3 are solutions"
+puts ""
+puts "It takes visual check for this BUG"
+puts "=================================="
+puts ""
+
+circle c1 500 1800 500 
+circle c2 500 1900 400 
+circle c3 700 1900 200 
+cirtang result -c c1 -c c2 -c c3
+
+checklength result_1 -l 2513.2741228703289
+checklength result_2 -l 837.75804095727631
+checklength result_3 -l 279.2526803190928
\ No newline at end of file
diff --git a/tests/lowalgos/2dgcc/buc60622_3 b/tests/lowalgos/2dgcc/buc60622_3
new file mode 100644 (file)
index 0000000..6dfa202
--- /dev/null
@@ -0,0 +1,19 @@
+puts "=================================="
+puts "BUC60622"
+puts "=================================="
+puts "There was an infinity of solutions and also c1, c2 and c3 are solutions"
+puts ""
+puts "It takes visual check for this BUG"
+puts "=================================="
+puts ""
+
+circle c3 500 3000 250
+circle c2 375 3000 125
+circle c1 625 3000 125
+cirtang result -c c1 -c c2 -c c3
+
+checklength result_1 -l 1570.7963267948965
+checklength result_2 -l 785.39816339744868
+checklength result_3 -l 785.39816339744823
+checklength result_4 -l 523.59877559829806
+checklength result_5 -l 523.59877559829806
\ No newline at end of file
diff --git a/tests/lowalgos/2dgcc/buc60941 b/tests/lowalgos/2dgcc/buc60941
new file mode 100644 (file)
index 0000000..94a101a
--- /dev/null
@@ -0,0 +1,20 @@
+puts "========"
+puts "BUC60941"
+puts "========"
+puts ""
+############################################################
+## When try to use Geom2dGcc_Circ2d2TanRad with two curves it rise exception. 
+############################################################
+
+circle curve_1 1.79356127430613 -11.9148900515605 12.0491272292007
+
+set poles { { 0 0 1 } { -2.14533906935467 4.92056269221697 1 } { -0.537398638327716 10.0937503357781 1 } { 10.3564232507092 8.73929826869582 1 } { 16.6366922939454 3.11858911810943 1 } { 16.39 -0.262 1 } }
+set knots { { 0 4 } { 8.6971225126475 1 } { 16.903955884905 1 } { 28.0087167558108 4 } }
+
+eval 2dbsplinecurve curve_2 3 [ llength $knots ] [ join $knots ] [ join $poles ]
+
+if [catch {cirtang result -c curve_1 -c curve_2 -r 2} catch_result] {
+    puts "Faulty BUC60941: function cirtang works wrongly"
+} else {
+    puts "BUC60941  OK: function cirtang works properly"
+}
diff --git a/tests/lowalgos/2dgcc/bug23866 b/tests/lowalgos/2dgcc/bug23866
new file mode 100644 (file)
index 0000000..663e584
--- /dev/null
@@ -0,0 +1,38 @@
+puts "========"
+puts "OCC23866"
+puts "========"
+puts ""
+########################################
+#  GccAna_Circ2d3Tan does not find a circle
+########################################
+
+restore [locate_data_file bug23866_3curves.brep] 3curves
+
+explode 3curves
+
+mkcurve 3d_curve_1 3curves_1
+mkcurve 3d_curve_2 3curves_2
+mkcurve 3d_curve_3 3curves_3
+
+to2d 2d_curve_1 3d_curve_1
+to2d 2d_curve_2 3d_curve_2
+to2d 2d_curve_3 3d_curve_3
+
+foreach a [directory cir*] { unset $a }
+cirtang cir -c 2d_curve_1 -c 2d_curve_2 -c 2d_curve_3
+
+set circles_Nb [llength [directory cir*] ]
+
+if { ${circles_Nb} != 8 } {
+   puts "Error: GccAna_Circ2d3Tan does not find a circle"
+} else {
+   puts "OK: GccAna_Circ2d3Tan find a circle"
+   checklength cir_1 -l 9429.8727947293246
+   checklength cir_2 -l 888.65915068757909
+   checklength cir_3 -l 8.5227983514817236
+   checklength cir_4 -l 6.2260879234386
+   checklength cir_5 -l 14054.240322333564
+   checklength cir_6 -l 596.25725451268329
+   checklength cir_7 -l 7.6941358383928531
+   checklength cir_8 -l 6.8966408969867814
+}
diff --git a/tests/lowalgos/2dgcc/bug29694 b/tests/lowalgos/2dgcc/bug29694
new file mode 100644 (file)
index 0000000..7b14751
--- /dev/null
@@ -0,0 +1,18 @@
+puts "========"
+puts "0029694: Geom2dGcc_Circ2dTanCenGeo crash"
+puts "========"
+puts ""
+
+point pp 1 1
+2dbsplinecurve cc 1 2 0 2 1 2 -10 -5 1 10 -5 1
+
+if { ![regexp {Solution of type C-P is} [cirtang result -p pp -c cc] ] } {
+  puts "Error: Cannot find any solution"
+}
+
+regexp "Center\\s*:\\s*(\[-0-9.+eE\]+)\\s*,\\s*(\[-0-9.+eE\]+)\\s*" [dump result_1] full pcx pcy
+
+checkreal CenterX $pcx 1.0 1.0e-7 0
+checkreal CenterX $pcy 1.0 1.0e-7 0
+
+checkdump result_1 -name Radius -ref 6
diff --git a/tests/lowalgos/2dgcc/doc001 b/tests/lowalgos/2dgcc/doc001
new file mode 100644 (file)
index 0000000..a5531c7
--- /dev/null
@@ -0,0 +1,10 @@
+point p 0 0 
+line l 10 0 -1 1 
+cirtang c -p p -c l -r 4 
+
+smallview -2D-
+don c_1 c_2
+2dfit
+disp l p
+
+checkview -screenshot -2d -path ${imagedir}/${test_image}.png
\ No newline at end of file
index 9a19d5f..c3848ca 100644 (file)
@@ -1,4 +1,5 @@
 001 2dinter
 002 bnd
 003 extcs
-004 extcc
\ No newline at end of file
+004 extcc
+005 2dgcc
\ No newline at end of file