2013-02-12 17:35:16 +06:00
|
|
|
# Common
|
|
|
|
|
|
|
|
import salome
|
2013-04-04 13:06:43 +06:00
|
|
|
salome.salome_init()
|
|
|
|
import GEOM
|
|
|
|
from salome.geom import geomBuilder
|
|
|
|
geompy = geomBuilder.New(salome.myStudy)
|
2013-02-12 17:35:16 +06:00
|
|
|
gg = salome.ImportComponentGUI("GEOM")
|
|
|
|
|
|
|
|
# create a vertex and a vector
|
|
|
|
p1 = geompy.MakeVertex(25, 55, 0)
|
|
|
|
p2 = geompy.MakeVertex( 0, 0, 0)
|
|
|
|
v = geompy.MakeVector(p1, p2)
|
|
|
|
|
|
|
|
# create a cylinder
|
|
|
|
height = 35
|
|
|
|
radius1 = 20
|
|
|
|
cylinder = geompy.MakeCylinder(p1, v, radius1, height)
|
|
|
|
|
|
|
|
# create a sphere
|
|
|
|
sphere = geompy.MakeSphereR(40)
|
|
|
|
|
|
|
|
# make common
|
|
|
|
common = geompy.MakeCommon(cylinder, sphere)
|
|
|
|
|
|
|
|
# add objects in the study
|
|
|
|
id_common = geompy.addToStudy(common, "Common")
|
|
|
|
|
|
|
|
# display the results
|
|
|
|
gg.createAndDisplayGO(id_common)
|
|
|
|
gg.setDisplayMode(id_common,1)
|