From: azv Date: Mon, 19 Feb 2018 07:32:52 +0000 (+0300) Subject: Issue #2157: Fix incorrect searching of features coincident to fillet point X-Git-Tag: V_3.0.0~9 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=99ec31c777055dab5411d31bb490fee1935f31ce;p=modules%2Fshaper.git Issue #2157: Fix incorrect searching of features coincident to fillet point Signed-off-by: mpv --- diff --git a/src/SketchPlugin/CMakeLists.txt b/src/SketchPlugin/CMakeLists.txt index cc169af86..34ddf4b9a 100644 --- a/src/SketchPlugin/CMakeLists.txt +++ b/src/SketchPlugin/CMakeLists.txt @@ -235,6 +235,7 @@ ADD_UNIT_TESTS(TestSketchPointLine.py Test2393.py Test2425.py Test2440.py + Test2157.py ) if(${SKETCHER_CHANGE_RADIUS_WHEN_MOVE}) diff --git a/src/SketchPlugin/SketchPlugin_Fillet.cpp b/src/SketchPlugin/SketchPlugin_Fillet.cpp index 106b3a7cf..d2e46b7c3 100644 --- a/src/SketchPlugin/SketchPlugin_Fillet.cpp +++ b/src/SketchPlugin/SketchPlugin_Fillet.cpp @@ -203,8 +203,15 @@ bool SketchPlugin_Fillet::calculateFilletParameters() if (!aFilletPoint2D.get()) return false; - std::set aFilletFeatures = - SketchPlugin_Tools::findFeaturesCoincidentToPoint(aFilletPoint2D); + std::set aCoincidentPoints = + SketchPlugin_Tools::findPointsCoincidentToPoint(aFilletPoint2D); + std::set aFilletFeatures; + for (std::set::iterator aCPIt = aCoincidentPoints.begin(); + aCPIt != aCoincidentPoints.end(); ++aCPIt) { + FeaturePtr anOwner = ModelAPI_Feature::feature((*aCPIt)->owner()); + if (anOwner) + aFilletFeatures.insert(anOwner); + } if (aFilletFeatures.size() != 2) { setError("Error: Selected point does not have two suitable edges for fillet."); return false; diff --git a/src/SketchPlugin/Test/Test2157.py b/src/SketchPlugin/Test/Test2157.py new file mode 100644 index 000000000..0635801f7 --- /dev/null +++ b/src/SketchPlugin/Test/Test2157.py @@ -0,0 +1,41 @@ +## Copyright (C) 2018-20xx CEA/DEN, EDF R&D +## +## This library is free software; you can redistribute it and/or +## modify it under the terms of the GNU Lesser General Public +## License as published by the Free Software Foundation; either +## version 2.1 of the License, or (at your option) any later version. +## +## This library is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## Lesser General Public License for more details. +## +## You should have received a copy of the GNU Lesser General Public +## License along with this library; if not, write to the Free Software +## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +## +## See http:##www.salome-platform.org/ or +## email : webmaster.salome@opencascade.com +## + +from salome.shaper import model + +model.begin() +partSet = model.moduleDocument() +Part_1 = model.addPart(partSet) +Part_1_doc = Part_1.document() +Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY")) +SketchLine_1 = Sketch_1.addLine(14.02956299682377, 22.92420172826143, 50.52730937285911, 55.74918048752026) +SketchLine_2 = Sketch_1.addLine(37.41590909090908, 14.23181818181818, 32.3113094484989, 39.36625633556781) +SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_1.result()) +SketchLine_3 = Sketch_1.addLine(32.3113094484989, 39.36625633556781, 60.59999999999999, 33.28409090909091) +SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint()) +model.do() + +SketchFillet_1 = Sketch_1.setFillet(SketchLine_2.endPoint()) +model.do() + +assert(Sketch_1.feature().error() == "") +assert(Sketch_1.solverError().value() == "") + +model.end()