X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=doc%2Fsalome%2Fexamples%2Fcreating_meshes_ex02.py;h=522f72bf4c1d05a2d0fd6e7d27618766e5d7ccb7;hp=3980d4d74ebd3b4cd1fc5f8387981bb5c5faa9bc;hb=8d297d6698f361d4f2dde723050bcfbaea050920;hpb=c98d9fcd7f02c1f1f5c24dd3e709ed75228d66c4 diff --git a/doc/salome/examples/creating_meshes_ex02.py b/doc/salome/examples/creating_meshes_ex02.py index 3980d4d74..522f72bf4 100644 --- a/doc/salome/examples/creating_meshes_ex02.py +++ b/doc/salome/examples/creating_meshes_ex02.py @@ -4,11 +4,11 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import SMESH, SALOMEDS from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() # create a box box = geompy.MakeBoxDXDYDZ(10., 10., 10.) @@ -40,11 +40,27 @@ algo_local = mesh.Segment(EdgeX) algo_local.Arithmetic1D(1, 4) # define "Propagation" hypothesis that propagates algo_local and "Arithmetic1D" hypothesis -# on all parallel edges of the box +# from EdgeX to all parallel edges algo_local.Propagation() # assign a hexahedral algorithm mesh.Hexahedron() -# compute the mesh + +# any sub-shape can be meshed individually -- +# compute mesh on two surfaces using different methods + +# get surfaces +surfaces = geompy.SubShapeAll(box, geompy.ShapeType["FACE"]) + +# method 1: no sub-mesh is created +mesh.Compute( surfaces[0] ) + +# method 2: a sub-mesh is created +submesh = mesh.GetSubMesh( surfaces[2], "submesh 2" ) +submesh.Compute() + + + +# compute the whole mesh mesh.Compute()