2013-02-12 17:35:16 +06:00
|
|
|
# Creation of a Filling
|
|
|
|
|
|
|
|
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")
|
|
|
|
|
|
|
|
mindeg = 2
|
|
|
|
maxdeg = 5
|
|
|
|
tol3d = 0.0001
|
|
|
|
tol2d = 0.0001
|
|
|
|
nbiter = 5
|
|
|
|
|
|
|
|
# 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)
|
2014-10-15 19:00:48 +06:00
|
|
|
ContoursList = []
|
|
|
|
for i in range(4):
|
2013-02-12 17:35:16 +06:00
|
|
|
S = geompy.MakeTranslation(arc, i * 50., 0., 0.)
|
2014-10-15 19:00:48 +06:00
|
|
|
ContoursList.append(S)
|
2013-02-12 17:35:16 +06:00
|
|
|
|
2014-10-15 19:00:48 +06:00
|
|
|
compound = geompy.MakeCompound(ContoursList)
|
2013-02-12 17:35:16 +06:00
|
|
|
|
|
|
|
# create a filling
|
|
|
|
filling = geompy.MakeFilling(compound, mindeg, maxdeg, tol3d, tol2d, nbiter)
|
|
|
|
|
|
|
|
# add objects in the study
|
|
|
|
id_compound = geompy.addToStudy(compound,"Compound")
|
|
|
|
id_filling = geompy.addToStudy(filling,"Filling")
|
|
|
|
|
|
|
|
# display the compound and the filling
|
|
|
|
gg.createAndDisplayGO(id_compound)
|
|
|
|
gg.createAndDisplayGO(id_filling)
|
|
|
|
gg.setDisplayMode(id_filling,1)
|