Version: 9.15.0
GEOM_TestOthers.py


GEOM_TestOthers.py

0 import os

32 import GEOM
33 import tempfile
34 
35 def TestExportImport (geompy, shape):
36 
37  print("Test Export/Import ...", end=' ')
38 
39  with tempfile.TemporaryDirectory() as tmpDir:
40  # Files for Export/Import testing
41  fileExportImportBREP = os.path.join(tmpDir, "testExportImportBREP.brep")
42  fileExportImportIGES = os.path.join(tmpDir, "testExportImportIGES.iges")
43  fileExportImportSTEP = os.path.join(tmpDir, "testExportImportSTEP.step")
44 
45  # ExportBREP, ExportIGES, ExportSTEP
46  geompy.ExportBREP(shape, fileExportImportBREP)
47  geompy.ExportIGES(shape, fileExportImportIGES)
48  geompy.ExportSTEP(shape, fileExportImportSTEP)
49 
50  # ImportBREP, ImportIGES, ImportSTEP
51  ImportBREP = geompy.ImportBREP(fileExportImportBREP)
52  ImportIGES = geompy.ImportIGES(fileExportImportIGES)
53  ImportSTEP = geompy.ImportSTEP(fileExportImportSTEP)
54 
55  geompy.addToStudy(ImportBREP, "ImportBREP")
56  geompy.addToStudy(ImportIGES, "ImportIGES")
57  geompy.addToStudy(ImportSTEP, "ImportSTEP")
58 
59  # GetIGESUnit and GetSTEPUnit
60  if geompy.GetIGESUnit(fileExportImportIGES) != "M":
61  ImportIGES_scaled = geompy.ImportIGES(fileExportImportIGES, True)
62  geompy.addToStudy(ImportIGES_scaled, "ImportIGES_scaled")
63  pass
64 
65  if geompy.GetSTEPUnit(fileExportImportSTEP) != "M":
66  ImportSTEP_scaled = geompy.ImportSTEP(fileExportImportSTEP, True)
67  geompy.addToStudy(ImportSTEP_scaled, "ImportSTEP_scaled")
68  pass
69  pass
70 
71  # Test RestoreShape from binary BRep stream
72  aStream = shape.GetShapeStream()
73  aNewShape = geompy.RestoreShape(aStream)
74  geompy.addToStudy(aNewShape, "aNewShape")
75 
76  print("OK")
77 
78 
79 def TestOtherOperations (geompy, math):
80 
81  # prepare data for further operations
82  vx = geompy.MakeVectorDXDYDZ( 1, 0, 0)
83  vy = geompy.MakeVectorDXDYDZ( 0, 1, 0)
84  vz = geompy.MakeVectorDXDYDZ( 0, 0, 1)
85 
86  v_y = geompy.MakeVectorDXDYDZ( 0, -1, 0)
87 
88  p11 = geompy.MakeVertex( 0, 0, 0)
89  p12 = geompy.MakeVertex(30, 0, 0)
90  p13 = geompy.MakeVertex(30, 30, 0)
91  p14 = geompy.MakeVertex( 0, 30, 0)
92 
93  p21 = geompy.MakeVertex(10, 10, 0)
94  p22 = geompy.MakeVertex(20, 10, 0)
95  p23 = geompy.MakeVertex(20, 20, 0)
96  p24 = geompy.MakeVertex(10, 20, 0)
97 
98  e11 = geompy.MakeEdge(p11, p12)
99  e12 = geompy.MakeEdge(p12, p13)
100  e13 = geompy.MakeEdge(p13, p14)
101  e14 = geompy.MakeEdge(p14, p11)
102 
103  e21 = geompy.MakeEdge(p21, p22)
104  e22 = geompy.MakeEdge(p22, p23)
105  e23 = geompy.MakeEdge(p23, p24)
106  e24 = geompy.MakeEdge(p24, p21)
107 
108  w1 = geompy.MakeWire([e11, e12, e13, e14])
109  w2 = geompy.MakeWire([e21, e22, e23, e24])
110  w3 = geompy.MakeTranslation(w2, 0, 0, 10)
111 
112  id_w1 = geompy.addToStudy(w1, "Outside Wire")
113  id_w2 = geompy.addToStudy(w2, "Inside Wire")
114  id_w3 = geompy.addToStudy(w3, "Inside Wire, translated along OZ")

