1 # Copyright (C) 2020-2021 CEA/DEN, EDF R&D
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.
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.
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
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 from salome.shaper import model
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())
37 DoF = model.dof(Sketch_1)
40 Sketch_1.setFillet(SketchLine_2.startPoint())
44 assert(model.dof(Sketch_1) == DoF)
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)
52 assert(model.checkPythonDump())