]> SALOME platform Git repositories - modules/shaper.git/blob - test.API/SHAPER/Transformations/TestTranslation_3.py
Salome HOME
Merge remote-tracking branch 'remotes/origin/Dev_ResultNames'
[modules/shaper.git] / test.API / SHAPER / Transformations / TestTranslation_3.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 """
22 Test case for Translation feature.
23 Written on High API.
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
32 # Boxes
33 Box_1 = model.addBox(Part_1_doc, 10, 20, 10)
34
35 ####################
36 # Sketches
37 # Sketch contenant un triangle
38 Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
39 SketchLine_1 = Sketch_1.addLine(105.8795836373178, 106.9780351893485, -55.30451701345322, -118.6797057217308)
40 SketchLine_2 = Sketch_1.addLine(-55.30451701345322, -118.6797057217308, -134.9484255703047, 86.11891628160174)
41 SketchLine_3 = Sketch_1.addLine(-134.9484255703047, 86.11891628160174, 105.8795836373178, 106.9780351893485)
42 SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint())
43 SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint())
44 SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchLine_3.endPoint())
45
46 # Sketch contenant un cercle et une ligne droite ne coupant pas le cercle, tous deux contenus dans l'une des faces de la box 1
47 Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Box_1_1/Top"))
48 SketchCircle_1 = Sketch_2.addCircle(3.625538020086079, 17.57352941176471, 2.190441696184978)
49 SketchLine_4 = Sketch_2.addLine(2.442711482557598, 6.454964041059345, 8.035432938365913, 18.18483116518828)
50
51 # Sketch contenant une ligne droite
52 Sketch_3 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
53 SketchLine_5 = Sketch_3.addLine(-42.70592498087446, -19.7671890801643, 76.68536514422158, 72.47712556405142)
54
55 # Sketch contenant 2 lignes droites independantes
56 Sketch_4 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
57 SketchLine_6 = Sketch_4.addLine(64.56241032998567, 126.9727403156384, -187.948350071736, -65.2797704447633)
58 SketchLine_7 = Sketch_4.addLine(147.7761836441895, 78.19225251076045, 2.869440459110503, -194.4045911047346)
59
60 # Sketch contenant un triangle et une ligne droite sans contact avec le triangle
61 Sketch_5 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
62 SketchLine_8 = Sketch_5.addLine(43.04160688665702, 82.49641319942614, -63.12769010043041, -3.586800573888105)
63 SketchLine_9 = Sketch_5.addLine(-63.12769010043041, -3.586800573888105, 60.25824964132004, -45.19368723098994)
64 SketchLine_10 = Sketch_5.addLine(60.25824964132004, -45.19368723098994, 43.04160688665702, 82.49641319942614)
65 SketchConstraintCoincidence_4 = Sketch_5.setCoincident(SketchLine_8.endPoint(), SketchLine_9.startPoint())
66 SketchConstraintCoincidence_5 = Sketch_5.setCoincident(SketchLine_9.endPoint(), SketchLine_10.startPoint())
67 SketchConstraintCoincidence_6 = Sketch_5.setCoincident(SketchLine_8.startPoint(), SketchLine_10.endPoint())
68 SketchLine_11 = Sketch_5.addLine(-129.0707731585723, -64.87131938806517, -62.80680259595319, 54.77196079444149)
69
70 # Sketch contenant deux triangles ayant un cote en commun
71 Sketch_6 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
72 SketchLine_12 = Sketch_6.addLine(31.56384505021527, 81.06169296987088, -80.3443328550933, -15.06456241033)
73 SketchLine_13 = Sketch_6.addLine(-80.3443328550933, -15.06456241033, 58.82352941176466, -35.15064562410331)
74 SketchLine_14 = Sketch_6.addLine(58.82352941176466, -35.15064562410331, 31.56384505021527, 81.06169296987088)
75 SketchLine_15 = Sketch_6.addLine(31.56384505021527, 81.06169296987088, 159.2539454806312, 40.88952654232425)
76 SketchLine_16 = Sketch_6.addLine(159.2539454806312, 40.88952654232425, 58.82352941176466, -35.15064562410331)
77 SketchConstraintCoincidence_7 = Sketch_6.setCoincident(SketchLine_12.endPoint(), SketchLine_13.startPoint())
78 SketchConstraintCoincidence_8 = Sketch_6.setCoincident(SketchLine_13.endPoint(), SketchLine_14.startPoint())
79 SketchConstraintCoincidence_9 = Sketch_6.setCoincident(SketchLine_12.startPoint(), SketchLine_14.endPoint())
80 SketchConstraintCoincidence_10 = Sketch_6.setCoincident(SketchLine_12.startPoint(), SketchLine_15.startPoint())
81 SketchConstraintCoincidence_11 = Sketch_6.setCoincident(SketchLine_15.endPoint(), SketchLine_16.startPoint())
82 SketchConstraintCoincidence_12 = Sketch_6.setCoincident(SketchLine_13.endPoint(), SketchLine_16.endPoint())
83
84 # Sketch contenant deux triangles ayant un cote en commun et une ligne droite ne coupant aucun des 2 triangles
85 Sketch_7 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
86 SketchLine_17 = Sketch_7.addLine(17.21664275466276, 98.27833572453372, -144.906743185079, -46.6284074605452)
87 SketchLine_18 = Sketch_7.addLine(-144.906743185079, -46.6284074605452, 143.4720229555236, -105.4519368723099)
88 SketchLine_19 = Sketch_7.addLine(143.4720229555236, -105.4519368723099, 17.21664275466276, 98.27833572453372)
89 SketchLine_20 = Sketch_7.addLine(17.21664275466276, 98.27833572453372, 272.5968436154949, 99.71305595408899)
90 SketchLine_21 = Sketch_7.addLine(272.5968436154949, 99.71305595408899, 143.4720229555236, -105.4519368723099)
91 SketchConstraintCoincidence_13 = Sketch_7.setCoincident(SketchLine_17.endPoint(), SketchLine_18.startPoint())
92 SketchConstraintCoincidence_14 = Sketch_7.setCoincident(SketchLine_18.endPoint(), SketchLine_19.startPoint())
93 SketchConstraintCoincidence_15 = Sketch_7.setCoincident(SketchLine_17.startPoint(), SketchLine_19.endPoint())
94 SketchConstraintCoincidence_16 = Sketch_7.setCoincident(SketchLine_17.startPoint(), SketchLine_20.startPoint())
95 SketchConstraintCoincidence_17 = Sketch_7.setCoincident(SketchLine_20.endPoint(), SketchLine_21.startPoint())
96 SketchConstraintCoincidence_18 = Sketch_7.setCoincident(SketchLine_18.endPoint(), SketchLine_21.endPoint())
97 SketchLine_22 = Sketch_7.addLine(-190.8177905308465, 62.41032998565277, -307.0301291248207, -188.6657101865136)
98
99 # Sketch contenant un cercle
100 Sketch_8 = model.addSketch(Part_1_doc, model.selection("FACE", "Box_1_1/Front"))
101 SketchCircle_2 = Sketch_8.addCircle(5.043472022955523, 6.180989956958394, 2.65480068754944)
102
103 model.do()
104
105 # Extrusions
106 Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Sketch_2/Wire-SketchCircle_1_2f")], model.selection(), 15, 0)
107 Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Sketch_8/Wire-SketchCircle_2_2f")], model.selection(), 15, 0)
108
109 # Edges
110 Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_2")])
111 Edge_2 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_3/Edge-SketchLine_5")])
112 Edge_3 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_3/Edge-SketchLine_5")])
113 Edge_4 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_3/Edge-SketchLine_5")])
114 Edge_5 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_3/Edge-SketchLine_5")])
115 Edge_6 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_3/Edge-SketchLine_5")])
116 Edge_7 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_4/Edge-SketchLine_7")])
117 Edge_8 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_4/Edge-SketchLine_6")])
118 Edge_9 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_4/Edge-SketchLine_7")])
119 Edge_10 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_4/Edge-SketchLine_7")])
120 Edge_11 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_5/Edge-SketchLine_11")])
121 Edge_12 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_7/Edge-SketchLine_22")])
122
123 # Axis
124 Axis_1 = model.addAxis(Part_1_doc, 10, 10, 10)
125
126 # Vertex
127 Vertex_1 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_3/Vertex-SketchLine_5e")])
128 Vertex_2 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_3/Vertex-SketchLine_5e")])
129 Vertex_3 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_3/Vertex-SketchLine_5e")])
130 Vertex_4 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_3/Vertex-SketchLine_5e")])
131 Vertex_5 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_3/Vertex-SketchLine_5e")])
132 Vertex_6 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_3/Vertex-SketchLine_5e")])
133 Vertex_7 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_3/Vertex-SketchLine_5e")])
134 Vertex_8 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_3/Vertex-SketchLine_5e")])
135 Vertex_9 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_3/Vertex-SketchLine_5e")])
136
137 # Wires
138 Wire_1 = model.addWire(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_2f-SketchLine_3f")])
139 Wire_2 = model.addWire(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_2f-SketchLine_3f")])
140 Wire_3 = model.addWire(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_2f-SketchLine_3f")])
141 Wire_4 = model.addWire(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_2f-SketchLine_3f")])
142 Wire_5 = model.addWire(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_2f-SketchLine_3f")])
143 Wire_6 = model.addWire(Part_1_doc, [model.selection("WIRE", "Sketch_5/Wire-SketchLine_8f-SketchLine_9f-SketchLine_10f")])
144 Wire_7 = model.addWire(Part_1_doc, [model.selection("WIRE", "Sketch_5/Wire-SketchLine_8f-SketchLine_9f-SketchLine_10f")])
145 Wire_8 = model.addWire(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_2f-SketchLine_3f")])
146 Wire_9 = model.addWire(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_2f-SketchLine_3f")])
147
148 # Faces
149 Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_2f-SketchLine_3f")])
150 Face_2 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_2f-SketchLine_3f")])
151 Face_3 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_2f-SketchLine_3f")])
152 Face_4 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_2f-SketchLine_3f")])
153 Face_5 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_2f-SketchLine_3f")])
154 Face_6 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_5/Wire-SketchLine_8f-SketchLine_9f-SketchLine_10f")])
155 Face_7 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_5/Wire-SketchLine_8f-SketchLine_9f-SketchLine_10f")])
156 Face_8 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_2f-SketchLine_3f")])
157 Face_9 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_2f-SketchLine_3f")])
158 Face_10 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_6/Wire-SketchLine_12f-SketchLine_13f-SketchLine_14f")])
159 Face_11 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_6/Wire-SketchLine_14r-SketchLine_15r-SketchLine_16r")])
160 Face_12 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_7/Wire-SketchLine_17f-SketchLine_18f-SketchLine_19f")])
161 Face_13 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_7/Wire-SketchLine_19r-SketchLine_20r-SketchLine_21r")])
162
163 # Shells
164 Shell_1 = model.addShell(Part_1_doc, [model.selection("FACE", "Face_10_1"), model.selection("FACE", "Face_11_1")])
165 Shell_1.result().setName("Shell_1_1")
166 Shell_2 = model.addShell(Part_1_doc, [model.selection("FACE", "Face_10_1"), model.selection("FACE", "Face_11_1")])
167 Shell_2.result().setName("Shell_2_1")
168 Shell_3 = model.addShell(Part_1_doc, [model.selection("FACE", "Face_10_1"), model.selection("FACE", "Face_11_1")])
169 Shell_3.result().setName("Shell_3_1")
170 Shell_4 = model.addShell(Part_1_doc, [model.selection("FACE", "Face_10_1"), model.selection("FACE", "Face_11_1")])
171 Shell_4.result().setName("Shell_4_1")
172 Shell_5 = model.addShell(Part_1_doc, [model.selection("FACE", "Face_10_1"), model.selection("FACE", "Face_11_1")])
173 Shell_5.result().setName("Shell_5_1")
174 Shell_6 = model.addShell(Part_1_doc, [model.selection("FACE", "Face_12_1"), model.selection("FACE", "Face_13_1")])
175 Shell_6.result().setName("Shell_6_1")
176 Shell_7 = model.addShell(Part_1_doc, [model.selection("FACE", "Face_12_1"), model.selection("FACE", "Face_13_1")])
177 Shell_7.result().setName("Shell_7_1")
178 Shell_8 = model.addShell(Part_1_doc, [model.selection("FACE", "Face_10_1"), model.selection("FACE", "Face_11_1")])
179 Shell_8.result().setName("Shell_8_1")
180 Shell_9 = model.addShell(Part_1_doc, [model.selection("FACE", "Face_10_1"), model.selection("FACE", "Face_11_1")])
181 Shell_9.result().setName("Shell_9_1")
182
183 # Parameters
184 model.addParameter(Part_1_doc, "d", "15")
185
186 # Translations
187 Translation_45 = model.addTranslation(Part_1_doc, [model.selection("VERTEX", "Vertex_1_1")], model.selection("EDGE", "PartSet/OX"), 15)
188 Translation_46 = model.addTranslation(Part_1_doc, [model.selection("VERTEX", "Vertex_2_1")], model.selection("EDGE", "PartSet/OX"), 0)
189 Translation_47 = model.addTranslation(Part_1_doc, [model.selection("VERTEX", "Vertex_3_1")], model.selection("EDGE", "PartSet/OX"), -15)
190 Translation_48 = model.addTranslation(Part_1_doc, [model.selection("VERTEX", "Vertex_4_1")], model.selection("EDGE", "InvalidName"), 15)
191 Translation_49 = model.addTranslation(Part_1_doc, [model.selection("VERTEX", "Vertex_5_1")], model.selection("EDGE", "PartSet/OX"), "d")
192 Translation_50 = model.addTranslation(Part_1_doc, [model.selection("VERTEX", "Vertex_6_1")], model.selection("EDGE", "Sketch_3/Edge-SketchLine_5"), 15)
193 Translation_51 = model.addTranslation(Part_1_doc, [model.selection("VERTEX", "Vertex_7_1")], model.selection("EDGE", "Edge_2_1"), 15)
194 Translation_52 = model.addTranslation(Part_1_doc, [model.selection("VERTEX", "Vertex_8_1")], model.selection("EDGE", "Box_1_1/Back&Box_1_1/Right"), 15)
195 Translation_53 = model.addTranslation(Part_1_doc, [model.selection("VERTEX", "Vertex_9_1")], model.selection("EDGE", "Axis_1"), 15)
196 Translation_54 = model.addTranslation(Part_1_doc, [model.selection("EDGE", "Edge_2_1")], model.selection("EDGE", "PartSet/OX"), 15)
197 Translation_55 = model.addTranslation(Part_1_doc, [model.selection("EDGE", "Edge_3_1")], model.selection("EDGE", "PartSet/OX"), 0)
198 Translation_56 = model.addTranslation(Part_1_doc, [model.selection("EDGE", "Edge_4_1")], model.selection("EDGE", "PartSet/OX"), -15)
199 Translation_57 = model.addTranslation(Part_1_doc, [model.selection("EDGE", "Edge_5_1")], model.selection("EDGE", "InvalidName"), 15)
200 Translation_58 = model.addTranslation(Part_1_doc, [model.selection("EDGE", "Edge_6_1")], model.selection("EDGE", "PartSet/OY"), "d")
201 Translation_59 = model.addTranslation(Part_1_doc, [model.selection("EDGE", "Edge_7_1")], model.selection("EDGE", "Sketch_4/Edge-SketchLine_6"), 15)
202 Translation_60 = model.addTranslation(Part_1_doc, [model.selection("EDGE", "Edge_8_1")], model.selection("EDGE", "Edge_9_1"), 15)
203 Translation_61 = model.addTranslation(Part_1_doc, [model.selection("EDGE", "Edge_9_1")], model.selection("EDGE", "Box_1_1/Front&Box_1_1/Right"), 15)
204 Translation_62 = model.addTranslation(Part_1_doc, [model.selection("EDGE", "Edge_10_1")], model.selection("EDGE", "Axis_1"), 15)
205 Translation_63 = model.addTranslation(Part_1_doc, [model.selection("WIRE", "Wire_1_1")], model.selection("EDGE", "PartSet/OX"), 15)
206 Translation_64 = model.addTranslation(Part_1_doc, [model.selection("WIRE", "Wire_2_1")], model.selection("EDGE", "PartSet/OX"), 0)
207 Translation_65 = model.addTranslation(Part_1_doc, [model.selection("WIRE", "Wire_3_1")], model.selection("EDGE", "PartSet/OX"), -15)
208 Translation_66 = model.addTranslation(Part_1_doc, [model.selection("WIRE", "Wire_4_1")], model.selection("EDGE", "InvalidName"), 15)
209 Translation_67 = model.addTranslation(Part_1_doc, [model.selection("WIRE", "Wire_5_1")], model.selection("EDGE", "PartSet/OY"), "d")
210 Translation_68 = model.addTranslation(Part_1_doc, [model.selection("WIRE", "Wire_6_1")], model.selection("EDGE", "Sketch_5/Edge-SketchLine_11"), 15)
211 Translation_69 = model.addTranslation(Part_1_doc, [model.selection("WIRE", "Wire_7_1")], model.selection("EDGE", "Edge_11_1"), 15)
212 Translation_70 = model.addTranslation(Part_1_doc, [model.selection("WIRE", "Wire_8_1")], model.selection("EDGE", "Box_1_1/Back&Box_1_1/Right"), 15)
213 Translation_71 = model.addTranslation(Part_1_doc, [model.selection("WIRE", "Wire_9_1")], model.selection("EDGE", "Axis_1"), 15)
214 Translation_72 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Face_1_1")], model.selection("EDGE", "PartSet/OX"), 15)
215 Translation_73 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Face_2_1")], model.selection("EDGE", "PartSet/OX"), 0)
216 Translation_74 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Face_3_1")], model.selection("EDGE", "PartSet/OX"), -15)
217 Translation_75 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Face_4_1")], model.selection("EDGE", "InvalidName"), -15)
218 Translation_76 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Face_5_1")], model.selection("EDGE", "PartSet/OX"), "d")
219 Translation_77 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Face_6_1")], model.selection("EDGE", "Sketch_5/Edge-SketchLine_11"), 15)
220 Translation_78 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Face_7_1")], model.selection("EDGE", "Edge_11_1"), 15)
221 Translation_79 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Face_8_1")], model.selection("EDGE", "Box_1_1/Front&Box_1_1/Right"), 15)
222 Translation_80 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Face_9_1")], model.selection("EDGE", "Axis_1"), 15)
223 Translation_81 = model.addTranslation(Part_1_doc, [model.selection("SHELL", "Shell_1_1")], model.selection("EDGE", "PartSet/OX"), 15)
224 Translation_82 = model.addTranslation(Part_1_doc, [model.selection("SHELL", "Shell_2_1")], model.selection("EDGE", "PartSet/OX"), 0)
225 Translation_83 = model.addTranslation(Part_1_doc, [model.selection("SHELL", "Shell_3_1")], model.selection("EDGE", "PartSet/OX"), -15)
226 Translation_84 = model.addTranslation(Part_1_doc, [model.selection("SHELL", "Shell_4_1")], model.selection("EDGE", "InvalidName"), 15)
227 Translation_85 = model.addTranslation(Part_1_doc, [model.selection("SHELL", "Shell_5_1")], model.selection("EDGE", "PartSet/OX"), "d")
228 Translation_86 = model.addTranslation(Part_1_doc, [model.selection("SHELL", "Shell_6_1")], model.selection("EDGE", "Sketch_7/Edge-SketchLine_22"), 15)
229 Translation_87 = model.addTranslation(Part_1_doc, [model.selection("SHELL", "Shell_7_1")], model.selection("EDGE", "Edge_12_1"), 15)
230 Translation_88 = model.addTranslation(Part_1_doc, [model.selection("SHELL", "Shell_8_1")], model.selection("EDGE", "Box_1_1/Front&Box_1_1/Right"), 15)
231 Translation_89 = model.addTranslation(Part_1_doc, [model.selection("SHELL", "Shell_9_1")], model.selection("EDGE", "Axis_1"), 15)
232 Translation_90 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Box_1_1"), model.selection("SOLID", "Extrusion_2_1")], model.selection("EDGE", "PartSet/OY"), 15)
233 model.do()
234 model.end()
235
236 # Checks
237 from GeomAPI import GeomAPI_Shape
238
239 model.testNbResults(Translation_45, 1)
240 model.testNbSubResults(Translation_45, [0])
241 model.testNbSubShapes(Translation_45, GeomAPI_Shape.COMPSOLID, [0])
242 model.testNbSubShapes(Translation_45, GeomAPI_Shape.SOLID, [0])
243 model.testNbSubShapes(Translation_45, GeomAPI_Shape.FACE, [0])
244 model.testNbSubShapes(Translation_45, GeomAPI_Shape.VERTEX, [1])
245 model.testHaveNamingFaces(Translation_45, model, Part_1_doc)
246
247 model.testNbResults(Translation_46, 1)
248 model.testNbSubResults(Translation_46, [0])
249 model.testNbSubShapes(Translation_46, GeomAPI_Shape.COMPSOLID, [0])
250 model.testNbSubShapes(Translation_46, GeomAPI_Shape.SOLID, [0])
251 model.testNbSubShapes(Translation_46, GeomAPI_Shape.FACE, [0])
252 model.testNbSubShapes(Translation_46, GeomAPI_Shape.VERTEX, [1])
253 model.testHaveNamingFaces(Translation_46, model, Part_1_doc)
254
255 model.testNbResults(Translation_47, 1)
256 model.testNbSubResults(Translation_47, [0])
257 model.testNbSubShapes(Translation_47, GeomAPI_Shape.COMPSOLID, [0])
258 model.testNbSubShapes(Translation_47, GeomAPI_Shape.SOLID, [0])
259 model.testNbSubShapes(Translation_47, GeomAPI_Shape.FACE, [0])
260 model.testNbSubShapes(Translation_47, GeomAPI_Shape.VERTEX, [1])
261 model.testHaveNamingFaces(Translation_47, model, Part_1_doc)
262
263 model.testNbResults(Translation_49, 1)
264 model.testNbSubResults(Translation_49, [0])
265 model.testNbSubShapes(Translation_49, GeomAPI_Shape.COMPSOLID, [0])
266 model.testNbSubShapes(Translation_49, GeomAPI_Shape.SOLID, [0])
267 model.testNbSubShapes(Translation_49, GeomAPI_Shape.FACE, [0])
268 model.testNbSubShapes(Translation_49, GeomAPI_Shape.VERTEX, [1])
269 model.testHaveNamingFaces(Translation_49, model, Part_1_doc)
270
271 model.testNbResults(Translation_50, 1)
272 model.testNbSubResults(Translation_50, [0])
273 model.testNbSubShapes(Translation_50, GeomAPI_Shape.COMPSOLID, [0])
274 model.testNbSubShapes(Translation_50, GeomAPI_Shape.SOLID, [0])
275 model.testNbSubShapes(Translation_50, GeomAPI_Shape.FACE, [0])
276 model.testNbSubShapes(Translation_50, GeomAPI_Shape.VERTEX, [1])
277 model.testHaveNamingFaces(Translation_50, model, Part_1_doc)
278
279 model.testNbResults(Translation_51, 1)
280 model.testNbSubResults(Translation_51, [0])
281 model.testNbSubShapes(Translation_51, GeomAPI_Shape.COMPSOLID, [0])
282 model.testNbSubShapes(Translation_51, GeomAPI_Shape.SOLID, [0])
283 model.testNbSubShapes(Translation_51, GeomAPI_Shape.FACE, [0])
284 model.testNbSubShapes(Translation_51, GeomAPI_Shape.VERTEX, [1])
285 model.testHaveNamingFaces(Translation_51, model, Part_1_doc)
286
287 model.testNbResults(Translation_52, 1)
288 model.testNbSubResults(Translation_52, [0])
289 model.testNbSubShapes(Translation_52, GeomAPI_Shape.COMPSOLID, [0])
290 model.testNbSubShapes(Translation_52, GeomAPI_Shape.SOLID, [0])
291 model.testNbSubShapes(Translation_52, GeomAPI_Shape.FACE, [0])
292 model.testNbSubShapes(Translation_52, GeomAPI_Shape.VERTEX, [1])
293 model.testHaveNamingFaces(Translation_52, model, Part_1_doc)
294
295 model.testNbResults(Translation_53, 1)
296 model.testNbSubResults(Translation_53, [0])
297 model.testNbSubShapes(Translation_53, GeomAPI_Shape.COMPSOLID, [0])
298 model.testNbSubShapes(Translation_53, GeomAPI_Shape.SOLID, [0])
299 model.testNbSubShapes(Translation_53, GeomAPI_Shape.FACE, [0])
300 model.testNbSubShapes(Translation_53, GeomAPI_Shape.VERTEX, [1])
301 model.testHaveNamingFaces(Translation_53, model, Part_1_doc)
302
303 model.testNbResults(Translation_54, 1)
304 model.testNbSubResults(Translation_54, [0])
305 model.testNbSubShapes(Translation_54, GeomAPI_Shape.SOLID, [0])
306 model.testNbSubShapes(Translation_54, GeomAPI_Shape.FACE, [0])
307 model.testNbSubShapes(Translation_54, GeomAPI_Shape.EDGE, [1])
308 model.testHaveNamingFaces(Translation_54, model, Part_1_doc)
309
310 model.testNbResults(Translation_55, 1)
311 model.testNbSubResults(Translation_55, [0])
312 model.testNbSubShapes(Translation_55, GeomAPI_Shape.SOLID, [0])
313 model.testNbSubShapes(Translation_55, GeomAPI_Shape.FACE, [0])
314 model.testNbSubShapes(Translation_55, GeomAPI_Shape.EDGE, [1])
315 model.testHaveNamingFaces(Translation_55, model, Part_1_doc)
316
317 model.testNbResults(Translation_56, 1)
318 model.testNbSubResults(Translation_56, [0])
319 model.testNbSubShapes(Translation_56, GeomAPI_Shape.SOLID, [0])
320 model.testNbSubShapes(Translation_56, GeomAPI_Shape.FACE, [0])
321 model.testNbSubShapes(Translation_56, GeomAPI_Shape.EDGE, [1])
322 model.testHaveNamingFaces(Translation_56, model, Part_1_doc)
323
324 model.testNbResults(Translation_58, 1)
325 model.testNbSubResults(Translation_58, [0])
326 model.testNbSubShapes(Translation_58, GeomAPI_Shape.SOLID, [0])
327 model.testNbSubShapes(Translation_58, GeomAPI_Shape.FACE, [0])
328 model.testNbSubShapes(Translation_58, GeomAPI_Shape.EDGE, [1])
329 model.testHaveNamingFaces(Translation_58, model, Part_1_doc)
330
331 model.testNbResults(Translation_59, 1)
332 model.testNbSubResults(Translation_59, [0])
333 model.testNbSubShapes(Translation_59, GeomAPI_Shape.SOLID, [0])
334 model.testNbSubShapes(Translation_59, GeomAPI_Shape.FACE, [0])
335 model.testNbSubShapes(Translation_59, GeomAPI_Shape.EDGE, [1])
336 model.testHaveNamingFaces(Translation_59, model, Part_1_doc)
337
338 model.testNbResults(Translation_60, 1)
339 model.testNbSubResults(Translation_60, [0])
340 model.testNbSubShapes(Translation_60, GeomAPI_Shape.SOLID, [0])
341 model.testNbSubShapes(Translation_60, GeomAPI_Shape.FACE, [0])
342 model.testNbSubShapes(Translation_60, GeomAPI_Shape.EDGE, [1])
343 model.testHaveNamingFaces(Translation_60, model, Part_1_doc)
344
345 model.testNbResults(Translation_61, 1)
346 model.testNbSubResults(Translation_61, [0])
347 model.testNbSubShapes(Translation_61, GeomAPI_Shape.SOLID, [0])
348 model.testNbSubShapes(Translation_61, GeomAPI_Shape.FACE, [0])
349 model.testNbSubShapes(Translation_61, GeomAPI_Shape.EDGE, [1])
350 model.testHaveNamingFaces(Translation_61, model, Part_1_doc)
351
352 model.testNbResults(Translation_62, 1)
353 model.testNbSubResults(Translation_62, [0])
354 model.testNbSubShapes(Translation_62, GeomAPI_Shape.SOLID, [0])
355 model.testNbSubShapes(Translation_62, GeomAPI_Shape.FACE, [0])
356 model.testNbSubShapes(Translation_62, GeomAPI_Shape.EDGE, [1])
357 model.testHaveNamingFaces(Translation_62, model, Part_1_doc)
358
359 model.testNbResults(Translation_63, 1)
360 model.testNbSubResults(Translation_63, [0])
361 model.testNbSubShapes(Translation_63, GeomAPI_Shape.SOLID, [0])
362 model.testNbSubShapes(Translation_63, GeomAPI_Shape.FACE, [0])
363 model.testNbSubShapes(Translation_63, GeomAPI_Shape.WIRE, [1])
364 model.testHaveNamingFaces(Translation_63, model, Part_1_doc)
365
366 model.testNbResults(Translation_64, 1)
367 model.testNbSubResults(Translation_64, [0])
368 model.testNbSubShapes(Translation_64, GeomAPI_Shape.SOLID, [0])
369 model.testNbSubShapes(Translation_64, GeomAPI_Shape.FACE, [0])
370 model.testNbSubShapes(Translation_64, GeomAPI_Shape.WIRE, [1])
371 model.testHaveNamingFaces(Translation_64, model, Part_1_doc)
372
373 model.testNbResults(Translation_65, 1)
374 model.testNbSubResults(Translation_65, [0])
375 model.testNbSubShapes(Translation_65, GeomAPI_Shape.SOLID, [0])
376 model.testNbSubShapes(Translation_65, GeomAPI_Shape.FACE, [0])
377 model.testNbSubShapes(Translation_65, GeomAPI_Shape.WIRE, [1])
378 model.testHaveNamingFaces(Translation_65, model, Part_1_doc)
379
380 model.testNbResults(Translation_67, 1)
381 model.testNbSubResults(Translation_67, [0])
382 model.testNbSubShapes(Translation_67, GeomAPI_Shape.SOLID, [0])
383 model.testNbSubShapes(Translation_67, GeomAPI_Shape.FACE, [0])
384 model.testNbSubShapes(Translation_67, GeomAPI_Shape.WIRE, [1])
385 model.testHaveNamingFaces(Translation_67, model, Part_1_doc)
386
387 model.testNbResults(Translation_68, 1)
388 model.testNbSubResults(Translation_68, [0])
389 model.testNbSubShapes(Translation_68, GeomAPI_Shape.SOLID, [0])
390 model.testNbSubShapes(Translation_68, GeomAPI_Shape.FACE, [0])
391 model.testNbSubShapes(Translation_68, GeomAPI_Shape.WIRE, [1])
392 model.testHaveNamingFaces(Translation_68, model, Part_1_doc)
393
394 model.testNbResults(Translation_69, 1)
395 model.testNbSubResults(Translation_69, [0])
396 model.testNbSubShapes(Translation_69, GeomAPI_Shape.SOLID, [0])
397 model.testNbSubShapes(Translation_69, GeomAPI_Shape.FACE, [0])
398 model.testNbSubShapes(Translation_69, GeomAPI_Shape.WIRE, [1])
399 model.testHaveNamingFaces(Translation_69, model, Part_1_doc)
400
401 model.testNbResults(Translation_70, 1)
402 model.testNbSubResults(Translation_70, [0])
403 model.testNbSubShapes(Translation_70, GeomAPI_Shape.SOLID, [0])
404 model.testNbSubShapes(Translation_70, GeomAPI_Shape.FACE, [0])
405 model.testNbSubShapes(Translation_70, GeomAPI_Shape.WIRE, [1])
406 model.testHaveNamingFaces(Translation_70, model, Part_1_doc)
407
408 model.testNbResults(Translation_71, 1)
409 model.testNbSubResults(Translation_71, [0])
410 model.testNbSubShapes(Translation_71, GeomAPI_Shape.SOLID, [0])
411 model.testNbSubShapes(Translation_71, GeomAPI_Shape.FACE, [0])
412 model.testNbSubShapes(Translation_71, GeomAPI_Shape.WIRE, [1])
413 model.testHaveNamingFaces(Translation_71, model, Part_1_doc)
414
415 model.testNbResults(Translation_72, 1)
416 model.testNbSubResults(Translation_72, [0])
417 model.testNbSubShapes(Translation_72, GeomAPI_Shape.SOLID, [0])
418 model.testNbSubShapes(Translation_72, GeomAPI_Shape.FACE, [1])
419 model.testHaveNamingFaces(Translation_72, model, Part_1_doc)
420
421 model.testNbResults(Translation_73, 1)
422 model.testNbSubResults(Translation_73, [0])
423 model.testNbSubShapes(Translation_73, GeomAPI_Shape.SOLID, [0])
424 model.testNbSubShapes(Translation_73, GeomAPI_Shape.FACE, [1])
425 model.testHaveNamingFaces(Translation_73, model, Part_1_doc)
426
427 model.testNbResults(Translation_74, 1)
428 model.testNbSubResults(Translation_74, [0])
429 model.testNbSubShapes(Translation_74, GeomAPI_Shape.SOLID, [0])
430 model.testNbSubShapes(Translation_74, GeomAPI_Shape.FACE, [1])
431 model.testHaveNamingFaces(Translation_74, model, Part_1_doc)
432
433 model.testNbResults(Translation_76, 1)
434 model.testNbSubResults(Translation_76, [0])
435 model.testNbSubShapes(Translation_76, GeomAPI_Shape.SOLID, [0])
436 model.testNbSubShapes(Translation_76, GeomAPI_Shape.FACE, [1])
437 model.testHaveNamingFaces(Translation_76, model, Part_1_doc)
438
439 model.testNbResults(Translation_77, 1)
440 model.testNbSubResults(Translation_77, [0])
441 model.testNbSubShapes(Translation_77, GeomAPI_Shape.SOLID, [0])
442 model.testNbSubShapes(Translation_77, GeomAPI_Shape.FACE, [1])
443 model.testHaveNamingFaces(Translation_77, model, Part_1_doc)
444
445 model.testNbResults(Translation_78, 1)
446 model.testNbSubResults(Translation_78, [0])
447 model.testNbSubShapes(Translation_78, GeomAPI_Shape.SOLID, [0])
448 model.testNbSubShapes(Translation_78, GeomAPI_Shape.FACE, [1])
449 model.testHaveNamingFaces(Translation_78, model, Part_1_doc)
450
451 model.testNbResults(Translation_79, 1)
452 model.testNbSubResults(Translation_79, [0])
453 model.testNbSubShapes(Translation_79, GeomAPI_Shape.SOLID, [0])
454 model.testNbSubShapes(Translation_79, GeomAPI_Shape.FACE, [1])
455 model.testHaveNamingFaces(Translation_79, model, Part_1_doc)
456
457 model.testNbResults(Translation_80, 1)
458 model.testNbSubResults(Translation_80, [0])
459 model.testNbSubShapes(Translation_80, GeomAPI_Shape.SOLID, [0])
460 model.testNbSubShapes(Translation_80, GeomAPI_Shape.FACE, [1])
461 model.testHaveNamingFaces(Translation_80, model, Part_1_doc)
462
463 model.testNbResults(Translation_81, 1)
464 model.testNbSubResults(Translation_81, [0])
465 model.testNbSubShapes(Translation_81, GeomAPI_Shape.SOLID, [0])
466 model.testNbSubShapes(Translation_81, GeomAPI_Shape.FACE, [2])
467 model.testNbSubShapes(Translation_81, GeomAPI_Shape.SHELL, [1])
468
469 model.testNbResults(Translation_82, 1)
470 model.testNbSubResults(Translation_82, [0])
471 model.testNbSubShapes(Translation_82, GeomAPI_Shape.SOLID, [0])
472 model.testNbSubShapes(Translation_82, GeomAPI_Shape.FACE, [2])
473 model.testNbSubShapes(Translation_82, GeomAPI_Shape.SHELL, [1])
474
475 model.testNbResults(Translation_83, 1)
476 model.testNbSubResults(Translation_83, [0])
477 model.testNbSubShapes(Translation_83, GeomAPI_Shape.SOLID, [0])
478 model.testNbSubShapes(Translation_83, GeomAPI_Shape.FACE, [2])
479 model.testNbSubShapes(Translation_83, GeomAPI_Shape.SHELL, [1])
480
481 model.testNbResults(Translation_85, 1)
482 model.testNbSubResults(Translation_85, [0])
483 model.testNbSubShapes(Translation_85, GeomAPI_Shape.SOLID, [0])
484 model.testNbSubShapes(Translation_85, GeomAPI_Shape.FACE, [2])
485 model.testNbSubShapes(Translation_85, GeomAPI_Shape.SHELL, [1])
486
487 model.testNbResults(Translation_86, 1)
488 model.testNbSubResults(Translation_86, [0])
489 model.testNbSubShapes(Translation_86, GeomAPI_Shape.SOLID, [0])
490 model.testNbSubShapes(Translation_86, GeomAPI_Shape.FACE, [2])
491 model.testNbSubShapes(Translation_86, GeomAPI_Shape.SHELL, [1])
492
493 model.testNbResults(Translation_87, 1)
494 model.testNbSubResults(Translation_87, [0])
495 model.testNbSubShapes(Translation_87, GeomAPI_Shape.SOLID, [0])
496 model.testNbSubShapes(Translation_87, GeomAPI_Shape.FACE, [2])
497 model.testNbSubShapes(Translation_87, GeomAPI_Shape.SHELL, [1])
498
499 model.testNbResults(Translation_88, 1)
500 model.testNbSubResults(Translation_88, [0])
501 model.testNbSubShapes(Translation_88, GeomAPI_Shape.SOLID, [0])
502 model.testNbSubShapes(Translation_88, GeomAPI_Shape.FACE, [2])
503 model.testNbSubShapes(Translation_88, GeomAPI_Shape.SHELL, [1])
504
505 model.testNbResults(Translation_89, 1)
506 model.testNbSubResults(Translation_89, [0])
507 model.testNbSubShapes(Translation_89, GeomAPI_Shape.SOLID, [0])
508 model.testNbSubShapes(Translation_89, GeomAPI_Shape.FACE, [2])
509 model.testNbSubShapes(Translation_89, GeomAPI_Shape.SHELL, [1])
510
511 model.testNbResults(Translation_90, 2)
512 model.testNbSubResults(Translation_90, [0, 0])
513 model.testNbSubShapes(Translation_90, GeomAPI_Shape.SOLID, [1, 1])
514 model.testNbSubShapes(Translation_90, GeomAPI_Shape.FACE, [6, 3])
515 model.testHaveNamingFaces(Translation_90, model, Part_1_doc)
516
517
518 model.testNbResults(Translation_48, 0)
519 assert(Translation_48.feature().error() == 'Attribute "axis_object" is not initialized.')
520
521 model.testNbResults(Translation_57, 0)
522 assert(Translation_57.feature().error() == 'Attribute "axis_object" is not initialized.')
523
524 model.testNbResults(Translation_66, 0)
525 assert(Translation_66.feature().error() == 'Attribute "axis_object" is not initialized.')
526
527 model.testNbResults(Translation_75, 0)
528 assert(Translation_75.feature().error() == 'Attribute "axis_object" is not initialized.')
529
530 model.testNbResults(Translation_84, 0)
531 assert(Translation_84.feature().error() == 'Attribute "axis_object" is not initialized.')