Salome HOME
Update mail address
[modules/geom.git] / src / GEOM_SWIG / GEOM_TestOthers.py
1 #  GEOM GEOM_SWIG : binding of C++ implementaion with Python
2 #
3 #  Copyright (C) 2003  CEA
4 #
5 #  This library is free software; you can redistribute it and/or
6 #  modify it under the terms of the GNU Lesser General Public
7 #  License as published by the Free Software Foundation; either
8 #  version 2.1 of the License.
9 #
10 #  This library is distributed in the hope that it will be useful,
11 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
12 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13 #  Lesser General Public License for more details.
14 #
15 #  You should have received a copy of the GNU Lesser General Public
16 #  License along with this library; if not, write to the Free Software
17 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
18 #
19 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #
21 #
22 #  File   : GEOM_TestOthers.py
23 #  Author : Julia DOROVSKIKH
24 #  Module : GEOM
25 #  $Header$
26
27 import os
28
29 def TestExportImport (geompy, shape):
30
31   print "Test Export/Import ...",
32
33   # Files for Export/Import testing
34   fileExportImport = "/tmp/testExportImport.brep"
35   fileExportImportBREP = "/tmp/testExportImportBREP.brep"
36   fileExportImportIGES = "/tmp/testExportImportIGES.iges"
37   fileExportImportSTEP = "/tmp/testExportImportSTEP.step"
38
39   if os.access(fileExportImport, os.F_OK):
40     if os.access(fileExportImport, os.W_OK):
41       os.remove(fileExportImport)
42     else:
43       fileExportImport = "/tmp/testExportImport1.brep"
44
45     if os.access(fileExportImportBREP, os.W_OK):
46       os.remove(fileExportImportBREP)
47     else:
48       fileExportImportBREP = "/tmp/testExportImportBREP1.brep"
49
50     if os.access(fileExportImportIGES, os.W_OK):
51       os.remove(fileExportImportIGES)
52     else:
53       fileExportImportIGES = "/tmp/testExportImportIGES1.iges"
54
55     if os.access(fileExportImportSTEP, os.W_OK):
56       os.remove(fileExportImportSTEP)
57     else:
58       fileExportImportSTEP = "/tmp/testExportImportSTEP1.step"
59
60   # Export
61   geompy.Export(shape, fileExportImport, "BREP")
62
63   # ExportBREP, ExportIGES, ExportSTEP
64   geompy.ExportBREP(shape, fileExportImportBREP)
65   geompy.ExportIGES(shape, fileExportImportIGES)
66   geompy.ExportSTEP(shape, fileExportImportSTEP)
67
68   # Import
69   Import = geompy.Import(fileExportImport, "BREP")
70
71   id_Import = geompy.addToStudy(Import, "Import")
72
73   # ImportBREP, ImportIGES, ImportSTEP
74   ImportBREP = geompy.ImportBREP(fileExportImportBREP)
75   ImportIGES = geompy.ImportIGES(fileExportImportIGES)
76   ImportSTEP = geompy.ImportSTEP(fileExportImportSTEP)
77
78   id_ImportBREP = geompy.addToStudy(ImportBREP, "ImportBREP")
79   id_ImportIGES = geompy.addToStudy(ImportIGES, "ImportIGES")
80   id_ImportSTEP = geompy.addToStudy(ImportSTEP, "ImportSTEP")
81
82   # Remove files for Export/Import testing
83   os.remove(fileExportImport)
84   os.remove(fileExportImportBREP)
85   os.remove(fileExportImportIGES)
86   os.remove(fileExportImportSTEP)
87
88   print "OK"
89
90
91 def TestOtherOperations (geompy, math):
92
93   # MakeFaces
94   p11 = geompy.MakeVertex( 0,  0, 0)
95   p12 = geompy.MakeVertex(30,  0, 0)
96   p13 = geompy.MakeVertex(30, 30, 0)
97   p14 = geompy.MakeVertex( 0, 30, 0)
98
99   p21 = geompy.MakeVertex(10, 10, 0)
100   p22 = geompy.MakeVertex(20, 10, 0)
101   p23 = geompy.MakeVertex(20, 20, 0)
102   p24 = geompy.MakeVertex(10, 20, 0)
103
104   e11 = geompy.MakeEdge(p11, p12)
105   e12 = geompy.MakeEdge(p12, p13)
106   e13 = geompy.MakeEdge(p13, p14)
107   e14 = geompy.MakeEdge(p14, p11)
108
109   e21 = geompy.MakeEdge(p21, p22)
110   e22 = geompy.MakeEdge(p22, p23)
111   e23 = geompy.MakeEdge(p23, p24)
112   e24 = geompy.MakeEdge(p24, p21)
113
114   w1 = geompy.MakeWire([e11, e12, e13, e14])
115   w2 = geompy.MakeWire([e21, e22, e23, e24])
116   w3 = geompy.MakeTranslation(w2, 0, 0, 10)
117
118   id_w1 = geompy.addToStudy(w1, "Outside Wire")
119   id_w2 = geompy.addToStudy(w2, "Inside Wire")
120   id_w3 = geompy.addToStudy(w3, "Inside Wire, translated along OZ")
121
122   f12 = geompy.MakeFaces([w1, w2], 0)
123   id_f12 = geompy.addToStudy(f12, "MakeFaces WO + WI")
124
125   # Export/Import
126   TestExportImport(geompy, f12)
127
128   # OrientationChange
129   Box = geompy.MakeBoxDXDYDZ(200, 200, 200)
130   Orientation = geompy.OrientationChange(Box)
131   id_Orientation = geompy.addToStudy(Orientation, "OrientationChange")
132
133   # MakeCommon, MakeCut, MakeFuse, MakeSection
134   Sphere = geompy.MakeSphereR(100)
135
136   Common  = geompy.MakeCommon (Box, Sphere)
137   Cut     = geompy.MakeCut    (Box, Sphere)
138   Fuse    = geompy.MakeFuse   (Box, Sphere)
139   Section = geompy.MakeSection(Box, Sphere)
140
141   id_Common  = geompy.addToStudy(Common,  "Common")
142   id_Cut     = geompy.addToStudy(Cut,     "Cut")
143   id_Fuse    = geompy.addToStudy(Fuse,    "Fuse")
144   id_Section = geompy.addToStudy(Section, "Section")
145
146   # Partition
147   p100 = geompy.MakeVertex(100, 100, 100)
148   p300 = geompy.MakeVertex(300, 300, 300)
149   Box1 = geompy.MakeBoxTwoPnt(p100, p300)
150   Partition = geompy.Partition([Box], [Box1], [], [Box])
151   id_Partition = geompy.addToStudy(Partition, "Partition of Box by Box1")
152
153   # MakeMultiRotation1D, MakeMultiRotation2D
154   pz = geompy.MakeVertex(0, 0, 100)
155   vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
156
157   MultiRot1D = geompy.MakeMultiRotation1D(f12, vy, pz, 6)
158   MultiRot2D = geompy.MakeMultiRotation2D(f12, vy, pz, 45, 6, 30, 3)
159
160   id_MultiRot1D = geompy.addToStudy(MultiRot1D, "MakeMultiRotation1D")
161   id_MultiRot2D = geompy.addToStudy(MultiRot2D, "MakeMultiRotation2D")
162
163   # MakeFilletAll
164   radius_fillet = 10.
165   face5 = geompy.SubShapeSorted(Box, geompy.ShapeType["FACE"], [5])
166   f_glob_id = geompy.GetSubShapeID(Box, face5)
167   SuppFace = geompy.SuppressFaces(Box, [f_glob_id])
168
169   MakeFilletAll = geompy.MakeFilletAll(SuppFace, radius_fillet)
170   id_MakeFilletAll = geompy.addToStudy(MakeFilletAll, "MakeFilletAll")
171
172   # MakeChamferAll
173   dimension_chamfer = 10.
174   MakeChamferAll = geompy.MakeChamferAll(SuppFace, dimension_chamfer)
175   id_MakeChamferAll = geompy.addToStudy(MakeChamferAll, "MakeChamferAll")
176
177   # MakeChamfer
178   d1 = 13.
179   d2 = 7.
180   box_faces = geompy.SubShapeAllSorted(Box, geompy.ShapeType["FACE"])
181   f_ind_1 = geompy.GetSubShapeID(Box, box_faces[0])
182   f_ind_2 = geompy.GetSubShapeID(Box, box_faces[1])
183   f_ind_3 = geompy.GetSubShapeID(Box, box_faces[2])
184
185   MakeChamfer = geompy.MakeChamfer(Box, d1, d2, geompy.ShapeType["FACE"],
186                                    [f_ind_1, f_ind_2, f_ind_3])
187   id_MakeChamfer = geompy.addToStudy(MakeChamfer, "MakeChamfer")
188
189   # NumberOfFaces
190   NumberOfFaces = geompy.NumberOfFaces(Box)
191   if NumberOfFaces != 6:
192     print "Bad number of faces in BOX!"
193
194   # NumberOfEdges
195   NumberOfEdges = geompy.NumberOfEdges(Box)
196   if NumberOfEdges != 12:
197     print "Bad number of edges in BOX!"
198
199   # MakeBlockExplode
200   Compound = geompy.MakeCompound([Box, Sphere])
201   MakeBlockExplode = geompy.MakeBlockExplode(Compound, 6, 6)
202
203   id_MakeBlockExplode = geompy.addToStudy(MakeBlockExplode[0], "MakeBlockExplode")
204
205   # CheckCompoundOfBlocks
206   p1 = geompy.MakeVertex(200, 0, 0)
207   p2 = geompy.MakeVertex(400, 200, 200)
208   p3 = geompy.MakeVertex(400, 50, 50)
209   p4 = geompy.MakeVertex(600, 250, 250)
210
211   Box2 = geompy.MakeBoxTwoPnt(p1, p2)
212   Box3 = geompy.MakeBoxTwoPnt(p3, p4)
213   Cyl  = geompy.MakeCylinderRH(50, 300)
214   Cone = geompy.MakeConeR1R2H(150, 10, 400)
215
216   Compound1 = geompy.MakeCompound([Box, Cyl, Cone, Box3, Box2])
217
218   IsValid = geompy.CheckCompoundOfBlocks(Compound1)
219   if IsValid == 0:
220     print "The Blocks Compound is NOT VALID"
221   else:
222     print "The Blocks Compound is VALID"
223
224   IsValid = geompy.CheckCompoundOfBlocks(Box)
225   if IsValid == 0:
226     print "The Box is NOT VALID"
227   else:
228     print "The Box is VALID"
229
230   # test geometrical groups
231
232   # CreateGroup
233   CreateGroup = geompy.CreateGroup(Box, geompy.ShapeType["FACE"])
234
235   id_CreateGroup = geompy.addToStudy(CreateGroup, "CreateGroup")
236
237   # AddObject
238   f_ind_4 = geompy.GetSubShapeID(Box, box_faces[3])
239   f_ind_5 = geompy.GetSubShapeID(Box, box_faces[4])
240   f_ind_6 = geompy.GetSubShapeID(Box, box_faces[5])
241
242   geompy.AddObject(CreateGroup, f_ind_6) # box_faces[5]
243   geompy.AddObject(CreateGroup, f_ind_1) # box_faces[0]
244   geompy.AddObject(CreateGroup, f_ind_4) # box_faces[3]
245   # Now contains f_ind_6, f_ind_1, f_ind_4
246
247   # UnionList
248   geompy.UnionList(CreateGroup, [box_faces[2], box_faces[4], box_faces[5]])
249   # Now contains f_ind_6, f_ind_1, f_ind_4, f_ind_3, f_ind_5
250
251   # RemoveObject(theGroup, theSubShapeID)
252   geompy.RemoveObject(CreateGroup, f_ind_1) # box_faces[0]
253   # Now contains f_ind_6, f_ind_4, f_ind_3, f_ind_5
254
255   # DifferenceList
256   geompy.DifferenceList(CreateGroup, [box_faces[1], box_faces[0], box_faces[3]])
257   # Now contains f_ind_6, f_ind_3, f_ind_5
258
259   # GetObjectIDs
260   GetObjectIDs = geompy.GetObjectIDs(CreateGroup)
261
262   print "Group of Box's faces includes the following IDs:"
263   print "(must be ", f_ind_6, ", ", f_ind_3, " and ", f_ind_5, ")"
264   for ObjectID in GetObjectIDs:
265     print " ", ObjectID
266
267   BoxCopy = geompy.GetMainShape(CreateGroup)
268
269   # DifferenceIDs
270   geompy.DifferenceIDs(CreateGroup, [f_ind_3, f_ind_5])
271   # Now contains f_ind_6
272
273   # UnionIDs
274   geompy.UnionIDs(CreateGroup, [f_ind_1, f_ind_2, f_ind_6])
275   # Now contains f_ind_6, f_ind_1, f_ind_2
276
277   # Check
278   GetObjectIDs = geompy.GetObjectIDs(CreateGroup)
279   print "Group of Box's faces includes the following IDs:"
280   print "(must be ", f_ind_6, ", ", f_ind_1, " and ", f_ind_2, ")"
281   for ObjectID in GetObjectIDs:
282     print " ", ObjectID
283
284   # -----------------------------------------------------------------------------
285   # enumeration ShapeTypeString as a dictionary
286   # -----------------------------------------------------------------------------
287   ShapeTypeString = {'0':"COMPOUND", '1':"COMPSOLID", '2':"SOLID", '3':"SHELL", '4':"FACE", '5':"WIRE", '6':"EDGE", '7':"VERTEX", '8':"SHAPE"}
288
289   GroupType = geompy.GetType(CreateGroup)
290   print "Type of elements of the created group is ", ShapeTypeString[`GroupType`]
291
292   # Prepare data for the following operations
293   p0 = geompy.MakeVertex(0, 0, 0)
294   b0 = geompy.MakeBox(-50, -50, -50, 50, 50, 50)
295   s0 = geompy.MakeSphereR(100)
296
297   id_b0 = geompy.addToStudy(b0, "b0")
298   id_s0 = geompy.addToStudy(s0, "s0")
299
300   v_0pp = geompy.MakeVectorDXDYDZ( 0,  1,  1)
301   v_0np = geompy.MakeVectorDXDYDZ( 0, -1,  1)
302   v_p0p = geompy.MakeVectorDXDYDZ( 1,  0,  1)
303   v_n0p = geompy.MakeVectorDXDYDZ(-1,  0,  1)
304   v_pp0 = geompy.MakeVectorDXDYDZ( 1,  1,  0)
305   v_np0 = geompy.MakeVectorDXDYDZ(-1,  1,  0)
306
307   pln_0pp = geompy.MakePlane(p0, v_0pp, 300)
308   pln_0np = geompy.MakePlane(p0, v_0np, 300)
309   pln_p0p = geompy.MakePlane(p0, v_p0p, 300)
310   pln_n0p = geompy.MakePlane(p0, v_n0p, 300)
311   pln_pp0 = geompy.MakePlane(p0, v_pp0, 300)
312   pln_np0 = geompy.MakePlane(p0, v_np0, 300)
313
314   part_tool_1 = geompy.MakePartition([b0, pln_0pp, pln_0np, pln_p0p, pln_n0p, pln_pp0, pln_np0],
315                                      [],
316                                      [],
317                                      [b0])
318
319   pt_pnt_1  = geompy.MakeVertex( 55,   0,  55)
320   pt_pnt_2  = geompy.MakeVertex(  0,  55,  55)
321   pt_pnt_3  = geompy.MakeVertex(-55,   0,  55)
322   pt_pnt_4  = geompy.MakeVertex(  0, -55,  55)
323   pt_pnt_5  = geompy.MakeVertex( 55,  55,   0)
324   pt_pnt_6  = geompy.MakeVertex( 55, -55,   0)
325   pt_pnt_7  = geompy.MakeVertex(-55,  55,   0)
326   pt_pnt_8  = geompy.MakeVertex(-55, -55,   0)
327   pt_pnt_9  = geompy.MakeVertex( 55,   0, -55)
328   pt_pnt_10 = geompy.MakeVertex(  0,  55, -55)
329   pt_pnt_11 = geompy.MakeVertex(-55,   0, -55)
330   pt_pnt_12 = geompy.MakeVertex(  0, -55, -55)
331
332   pt_face_1  = geompy.GetFaceNearPoint(part_tool_1, pt_pnt_1)
333   pt_face_2  = geompy.GetFaceNearPoint(part_tool_1, pt_pnt_2)
334   pt_face_3  = geompy.GetFaceNearPoint(part_tool_1, pt_pnt_3)
335   pt_face_4  = geompy.GetFaceNearPoint(part_tool_1, pt_pnt_4)
336   pt_face_5  = geompy.GetFaceNearPoint(part_tool_1, pt_pnt_5)
337   pt_face_6  = geompy.GetFaceNearPoint(part_tool_1, pt_pnt_6)
338   pt_face_7  = geompy.GetFaceNearPoint(part_tool_1, pt_pnt_7)
339   pt_face_8  = geompy.GetFaceNearPoint(part_tool_1, pt_pnt_8)
340   pt_face_9  = geompy.GetFaceNearPoint(part_tool_1, pt_pnt_9)
341   pt_face_10 = geompy.GetFaceNearPoint(part_tool_1, pt_pnt_10)
342   pt_face_11 = geompy.GetFaceNearPoint(part_tool_1, pt_pnt_11)
343   pt_face_12 = geompy.GetFaceNearPoint(part_tool_1, pt_pnt_12)
344
345   pt_box = geompy.GetBlockNearPoint(part_tool_1, p0)
346
347   part_tool = geompy.MakeCompound([pt_face_1, pt_face_4, pt_face_7, pt_face_10,
348                                    pt_face_2, pt_face_5, pt_face_8, pt_face_11,
349                                    pt_face_3, pt_face_6, pt_face_9, pt_face_12, pt_box])
350   id_part_tool = geompy.addToStudy(part_tool, "part_tool")
351
352   part = geompy.MakePartition([s0], [part_tool])
353   geompy.addToStudy(part, "part")
354
355   # GetFreeFacesIDs
356   anIDs = geompy.GetFreeFacesIDs(part)
357   freeFaces = geompy.GetSubShape(part, anIDs)
358
359   geompy.addToStudy(freeFaces, "freeFaces")
360
361   # RemoveExtraEdges
362   freeFacesWithoutExtra = geompy.RemoveExtraEdges(freeFaces)
363
364   geompy.addToStudy(freeFacesWithoutExtra, "freeFacesWithoutExtra")
365
366   # GetSharedShapes
367   sharedFaces = geompy.GetSharedShapes(part, freeFacesWithoutExtra, geompy.ShapeType["FACE"])
368
369   for shFace in sharedFaces:
370     geompy.addToStudy(shFace, "sharedFace")
371
372   # CheckAndImprove
373   blocksComp = geompy.CheckAndImprove(part)
374
375   geompy.addToStudy(blocksComp, "blocksComp")
376
377   # Propagate
378   listChains = geompy.Propagate(blocksComp)
379
380   for chain in listChains:
381     geompy.addToStudyInFather(blocksComp, chain, "propagation chain")
382
383   # GetPoint(theShape, theX, theY, theZ, theEpsilon)
384   #
385   # (-50,  50, 50) .-----. (50,  50, 50)
386   #      pb0_top_1 |     |
387   #                |     . pmidle
388   #                |     |
389   # (-50, -50, 50) '-----' (50, -50, 50)
390   #
391   pb0_top_1 = geompy.GetPoint(blocksComp, -50,  50,  50, 0.01)
392   pb0_bot_1 = geompy.GetPoint(blocksComp, -50, -50, -50, 0.01)
393
394   geompy.addToStudyInFather(blocksComp, pb0_top_1, "point from blocksComp (-50,  50,  50)")
395   geompy.addToStudyInFather(blocksComp, pb0_bot_1, "point from blocksComp (-50, -50, -50)")
396
397   # GetEdgeNearPoint(theShape, thePoint)
398   pmidle = geompy.MakeVertex(50, 0, 50)
399   edge1 = geompy.GetEdgeNearPoint(blocksComp, pmidle)
400
401   geompy.addToStudyInFather(blocksComp, edge1, "edge near point (50, 0, 50)")
402
403   # GetBlockByParts(theCompound, theParts)
404   b0_image = geompy.GetBlockByParts(blocksComp, [pb0_top_1, pb0_bot_1, edge1])
405
406   geompy.addToStudyInFather(blocksComp, b0_image, "b0 image")
407
408   # GetShapesOnPlane
409   faces_on_pln = geompy.GetShapesOnPlane(blocksComp, geompy.ShapeType["FACE"],
410                                          v_0pp, geompy.GEOM.ST_ONIN)
411   for face_i in faces_on_pln:
412     geompy.addToStudy(face_i, "Face on Plane (N = (0, 1, 1)) or below it")
413
414   # GetShapesOnPlaneIDs
415   faces_above_pln_ids = geompy.GetShapesOnPlaneIDs(blocksComp, geompy.ShapeType["FACE"],
416                                                    v_0pp, geompy.GEOM.ST_OUT)
417   faces_above = geompy.CreateGroup(blocksComp, geompy.ShapeType["FACE"])
418   geompy.UnionIDs(faces_above, faces_above_pln_ids)
419   geompy.addToStudy(faces_above, "Group of faces above Plane (N = (0, 1, 1))")
420
421   # GetShapesOnCylinder
422   edges_out_cyl = geompy.GetShapesOnCylinder(blocksComp, geompy.ShapeType["EDGE"],
423                                              vy, 55, geompy.GEOM.ST_OUT)
424   for edge_i in edges_out_cyl:
425     geompy.addToStudy(edge_i, "Edge out of Cylinder (axis = (0, 1, 0), r = 55)")
426
427   # GetShapesOnCylinderIDs
428   edges_in_cyl_ids = geompy.GetShapesOnCylinderIDs(blocksComp, geompy.ShapeType["EDGE"],
429                                                    vy, 80, geompy.GEOM.ST_IN)
430   edges_in = geompy.CreateGroup(blocksComp, geompy.ShapeType["EDGE"])
431   geompy.UnionIDs(edges_in, edges_in_cyl_ids)
432   geompy.addToStudy(edges_in, "Group of edges inside Cylinder (axis = (0, 1, 0), r = 55)")
433
434   # GetShapesOnSphere
435   vertices_on_sph = geompy.GetShapesOnSphere(blocksComp, geompy.ShapeType["VERTEX"],
436                                              p0, 100, geompy.GEOM.ST_ON)
437   for vertex_i in vertices_on_sph:
438     geompy.addToStudy(vertex_i, "Vertex on Sphere (center = (0, 0, 0), r = 100)")
439     pass
440
441   # GetShapesOnSphereIDs
442   vertices_on_sph_ids = geompy.GetShapesOnSphereIDs(blocksComp, geompy.ShapeType["VERTEX"],
443                                                     p0, 100, geompy.GEOM.ST_ON)
444   vertices_on = geompy.CreateGroup(blocksComp, geompy.ShapeType["VERTEX"])
445   geompy.UnionIDs(vertices_on, vertices_on_sph_ids)
446   geompy.addToStudy(vertices_on, "Group of vertices on Sphere (center = (0, 0, 0), r = 100)")
447
448   # GetShapesOnQuadrangle
449
450   geompy.addToStudy(f12, "F12" )
451
452   bl = geompy.MakeVertex(10,-10, 0)
453   br = geompy.MakeVertex(40,-10, 0)
454   tr = geompy.MakeVertex(40, 20, 0)
455   tl = geompy.MakeVertex(10, 20, 0)
456   qe1 = geompy.MakeEdge(bl, br)
457   qe2 = geompy.MakeEdge(br, tr)
458   qe3 = geompy.MakeEdge(tr, tl)
459   qe4 = geompy.MakeEdge(tl, bl)
460   quadrangle = geompy.MakeWire([qe1, qe2, qe3, qe4])
461   geompy.addToStudy(quadrangle, "Quadrangle")
462
463   edges_onin_quad = geompy.GetShapesOnQuadrangle( f12, geompy.ShapeType["EDGE"],
464                                                   tl, tr, bl, br, geompy.GEOM.ST_ONIN)
465   comp = geompy.MakeCompound(edges_onin_quad)
466   geompy.addToStudy(comp, "Edges of F12 ONIN Quadrangle")
467   if len( edges_onin_quad ) != 4:
468     print "Error in GetShapesOnQuadrangle()"
469     pass
470
471   # GetShapesOnQuadrangleIDs
472   vertices_on_quad_ids = geompy.GetShapesOnQuadrangleIDs(f12, geompy.ShapeType["VERTEX"],
473                                                          tl, tr, bl, br, geompy.GEOM.ST_ON)
474   vertices_on_quad = geompy.CreateGroup(f12, geompy.ShapeType["VERTEX"])
475   geompy.UnionIDs(vertices_on_quad, vertices_on_quad_ids)
476   geompy.addToStudy(vertices_on_quad, "Group of vertices on Quadrangle F12")
477
478   # GetInPlace(theShapeWhere, theShapeWhat)
479   box5 = geompy.MakeBoxDXDYDZ(100, 100, 100)
480   box6 = geompy.MakeTranslation(box5, 50, 50, 0)
481
482   part = geompy.MakePartition([box5], [box6])
483   geompy.addToStudy(part, "Partitioned")
484
485   ibb = 5
486   box_list = [box5, box6]
487   for abox in box_list:
488     geompy.addToStudy(abox, "Box " + `ibb`)
489     box_faces = geompy.SubShapeAll(abox, geompy.ShapeType["FACE"])
490     ifa = 1
491     for aface in box_faces:
492       geompy.addToStudyInFather(abox, aface, "Face" + `ifa`)
493       refl_box_face = geompy.GetInPlace(part, aface)
494       if refl_box_face is not None:
495         geompy.addToStudyInFather(part, refl_box_face,
496                                   "Reflection of Face " + `ifa` + " of box " + `ibb`)
497       ifa = ifa + 1
498     ibb = ibb + 1