2013-02-12 17:35:16 +06:00
|
|
|
# Creation of a Compound
|
|
|
|
|
|
|
|
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
|
|
|
|
p1 = geompy.MakeVertex( -30., -30., 50.)
|
|
|
|
p2 = geompy.MakeVertex( -60., -60., 30.)
|
|
|
|
p3 = geompy.MakeVertex( -30., -30., 10.)
|
|
|
|
|
|
|
|
# create an arc from three points
|
|
|
|
arc = geompy.MakeArc(p1, p2, p3)
|
|
|
|
ShapeListCompound = []
|
|
|
|
i = 0
|
|
|
|
while i <= 3 :
|
|
|
|
S = geompy.MakeTranslation(arc, i * 50., 0., 0.)
|
|
|
|
ShapeListCompound.append(S)
|
|
|
|
i = i + 1
|
|
|
|
|
2017-12-04 16:40:22 +05:00
|
|
|
# create a compound of the given shapes
|
2013-02-12 17:35:16 +06:00
|
|
|
compound = geompy.MakeCompound(ShapeListCompound)
|
|
|
|
|
|
|
|
# add object in the study
|
|
|
|
id_compound = geompy.addToStudy(compound,"Compound")
|
|
|
|
|
|
|
|
# display the compound
|
|
|
|
gg.createAndDisplayGO(id_compound)
|