Salome HOME
Fix for the issue #2439 : Naming of vertices incorrect after build an edge
authormpv <mpv@opencascade.com>
Thu, 15 Feb 2018 14:20:59 +0000 (17:20 +0300)
committermpv <mpv@opencascade.com>
Thu, 15 Feb 2018 14:20:59 +0000 (17:20 +0300)
src/BuildPlugin/BuildPlugin_Edge.cpp
src/BuildPlugin/CMakeLists.txt
src/BuildPlugin/Test/Test2439.py [new file with mode: 0644]

index 62a036a4b83c5fe99503bb395864c7cb68033cd4..253de35b573f465e337c72eac1e9af642759c138 100644 (file)
@@ -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;
index f83476d8fb25413f94135bd491b8e3dd08476baf..ec8947b4a6d981fc7ad05fb86d6507930a479704 100644 (file)
@@ -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 (file)
index 0000000..3a66d39
--- /dev/null
@@ -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<mailto: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()