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