Salome HOME
Updated copyright comment
[modules/shaper.git] / src / SketchPlugin / Test / Test3170.py
1 # Copyright (C) 2020-2024  CEA, EDF
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 email : webmaster.salome@opencascade.com
18 #
19
20 from salome.shaper import model
21
22 model.begin()
23 partSet = model.moduleDocument()
24 Sketch_1 = model.addSketch(partSet, model.defaultPlane("XOY"))
25 SketchLine_1 = Sketch_1.addLine(-17.82085345143611, 21.43637119696745, -32.3626718085896, -17.44370962732489)
26 SketchLine_2 = Sketch_1.addLine(-32.3626718085896, -17.44370962732489, 6.049253461791531, -11.27075409452475)
27 SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint())
28 SketchLine_3 = Sketch_1.addLine(6.049253461791531, -11.27075409452475, -17.82085345143611, 21.43637119696745)
29 SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint())
30 SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchLine_3.endPoint())
31 SketchLine_4 = Sketch_1.addLine(-32.3626718085896, -17.44370962732489, -5.812861704098991, 4.982867573918385)
32 SketchLine_4.setAuxiliary(True)
33 SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_4.startPoint())
34 SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_3.result())
35 model.end()
36
37 DoF = model.dof(Sketch_1)
38
39 model.begin()
40 Sketch_1.setFillet(SketchLine_2.startPoint())
41 DoF += 3
42 model.end()
43
44 assert(model.dof(Sketch_1) == DoF)
45
46 model.testNbSubFeatures(Sketch_1, "SketchPoint", 0)
47 model.testNbSubFeatures(Sketch_1, "SketchLine", 4)
48 model.testNbSubFeatures(Sketch_1, "SketchArc", 1)
49 model.testNbSubFeatures(Sketch_1, "SketchConstraintCoincidence", 5)
50 model.testNbSubFeatures(Sketch_1, "SketchConstraintTangent", 2)
51
52 assert(model.checkPythonDump())