115 
116  # MakeFaces
117  f12 = geompy.MakeFaces([w1, w2], 0)
118  id_f12 = geompy.addToStudy(f12, "MakeFaces WO + WI")
119 
120  # Export/Import
121  TestExportImport(geompy, f12)

122 
123  # OrientationChange
124  Box = geompy.MakeBoxDXDYDZ(200, 200, 200)
125  geompy.addToStudy(Box, "Box")
126  Orientation = geompy.OrientationChange(Box)
127  id_Orientation = geompy.addToStudy(Orientation, "OrientationChange")

128 
129  # MakeCommon, MakeCut, MakeFuse, MakeSection
130  p1 = geompy.MakeVertex(60, 120, 0)
131  p2 = geompy.MakeVertex( 0, 0, 0)
132  v = geompy.MakeVector(p1, p2)
133  height = 90
134  radius1 = 50
135  cylinder = geompy.MakeCylinder(p1, v, radius1, height)
136  Sphere = geompy.MakeSphereR(100)
137 
138  Common1 = geompy.MakeCommon (Box, Sphere)
139  Cut1 = geompy.MakeCut (Box, Sphere)
140  Fuse1 = geompy.MakeFuse (Box, Sphere)
141  Section = geompy.MakeSection (Box, Sphere)
142  Common2 = geompy.MakeCommonList([Box, Sphere, cylinder])
143  Cut2 = geompy.MakeCutList (Box, [Sphere, cylinder])
144  Fuse2 = geompy.MakeFuseList ([Box, Sphere, cylinder])
145 
146  id_Common1 = geompy.addToStudy(Common1, "Common_1")
147  id_Cut1 = geompy.addToStudy(Cut1, "Cut_1")
148  id_Fuse1 = geompy.addToStudy(Fuse1, "Fuse_1")
149  id_Section = geompy.addToStudy(Section, "Section")
150  id_Common2 = geompy.addToStudy(Common2, "Common_2")
151  id_Cut2 = geompy.addToStudy(Cut2, "Cut_2")
152  id_Fuse2 = geompy.addToStudy(Fuse2, "Fuse_2")

153 
154  # Partition
155  p100 = geompy.MakeVertex(100, 100, 100)
156  p300 = geompy.MakeVertex(300, 300, 300)
157  Box1 = geompy.MakeBoxTwoPnt(p100, p300)
158  Partition = geompy.Partition([Box], [Box1])
159  id_Partition = geompy.addToStudy(Partition, "Partition of Box by Box1")

160 
161  # MakeMultiRotation1D, MakeMultiRotation2D
162  pz = geompy.MakeVertex(0, 0, 100)
163  vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
164 
165  MultiRot1Dt = geompy.MakeMultiRotation1DNbTimes(f12, vy, pz, 6)
166  MultiRot1Ds = geompy.MakeMultiRotation1DByStep(f12, vy, pz, math.pi/5., 6)
167 
168  MultiRot2Dt = geompy.MakeMultiRotation2DNbTimes(f12, vy, pz, 5, 30, 3)
169  MultiRot2Ds = geompy.MakeMultiRotation2DByStep(f12, vy, pz, math.pi/4., 6, 30, 3)
170 
171  geompy.addToStudy(MultiRot1Dt, "MakeMultiRotation1DNbTimes")
172  geompy.addToStudy(MultiRot1Ds, "MakeMultiRotation1DByStep")
173  geompy.addToStudy(MultiRot2Dt, "MakeMultiRotation2DNbTimes")
174  id_MultiRot2D = geompy.addToStudy(MultiRot2Ds, "MakeMultiRotation2DByStep")

