6 from salome.geom import geomBuilder
7 geompy = geomBuilder.New(salome.myStudy)
8 gg = salome.ImportComponentGUI("GEOM")
10 # create a vertex and a vector
11 p0 = geompy.MakeVertex( 0., 0., 0.)
12 p200 = geompy.MakeVertex(200., 200., 200.)
14 # create a box from two points
15 box = geompy.MakeBoxTwoPnt(p0, p200)
17 # perform an Archimede operation on the selected shape with selected parameters
20 meshingdeflection = 0.01
21 archimede = geompy.Archimede(box, weight, waterdensity, meshingdeflection)
23 # add objects in the study
24 id_box = geompy.addToStudy(box,"Box")
25 id_archimede = geompy.addToStudy(archimede,"Archimede")
27 # display the box and the result of Archimede operation
28 gg.createAndDisplayGO(id_box)
29 gg.setDisplayMode(id_box,1)
30 gg.createAndDisplayGO(id_archimede)
31 gg.setDisplayMode(id_archimede,1)