2013-02-12 20:37:44 +06:00
|
|
|
# Extrusion
|
|
|
|
|
2013-04-04 13:08:19 +06:00
|
|
|
|
2013-02-12 20:37:44 +06:00
|
|
|
import salome
|
2013-04-04 13:08:19 +06:00
|
|
|
salome.salome_init()
|
|
|
|
import GEOM
|
|
|
|
from salome.geom import geomBuilder
|
2017-06-13 15:01:10 +05:00
|
|
|
geompy = geomBuilder.New()
|
2013-04-04 13:08:19 +06:00
|
|
|
|
|
|
|
import SMESH, SALOMEDS
|
|
|
|
from salome.smesh import smeshBuilder
|
2017-06-13 15:01:10 +05:00
|
|
|
smesh = smeshBuilder.New()
|
2013-02-12 20:37:44 +06:00
|
|
|
|
|
|
|
import SMESH_mechanic
|
|
|
|
|
2013-04-04 13:08:19 +06:00
|
|
|
#smesh = SMESH_mechanic.smesh
|
2013-02-12 20:37:44 +06:00
|
|
|
mesh = SMESH_mechanic.mesh
|
|
|
|
|
|
|
|
# select the top face
|
|
|
|
faces = geompy.SubShapeAllSorted(SMESH_mechanic.shape_mesh, geompy.ShapeType["FACE"])
|
|
|
|
face = faces[7]
|
|
|
|
geompy.addToStudyInFather(SMESH_mechanic.shape_mesh, face, "face circular top")
|
|
|
|
|
|
|
|
# create a vector for extrusion
|
2013-04-04 13:08:19 +06:00
|
|
|
point = SMESH.PointStruct(0., 0., 5.)
|
|
|
|
vector = SMESH.DirStruct(point)
|
2013-02-12 20:37:44 +06:00
|
|
|
|
|
|
|
# create a group to be extruded
|
2013-04-04 13:08:19 +06:00
|
|
|
GroupTri = mesh.GroupOnGeom(face, "Group of faces (extrusion)", SMESH.FACE)
|
2013-02-12 20:37:44 +06:00
|
|
|
|
|
|
|
# perform extrusion of the group
|
|
|
|
mesh.ExtrusionSweepObject(GroupTri, vector, 5)
|
|
|
|
|
2017-06-13 15:01:10 +05:00
|
|
|
salome.sg.updateObjBrowser()
|