]> SALOME platform Git repositories - modules/geom.git/blob - doc/salome/examples/basic_operations_ex02.py
Salome HOME
Merge from V6_main 11/02/2013
[modules/geom.git] / doc / salome / examples / basic_operations_ex02.py
1 # Archimede
2
3 import geompy
4 import salome
5 gg = salome.ImportComponentGUI("GEOM")
6
7 # create a vertex and a vector
8 p0   = geompy.MakeVertex(  0.,   0.,   0.)
9 p200 = geompy.MakeVertex(200., 200., 200.)
10
11 # create a box from two points
12 box = geompy.MakeBoxTwoPnt(p0, p200)
13
14 # perform an Archimede operation on the selected shape with selected parameters
15 weight  = 1000000.
16 waterdensity = 1.
17 meshingdeflection = 0.01
18 archimede  = geompy.Archimede(box, weight, waterdensity, meshingdeflection)
19
20 # add objects in the study
21 id_box = geompy.addToStudy(box,"Box")
22 id_archimede = geompy.addToStudy(archimede,"Archimede")
23
24 # display the box and the result of Archimede operation
25 gg.createAndDisplayGO(id_box)
26 gg.setDisplayMode(id_box,1)
27 gg.createAndDisplayGO(id_archimede)
28 gg.setDisplayMode(id_archimede,1)