2013-02-12 17:35:16 +06:00
|
|
|
# Archimede
|
|
|
|
|
|
|
|
import salome
|
2021-08-12 11:43:44 +05:00
|
|
|
salome.salome_init_without_session()
|
2013-04-04 13:06:43 +06:00
|
|
|
import GEOM
|
|
|
|
from salome.geom import geomBuilder
|
2017-06-13 14:57:14 +05:00
|
|
|
geompy = geomBuilder.New()
|
2013-02-12 17:35:16 +06:00
|
|
|
gg = salome.ImportComponentGUI("GEOM")
|
|
|
|
|
|
|
|
# create a vertex and a vector
|
|
|
|
p0 = geompy.MakeVertex( 0., 0., 0.)
|
|
|
|
p200 = geompy.MakeVertex(200., 200., 200.)
|
|
|
|
|
|
|
|
# create a box from two points
|
|
|
|
box = geompy.MakeBoxTwoPnt(p0, p200)
|
|
|
|
|
|
|
|
# perform an Archimede operation on the selected shape with selected parameters
|
|
|
|
weight = 1000000.
|
|
|
|
waterdensity = 1.
|
|
|
|
meshingdeflection = 0.01
|
|
|
|
archimede = geompy.Archimede(box, weight, waterdensity, meshingdeflection)
|
|
|
|
|
|
|
|
# add objects in the study
|
|
|
|
id_box = geompy.addToStudy(box,"Box")
|
|
|
|
id_archimede = geompy.addToStudy(archimede,"Archimede")
|
|
|
|
|
|
|
|
# display the box and the result of Archimede operation
|
|
|
|
gg.createAndDisplayGO(id_box)
|
|
|
|
gg.setDisplayMode(id_box,1)
|
|
|
|
gg.createAndDisplayGO(id_archimede)
|
|
|
|
gg.setDisplayMode(id_archimede,1)
|