Salome HOME
83613dda42e8df0195fe1ab4721a94a6d833340d
[modules/shaper.git] / src / ModelAPI / Test / TestWeakNaming2452.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 from salome.shaper import model
22
23 model.begin()
24 partSet = model.moduleDocument()
25 Part_1 = model.addPart(partSet)
26 Part_1_doc = Part_1.document()
27 Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
28 SketchLine_1 = Sketch_1.addLine(-20.13803680981595, 73.73619631901842, -73.42638036809818, 73.73619631901842)
29 SketchLine_2 = Sketch_1.addLine(-73.42638036809818, 73.73619631901842, -73.42638036809818, 32.22085889570552)
30 SketchLine_3 = Sketch_1.addLine(-73.42638036809818, 32.22085889570552, -20.13803680981595, 32.22085889570552)
31 SketchLine_4 = Sketch_1.addLine(-20.13803680981595, 32.22085889570552, -20.13803680981595, 73.73619631901842)
32 SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_1.startPoint())
33 SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint())
34 SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint())
35 SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
36 SketchConstraintHorizontal_1 = Sketch_1.setHorizontal(SketchLine_1.result())
37 SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_2.result())
38 SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_3.result())
39 SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_4.result())
40 SketchLine_5 = Sketch_1.addLine(82.41104294478531, 71.56748466257669, 24.47546012269937, 71.56748466257669)
41 SketchLine_6 = Sketch_1.addLine(24.47546012269937, 71.56748466257669, 24.47546012269937, 17.96932515337424)
42 SketchLine_7 = Sketch_1.addLine(24.47546012269937, 17.96932515337424, 82.41104294478531, 17.96932515337424)
43 SketchLine_8 = Sketch_1.addLine(82.41104294478531, 17.96932515337424, 82.41104294478531, 71.56748466257669)
44 SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_8.endPoint(), SketchLine_5.startPoint())
45 SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_5.endPoint(), SketchLine_6.startPoint())
46 SketchConstraintCoincidence_7 = Sketch_1.setCoincident(SketchLine_6.endPoint(), SketchLine_7.startPoint())
47 SketchConstraintCoincidence_8 = Sketch_1.setCoincident(SketchLine_7.endPoint(), SketchLine_8.startPoint())
48 SketchConstraintHorizontal_3 = Sketch_1.setHorizontal(SketchLine_5.result())
49 SketchConstraintVertical_3 = Sketch_1.setVertical(SketchLine_6.result())
50 SketchConstraintHorizontal_4 = Sketch_1.setHorizontal(SketchLine_7.result())
51 SketchConstraintVertical_4 = Sketch_1.setVertical(SketchLine_8.result())
52 SketchLine_9 = Sketch_1.addLine(-0.3098159509202501, -18.89877300613497, -69.70858895705524, -18.89877300613497)
53 SketchLine_10 = Sketch_1.addLine(-69.70858895705524, -18.89877300613497, -69.70858895705524, -72.80674846625769)
54 SketchLine_11 = Sketch_1.addLine(-69.70858895705524, -72.80674846625769, -0.3098159509202501, -72.80674846625769)
55 SketchLine_12 = Sketch_1.addLine(-0.3098159509202501, -72.80674846625769, -0.3098159509202501, -18.89877300613497)
56 SketchConstraintCoincidence_9 = Sketch_1.setCoincident(SketchLine_12.endPoint(), SketchLine_9.startPoint())
57 SketchConstraintCoincidence_10 = Sketch_1.setCoincident(SketchLine_9.endPoint(), SketchLine_10.startPoint())
58 SketchConstraintCoincidence_11 = Sketch_1.setCoincident(SketchLine_10.endPoint(), SketchLine_11.startPoint())
59 SketchConstraintCoincidence_12 = Sketch_1.setCoincident(SketchLine_11.endPoint(), SketchLine_12.startPoint())
60 SketchConstraintHorizontal_5 = Sketch_1.setHorizontal(SketchLine_9.result())
61 SketchConstraintVertical_5 = Sketch_1.setVertical(SketchLine_10.result())
62 SketchConstraintHorizontal_6 = Sketch_1.setHorizontal(SketchLine_11.result())
63 SketchConstraintVertical_6 = Sketch_1.setVertical(SketchLine_12.result())
64 SketchLine_13 = Sketch_1.addLine(74.04601226993866, -25.09509202453988, 29.74233128834356, -25.09509202453988)
65 SketchLine_14 = Sketch_1.addLine(29.74233128834356, -25.09509202453988, 29.74233128834356, -77.45398773006136)
66 SketchLine_15 = Sketch_1.addLine(29.74233128834356, -77.45398773006136, 74.04601226993866, -77.45398773006136)
67 SketchLine_16 = Sketch_1.addLine(74.04601226993866, -77.45398773006136, 74.04601226993866, -25.09509202453988)
68 SketchConstraintCoincidence_13 = Sketch_1.setCoincident(SketchLine_16.endPoint(), SketchLine_13.startPoint())
69 SketchConstraintCoincidence_14 = Sketch_1.setCoincident(SketchLine_13.endPoint(), SketchLine_14.startPoint())
70 SketchConstraintCoincidence_15 = Sketch_1.setCoincident(SketchLine_14.endPoint(), SketchLine_15.startPoint())
71 SketchConstraintCoincidence_16 = Sketch_1.setCoincident(SketchLine_15.endPoint(), SketchLine_16.startPoint())
72 SketchConstraintHorizontal_7 = Sketch_1.setHorizontal(SketchLine_13.result())
73 SketchConstraintVertical_7 = Sketch_1.setVertical(SketchLine_14.result())
74 SketchConstraintHorizontal_8 = Sketch_1.setHorizontal(SketchLine_15.result())
75 SketchConstraintVertical_8 = Sketch_1.setVertical(SketchLine_16.result())
76 SketchLine_17 = Sketch_1.addLine(52.66871165644174, 52.66871165644174, -42.75460122699386, 52.66871165644174)
77 SketchLine_18 = Sketch_1.addLine(-42.75460122699386, 52.66871165644174, -42.75460122699386, -41.51533742331289)
78 SketchLine_19 = Sketch_1.addLine(-42.75460122699386, -41.51533742331289, 52.66871165644174, -41.51533742331289)
79 SketchLine_20 = Sketch_1.addLine(52.66871165644174, -41.51533742331289, 52.66871165644174, 52.66871165644174)
80 SketchConstraintCoincidence_17 = Sketch_1.setCoincident(SketchLine_20.endPoint(), SketchLine_17.startPoint())
81 SketchConstraintCoincidence_18 = Sketch_1.setCoincident(SketchLine_17.endPoint(), SketchLine_18.startPoint())
82 SketchConstraintCoincidence_19 = Sketch_1.setCoincident(SketchLine_18.endPoint(), SketchLine_19.startPoint())
83 SketchConstraintCoincidence_20 = Sketch_1.setCoincident(SketchLine_19.endPoint(), SketchLine_20.startPoint())
84 SketchConstraintHorizontal_9 = Sketch_1.setHorizontal(SketchLine_17.result())
85 SketchConstraintVertical_9 = Sketch_1.setVertical(SketchLine_18.result())
86 SketchConstraintHorizontal_10 = Sketch_1.setHorizontal(SketchLine_19.result())
87 SketchConstraintVertical_10 = Sketch_1.setVertical(SketchLine_20.result())
88 model.do()
89 Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), 100, 100)
90 Translation_1 = model.addTranslation(Part_1_doc, [model.selection("COMPSOLID", "Extrusion_1_1")], model.selection("EDGE", "[Extrusion_1_1_2/Generated_Face&Sketch_1/SketchLine_20][Extrusion_1_1_2/To_Face]"), 200)
91 Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), 50, 50)
92 Translation_2 = model.addTranslation(Part_1_doc, [model.selection("COMPSOLID", "Extrusion_2_1")], model.selection("EDGE", "[Extrusion_2_1_2/Generated_Face&Sketch_1/SketchLine_20][Extrusion_2_1_2/To_Face]"), 150)
93 Boolean_1 = model.addCut(Part_1_doc, [model.selection("COMPSOLID", "Translation_1_1")], [model.selection("COMPSOLID", "Translation_2_1")])
94 model.do()
95 model.testHaveNamingSubshapes(Boolean_1, model, Part_1_doc)
96 model.end()