175 
176  # MakeFilletAll
177  radius_fillet = 10.
178  face5 = geompy.SubShapeSortedCentres(Box, geompy.ShapeType["FACE"], [5])
179  f_glob_id = geompy.GetSubShapeID(Box, face5)
180  SuppFace = geompy.SuppressFaces(Box, [f_glob_id])
181 
182  MakeFilletAll = geompy.MakeFilletAll(SuppFace, radius_fillet)
183  id_MakeFilletAll = geompy.addToStudy(MakeFilletAll, "MakeFilletAll")

184 
185  # MakeChamferAll
186  dimension_chamfer = 10.
187  MakeChamferAll = geompy.MakeChamferAll(SuppFace, dimension_chamfer)
188  id_MakeChamferAll = geompy.addToStudy(MakeChamferAll, "MakeChamferAll")

189 
190  # MakeChamfer
191  d1 = 13.
192  d2 = 7.
193  box_faces = geompy.SubShapeAllSortedCentres(Box, geompy.ShapeType["FACE"])
194  f_ind_1 = geompy.GetSubShapeID(Box, box_faces[0])
195  f_ind_2 = geompy.GetSubShapeID(Box, box_faces[1])
196  f_ind_3 = geompy.GetSubShapeID(Box, box_faces[2])
197 
198  MakeChamfer = geompy.MakeChamfer(Box, d1, d2, geompy.ShapeType["FACE"],
199  [f_ind_1, f_ind_2, f_ind_3])
200  id_MakeChamfer = geompy.addToStudy(MakeChamfer, "MakeChamfer")

201 
202  # NumberOf
203  NumberOfFaces = geompy.NumberOfFaces(Box)
204  NumberOfEdges = geompy.NumberOfEdges(Box)
205  NumberOfSolids = geompy.NumberOfSolids(Box)
206  NumberOfShapes = geompy.NumberOfSubShapes(Box, geompy.ShapeType["SHAPE"])
207 
208  assert (NumberOfFaces == 6), "Bad number of faces in BOX!"
209  assert (NumberOfEdges == 12), "Bad number of edges in BOX!"
210  assert (NumberOfSolids == 1), "Bad number of solids in BOX!"
211  assert (NumberOfShapes == 34), "Bad number of shapes in BOX!"

212 
213  # MakeBlockExplode
214  Compound = geompy.MakeCompound([Box, Sphere])
215  MakeBlockExplode = geompy.MakeBlockExplode(Compound, 6, 6)
216 
217  id_MakeBlockExplode = geompy.addToStudy(MakeBlockExplode[0], "MakeBlockExplode")

218 
219  # CheckCompoundOfBlocks
220  p1 = geompy.MakeVertex(200, 0, 0)
221  p2 = geompy.MakeVertex(400, 200, 200)
222  p3 = geompy.MakeVertex(400, 50, 50)
223  p4 = geompy.MakeVertex(600, 250, 250)
224 
225  Box2 = geompy.MakeBoxTwoPnt(p1, p2)
226  Box3 = geompy.MakeBoxTwoPnt(p3, p4)
227  Cyl = geompy.MakeCylinderRH(50, 300)
228  Cone = geompy.MakeConeR1R2H(150, 10, 400)
229 
230  Compound1 = geompy.MakeCompound([Box, Cyl, Cone, Box3, Box2], "Compound1")
231 
232  print("Printing errors of not valid Blocks Compound (EXPECTED):")
233  IsValid = geompy.CheckCompoundOfBlocks(Compound1)
234  # This Blocks Compound is NOT VALID
235  assert (not IsValid)
236  (NonBlocks, NonQuads) = geompy.GetNonBlocks(Compound1)
237  if NonBlocks is not None:
238  geompy.addToStudyInFather(Compound1, NonBlocks, "Group of non-hexahedral solids")
239  if NonQuads is not None:
240  geompy.addToStudyInFather(Compound1, NonQuads, "Group of non-quadrangular faces")
241 
242  IsValid = geompy.CheckCompoundOfBlocks(Box)
243  assert (IsValid) # Box is a VALID Blocks Compound

