X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=doc%2Fsalome%2Fexamples%2Fcreating_meshes_ex08.py;h=ff41f09c65ab6f8a2ef59520cb88bf62a07c40fa;hb=21b39b999745333dff21ad9b309270722f59a36d;hp=7fa7a7dcffc3161a293aa5e6a3624c2c5608166e;hpb=d5029840731bccaa1718e65f0abf3b19198c7293;p=modules%2Fsmesh.git diff --git a/doc/salome/examples/creating_meshes_ex08.py b/doc/salome/examples/creating_meshes_ex08.py index 7fa7a7dcf..ff41f09c6 100644 --- a/doc/salome/examples/creating_meshes_ex08.py +++ b/doc/salome/examples/creating_meshes_ex08.py @@ -15,9 +15,12 @@ box = geompy.MakeBoxDXDYDZ(100,100,100) face = geompy.SubShapeAllSorted(box, geompy.ShapeType["FACE"])[0] # generate a prismatic 3D mesh -mesh = smesh.Mesh(box) +mesh = smesh.Mesh(box, "box") localAlgo = mesh.Triangle(face) -mesh.AutomaticHexahedralization() +mesh.Segment().NumberOfSegments( 3 ) +mesh.Quadrangle() +mesh.Prism() +mesh.Compute() # objects to copy fGroup = mesh.GroupOnGeom( face, "2D on face") @@ -45,3 +48,12 @@ newMesh = smesh.CopyMesh( mesh.GetIDSource( nodeIds, SMESH.NODE), "some nodes co # 6. copy a sub-mesh newMesh = smesh.CopyMesh( subMesh, "sub-mesh copy" ) + + +# make a new mesh with same hypotheses on a modified geometry + +smallBox = geompy.MakeScaleAlongAxes( box, None, 1, 0.5, 0.5 ) +cutBox = geompy.MakeCut( box, smallBox, theName="box - smallBox" ) + +ok, newMesh, groups, submehses, hyps, invIDs = smesh.CopyMeshWithGeom( mesh, cutBox, "cutBox" ) +newMesh.Compute()