Salome HOME
84fb5e316872d9cbf148c75ae76bc88b5dd323f5
[modules/shaper.git] / src / ModelAPI / Test / Test2685.py
1 # Copyright (C) 2014-2023  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 email : webmaster.salome@opencascade.com
18 #
19
20 from SketchAPI import *
21
22 from salome.shaper import model
23
24 model.begin()
25 partSet = model.moduleDocument()
26 Part_1 = model.addPart(partSet)
27 Part_1_doc = Part_1.document()
28 Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
29 SketchCircle_1 = Sketch_1.addCircle(22, 5, 10)
30 SketchCircle_2 = Sketch_1.addCircle(0, 0, 7.5)
31 SketchCircle_3 = Sketch_1.addCircle(29, -20, 7.5)
32 SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "PartSet/Origin", 1), False)
33 SketchPoint_1 = SketchProjection_1.createdFeature()
34 SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchCircle_2.center(), SketchAPI_Point(SketchPoint_1).coordinates())
35 SketchProjection_2 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OY"), False)
36 SketchLine_1 = SketchProjection_2.createdFeature()
37 SketchConstraintDistance_1 = Sketch_1.setDistance(SketchCircle_1.center(), SketchLine_1.result(), 22, True)
38 SketchProjection_3 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OX"), False)
39 SketchLine_2 = SketchProjection_3.createdFeature()
40 SketchConstraintDistance_2 = Sketch_1.setDistance(SketchCircle_1.center(), SketchLine_2.result(), 5, True)
41 SketchConstraintRadius_1 = Sketch_1.setRadius(SketchCircle_1.results()[1], 10)
42 SketchConstraintRadius_2 = Sketch_1.setRadius(SketchCircle_2.results()[1], 7.5)
43 SketchConstraintRadius_3 = Sketch_1.setRadius(SketchCircle_3.results()[1], 7.5)
44 SketchLine_3 = Sketch_1.addLine(22, 5, 22, 41.96787958115183)
45 SketchLine_3.setAuxiliary(True)
46 SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchCircle_1.center(), SketchLine_3.startPoint())
47 SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_3.result())
48 SketchConstraintDistance_3 = Sketch_1.setDistance(SketchCircle_3.center(), SketchLine_3.result(), 7, True)
49 SketchConstraintDistance_4 = Sketch_1.setDistance(SketchCircle_3.center(), SketchLine_2.result(), 20, True)
50 SketchArc_1 = Sketch_1.addArc(22, 5, 19.39053135678072, 27.42761377547613, 44.57891020979248, 5, True)
51 SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchCircle_1.center(), SketchArc_1.center())
52 SketchLine_4 = Sketch_1.addLine(22, 5, 85.59353403141361, 5)
53 SketchLine_4.setAuxiliary(True)
54 SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchCircle_1.center(), SketchLine_4.startPoint())
55 SketchConstraintHorizontal_1 = Sketch_1.setHorizontal(SketchLine_4.result())
56 SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchArc_1.endPoint(), SketchLine_4.result())
57 SketchLine_5 = Sketch_1.addLine(44.57891020979248, 5, 44.57891020979248, -20)
58 SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchArc_1.endPoint(), SketchLine_5.startPoint())
59 SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_5.result())
60 SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_5.result(), 25)
61 model.end()
62
63 assert(model.checkPythonDump(model.ModelHighAPI.CHECK_WEAK))