244 
245  # GetSame
246  Cone_ss = geompy.GetSame(Compound1, Cone)
247  id_Cone_ss = geompy.addToStudyInFather(Compound1, Cone_ss, "Cone subshape")

248 
249  # test geometrical groups
250 
251  # CreateGroup
252  CreateGroup = geompy.CreateGroup(Box, geompy.ShapeType["FACE"])
253 
254  id_CreateGroup = geompy.addToStudy(CreateGroup, "CreateGroup")

255 
256  # AddObject
257  f_ind_4 = geompy.GetSubShapeID(Box, box_faces[3])
258  f_ind_5 = geompy.GetSubShapeID(Box, box_faces[4])
259  f_ind_6 = geompy.GetSubShapeID(Box, box_faces[5])
260 
261  geompy.AddObject(CreateGroup, f_ind_6) # box_faces[5]
262  geompy.AddObject(CreateGroup, f_ind_1) # box_faces[0]
263  geompy.AddObject(CreateGroup, f_ind_4) # box_faces[3]
264  # Now contains f_ind_6, f_ind_1, f_ind_4

265 
266  # UnionList
267  geompy.UnionList(CreateGroup, [box_faces[2], box_faces[4], box_faces[5]])
268  # Now contains f_ind_6, f_ind_1, f_ind_4, f_ind_3, f_ind_5

269 
270  # RemoveObject(theGroup, theSubShapeID)
271  geompy.RemoveObject(CreateGroup, f_ind_1) # box_faces[0]
272  # Now contains f_ind_6, f_ind_4, f_ind_3, f_ind_5

273 
274  # DifferenceList
275  geompy.DifferenceList(CreateGroup, [box_faces[1], box_faces[0], box_faces[3]])
276  # Now contains f_ind_6, f_ind_3, f_ind_5

277 
278  # GetObjectIDs
279  GetObjectIDs = geompy.GetObjectIDs(CreateGroup)
280  assert (sorted(GetObjectIDs) == sorted([f_ind_6, f_ind_3, f_ind_5]))

281 
282  # GetMainShape
283  BoxCopy = geompy.GetMainShape(CreateGroup)

284 
285  # DifferenceIDs
286  geompy.DifferenceIDs(CreateGroup, [f_ind_3, f_ind_5])
287  # Now contains f_ind_6

288 
289  # UnionIDs
290  geompy.UnionIDs(CreateGroup, [f_ind_1, f_ind_2, f_ind_6])
291  # Now contains f_ind_6, f_ind_1, f_ind_2
292 
293  # Check
294  GetObjectIDs = geompy.GetObjectIDs(CreateGroup)
295  assert (sorted(GetObjectIDs) == sorted([f_ind_6, f_ind_1, f_ind_2]))

