]> SALOME platform Git repositories - modules/smesh.git/blob - doc/salome/examples/transforming_meshes_ex03.py
Salome HOME
23207: EDF 11232 SMESH: viscou layers builder fails at the very fist inflation
[modules/smesh.git] / doc / salome / examples / transforming_meshes_ex03.py
1 # Scale
2
3 import salome
4 salome.salome_init()
5 import GEOM
6 from salome.geom import geomBuilder
7 geompy = geomBuilder.New(salome.myStudy)
8
9 import SMESH, SALOMEDS
10 from salome.smesh import smeshBuilder
11 smesh =  smeshBuilder.New(salome.myStudy)
12
13 Box = geompy.MakeBoxDXDYDZ(200, 200, 200)
14 f = geompy.SubShapeAllSorted(Box, geompy.ShapeType["FACE"])
15
16 Mesh1 = smesh.Mesh(f[0])
17 Regular_1D = Mesh1.Segment()
18 Nb_Segments_1 = Regular_1D.NumberOfSegments(3)
19 Nb_Segments_1.SetDistrType( 0 )
20 Quadrangle_2D = Mesh1.Quadrangle()
21 isDone = Mesh1.Compute()
22
23 #Perform scale opration for the whole mesh and creation of a new mesh
24 newMesh = Mesh1.ScaleMakeMesh(Mesh1,SMESH.PointStruct(100,100,200),[0.5,0.3,0.7],True,"ScaledMesh")
25
26 #Perform scale operation for the whole mesh and copy elements
27 Mesh1.Scale(Mesh1,SMESH.PointStruct(200,100,100),[0.5,0.5,0.5],True,True)
28
29 #Perform scale opration for two edges and move elements
30 Mesh1.Scale([1,2],SMESH.PointStruct(-100,100,100),[0.8,1.0,0.7],False)
31
32 #Perform scale opration for one face and move elements
33 Mesh1.Scale([21],SMESH.PointStruct(0,200,200),[0.7,0.7,0.7],False)