X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=test.models%2Fwheel_rim.py;h=fc845501783283bba4deec0c000f9748b4531b42;hb=d3636d9a263bea301d2f8e5c5951c6d0dce0fbf2;hp=2c456ef9f19c55480b96ddb969fbb0cf58e3723d;hpb=5f971a92f964594a68189c5fd7c8131758e8c20a;p=modules%2Fshaper.git diff --git a/test.models/wheel_rim.py b/test.models/wheel_rim.py index 2c456ef9f..fc8455017 100644 --- a/test.models/wheel_rim.py +++ b/test.models/wheel_rim.py @@ -1,3 +1,23 @@ +## 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() @@ -59,6 +79,16 @@ SketchConstraintCoincidence_18 = Sketch_1.setCoincident(SketchLine_7.startPoint( SketchConstraintCoincidence_18.setName("SketchConstraintCoincidence_20") SketchConstraintTangent_2 = Sketch_1.setTangent(SketchArc_2.results()[1], SketchArc_3.results()[1]) SketchConstraintTangent_3 = Sketch_1.setTangent(SketchArc_3.results()[1], SketchArc_2.results()[1]) +model.do() + +# check overconstraint message appears +assert Sketch_1.solverError().value() != "", "FAILED: Sketch should report over-constrained situation" +# remove duplicated Tangent constraint +Part_1_doc.removeFeature(SketchConstraintTangent_3.feature()) +model.do() +assert Sketch_1.solverError().value() == "", "FAILED: Sketch should NOT report over-constrained situation" + +# continue creating model SketchLine_8 = Sketch_1.addLine(16.63997893808557, 190, 16.63997893808557, 184) SketchConstraintCoincidence_19 = Sketch_1.setCoincident(SketchLine_2.startPoint(), SketchLine_8.startPoint()) SketchConstraintCoincidence_19.setName("SketchConstraintCoincidence_21") @@ -234,6 +264,6 @@ model.testNbSubShapes(Boolean_1, GeomAPI_Shape.SOLID, [1]) model.testNbSubShapes(Boolean_1, GeomAPI_Shape.FACE, [35]) model.testNbSubShapes(Boolean_1, GeomAPI_Shape.EDGE, [162]) model.testNbSubShapes(Boolean_1, GeomAPI_Shape.VERTEX, [324]) -model.testResultsVolumes(Boolean_1, [2053931.831648423336446285247802734]) +model.testResultsVolumes(Boolean_1, [2053931.558882251149043440818786621]) assert(model.checkPythonDump())