Salome HOME
0a089ea94c30a8f1da5c6609c2a17913c2291129
[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 model.addRecover(Part_1_doc, Shell_1, [Face_10.result()])
167 model.addRecover(Part_1_doc, Shell_1, [Face_11.result()])
168 Shell_2 = model.addShell(Part_1_doc, [model.selection("FACE", "Recover_1_1"), model.selection("FACE", "Recover_2_1")])
169 Shell_2.result().setName("Shell_2_1")
170 model.addRecover(Part_1_doc, Shell_1, [Face_10.result()])
171 model.addRecover(Part_1_doc, Shell_1, [Face_11.result()])
172 Shell_3 = model.addShell(Part_1_doc, [model.selection("FACE", "Recover_3_1"), model.selection("FACE", "Recover_4_1")])
173 Shell_3.result().setName("Shell_3_1")
174 model.addRecover(Part_1_doc, Shell_1, [Face_10.result()])
175 model.addRecover(Part_1_doc, Shell_1, [Face_11.result()])
176 Shell_4 = model.addShell(Part_1_doc, [model.selection("FACE", "Recover_5_1"), model.selection("FACE", "Recover_6_1")])
177 Shell_4.result().setName("Shell_4_1")
178 model.addRecover(Part_1_doc, Shell_1, [Face_10.result()])
179 model.addRecover(Part_1_doc, Shell_1, [Face_11.result()])
180 Shell_5 = model.addShell(Part_1_doc, [model.selection("FACE", "Recover_7_1"), model.selection("FACE", "Recover_8_1")])
181 Shell_5.result().setName("Shell_5_1")
182 Shell_6 = model.addShell(Part_1_doc, [model.selection("FACE", "Face_12_1"), model.selection("FACE", "Face_13_1")])
183 Shell_6.result().setName("Shell_6_1")
184 model.addRecover(Part_1_doc, Shell_1, [Face_12.result()])
185 model.addRecover(Part_1_doc, Shell_1, [Face_13.result()])
186 Shell_7 = model.addShell(Part_1_doc, [model.selection("FACE", "Recover_9_1"), model.selection("FACE", "Recover_10_1")])
187 Shell_7.result().setName("Shell_7_1")
188 model.addRecover(Part_1_doc, Shell_1, [Face_10.result()])
189 model.addRecover(Part_1_doc, Shell_1, [Face_11.result()])
190 Shell_8 = model.addShell(Part_1_doc, [model.selection("FACE", "Recover_11_1"), model.selection("FACE", "Recover_12_1")])
191 Shell_8.result().setName("Shell_8_1")
192 model.addRecover(Part_1_doc, Shell_1, [Face_10.result()])
193 model.addRecover(Part_1_doc, Shell_1, [Face_11.result()])
194 Shell_9 = model.addShell(Part_1_doc, [model.selection("FACE", "Recover_13_1"), model.selection("FACE", "Recover_14_1")])
195 Shell_9.result().setName("Shell_9_1")
196
197 # Parameters
198 model.addParameter(Part_1_doc, "d", "15")
199
200 # Translations
201 Translation_45 = model.addTranslation(Part_1_doc, [model.selection("VERTEX", "Vertex_1_1")], model.selection("EDGE", "PartSet/OX"), 15)
202 Translation_46 = model.addTranslation(Part_1_doc, [model.selection("VERTEX", "Vertex_2_1")], model.selection("EDGE", "PartSet/OX"), 0)
203 Translation_47 = model.addTranslation(Part_1_doc, [model.selection("VERTEX", "Vertex_3_1")], model.selection("EDGE", "PartSet/OX"), -15)
204 Translation_48 = model.addTranslation(Part_1_doc, [model.selection("VERTEX", "Vertex_4_1")], model.selection("EDGE", "InvalidName"), 15)
205 Translation_49 = model.addTranslation(Part_1_doc, [model.selection("VERTEX", "Vertex_5_1")], model.selection("EDGE", "PartSet/OX"), "d")
206 Translation_50 = model.addTranslation(Part_1_doc, [model.selection("VERTEX", "Vertex_6_1")], model.selection("EDGE", "Sketch_3/Edge-SketchLine_5"), 15)
207 Translation_51 = model.addTranslation(Part_1_doc, [model.selection("VERTEX", "Vertex_7_1")], model.selection("EDGE", "Edge_2_1"), 15)
208 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)
209 Translation_53 = model.addTranslation(Part_1_doc, [model.selection("VERTEX", "Vertex_9_1")], model.selection("EDGE", "Axis_1"), 15)
210 Translation_54 = model.addTranslation(Part_1_doc, [model.selection("EDGE", "Edge_2_1")], model.selection("EDGE", "PartSet/OX"), 15)
211 Translation_55 = model.addTranslation(Part_1_doc, [model.selection("EDGE", "Edge_3_1")], model.selection("EDGE", "PartSet/OX"), 0)
212 Translation_56 = model.addTranslation(Part_1_doc, [model.selection("EDGE", "Edge_4_1")], model.selection("EDGE", "PartSet/OX"), -15)
213 Translation_57 = model.addTranslation(Part_1_doc, [model.selection("EDGE", "Edge_5_1")], model.selection("EDGE", "InvalidName"), 15)
214 Translation_58 = model.addTranslation(Part_1_doc, [model.selection("EDGE", "Edge_6_1")], model.selection("EDGE", "PartSet/OY"), "d")
215 Translation_59 = model.addTranslation(Part_1_doc, [model.selection("EDGE", "Edge_7_1")], model.selection("EDGE", "Sketch_4/Edge-SketchLine_6"), 15)
216 Translation_60 = model.addTranslation(Part_1_doc, [model.selection("EDGE", "Edge_8_1")], model.selection("EDGE", "Edge_9_1"), 15)
217 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)
218 Translation_62 = model.addTranslation(Part_1_doc, [model.selection("EDGE", "Edge_10_1")], model.selection("EDGE", "Axis_1"), 15)
219 Translation_63 = model.addTranslation(Part_1_doc, [model.selection("WIRE", "Wire_1_1")], model.selection("EDGE", "PartSet/OX"), 15)
220 Translation_64 = model.addTranslation(Part_1_doc, [model.selection("WIRE", "Wire_2_1")], model.selection("EDGE", "PartSet/OX"), 0)
221 Translation_65 = model.addTranslation(Part_1_doc, [model.selection("WIRE", "Wire_3_1")], model.selection("EDGE", "PartSet/OX"), -15)
222 Translation_66 = model.addTranslation(Part_1_doc, [model.selection("WIRE", "Wire_4_1")], model.selection("EDGE", "InvalidName"), 15)
223 Translation_67 = model.addTranslation(Part_1_doc, [model.selection("WIRE", "Wire_5_1")], model.selection("EDGE", "PartSet/OY"), "d")
224 Translation_68 = model.addTranslation(Part_1_doc, [model.selection("WIRE", "Wire_6_1")], model.selection("EDGE", "Sketch_5/Edge-SketchLine_11"), 15)
225 Translation_69 = model.addTranslation(Part_1_doc, [model.selection("WIRE", "Wire_7_1")], model.selection("EDGE", "Edge_11_1"), 15)
226 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)
227 Translation_71 = model.addTranslation(Part_1_doc, [model.selection("WIRE", "Wire_9_1")], model.selection("EDGE", "Axis_1"), 15)
228 Translation_72 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Face_1_1")], model.selection("EDGE", "PartSet/OX"), 15)
229 Translation_73 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Face_2_1")], model.selection("EDGE", "PartSet/OX"), 0)
230 Translation_74 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Face_3_1")], model.selection("EDGE", "PartSet/OX"), -15)
231 Translation_75 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Face_4_1")], model.selection("EDGE", "InvalidName"), -15)
232 Translation_76 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Face_5_1")], model.selection("EDGE", "PartSet/OX"), "d")
233 Translation_77 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Face_6_1")], model.selection("EDGE", "Sketch_5/Edge-SketchLine_11"), 15)
234 Translation_78 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Face_7_1")], model.selection("EDGE", "Edge_11_1"), 15)
235 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)
236 Translation_80 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Face_9_1")], model.selection("EDGE", "Axis_1"), 15)
237 Translation_81 = model.addTranslation(Part_1_doc, [model.selection("SHELL", "Shell_1_1")], model.selection("EDGE", "PartSet/OX"), 15)
238 Translation_82 = model.addTranslation(Part_1_doc, [model.selection("SHELL", "Shell_2_1")], model.selection("EDGE", "PartSet/OX"), 0)
239 Translation_83 = model.addTranslation(Part_1_doc, [model.selection("SHELL", "Shell_3_1")], model.selection("EDGE", "PartSet/OX"), -15)
240 Translation_84 = model.addTranslation(Part_1_doc, [model.selection("SHELL", "Shell_4_1")], model.selection("EDGE", "InvalidName"), 15)
241 Translation_85 = model.addTranslation(Part_1_doc, [model.selection("SHELL", "Shell_5_1")], model.selection("EDGE", "PartSet/OX"), "d")
242 Translation_86 = model.addTranslation(Part_1_doc, [model.selection("SHELL", "Shell_6_1")], model.selection("EDGE", "Sketch_7/Edge-SketchLine_22"), 15)
243 Translation_87 = model.addTranslation(Part_1_doc, [model.selection("SHELL", "Shell_7_1")], model.selection("EDGE", "Edge_12_1"), 15)
244 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)
245 Translation_89 = model.addTranslation(Part_1_doc, [model.selection("SHELL", "Shell_9_1")], model.selection("EDGE", "Axis_1"), 15)
246 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)
247 model.do()
248 model.end()
249
250 # Checks
251 from GeomAPI import GeomAPI_Shape
252
253 model.testNbResults(Translation_45, 1)
254 model.testNbSubResults(Translation_45, [0])
255 model.testNbSubShapes(Translation_45, GeomAPI_Shape.COMPSOLID, [0])
256 model.testNbSubShapes(Translation_45, GeomAPI_Shape.SOLID, [0])
257 model.testNbSubShapes(Translation_45, GeomAPI_Shape.FACE, [0])
258 model.testNbSubShapes(Translation_45, GeomAPI_Shape.VERTEX, [1])
259 model.testHaveNamingFaces(Translation_45, model, Part_1_doc)
260
261 model.testNbResults(Translation_46, 1)
262 model.testNbSubResults(Translation_46, [0])
263 model.testNbSubShapes(Translation_46, GeomAPI_Shape.COMPSOLID, [0])
264 model.testNbSubShapes(Translation_46, GeomAPI_Shape.SOLID, [0])
265 model.testNbSubShapes(Translation_46, GeomAPI_Shape.FACE, [0])
266 model.testNbSubShapes(Translation_46, GeomAPI_Shape.VERTEX, [1])
267 model.testHaveNamingFaces(Translation_46, model, Part_1_doc)
268
269 model.testNbResults(Translation_47, 1)
270 model.testNbSubResults(Translation_47, [0])
271 model.testNbSubShapes(Translation_47, GeomAPI_Shape.COMPSOLID, [0])
272 model.testNbSubShapes(Translation_47, GeomAPI_Shape.SOLID, [0])
273 model.testNbSubShapes(Translation_47, GeomAPI_Shape.FACE, [0])
274 model.testNbSubShapes(Translation_47, GeomAPI_Shape.VERTEX, [1])
275 model.testHaveNamingFaces(Translation_47, model, Part_1_doc)
276
277 model.testNbResults(Translation_49, 1)
278 model.testNbSubResults(Translation_49, [0])
279 model.testNbSubShapes(Translation_49, GeomAPI_Shape.COMPSOLID, [0])
280 model.testNbSubShapes(Translation_49, GeomAPI_Shape.SOLID, [0])
281 model.testNbSubShapes(Translation_49, GeomAPI_Shape.FACE, [0])
282 model.testNbSubShapes(Translation_49, GeomAPI_Shape.VERTEX, [1])
283 model.testHaveNamingFaces(Translation_49, model, Part_1_doc)
284
285 model.testNbResults(Translation_50, 1)
286 model.testNbSubResults(Translation_50, [0])
287 model.testNbSubShapes(Translation_50, GeomAPI_Shape.COMPSOLID, [0])
288 model.testNbSubShapes(Translation_50, GeomAPI_Shape.SOLID, [0])
289 model.testNbSubShapes(Translation_50, GeomAPI_Shape.FACE, [0])
290 model.testNbSubShapes(Translation_50, GeomAPI_Shape.VERTEX, [1])
291 model.testHaveNamingFaces(Translation_50, model, Part_1_doc)
292
293 model.testNbResults(Translation_51, 1)
294 model.testNbSubResults(Translation_51, [0])
295 model.testNbSubShapes(Translation_51, GeomAPI_Shape.COMPSOLID, [0])
296 model.testNbSubShapes(Translation_51, GeomAPI_Shape.SOLID, [0])
297 model.testNbSubShapes(Translation_51, GeomAPI_Shape.FACE, [0])
298 model.testNbSubShapes(Translation_51, GeomAPI_Shape.VERTEX, [1])
299 model.testHaveNamingFaces(Translation_51, model, Part_1_doc)
300
301 model.testNbResults(Translation_52, 1)
302 model.testNbSubResults(Translation_52, [0])
303 model.testNbSubShapes(Translation_52, GeomAPI_Shape.COMPSOLID, [0])
304 model.testNbSubShapes(Translation_52, GeomAPI_Shape.SOLID, [0])
305 model.testNbSubShapes(Translation_52, GeomAPI_Shape.FACE, [0])
306 model.testNbSubShapes(Translation_52, GeomAPI_Shape.VERTEX, [1])
307 model.testHaveNamingFaces(Translation_52, model, Part_1_doc)
308
309 model.testNbResults(Translation_53, 1)
310 model.testNbSubResults(Translation_53, [0])
311 model.testNbSubShapes(Translation_53, GeomAPI_Shape.COMPSOLID, [0])
312 model.testNbSubShapes(Translation_53, GeomAPI_Shape.SOLID, [0])
313 model.testNbSubShapes(Translation_53, GeomAPI_Shape.FACE, [0])
314 model.testNbSubShapes(Translation_53, GeomAPI_Shape.VERTEX, [1])
315 model.testHaveNamingFaces(Translation_53, model, Part_1_doc)
316
317 model.testNbResults(Translation_54, 1)
318 model.testNbSubResults(Translation_54, [0])
319 model.testNbSubShapes(Translation_54, GeomAPI_Shape.SOLID, [0])
320 model.testNbSubShapes(Translation_54, GeomAPI_Shape.FACE, [0])
321 model.testNbSubShapes(Translation_54, GeomAPI_Shape.EDGE, [1])
322 model.testHaveNamingFaces(Translation_54, model, Part_1_doc)
323
324 model.testNbResults(Translation_55, 1)
325 model.testNbSubResults(Translation_55, [0])
326 model.testNbSubShapes(Translation_55, GeomAPI_Shape.SOLID, [0])
327 model.testNbSubShapes(Translation_55, GeomAPI_Shape.FACE, [0])
328 model.testNbSubShapes(Translation_55, GeomAPI_Shape.EDGE, [1])
329 model.testHaveNamingFaces(Translation_55, model, Part_1_doc)
330
331 model.testNbResults(Translation_56, 1)
332 model.testNbSubResults(Translation_56, [0])
333 model.testNbSubShapes(Translation_56, GeomAPI_Shape.SOLID, [0])
334 model.testNbSubShapes(Translation_56, GeomAPI_Shape.FACE, [0])
335 model.testNbSubShapes(Translation_56, GeomAPI_Shape.EDGE, [1])
336 model.testHaveNamingFaces(Translation_56, model, Part_1_doc)
337
338 model.testNbResults(Translation_58, 1)
339 model.testNbSubResults(Translation_58, [0])
340 model.testNbSubShapes(Translation_58, GeomAPI_Shape.SOLID, [0])
341 model.testNbSubShapes(Translation_58, GeomAPI_Shape.FACE, [0])
342 model.testNbSubShapes(Translation_58, GeomAPI_Shape.EDGE, [1])
343 model.testHaveNamingFaces(Translation_58, model, Part_1_doc)
344
345 model.testNbResults(Translation_59, 1)
346 model.testNbSubResults(Translation_59, [0])
347 model.testNbSubShapes(Translation_59, GeomAPI_Shape.SOLID, [0])
348 model.testNbSubShapes(Translation_59, GeomAPI_Shape.FACE, [0])
349 model.testNbSubShapes(Translation_59, GeomAPI_Shape.EDGE, [1])
350 model.testHaveNamingFaces(Translation_59, model, Part_1_doc)
351
352 model.testNbResults(Translation_60, 1)
353 model.testNbSubResults(Translation_60, [0])
354 model.testNbSubShapes(Translation_60, GeomAPI_Shape.SOLID, [0])
355 model.testNbSubShapes(Translation_60, GeomAPI_Shape.FACE, [0])
356 model.testNbSubShapes(Translation_60, GeomAPI_Shape.EDGE, [1])
357 model.testHaveNamingFaces(Translation_60, model, Part_1_doc)
358
359 model.testNbResults(Translation_61, 1)
360 model.testNbSubResults(Translation_61, [0])
361 model.testNbSubShapes(Translation_61, GeomAPI_Shape.SOLID, [0])
362 model.testNbSubShapes(Translation_61, GeomAPI_Shape.FACE, [0])
363 model.testNbSubShapes(Translation_61, GeomAPI_Shape.EDGE, [1])
364 model.testHaveNamingFaces(Translation_61, model, Part_1_doc)
365
366 model.testNbResults(Translation_62, 1)
367 model.testNbSubResults(Translation_62, [0])
368 model.testNbSubShapes(Translation_62, GeomAPI_Shape.SOLID, [0])
369 model.testNbSubShapes(Translation_62, GeomAPI_Shape.FACE, [0])
370 model.testNbSubShapes(Translation_62, GeomAPI_Shape.EDGE, [1])
371 model.testHaveNamingFaces(Translation_62, model, Part_1_doc)
372
373 model.testNbResults(Translation_63, 1)
374 model.testNbSubResults(Translation_63, [0])
375 model.testNbSubShapes(Translation_63, GeomAPI_Shape.SOLID, [0])
376 model.testNbSubShapes(Translation_63, GeomAPI_Shape.FACE, [0])
377 model.testNbSubShapes(Translation_63, GeomAPI_Shape.WIRE, [1])
378 model.testHaveNamingFaces(Translation_63, model, Part_1_doc)
379
380 model.testNbResults(Translation_64, 1)
381 model.testNbSubResults(Translation_64, [0])
382 model.testNbSubShapes(Translation_64, GeomAPI_Shape.SOLID, [0])
383 model.testNbSubShapes(Translation_64, GeomAPI_Shape.FACE, [0])
384 model.testNbSubShapes(Translation_64, GeomAPI_Shape.WIRE, [1])
385 model.testHaveNamingFaces(Translation_64, model, Part_1_doc)
386
387 model.testNbResults(Translation_65, 1)
388 model.testNbSubResults(Translation_65, [0])
389 model.testNbSubShapes(Translation_65, GeomAPI_Shape.SOLID, [0])
390 model.testNbSubShapes(Translation_65, GeomAPI_Shape.FACE, [0])
391 model.testNbSubShapes(Translation_65, GeomAPI_Shape.WIRE, [1])
392 model.testHaveNamingFaces(Translation_65, model, Part_1_doc)
393
394 model.testNbResults(Translation_67, 1)
395 model.testNbSubResults(Translation_67, [0])
396 model.testNbSubShapes(Translation_67, GeomAPI_Shape.SOLID, [0])
397 model.testNbSubShapes(Translation_67, GeomAPI_Shape.FACE, [0])
398 model.testNbSubShapes(Translation_67, GeomAPI_Shape.WIRE, [1])
399 model.testHaveNamingFaces(Translation_67, model, Part_1_doc)
400
401 model.testNbResults(Translation_68, 1)
402 model.testNbSubResults(Translation_68, [0])
403 model.testNbSubShapes(Translation_68, GeomAPI_Shape.SOLID, [0])
404 model.testNbSubShapes(Translation_68, GeomAPI_Shape.FACE, [0])
405 model.testNbSubShapes(Translation_68, GeomAPI_Shape.WIRE, [1])
406 model.testHaveNamingFaces(Translation_68, model, Part_1_doc)
407
408 model.testNbResults(Translation_69, 1)
409 model.testNbSubResults(Translation_69, [0])
410 model.testNbSubShapes(Translation_69, GeomAPI_Shape.SOLID, [0])
411 model.testNbSubShapes(Translation_69, GeomAPI_Shape.FACE, [0])
412 model.testNbSubShapes(Translation_69, GeomAPI_Shape.WIRE, [1])
413 model.testHaveNamingFaces(Translation_69, model, Part_1_doc)
414
415 model.testNbResults(Translation_70, 1)
416 model.testNbSubResults(Translation_70, [0])
417 model.testNbSubShapes(Translation_70, GeomAPI_Shape.SOLID, [0])
418 model.testNbSubShapes(Translation_70, GeomAPI_Shape.FACE, [0])
419 model.testNbSubShapes(Translation_70, GeomAPI_Shape.WIRE, [1])
420 model.testHaveNamingFaces(Translation_70, model, Part_1_doc)
421
422 model.testNbResults(Translation_71, 1)
423 model.testNbSubResults(Translation_71, [0])
424 model.testNbSubShapes(Translation_71, GeomAPI_Shape.SOLID, [0])
425 model.testNbSubShapes(Translation_71, GeomAPI_Shape.FACE, [0])
426 model.testNbSubShapes(Translation_71, GeomAPI_Shape.WIRE, [1])
427 model.testHaveNamingFaces(Translation_71, model, Part_1_doc)
428
429 model.testNbResults(Translation_72, 1)
430 model.testNbSubResults(Translation_72, [0])
431 model.testNbSubShapes(Translation_72, GeomAPI_Shape.SOLID, [0])
432 model.testNbSubShapes(Translation_72, GeomAPI_Shape.FACE, [1])
433 model.testHaveNamingFaces(Translation_72, model, Part_1_doc)
434
435 model.testNbResults(Translation_73, 1)
436 model.testNbSubResults(Translation_73, [0])
437 model.testNbSubShapes(Translation_73, GeomAPI_Shape.SOLID, [0])
438 model.testNbSubShapes(Translation_73, GeomAPI_Shape.FACE, [1])
439 model.testHaveNamingFaces(Translation_73, model, Part_1_doc)
440
441 model.testNbResults(Translation_74, 1)
442 model.testNbSubResults(Translation_74, [0])
443 model.testNbSubShapes(Translation_74, GeomAPI_Shape.SOLID, [0])
444 model.testNbSubShapes(Translation_74, GeomAPI_Shape.FACE, [1])
445 model.testHaveNamingFaces(Translation_74, model, Part_1_doc)
446
447 model.testNbResults(Translation_76, 1)
448 model.testNbSubResults(Translation_76, [0])
449 model.testNbSubShapes(Translation_76, GeomAPI_Shape.SOLID, [0])
450 model.testNbSubShapes(Translation_76, GeomAPI_Shape.FACE, [1])
451 model.testHaveNamingFaces(Translation_76, model, Part_1_doc)
452
453 model.testNbResults(Translation_77, 1)
454 model.testNbSubResults(Translation_77, [0])
455 model.testNbSubShapes(Translation_77, GeomAPI_Shape.SOLID, [0])
456 model.testNbSubShapes(Translation_77, GeomAPI_Shape.FACE, [1])
457 model.testHaveNamingFaces(Translation_77, model, Part_1_doc)
458
459 model.testNbResults(Translation_78, 1)
460 model.testNbSubResults(Translation_78, [0])
461 model.testNbSubShapes(Translation_78, GeomAPI_Shape.SOLID, [0])
462 model.testNbSubShapes(Translation_78, GeomAPI_Shape.FACE, [1])
463 model.testHaveNamingFaces(Translation_78, model, Part_1_doc)
464
465 model.testNbResults(Translation_79, 1)
466 model.testNbSubResults(Translation_79, [0])
467 model.testNbSubShapes(Translation_79, GeomAPI_Shape.SOLID, [0])
468 model.testNbSubShapes(Translation_79, GeomAPI_Shape.FACE, [1])
469 model.testHaveNamingFaces(Translation_79, model, Part_1_doc)
470
471 model.testNbResults(Translation_80, 1)
472 model.testNbSubResults(Translation_80, [0])
473 model.testNbSubShapes(Translation_80, GeomAPI_Shape.SOLID, [0])
474 model.testNbSubShapes(Translation_80, GeomAPI_Shape.FACE, [1])
475 model.testHaveNamingFaces(Translation_80, model, Part_1_doc)
476
477 model.testNbResults(Translation_81, 1)
478 model.testNbSubResults(Translation_81, [0])
479 model.testNbSubShapes(Translation_81, GeomAPI_Shape.SOLID, [0])
480 model.testNbSubShapes(Translation_81, GeomAPI_Shape.FACE, [2])
481 model.testNbSubShapes(Translation_81, GeomAPI_Shape.SHELL, [1])
482
483 model.testNbResults(Translation_82, 1)
484 model.testNbSubResults(Translation_82, [0])
485 model.testNbSubShapes(Translation_82, GeomAPI_Shape.SOLID, [0])
486 model.testNbSubShapes(Translation_82, GeomAPI_Shape.FACE, [2])
487 model.testNbSubShapes(Translation_82, GeomAPI_Shape.SHELL, [1])
488
489 model.testNbResults(Translation_83, 1)
490 model.testNbSubResults(Translation_83, [0])
491 model.testNbSubShapes(Translation_83, GeomAPI_Shape.SOLID, [0])
492 model.testNbSubShapes(Translation_83, GeomAPI_Shape.FACE, [2])
493 model.testNbSubShapes(Translation_83, GeomAPI_Shape.SHELL, [1])
494
495 model.testNbResults(Translation_85, 1)
496 model.testNbSubResults(Translation_85, [0])
497 model.testNbSubShapes(Translation_85, GeomAPI_Shape.SOLID, [0])
498 model.testNbSubShapes(Translation_85, GeomAPI_Shape.FACE, [2])
499 model.testNbSubShapes(Translation_85, GeomAPI_Shape.SHELL, [1])
500
501 model.testNbResults(Translation_86, 1)
502 model.testNbSubResults(Translation_86, [0])
503 model.testNbSubShapes(Translation_86, GeomAPI_Shape.SOLID, [0])
504 model.testNbSubShapes(Translation_86, GeomAPI_Shape.FACE, [2])
505 model.testNbSubShapes(Translation_86, GeomAPI_Shape.SHELL, [1])
506
507 model.testNbResults(Translation_87, 1)
508 model.testNbSubResults(Translation_87, [0])
509 model.testNbSubShapes(Translation_87, GeomAPI_Shape.SOLID, [0])
510 model.testNbSubShapes(Translation_87, GeomAPI_Shape.FACE, [2])
511 model.testNbSubShapes(Translation_87, GeomAPI_Shape.SHELL, [1])
512
513 model.testNbResults(Translation_88, 1)
514 model.testNbSubResults(Translation_88, [0])
515 model.testNbSubShapes(Translation_88, GeomAPI_Shape.SOLID, [0])
516 model.testNbSubShapes(Translation_88, GeomAPI_Shape.FACE, [2])
517 model.testNbSubShapes(Translation_88, GeomAPI_Shape.SHELL, [1])
518
519 model.testNbResults(Translation_89, 1)
520 model.testNbSubResults(Translation_89, [0])
521 model.testNbSubShapes(Translation_89, GeomAPI_Shape.SOLID, [0])
522 model.testNbSubShapes(Translation_89, GeomAPI_Shape.FACE, [2])
523 model.testNbSubShapes(Translation_89, GeomAPI_Shape.SHELL, [1])
524
525 model.testNbResults(Translation_90, 2)
526 model.testNbSubResults(Translation_90, [0, 0])
527 model.testNbSubShapes(Translation_90, GeomAPI_Shape.SOLID, [1, 1])
528 model.testNbSubShapes(Translation_90, GeomAPI_Shape.FACE, [6, 3])
529 model.testHaveNamingFaces(Translation_90, model, Part_1_doc)
530
531
532 model.testNbResults(Translation_48, 0)
533 assert(Translation_48.feature().error() == 'Attribute "axis_object" is not initialized.')
534
535 model.testNbResults(Translation_57, 0)
536 assert(Translation_57.feature().error() == 'Attribute "axis_object" is not initialized.')
537
538 model.testNbResults(Translation_66, 0)
539 assert(Translation_66.feature().error() == 'Attribute "axis_object" is not initialized.')
540
541 model.testNbResults(Translation_75, 0)
542 assert(Translation_75.feature().error() == 'Attribute "axis_object" is not initialized.')
543
544 model.testNbResults(Translation_84, 0)
545 assert(Translation_84.feature().error() == 'Attribute "axis_object" is not initialized.')