296 
297  # Boolean Operations on Groups (Union, Intersection, Cut)
298  Group_1 = geompy.CreateGroup(Box, geompy.ShapeType["FACE"])
299  geompy.UnionIDs(Group_1, [13, 23])
300  Group_2 = geompy.CreateGroup(Box, geompy.ShapeType["FACE"])
301  geompy.UnionIDs(Group_2, [3, 27])
302  Group_3 = geompy.CreateGroup(Box, geompy.ShapeType["FACE"])
303  geompy.UnionIDs(Group_3, [33, 23])
304  Group_4 = geompy.CreateGroup(Box, geompy.ShapeType["FACE"])
305  geompy.UnionIDs(Group_4, [31, 27])
306 
307  geompy.addToStudyInFather(Box, Group_1, 'Group_1')
308  geompy.addToStudyInFather(Box, Group_2, 'Group_2')
309  geompy.addToStudyInFather(Box, Group_3, 'Group_3')
310  geompy.addToStudyInFather(Box, Group_4, 'Group_4')
311 
312  # union groups
313  Group_U_1_2 = geompy.UnionGroups(Group_1, Group_2)
314  Group_UL_3_4 = geompy.UnionListOfGroups([Group_3, Group_4])
315 
316  geompy.addToStudyInFather(Box, Group_U_1_2, 'Group_U_1_2')
317  geompy.addToStudyInFather(Box, Group_UL_3_4, 'Group_UL_3_4')
318 
319  # intersect groups
320  Group_I_1_3 = geompy.IntersectGroups(Group_1, Group_3)
321  Group_IL_1_3 = geompy.IntersectListOfGroups([Group_1, Group_3])
322 
323  geompy.addToStudyInFather(Box, Group_I_1_3, 'Group_I_1_3')
324  geompy.addToStudyInFather(Box, Group_IL_1_3, 'Group_IL_1_3')
325 
326  # cut groups
327  Group_C_2_4 = geompy.CutGroups(Group_2, Group_4)
328  Group_CL_2_4 = geompy.CutListOfGroups([Group_2], [Group_4])
329 
330  geompy.addToStudyInFather(Box, Group_C_2_4, 'Group_C_2_4')
331  geompy.addToStudyInFather(Box, Group_CL_2_4, 'Group_CL_2_4')

