From 9353f1ed979ac1dfd707739761bf54340ede16dd Mon Sep 17 00:00:00 2001 From: dbv Date: Wed, 29 Aug 2018 15:50:33 +0300 Subject: [PATCH] Issue #2319: AttributeError: 'NoneType' object has no attribute 'isVertex' in model.testHaveNamingVertices Added small fix. --- src/FeaturesPlugin/CMakeLists.txt | 1 + src/FeaturesPlugin/FeaturesPlugin_Union.cpp | 4 +- .../Test/TestUnion4CurvedFaces_2.py | 39 +++++++++++++++++++ 3 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 src/FeaturesPlugin/Test/TestUnion4CurvedFaces_2.py diff --git a/src/FeaturesPlugin/CMakeLists.txt b/src/FeaturesPlugin/CMakeLists.txt index 59934e949..11a8377a2 100644 --- a/src/FeaturesPlugin/CMakeLists.txt +++ b/src/FeaturesPlugin/CMakeLists.txt @@ -236,6 +236,7 @@ ADD_UNIT_TESTS(TestExtrusion.py TestPartitionInclinedFaceSolid.py TestPartitionWireFaceSolid.py TestUnion4CurvedFaces.py + TestUnion4CurvedFaces_2.py TestUnion4Faces.py TestUnionOfUnion.py TestMeasurementLength.py diff --git a/src/FeaturesPlugin/FeaturesPlugin_Union.cpp b/src/FeaturesPlugin/FeaturesPlugin_Union.cpp index 33bd7450b..775da23a3 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Union.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Union.cpp @@ -183,10 +183,10 @@ void FeaturesPlugin_Union::execute() for(ListOfShape::const_iterator anIter = anObjects.begin(); anIter != anObjects.end(); ++anIter) { aResultBody->loadAndOrientModifiedShapes(&aMakeShapeList, *anIter, GeomAPI_Shape::EDGE, aModifyEdgeTag, aModEName, aMapOfShapes, - true, false, true); + false, true, true); aResultBody->loadAndOrientModifiedShapes(&aMakeShapeList, *anIter, GeomAPI_Shape::FACE, aModifyFaceTag, aModFName, aMapOfShapes, - true, false, true); + false, true, true); //aResultBody->loadDeletedShapes(&aMakeShapeList, *anIter, GeomAPI_Shape::FACE, aDeletedTag); } diff --git a/src/FeaturesPlugin/Test/TestUnion4CurvedFaces_2.py b/src/FeaturesPlugin/Test/TestUnion4CurvedFaces_2.py new file mode 100644 index 000000000..2519dd469 --- /dev/null +++ b/src/FeaturesPlugin/Test/TestUnion4CurvedFaces_2.py @@ -0,0 +1,39 @@ +## 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")) +SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "PartSet/Origin"), False) +SketchPoint_1 = SketchProjection_1.createdFeature() +SketchArc_1 = Sketch_1.addArc(0, 0, 14.26163338647443, -11.82948087533604, 14.26163338647443, 11.82948087533609, False) +SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchPoint_1.result(), SketchArc_1.center()) +SketchLine_1 = Sketch_1.addLine(14.26163338647443, -11.82948087533604, 14.26163338647443, 11.82948087533609) +SketchLine_1.setAuxiliary(True) +SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchArc_1.startPoint(), SketchLine_1.startPoint()) +SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchArc_1.endPoint(), SketchLine_1.endPoint()) +SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_1.result()) +model.do() +Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchArc_1_2")]) +Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("EDGE", "Edge_1_1")], model.selection("EDGE", "PartSet/OY"), 360, 0) +Partition_1 = model.addPartition(Part_1_doc, [model.selection("FACE", "PartSet/YOZ"), model.selection("FACE", "PartSet/XOZ"), model.selection("FACE", "PartSet/XOY"), model.selection("FACE", "Revolution_1_1")]) +Union_1 = model.addUnion(Part_1_doc, [model.selection("FACE", "Partition_1_1_1"), model.selection("FACE", "Partition_1_1_2"), model.selection("FACE", "Partition_1_1_3"), model.selection("FACE", "Partition_1_1_4")]) +model.testHaveNamingSubshapes(Union_1,model,Part_1_doc) +model.do() +model.end() -- 2.39.2