From aea873ec041ce8a40671807b73b09abcd5ec44d3 Mon Sep 17 00:00:00 2001 From: azv Date: Tue, 16 Jan 2018 15:41:32 +0300 Subject: [PATCH] Issue #2394: Incorrect selected subsolids in "union" after modifying the geometry ("delta-p") Fix failures in test case related to #2394 --- src/FeaturesPlugin/Test/Test2394.py | 2 +- src/GeomAlgoAPI/GeomAlgoAPI_SortListOfShapes.cpp | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/FeaturesPlugin/Test/Test2394.py b/src/FeaturesPlugin/Test/Test2394.py index 784e39f30..fae2d1a1e 100644 --- a/src/FeaturesPlugin/Test/Test2394.py +++ b/src/FeaturesPlugin/Test/Test2394.py @@ -106,7 +106,7 @@ Boolean_4.result().subResult(2).setColor(51, 51, 102) Boolean_4.result().subResult(3).setColor(102, 204, 102) Boolean_4.result().subResult(4).setColor(204, 204, 0) -Union_1 = model.addUnion(Part_1_doc, [model.selection("SOLID", "Boolean_4_1_4"), model.selection("SOLID", "Boolean_4_1_3")]) +Union_1 = model.addUnion(Part_1_doc, [model.selection("SOLID", "Boolean_4_1_4"), model.selection("SOLID", "Boolean_4_1_2")]) Point_3 = model.addPoint(Part_1_doc, model.selection("EDGE", "Axis_1"), model.selection("FACE", "Plane_2 arrivee tuyau")) diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_SortListOfShapes.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_SortListOfShapes.cpp index a6d04aabf..730def474 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_SortListOfShapes.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_SortListOfShapes.cpp @@ -116,10 +116,11 @@ class CompareShapes bool isLess(const gp_Pnt& theLHS, const gp_Pnt& theRHS) { + static const double aTol = 10. * Precision::Confusion(); for (int anIndex = 1; anIndex <= 3; ++anIndex) { - if (isLessWithTol(theLHS.Coord(anIndex), theRHS.Coord(anIndex), Precision::Confusion())) + if (isLessWithTol(theLHS.Coord(anIndex), theRHS.Coord(anIndex), aTol)) return true; - else if (isLessWithTol(theRHS.Coord(anIndex), theLHS.Coord(anIndex), Precision::Confusion())) + else if (isLessWithTol(theRHS.Coord(anIndex), theLHS.Coord(anIndex), aTol)) return false; } // equal points -- 2.39.2