0028631: Modeling Algorithms - Crash while building a 2D circle tangent to another...
[occt.git] / src / GccAna / GccAna_Circ2d3Tan_7.cxx
index 21c87b5..5e521f3 100644 (file)
@@ -185,9 +185,10 @@ GccAna_Circ2d3Tan::
                 else {
                   TheSame1(NbrSol) = 0;
                   gp_Dir2d dc(center1.XY()-Center.XY());
+                  if (qualifier1(NbrSol) == GccEnt_enclosed)
+                    dc.Reverse(); // if tangent circle is inside the source circle, moving to edge of source circle
                   pnttg1sol(NbrSol)=gp_Pnt2d(Center.XY()+Radius(nbsol3)*dc.XY());
-                  par1sol(NbrSol)=ElCLib::Parameter(cirsol(NbrSol),
-                                                   pnttg1sol(NbrSol));
+                  par1sol(NbrSol)=ElCLib::Parameter(cirsol(NbrSol), pnttg1sol(NbrSol));
                   pararg1(NbrSol)=ElCLib::Parameter(C1,pnttg1sol(NbrSol));
                 }