]> OCCT Git - occt-copy.git/commitdiff
Porting the fix of 26099 bug
authornbv <nbv@opencascade.com>
Thu, 10 Sep 2015 13:42:29 +0000 (16:42 +0300)
committernbv <nbv@opencascade.com>
Fri, 11 Sep 2015 06:34:39 +0000 (09:34 +0300)
src/IntCurve/IntCurve_IntConicConic_1.cxx

index aeed78226fb0a7068ca9f2c88d99335028f1713d..9f1f999018e36c5da7bffd24c99aa00a09e41e35 100644 (file)
@@ -1190,6 +1190,30 @@ static Standard_Boolean computeIntPoint(const IntRes2d_Domain& theCurDomain,
   return Standard_True;
 }
 
+//=======================================================================
+//function : CheckLLCoincidence
+//purpose  : Returns true if input are trimmed curves and they coincide
+//           within tolerance
+//=======================================================================
+static Standard_Boolean CheckLLCoincidence(const gp_Lin2d& L1,
+                                           const gp_Lin2d& L2,
+                                           const IntRes2d_Domain& Domain1,
+                                           const IntRes2d_Domain& Domain2,
+                                           const Standard_Real theTol)
+{
+  Standard_Boolean isFirst1 = (Domain1.HasFirstPoint() &&
+    L2.Distance(Domain1.FirstPoint()) < theTol);
+  Standard_Boolean isLast1 = (Domain1.HasLastPoint() &&
+    L2.Distance(Domain1.LastPoint()) < theTol);
+  if (isFirst1 && isLast1)
+    return Standard_True;
+  Standard_Boolean isFirst2 = (Domain2.HasFirstPoint() &&
+    L1.Distance(Domain2.FirstPoint()) < theTol);
+  Standard_Boolean isLast2 = (Domain2.HasLastPoint() &&
+    L1.Distance(Domain2.LastPoint()) < theTol);
+  return isFirst2 && isLast2;
+}
+
 //----------------------------------------------------------------------
 void IntCurve_IntConicConic::Perform(const gp_Lin2d& L1
                                      ,const IntRes2d_Domain& Domain1
@@ -1220,6 +1244,9 @@ void IntCurve_IntConicConic::Perform(const gp_Lin2d& L1
 
   done=Standard_True;
 
+  if(nbsol==1 && CheckLLCoincidence(L1, L2, Domain1, Domain2, Tol))
+    nbsol = 2;
+
   if(nbsol==1) {
     //---------------------------------------------------
     //-- d: distance du point I a partir de laquelle  les