Salome HOME
Fix for the issue #2753 : error when dump/load script
[modules/shaper.git] / src / SketchPlugin / Test / Test2034_2.py
1 ## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
2 ##
3 ## This library is free software; you can redistribute it and/or
4 ## modify it under the terms of the GNU Lesser General Public
5 ## License as published by the Free Software Foundation; either
6 ## version 2.1 of the License, or (at your option) any later version.
7 ##
8 ## This library is distributed in the hope that it will be useful,
9 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
10 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 ## Lesser General Public License for more details.
12 ##
13 ## You should have received a copy of the GNU Lesser General Public
14 ## License along with this library; if not, write to the Free Software
15 ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 ##
17 ## See http:##www.salome-platform.org/ or
18 ## email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
19 ##
20
21 """
22     Test2034_2.py
23     Test case for issue #2034 "Conflicting constraint not raised (but found by planegcs and shaper's dof computation)"
24 """
25
26 from salome.shaper import model
27
28 model.begin()
29 partSet = model.moduleDocument()
30 Sketch_1 = model.addSketch(partSet, model.defaultPlane("XOY"))
31 SketchCircle_1 = Sketch_1.addCircle(2.537917624456907, 8.497392663945117, 15)
32 SketchLine_1 = Sketch_1.addLine(-12.22290362866818, 11.16537990805196, 2.537924341198721, 8.497429825311462)
33 SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchCircle_1.results()[1])
34 SketchLine_2 = Sketch_1.addLine(2.537924341198721, 8.497429825311462, 17.29875231106562, 5.829479742570965)
35 SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint())
36 SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchCircle_1.results()[1])
37 SketchConstraintCollinear_1 = Sketch_1.setCollinear(SketchLine_1.result(), SketchLine_2.result())
38 SketchConstraintEqual_1 = Sketch_1.setEqual(SketchLine_1.result(), SketchLine_2.result())
39 SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_1.result(), 15)
40 SketchConstraintRadius_1 = Sketch_1.setRadius(SketchCircle_1.results()[1], 15)
41 model.do()
42
43 # check sketch is correct
44 assert(Sketch_1.solverError().value() == "")
45
46 # add coincidence between center of circle and the end point of line
47 Sketch_1.setCoincident(SketchCircle_1.center(), SketchLine_1.endPoint())
48 model.do()
49 assert(Sketch_1.solverError().value() != "")
50
51
52 model.end()