From 01e7972a8204f4cba29cd9802e12086737d327d9 Mon Sep 17 00:00:00 2001 From: mpv Date: Thu, 15 Feb 2018 17:20:59 +0300 Subject: [PATCH] Fix for the issue #2439 : Naming of vertices incorrect after build an edge --- src/BuildPlugin/BuildPlugin_Edge.cpp | 3 +- src/BuildPlugin/CMakeLists.txt | 1 + src/BuildPlugin/Test/Test2439.py | 46 ++++++++++++++++++++++++++++ 3 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 src/BuildPlugin/Test/Test2439.py diff --git a/src/BuildPlugin/BuildPlugin_Edge.cpp b/src/BuildPlugin/BuildPlugin_Edge.cpp index 62a036a4b..253de35b5 100644 --- a/src/BuildPlugin/BuildPlugin_Edge.cpp +++ b/src/BuildPlugin/BuildPlugin_Edge.cpp @@ -103,7 +103,8 @@ void BuildPlugin_Edge::execute() int aModVertexTag = 1; std::string aModVertexName = "Modified_Vertex"; aResultBody->loadAndOrientModifiedShapes(&aCopyAlgo, aShape, GeomAPI_Shape::VERTEX, - aModVertexTag, aModVertexName, *aSubShapes.get()); + aModVertexTag, aModVertexName, *aSubShapes.get(), + true); setResult(aResultBody, aResultIndex); ++aResultIndex; diff --git a/src/BuildPlugin/CMakeLists.txt b/src/BuildPlugin/CMakeLists.txt index f83476d8f..ec8947b4a 100644 --- a/src/BuildPlugin/CMakeLists.txt +++ b/src/BuildPlugin/CMakeLists.txt @@ -113,4 +113,5 @@ ADD_UNIT_TESTS(TestVertex.py Test1920.py Test2398.py Test2415.py + Test2439.py ) diff --git a/src/BuildPlugin/Test/Test2439.py b/src/BuildPlugin/Test/Test2439.py new file mode 100644 index 000000000..3a66d3930 --- /dev/null +++ b/src/BuildPlugin/Test/Test2439.py @@ -0,0 +1,46 @@ +## Copyright (C) 2014-2017 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(200, 200, -200, 200) +SketchLine_2 = Sketch_1.addLine(-200, 200, -200, -200) +SketchLine_3 = Sketch_1.addLine(-200, -200, 200, -200) +SketchLine_4 = Sketch_1.addLine(200, -200, 200, 200) +SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_1.startPoint()) +SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint()) +SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint()) +SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint()) +SketchConstraintHorizontal_1 = Sketch_1.setHorizontal(SketchLine_1.result()) +SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_2.result()) +SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_3.result()) +SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_4.result()) +model.do() +Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_2f-SketchLine_3f-SketchLine_4f")], model.selection(), 100, 0) +Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Extrusion_1_1/Generated_Face_2&Extrusion_1_1/To_Face_1")]) +model.do() + +model.testHaveNamingSubshapes(Edge_1, model, Part_1_doc) +model.end() -- 2.39.2