mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-11-11 16:19:16 +05:00
- Modifing Geometry and Mesh Python scripts from SALOME 6 and before
This commit is contained in:
parent
98eacab61c
commit
e2a638a026
@ -5,10 +5,10 @@ from SMESH_mechanic import *
|
||||
mesh.Tetrahedron()
|
||||
mesh.Compute()
|
||||
# get all triangles, quadrangles, tetrahedrons, pyramids
|
||||
filter_tri = smesh.GetFilter(SMESH.FACE, SMESH.FT_ElemGeomType, smesh.Geom_TRIANGLE)
|
||||
filter_qua = smesh.GetFilter(SMESH.FACE, SMESH.FT_ElemGeomType, smesh.Geom_QUADRANGLE)
|
||||
filter_tet = smesh.GetFilter(SMESH.VOLUME, SMESH.FT_ElemGeomType, smesh.Geom_TETRA)
|
||||
filter_pyr = smesh.GetFilter(SMESH.VOLUME, SMESH.FT_ElemGeomType, smesh.Geom_PYRAMID)
|
||||
filter_tri = smesh.GetFilter(SMESH.FACE, SMESH.FT_ElemGeomType, SMESH.Geom_TRIANGLE)
|
||||
filter_qua = smesh.GetFilter(SMESH.FACE, SMESH.FT_ElemGeomType, SMESH.Geom_QUADRANGLE)
|
||||
filter_tet = smesh.GetFilter(SMESH.VOLUME, SMESH.FT_ElemGeomType, SMESH.Geom_TETRA)
|
||||
filter_pyr = smesh.GetFilter(SMESH.VOLUME, SMESH.FT_ElemGeomType, SMESH.Geom_PYRAMID)
|
||||
ids_tri = mesh.GetIdsFromFilter(filter_tri)
|
||||
ids_qua = mesh.GetIdsFromFilter(filter_qua)
|
||||
ids_tet = mesh.GetIdsFromFilter(filter_tet)
|
||||
|
@ -865,9 +865,11 @@ namespace
|
||||
const char* fname = "/tmp/viscous.py";
|
||||
cout << "execfile('"<<fname<<"')"<<endl;
|
||||
py = new ofstream(fname);
|
||||
*py << "from smesh import *" << endl
|
||||
<< "meshSO = GetCurrentStudy().FindObjectID('0:1:2:3')" << endl
|
||||
<< "mesh = Mesh( meshSO.GetObject() )"<<endl;
|
||||
*py << "import SMESH" << endl
|
||||
<< "from salome.smesh import smeshBuilder" << endl
|
||||
<< "smesh = smeshBuilder.New(salome.myStudy)" << endl
|
||||
<< "meshSO = smesh.GetCurrentStudy().FindObjectID('0:1:2:3')" << endl
|
||||
<< "mesh = smesh.Mesh( meshSO.GetObject() )"<<endl;
|
||||
}
|
||||
void Finish() {
|
||||
if (py)
|
||||
|
@ -18,11 +18,11 @@
|
||||
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
#
|
||||
|
||||
import geompy
|
||||
import salome
|
||||
salome.salome_init()
|
||||
theStudy = salome.myStudy
|
||||
geompy.init_geom(theStudy)
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
geompy = geomBuilder.New(salome.myStudy)
|
||||
|
||||
filename="/home/gboulant/development/projets/salome/SPADDER/spadder/resources/padderexe/REF_spheres.dat.xyz"
|
||||
file=open(filename,'rb')
|
||||
|
@ -37,7 +37,8 @@ from salome.kernel.uiexception import AdminException
|
||||
|
||||
from omniORB import CORBA
|
||||
import SMESH
|
||||
import smesh
|
||||
from salome.smesh import smeshBuilder
|
||||
smesh = smeshBuilder.New(salome.myStudy)
|
||||
import MESHJOB
|
||||
|
||||
gui_states = ["CAN_SELECT", "CAN_COMPUTE", "CAN_REFRESH", "CAN_PUBLISH"]
|
||||
|
Loading…
Reference in New Issue
Block a user