Version: 8.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
Viewing Geometrical Objects


Changing Display Mode

1 # Changing Display Mode
2 
3 import salome
4 salome.salome_init()
5 import GEOM
6 from salome.geom import geomBuilder
7 geompy = geomBuilder.New(salome.myStudy)
8 box = geompy.MakeBox(0,0,0, 50,50,50)
9 box2 = geompy.MakeBox(-50,-50,-50, 0,0,0)
10 
11 sphere = geompy.MakeSphere(50,50,50, 30)
12 fuse = geompy.MakeBoolean(box,sphere,3)
13 fuse_id = geompy.addToStudy(fuse,"Fuse")
14 
15 gg = salome.ImportComponentGUI("GEOM")
16 gg.createAndDisplayGO(fuse_id)
17 gg.setDisplayMode(fuse_id,1)
18 gg.setVectorsMode(fuse_id, True)
19 gg.setVerticesMode(fuse_id, True)
20 gg.setNameMode(fuse_id, 1)

Download this script


Changing Color

1 # Changing Color
2 
3 import salome
4 salome.salome_init()
5 import GEOM
6 from salome.geom import geomBuilder
7 geompy = geomBuilder.New(salome.myStudy)
8 box = geompy.MakeBox(0,0,0, 50,50,50)
9 
10 sphere = geompy.MakeSphere(50,50,50, 30)
11 fuse = geompy.MakeBoolean(box,sphere,3)
12 fuse_id = geompy.addToStudy(fuse,"Fuse")
13 
14 gg = salome.ImportComponentGUI("GEOM")
15 gg.createAndDisplayGO(fuse_id)
16 gg.setDisplayMode(fuse_id,1)
17 gg.setColor(fuse_id,218,165,31)

Download this script


Changing Transparency

1 # Changing Transparency
2 
3 import salome
4 salome.salome_init()
5 import GEOM
6 from salome.geom import geomBuilder
7 geompy = geomBuilder.New(salome.myStudy)
8 
9 box = geompy.MakeBox(0,0,0, 50,50,50)
10 sphere = geompy.MakeSphere(50,50,50, 30)
11 
12 fuse = geompy.MakeBoolean(box,sphere,3)
13 fuse_id = geompy.addToStudy(fuse,"Fuse")
14 
15 gg = salome.ImportComponentGUI("GEOM")
16 gg.createAndDisplayGO(fuse_id)
17 gg.setDisplayMode(fuse_id,1)
18 gg.setColor(fuse_id,218,165,31)
19 gg.setTransparency(fuse_id,0.5)

Download this script


Set Point Marker

1 # Set Point Marker
2 
3 import os
4 import salome
5 salome.salome_init()
6 import GEOM
7 from salome.geom import geomBuilder
8 geompy = geomBuilder.New(salome.myStudy)
9 
10 texture_file = os.path.join(os.getenv("GEOM_ROOT_DIR"), "share", "salome", "resources", "geom", "textures", "texture1.dat")
11 texture = geompy.LoadTexture(texture_file)
12 
13 v1 = geompy.MakeVertex(0, 0, 0)
14 v2 = geompy.MakeVertex(100, 0, 0)
15 v3 = geompy.MakeVertex(0, 100, 0)
16 
17 v1.SetMarkerStd(GEOM.MT_O_PLUS, GEOM.MS_25)
18 v2.SetMarkerStd(GEOM.MT_BALL, GEOM.MS_40)
19 v3.SetMarkerTexture(texture)

Download this script