1 #==============================================================================
2 # File : GEOM_example3.py
3 # Created : sam nov 10 00:53:24 CET 2001
4 # Author : Paul RASCLE, EDF
8 #==============================================================================
13 from time import sleep
15 geom = salome.lcc.FindOrLoadComponent("FactoryServer", "GEOM")
16 myBuilder = salome.myStudy.NewBuilder()
18 gg = salome.ImportComponentGUI("GEOM")
20 point0 = geom.MakePointStruct(0.,0.,0.)
21 pointz1 = geom.MakePointStruct(0.,0.,1.)
22 dirz = geom.MakeDirection(pointz1)
24 torus1 = geompy.MakeTorus(point0,dirz,150.,25.)
25 id_torus1 = geompy.addToStudy(torus1,"torus1")
26 gg.createAndDisplayGO(id_torus1)
28 torus2 = geom.MakeCopy(torus1)
29 torus2 = geom.MakeTranslation(torus2,0.,0.,100.)
30 id_torus2 = geompy.addToStudy(torus2,"torus2")
31 gg.createAndDisplayGO(id_torus2)
33 cylz1 = geompy.MakeCylinder(point0,dirz,25.,100.)
39 acyl = geom.MakeCopy(cylz1)
40 x = 150. * math.cos(ind * math.pi/3.)
41 y = 150. * math.sin(ind * math.pi/3.)
44 acyl = geompy.MakeTranslation(acyl,x,y,z)
45 id_acyl = geompy.addToStudy(acyl,name)
46 gg.createAndDisplayGO(id_acyl)
47 shapeList.append(acyl)
48 idList.append(id_acyl)
51 shapeList.append(torus1)
52 shapeList.append(torus2)
53 idList.append(id_torus1)
54 idList.append(id_torus2)
57 for shape in shapeList:
58 iorStringList.append(shape._get_Name())
60 cage = geompy.MakeCompound(iorStringList)
61 id_cage = geompy.addToStudy(cage,"cage")
62 gg.createAndDisplayGO(id_cage)
83 gg.setTransparency(id_torus1,0.5)
85 gg.setDisplayMode(id_torus1,1)
86 gg.setDisplayMode(id_torus2,1)
87 gg.setDisplayMode(id_acyl,1)
88 #gg.setDisplayMode(id_cage,1)
90 gg.setColor(id_torus1,0,0,255)
91 gg.setColor(id_torus2,255,0,0)
92 gg.setColor(id_acyl,0,255,0)
93 #gg.setColor(id_cage,255,255,0)