332 
333  GroupType = geompy.GetType(CreateGroup)
334  assert (GroupType == geompy.ShapeType["FACE"])
335 
336  # Example of sphere partitioning into hexahedral blocks
337  p0 = geompy.MakeVertex(0, 0, 0)
338  b0 = geompy.MakeBox(-50, -50, -50, 50, 50, 50)
339  s0 = geompy.MakeSphereR(100)
340 
341  id_b0 = geompy.addToStudy(b0, "b0")
342  id_s0 = geompy.addToStudy(s0, "s0")
343 
344  v_0pp = geompy.MakeVectorDXDYDZ( 0, 1, 1)
345  v_0np = geompy.MakeVectorDXDYDZ( 0, -1, 1)
346  v_p0p = geompy.MakeVectorDXDYDZ( 1, 0, 1)
347  v_p0n = geompy.MakeVectorDXDYDZ( 1, 0, -1)
348  v_pp0 = geompy.MakeVectorDXDYDZ( 1, 1, 0)
349  v_pn0 = geompy.MakeVectorDXDYDZ( 1, -1, 0)
350 
351  pln_0pp = geompy.MakePlane(p0, v_0pp, 300)
352  pln_0np = geompy.MakePlane(p0, v_0np, 300)
353  pln_p0p = geompy.MakePlane(p0, v_p0p, 300)
354  pln_p0n = geompy.MakePlane(p0, v_p0n, 300)
355  pln_pp0 = geompy.MakePlane(p0, v_pp0, 300)
356  pln_pn0 = geompy.MakePlane(p0, v_pn0, 300)
357 
358  part_objs = [b0, pln_0pp, pln_0np, pln_p0p, pln_p0n, pln_pp0, pln_pn0]
359  part_tool_1 = geompy.MakePartition(part_objs, KeepNonlimitShapes=1)
360  geompy.addToStudy(part_tool_1, "part_tool_1")
361 
362  pt_pnt_1 = geompy.MakeVertex( 55, 0, 55)
363  pt_pnt_2 = geompy.MakeVertex( 0, 55, 55)
364  pt_pnt_3 = geompy.MakeVertex(-55, 0, 55)
365  pt_pnt_4 = geompy.MakeVertex( 0, -55, 55)
366  pt_pnt_5 = geompy.MakeVertex( 55, 55, 0)
367  pt_pnt_6 = geompy.MakeVertex( 55, -55, 0)
368  pt_pnt_7 = geompy.MakeVertex(-55, 55, 0)
369  pt_pnt_8 = geompy.MakeVertex(-55, -55, 0)
370  pt_pnt_9 = geompy.MakeVertex( 55, 0, -55)
371  pt_pnt_10 = geompy.MakeVertex( 0, 55, -55)
372  pt_pnt_11 = geompy.MakeVertex(-55, 0, -55)
373  pt_pnt_12 = geompy.MakeVertex( 0, -55, -55)
374 
375  pt_face_1 = geompy.GetFaceNearPoint(part_tool_1, pt_pnt_1)
376  pt_face_2 = geompy.GetFaceNearPoint(part_tool_1, pt_pnt_2)
377  pt_face_3 = geompy.GetFaceNearPoint(part_tool_1, pt_pnt_3)
378  pt_face_4 = geompy.GetFaceNearPoint(part_tool_1, pt_pnt_4)
379  pt_face_5 = geompy.GetFaceNearPoint(part_tool_1, pt_pnt_5)
380  pt_face_6 = geompy.GetFaceNearPoint(part_tool_1, pt_pnt_6)
381  pt_face_7 = geompy.GetFaceNearPoint(part_tool_1, pt_pnt_7)
382  pt_face_8 = geompy.GetFaceNearPoint(part_tool_1, pt_pnt_8)
383  pt_face_9 = geompy.GetFaceNearPoint(part_tool_1, pt_pnt_9)
384  pt_face_10 = geompy.GetFaceNearPoint(part_tool_1, pt_pnt_10)
385  pt_face_11 = geompy.GetFaceNearPoint(part_tool_1, pt_pnt_11)
386  pt_face_12 = geompy.GetFaceNearPoint(part_tool_1, pt_pnt_12)
387 
388  part_tools = [pt_face_1, pt_face_4, pt_face_7, pt_face_10,
389  pt_face_2, pt_face_5, pt_face_8, pt_face_11,
390  pt_face_3, pt_face_6, pt_face_9, pt_face_12, b0]
391  part_tool = geompy.MakeCompound(part_tools)
392  geompy.addToStudy(part_tool, "part_tool")
393  part = geompy.MakePartition([s0], [part_tool])
394  geompy.addToStudy(part, "part")
395 
396  # GetFreeFacesIDs
397  anIDs = geompy.GetFreeFacesIDs(part)
398  freeFaces = geompy.GetSubShape(part, anIDs)
399 
400  geompy.addToStudy(freeFaces, "freeFaces")
401 
402  # Example of hexahedral sphere creation
403  # (spherical surface of solid is made of six quasi-quadrangular faces)
404  tools = [pln_pp0, pln_pn0, pln_p0p, pln_p0n]
405  Partition_1 = geompy.MakePartition([Sphere], tools, [], [], geompy.ShapeType["SOLID"], 0, [])
406  geompy.addToStudy(Partition_1, "Partition_1")
407 
408  faces = geompy.SubShapeAllSortedCentres(Partition_1, geompy.ShapeType["FACE"])
409 
410  Face_1 = faces[0]
411  Face_2 = faces[39]
412  Face_3 = faces[40]
413 
414  geompy.addToStudyInFather(Partition_1, Face_1, "Face_1")
415  geompy.addToStudyInFather(Partition_1, Face_2, "Face_2")
416  geompy.addToStudyInFather(Partition_1, Face_3, "Face_3")
417 
418  Vector_5 = geompy.MakeVectorDXDYDZ(0, 20, 0)
419  geompy.addToStudy(Vector_5, "Vector_5")
420 
421  Rotation_1 = geompy.MakeRotation(Face_1, Vector_5, 90*math.pi/180.0)
422  Rotation_2 = geompy.MakeRotation(Face_1, Vector_5, 180*math.pi/180.0)
423  Rotation_3 = geompy.MakeRotation(Face_1, Vector_5, 270*math.pi/180.0)
424 
425  geompy.addToStudy(Rotation_1, "Rotation_1")
426  geompy.addToStudy(Rotation_2, "Rotation_2")
427  geompy.addToStudy(Rotation_3, "Rotation_3")
428 
429  Vector_6 = geompy.MakeVectorDXDYDZ(0, 0, 20)
430  geompy.addToStudy(Vector_6, "Vector_6")
431 
432  Rotation_4 = geompy.MakeRotation(Face_1, Vector_6, 90*math.pi/180.0)
433  Rotation_5 = geompy.MakeRotation(Face_1, Vector_6, -90*math.pi/180.0)
434  geompy.addToStudy(Rotation_4, "Rotation_4")
435  geompy.addToStudy(Rotation_5, "Rotation_5")
436 
437  Shell_1 = geompy.MakeShell([Face_1, Rotation_1, Rotation_2, Rotation_3, Rotation_4, Rotation_5])
438  Solid_1 = geompy.MakeSolid([Shell_1])

