X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=doc%2Fsalome%2Fexamples%2Fmodifying_meshes_ex22.py;h=94ce7561d26bb9daa5ebac75bc955dcdc85cd657;hp=d9e1f97d9431a6ca63509bb465fe4d45310abb0a;hb=d9f4b53e489dd5857db264ede6acded7b076c9f1;hpb=8a9d91b414c3f26586dea735c22c7700898a0a1e diff --git a/doc/salome/examples/modifying_meshes_ex22.py b/doc/salome/examples/modifying_meshes_ex22.py index d9e1f97d9..94ce7561d 100644 --- a/doc/salome/examples/modifying_meshes_ex22.py +++ b/doc/salome/examples/modifying_meshes_ex22.py @@ -1,8 +1,10 @@ # Extrusion +# There is a series of Extrusion Along Line methods added at different times; +# a fully functional method is ExtrusionSweepObjects() import salome, math -salome.salome_init() +salome.salome_init_without_session() from salome.geom import geomBuilder geompy = geomBuilder.New() @@ -48,22 +50,13 @@ stepVector = [0.,0.,1.] mesh.ExtrusionSweepObject1D( obj, stepVector, nbSteps ) # extrude a group -lineExtruded = None -for g in mesh.GetGroups( SMESH.FACE ): - if g.GetName() == "line_extruded": - lineExtruded = g - break -obj = lineExtruded +obj = mesh.GetGroupByName( "line_extruded", SMESH.FACE )[0] stepVector = [0,-5.,0.] nbSteps = 1 mesh.ExtrusionSweepObject( obj, stepVector, nbSteps ) # extrude all nodes and triangle faces of the disk quarter, applying a scale factor -diskGroup = None -for g in mesh.GetGroups( SMESH.FACE ): - if g.GetName() == "line_rotated": - diskGroup = g - break +diskGroup = mesh.GetGroupByName( "line_rotated", SMESH.FACE )[0] crit = [ smesh.GetCriterion( SMESH.FACE, SMESH.FT_ElemGeomType,'=',SMESH.Geom_TRIANGLE ), smesh.GetCriterion( SMESH.FACE, SMESH.FT_BelongToMeshGroup,'=', diskGroup )] trianglesFilter = smesh.GetFilterFromCriteria( crit )