mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2024-12-28 10:20:35 +05:00
29 lines
698 B
Python
29 lines
698 B
Python
|
# Creation of a Compound
|
||
|
|
||
|
import geompy
|
||
|
import salome
|
||
|
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
|
||
|
|
||
|
# create a compund of the given shapes
|
||
|
compound = geompy.MakeCompound(ShapeListCompound)
|
||
|
|
||
|
# add object in the study
|
||
|
id_compound = geompy.addToStudy(compound,"Compound")
|
||
|
|
||
|
# display the compound
|
||
|
gg.createAndDisplayGO(id_compound)
|