2013-02-12 20:37:44 +06:00
|
|
|
# Scale
|
|
|
|
|
2013-04-04 13:08:19 +06:00
|
|
|
import salome
|
2021-08-12 14:38:10 +05:00
|
|
|
salome.salome_init_without_session()
|
2013-04-04 13:08:19 +06:00
|
|
|
|
2022-04-11 18:28:01 +05:00
|
|
|
import SMESH
|
|
|
|
from salome.geom import geomBuilder
|
2013-04-04 13:08:19 +06:00
|
|
|
from salome.smesh import smeshBuilder
|
|
|
|
|
2022-04-11 18:28:01 +05:00
|
|
|
geom_builder = geomBuilder.New()
|
|
|
|
smesh_builder = smeshBuilder.New()
|
|
|
|
|
|
|
|
Box = geom_builder.MakeBoxDXDYDZ(200, 200, 200)
|
|
|
|
f = geom_builder.SubShapeAllSorted(Box, geom_builder.ShapeType["FACE"])
|
2013-02-12 20:37:44 +06:00
|
|
|
|
2022-04-11 18:28:01 +05:00
|
|
|
Mesh1 = smesh_builder.Mesh(f[0])
|
2013-02-12 20:37:44 +06:00
|
|
|
Regular_1D = Mesh1.Segment()
|
|
|
|
Nb_Segments_1 = Regular_1D.NumberOfSegments(3)
|
|
|
|
Nb_Segments_1.SetDistrType( 0 )
|
|
|
|
Quadrangle_2D = Mesh1.Quadrangle()
|
|
|
|
isDone = Mesh1.Compute()
|
|
|
|
|
2018-06-19 21:58:29 +05:00
|
|
|
#Perform scale operation for the whole mesh and creation of a new mesh
|
2013-02-12 20:37:44 +06:00
|
|
|
newMesh = Mesh1.ScaleMakeMesh(Mesh1,SMESH.PointStruct(100,100,200),[0.5,0.3,0.7],True,"ScaledMesh")
|
|
|
|
|
|
|
|
#Perform scale operation for the whole mesh and copy elements
|
|
|
|
Mesh1.Scale(Mesh1,SMESH.PointStruct(200,100,100),[0.5,0.5,0.5],True,True)
|
|
|
|
|
2018-06-19 21:58:29 +05:00
|
|
|
#Perform scale operation for two edges and move elements
|
2013-02-12 20:37:44 +06:00
|
|
|
Mesh1.Scale([1,2],SMESH.PointStruct(-100,100,100),[0.8,1.0,0.7],False)
|
|
|
|
|
2018-06-19 21:58:29 +05:00
|
|
|
#Perform scale operation for one face and move elements
|
2013-02-12 20:37:44 +06:00
|
|
|
Mesh1.Scale([21],SMESH.PointStruct(0,200,200),[0.7,0.7,0.7],False)
|