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