Salome HOME
0023588: [CEA 2272] : GEOM test failed after transition to OCC 7.3 V9_1_0
authorvsr <vsr@opencascade.com>
Wed, 12 Sep 2018 12:39:42 +0000 (15:39 +0300)
committervsr <vsr@opencascade.com>
Wed, 12 Sep 2018 12:39:42 +0000 (15:39 +0300)
- Attempt 2, to fix regression caused be commit 81364d3f

src/GEOMImpl/GEOMImpl_IMeasureOperations.cxx
src/GEOMUtils/GEOMUtils.cxx

index 809975e3bb9156dd11ad13c1e624cd901f61d5d1..a06332644285efcee503ab9dcc6dbfac9d83bc89 100644 (file)
@@ -2128,7 +2128,7 @@ Standard_Integer GEOMImpl_IMeasureOperations::ClosestPoints (Handle(GEOM_Object)
     // additional workaround for bugs 19899, 19908 and 19910 from Mantis
     gp_Pnt P1s, P2s;
     double dist = GEOMUtils::GetMinDistanceSingular(aShape1, aShape2, P1s, P2s);
-    bool singularBetter = dist > -1.0;
+    bool singularBetter = dist >0;
 
     BRepExtrema_DistShapeShape dst (aShape1, aShape2);
     if (dst.IsDone()) {
@@ -2148,7 +2148,7 @@ Standard_Integer GEOMImpl_IMeasureOperations::ClosestPoints (Handle(GEOM_Object)
         theDoubles->Append(P2.Z());
        
        Standard_Real Dist = P1.Distance(P2);
-       singularBetter = dist < Dist;
+       singularBetter = singularBetter && dist < Dist;
       }
     }
 
index 32e6214ee2bc6db189bc18e89839f916b6b7d4bb..a8dd75b7f2c13e4e458a67f69bacc038b28a8d67 100644 (file)
@@ -1011,7 +1011,7 @@ Standard_Real GEOMUtils::GetMinDistance
       P2 = dst.PointOnShape2(i);
 
       Standard_Real Dist = P1.Distance(P2);
-      if (aResult > Dist) {
+      if (aResult < 0 || aResult > Dist) {
         aResult = Dist;
         thePnt1 = P1;
         thePnt2 = P2;