pyexamplesdir = $(docdir)/examples/SMESH
-BAD_TESTS =
+BAD_TESTS = \
+ 3dmesh.py \
+ creating_meshes_ex01.py \
+ creating_meshes_ex03.py \
+ creating_meshes_ex05.py \
+ defining_hypotheses_ex06.py \
+ defining_hypotheses_ex09.py \
+ defining_hypotheses_ex17.py \
+ filters_ex02.py \
+ filters_ex08.py \
+ filters_ex23.py \
+ filters_ex24.py \
+ filters_ex25.py \
+ filters_ex32.py \
+ filters_ex35.py \
+ generate_flat_elements.py \
+ modifying_meshes_ex26.py \
+ notebook_smesh.py \
+ quality_controls_ex06.py \
+ quality_controls_ex20.py \
+ quality_controls_ex21.py \
+ quality_controls_ex22.py \
+ viewing_meshes_ex01.py
GOOD_TESTS = \
- 3dmesh.py \
cartesian_algo.py \
- creating_meshes_ex01.py \
creating_meshes_ex02.py \
- creating_meshes_ex03.py \
creating_meshes_ex04.py \
- creating_meshes_ex05.py \
creating_meshes_ex06.py \
creating_meshes_ex07.py \
creating_meshes_ex08.py \
defining_hypotheses_ex03.py \
defining_hypotheses_ex04.py \
defining_hypotheses_ex05.py \
- defining_hypotheses_ex06.py \
defining_hypotheses_ex07.py \
defining_hypotheses_ex08.py \
- defining_hypotheses_ex09.py \
defining_hypotheses_ex10.py \
defining_hypotheses_ex11.py \
defining_hypotheses_ex12.py \
defining_hypotheses_ex14.py \
defining_hypotheses_ex15.py \
defining_hypotheses_ex16.py \
- defining_hypotheses_ex17.py \
filters_ex01.py \
- filters_ex02.py \
filters_ex03.py \
filters_ex04.py \
filters_ex05.py \
filters_ex06.py \
filters_ex07.py \
- filters_ex08.py \
filters_ex09.py \
filters_ex10.py \
filters_ex11.py \
filters_ex20.py \
filters_ex21.py \
filters_ex22.py \
- filters_ex23.py \
- filters_ex24.py \
- filters_ex25.py \
filters_ex26.py \
filters_ex27.py \
filters_ex28.py \
filters_ex29.py \
filters_ex30.py \
filters_ex31.py \
- filters_ex32.py \
filters_ex33.py \
filters_ex34.py \
- filters_ex35.py \
filters_ex36.py \
- generate_flat_elements.py \
grouping_elements_ex01.py \
grouping_elements_ex02.py \
grouping_elements_ex03.py \
modifying_meshes_ex23.py \
modifying_meshes_ex24.py \
modifying_meshes_ex25.py \
- modifying_meshes_ex26.py \
- notebook_smesh.py \
prism_3d_algo.py \
quality_controls_ex01.py \
quality_controls_ex02.py \
quality_controls_ex03.py \
quality_controls_ex04.py \
quality_controls_ex05.py \
- quality_controls_ex06.py \
quality_controls_ex07.py \
quality_controls_ex08.py \
quality_controls_ex09.py \
quality_controls_ex17.py \
quality_controls_ex18.py \
quality_controls_ex19.py \
- quality_controls_ex20.py \
- quality_controls_ex21.py \
- quality_controls_ex22.py \
transforming_meshes_ex01.py \
transforming_meshes_ex02.py \
transforming_meshes_ex03.py \
transforming_meshes_ex12.py \
transforming_meshes_ex13.py \
use_existing_faces.py \
- viewing_meshes_ex01.py \
viewing_meshes_ex02.py
pyexamples_SCRIPTS = $(BAD_TESTS) $(GOOD_TESTS)
# create mesh
from SMESH_mechanic import *
# remove some faces to have faces with bare borders
-mesh.RemoveElements( mesh.GetElementsByType(FACE)[0:5] )
+mesh.RemoveElements( mesh.GetElementsByType(smesh.FACE)[0:5] )
# get all faces bare borders
filter = smesh.GetFilter(smesh.FACE, smesh.FT_BareBorderFace)
ids = mesh.GetIdsFromFilter(filter)
# create mesh
from SMESH_mechanic import *
-faceID = mesh.GetElementsByType(FACE)[0]
+faceID = mesh.GetElementsByType(smesh.FACE)[0]
# get all faces co-planar to the first face with tolerance 5 degrees
filter = smesh.GetFilter(smesh.FACE, smesh.FT_CoplanarFaces,faceID,Tolerance=5.0)
ids = mesh.GetIdsFromFilter(filter)
# create mesh
from SMESH_mechanic import *
# get nodes with identifiers [5-10] and [15-30]
-criterion1 = smesh.GetCriterion(smesh.NODE, smesh.FT_RangeOfIds, Treshold="5-10",\
+criterion1 = smesh.GetCriterion(smesh.NODE, smesh.FT_RangeOfIds, Threshold="5-10",\
BinaryOp=smesh.FT_LogicalOR)
-criterion2 = smesh.GetCriterion(smesh.NODE, smesh.FT_RangeOfIds, Treshold="15-30")
+criterion2 = smesh.GetCriterion(smesh.NODE, smesh.FT_RangeOfIds, Threshold="15-30")
filter = smesh.CreateFilterManager().CreateFilter()
filter.SetCriteria([criterion1,criterion2])
ids = mesh.GetIdsFromFilter(filter)
# Add Polyhedron
import salome
+import smesh
import math
# create an empty mesh structure
pass
# Create a polyhedral volume (12-hedron with pentagonal faces)
-MeshEditor.AddPolyhedralVolume([dd[0], dd[1], dd[2], dd[3], dd[4], # top
- dd[0], cc[0], bb[1], cc[1], dd[1], # -
- dd[1], cc[1], bb[2], cc[2], dd[2], # -
- dd[2], cc[2], bb[3], cc[3], dd[3], # - below top
- dd[3], cc[3], bb[4], cc[4], dd[4], # -
- dd[4], cc[4], bb[0], cc[0], dd[0], # -
- aa[4], bb[4], cc[4], bb[0], aa[0], # .
- aa[3], bb[3], cc[3], bb[4], aa[4], # .
- aa[2], bb[2], cc[2], bb[3], aa[3], # . above bottom
- aa[1], bb[1], cc[1], bb[2], aa[2], # .
- aa[0], bb[0], cc[0], bb[1], aa[1], # .
- aa[0], aa[1], aa[2], aa[3], aa[4]], # bottom
- [5,5,5,5,5,5,5,5,5,5,5,5])
+mesh.GetMeshEditor().AddPolyhedralVolume([dd[0], dd[1], dd[2], dd[3], dd[4], # top
+ dd[0], cc[0], bb[1], cc[1], dd[1], # -
+ dd[1], cc[1], bb[2], cc[2], dd[2], # -
+ dd[2], cc[2], bb[3], cc[3], dd[3], # - below top
+ dd[3], cc[3], bb[4], cc[4], dd[4], # -
+ dd[4], cc[4], bb[0], cc[0], dd[0], # -
+ aa[4], bb[4], cc[4], bb[0], aa[0], # .
+ aa[3], bb[3], cc[3], bb[4], aa[4], # .
+ aa[2], bb[2], cc[2], bb[3], aa[3], # . above bottom
+ aa[1], bb[1], cc[1], bb[2], aa[2], # .
+ aa[0], bb[0], cc[0], bb[1], aa[1], # .
+ aa[0], aa[1], aa[2], aa[3], aa[4]], # bottom
+ [5,5,5,5,5,5,5,5,5,5,5,5])
salome.sg.updateObjBrowser(1)
print ""
# create a group
-aGroup = mesh.CreateGroup(SMESH.EDGE, "Free borders")
+aGroup = mesh.GetMesh().CreateGroup(smesh.EDGE, "Free borders")
aGroup.Add(anIds)
salome.sg.updateObjBrowser(1)
print ""
# create a group
-aGroup = mesh.CreateGroup(SMESH.EDGE, "Borders at multi-connections")
+aGroup = mesh.GetMesh().CreateGroup(smesh.EDGE, "Borders at multi-connections")
aGroup.Add(anIds)
salome.sg.updateObjBrowser(1)
print ""
# create a group
-aGroup = mesh.CreateGroup(SMESH.EDGE, "Edges with length > " + `length_margin`)
+aGroup = mesh.GetMesh().CreateGroup(smesh.EDGE, "Edges with length > " + `length_margin`)
aGroup.Add(anIds)
salome.sg.updateObjBrowser(1)
mesh = SMESH_mechanic.mesh
# create a symmetrical copy of the mesh mirrored through a point
-axis = SMESH.AxisStruct(0, 0, 0, 0, 0, 0)
+axis = smesh.AxisStruct(0, 0, 0, 0, 0, 0)
mesh.Mirror([], axis, smesh.POINT, 1)
box = geompy.MakeBoxDXDYDZ(100,100,100)
# Create a mesh
-mesh = Mesh(box,"Mesh")
+mesh = smesh.Mesh(box,"Mesh")
mesh.AutomaticHexahedralization()
mesh.Compute()