From: mpv Date: Thu, 17 Oct 2019 16:12:45 +0000 (+0300) Subject: Fix for the issue #17867 : ExtrusionCut doesn't work X-Git-Tag: V9_4_0rc1~18 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=d83e80be12739ea2d4f3101fabab8d2b2ba40313;p=modules%2Fshaper.git Fix for the issue #17867 : ExtrusionCut doesn't work Allow to select start point of an arc even due to the 2D->3D conversion produces 3.e-7 error in coordinates. --- diff --git a/src/Model/Model_Data.h b/src/Model/Model_Data.h index f2698eef9..9f26d8de1 100644 --- a/src/Model/Model_Data.h +++ b/src/Model/Model_Data.h @@ -326,7 +326,6 @@ private: MODEL_EXPORT virtual bool isPrecedingAttribute(const std::string& theAttribute1, const std::string& theAttribute2) const; - friend class Model_Objects; }; /// Generic method to register back reference, used in referencing attributes. diff --git a/src/PartSet/PartSet_Tools.cpp b/src/PartSet/PartSet_Tools.cpp index 3ef5b735f..0ff7ad2e5 100644 --- a/src/PartSet/PartSet_Tools.cpp +++ b/src/PartSet/PartSet_Tools.cpp @@ -648,6 +648,7 @@ AttributePtr PartSet_Tools::findAttributeBy2dPoint(ObjectPtr theObj, aFeature->data()->attributes(GeomDataAPI_Point2D::typeId()); std::list::const_iterator anIt = anAttiributes.begin(), aLast = anAttiributes.end(); + double aMinDistance = 1.e-6; // searching for point with minimal distance and < 1.e-6 for (; anIt != aLast && !anAttribute; anIt++) { std::shared_ptr aCurPoint = std::dynamic_pointer_cast(*anIt); @@ -656,9 +657,12 @@ AttributePtr PartSet_Tools::findAttributeBy2dPoint(ObjectPtr theObj, std::shared_ptr aPnt = convertTo3D(aCurPoint->x(), aCurPoint->y(), theSketch); - if (aPnt && (aPnt->distance(aValue) < Precision::Confusion())) { - anAttribute = aCurPoint; - break; + if (aPnt) { + double aDistance = aPnt->distance(aValue); + if (aDistance < aMinDistance) { + anAttribute = aCurPoint; + aMinDistance = aPnt->distance(aValue); + } } } }