439 
440  # RemoveExtraEdges with union of all faces, sharing common surfaces
441  box10 = geompy.MakeBoxDXDYDZ(10, 10, 10, "box10")
442  box11 = geompy.MakeTranslation(box10, 10, 0, 0, "box11")
443  FuseB = geompy.MakeFuse(box10, box11, checkSelfInte=False, rmExtraEdges=False, theName="FuseB")
444  NoExtraEdges_1 = geompy.RemoveExtraEdges(FuseB, True) # doUnionFaces = True
445 
446  geompy.addToStudy(Shell_1, "Shell_1")
447  geompy.addToStudy(Solid_1, "Solid_1")
448  geompy.addToStudy(NoExtraEdges_1, "NoExtraEdges_1")
449 
450  # RemoveExtraEdges (by default, doUnionFaces = False)
451  freeFacesWithoutExtra = geompy.RemoveExtraEdges(freeFaces)
452 
453  geompy.addToStudy(freeFacesWithoutExtra, "freeFacesWithoutExtra")

454 
455  # UnionFaces
456  unitedFaces = geompy.UnionFaces(freeFaces)
457 
458  geompy.addToStudy(unitedFaces, "unitedFaces")

459 
460  # GetSharedShapes
461  sharedFaces = geompy.GetSharedShapes(part, freeFaces,
462  geompy.ShapeType["FACE"])
463  ind = 1
464  for shFace in sharedFaces:
465  geompy.addToStudy(shFace, "sharedFace_" + repr(ind))
466  ind = ind + 1
467  pass
468 
469  sharedEdges = geompy.GetSharedShapesMulti([part, freeFaces],
470  geompy.ShapeType["EDGE"])
471  ind = 1
472  for shEdge in sharedEdges:
473  geompy.addToStudy(shEdge, "sharedEdge_" + repr(ind))

474  ind = ind + 1
475  pass
476 
477  # TransferData
478  path = os.getenv("DATA_DIR")
479  fileName = path + "/Shapes/Step/black_and_white.step"
480  blackWhite = geompy.ImportSTEP(fileName)
481  blackWhiteCopy = geompy.MakeCopy(blackWhite[0])
482  subBlackWhite = geompy.SubShapeAll(blackWhiteCopy, GEOM.SOLID)
483  geompy.TransferData(blackWhite[0], blackWhiteCopy)
484  geompy.addToStudy(blackWhite[0], "blackWhite")
485  geompy.addToStudy(blackWhiteCopy, "blackWhiteCopy")
486  geompy.addToStudyInFather( blackWhiteCopy, subBlackWhite[0], "" )
487  geompy.addToStudyInFather( blackWhiteCopy, subBlackWhite[1], "" )