]> OCCT Git - occt-copy.git/commitdiff
Additional fix for 29713
authorgka <gka@opencascade.com>
Fri, 20 Apr 2018 14:52:21 +0000 (17:52 +0300)
committergka <gka@opencascade.com>
Fri, 27 Apr 2018 12:45:43 +0000 (15:45 +0300)
0029713: Test Harness command "fixshape" can not fix attached face

Fix to reverse invalid oriented pcurves was made

src/ShapeAnalysis/ShapeAnalysis_Edge.cxx

index f1bc7821c4bac0662c065a453c4b83eacd144fb3..5342e2a924041f8efed99c0311cd1bb61fb5ccf7 100644 (file)
@@ -438,7 +438,7 @@ Standard_Boolean ShapeAnalysis_Edge::CheckCurve3dWithPCurve (const TopoDS_Edge&
   TopoDS_Vertex aFirstVert = FirstVertex (edge);
   TopoDS_Vertex aLastVert  = LastVertex (edge);
 
-  if (aFirstVert.IsNull() || aLastVert.IsNull())
+  if (aFirstVert.IsNull() || aLastVert.IsNull() || aFirstVert.IsSame(aLastVert))
     return Standard_False;
 
   Standard_Real preci1 = BRep_Tool::Tolerance (aFirstVert),
@@ -469,13 +469,13 @@ Standard_Boolean ShapeAnalysis_Edge::CheckPoints (const gp_Pnt& P1A,
                                                  const Standard_Real preci2) 
 {
   myStatus = ShapeExtend::EncodeStatus (ShapeExtend_OK);
-  if (P1A.SquareDistance (P2A) <= preci1 * preci1 &&
-      P1B.SquareDistance (P2B) <= preci2 * preci2)
-    return Standard_False;
-  else if (P1A.Distance (P2B) + (P1B.Distance (P2A)) <
-          P1A.Distance (P2A) + (P1B.Distance (P2B)))
-    myStatus |= ShapeExtend::EncodeStatus (ShapeExtend_DONE1);
-  return Standard_True;
+  if( (P1A.SquareDistance(P2B) < P1A.SquareDistance(P2A) ) && 
+    ( P1B.SquareDistance(P2A) < P1B.SquareDistance(P2B)) )
+ {
+    myStatus |= ShapeExtend::EncodeStatus(ShapeExtend_DONE1);
+    return Standard_True;
+  }
+  return Standard_False;
 }