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.Tetrahedron()
|
||||||
mesh.Compute()
|
mesh.Compute()
|
||||||
# get all triangles, quadrangles, tetrahedrons, pyramids
|
# get all triangles, quadrangles, tetrahedrons, pyramids
|
||||||
filter_tri = smesh.GetFilter(SMESH.FACE, SMESH.FT_ElemGeomType, smesh.Geom_TRIANGLE)
|
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_qua = smesh.GetFilter(SMESH.FACE, SMESH.FT_ElemGeomType, SMESH.Geom_QUADRANGLE)
|
||||||
filter_tet = smesh.GetFilter(SMESH.VOLUME, SMESH.FT_ElemGeomType, smesh.Geom_TETRA)
|
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_pyr = smesh.GetFilter(SMESH.VOLUME, SMESH.FT_ElemGeomType, SMESH.Geom_PYRAMID)
|
||||||
ids_tri = mesh.GetIdsFromFilter(filter_tri)
|
ids_tri = mesh.GetIdsFromFilter(filter_tri)
|
||||||
ids_qua = mesh.GetIdsFromFilter(filter_qua)
|
ids_qua = mesh.GetIdsFromFilter(filter_qua)
|
||||||
ids_tet = mesh.GetIdsFromFilter(filter_tet)
|
ids_tet = mesh.GetIdsFromFilter(filter_tet)
|
||||||
|
@ -865,9 +865,11 @@ namespace
|
|||||||
const char* fname = "/tmp/viscous.py";
|
const char* fname = "/tmp/viscous.py";
|
||||||
cout << "execfile('"<<fname<<"')"<<endl;
|
cout << "execfile('"<<fname<<"')"<<endl;
|
||||||
py = new ofstream(fname);
|
py = new ofstream(fname);
|
||||||
*py << "from smesh import *" << endl
|
*py << "import SMESH" << endl
|
||||||
<< "meshSO = GetCurrentStudy().FindObjectID('0:1:2:3')" << endl
|
<< "from salome.smesh import smeshBuilder" << endl
|
||||||
<< "mesh = Mesh( meshSO.GetObject() )"<<endl;
|
<< "smesh = smeshBuilder.New(salome.myStudy)" << endl
|
||||||
|
<< "meshSO = smesh.GetCurrentStudy().FindObjectID('0:1:2:3')" << endl
|
||||||
|
<< "mesh = smesh.Mesh( meshSO.GetObject() )"<<endl;
|
||||||
}
|
}
|
||||||
void Finish() {
|
void Finish() {
|
||||||
if (py)
|
if (py)
|
||||||
|
@ -18,11 +18,11 @@
|
|||||||
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
#
|
#
|
||||||
|
|
||||||
import geompy
|
|
||||||
import salome
|
import salome
|
||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
theStudy = salome.myStudy
|
import GEOM
|
||||||
geompy.init_geom(theStudy)
|
from salome.geom import geomBuilder
|
||||||
|
geompy = geomBuilder.New(salome.myStudy)
|
||||||
|
|
||||||
filename="/home/gboulant/development/projets/salome/SPADDER/spadder/resources/padderexe/REF_spheres.dat.xyz"
|
filename="/home/gboulant/development/projets/salome/SPADDER/spadder/resources/padderexe/REF_spheres.dat.xyz"
|
||||||
file=open(filename,'rb')
|
file=open(filename,'rb')
|
||||||
|
@ -37,7 +37,8 @@ from salome.kernel.uiexception import AdminException
|
|||||||
|
|
||||||
from omniORB import CORBA
|
from omniORB import CORBA
|
||||||
import SMESH
|
import SMESH
|
||||||
import smesh
|
from salome.smesh import smeshBuilder
|
||||||
|
smesh = smeshBuilder.New(salome.myStudy)
|
||||||
import MESHJOB
|
import MESHJOB
|
||||||
|
|
||||||
gui_states = ["CAN_SELECT", "CAN_COMPUTE", "CAN_REFRESH", "CAN_PUBLISH"]
|
gui_states = ["CAN_SELECT", "CAN_COMPUTE", "CAN_REFRESH", "CAN_PUBLISH"]
|
||||||
|
Loading…
Reference in New Issue
Block a user