1 # Defining Meshing Algorithms
6 from salome.geom import geomBuilder
7 geompy = geomBuilder.New(salome.myStudy)
10 from salome.smesh import smeshBuilder
11 smesh = smeshBuilder.New(salome.myStudy)
14 box = geompy.MakeBoxDXDYDZ(10., 10., 10.)
15 geompy.addToStudy(box, "Box")
17 # 1. Create a hexahedral mesh on the box
18 hexa = smesh.Mesh(box, "Box : hexahedrical mesh")
20 # create a Regular 1D algorithm for edges
21 algo1D = hexa.Segment()
23 # create a quadrangle 2D algorithm for faces
24 algo2D = hexa.Quadrangle()
26 # create a hexahedron 3D algorithm for solids
27 algo3D = hexa.Hexahedron()
30 algo1D.Arithmetic1D(1, 4)
35 # 2. Create a tetrahedral mesh on the box
36 tetra = smesh.Mesh(box, "Box : tetrahedrical mesh")
38 # create a Regular 1D algorithm for edges
39 algo1D = tetra.Segment()
41 # create a Mefisto 2D algorithm for faces
42 algo2D = tetra.Triangle()
44 # create a 3D algorithm for solids
45 algo3D = tetra.Tetrahedron()
48 algo1D.Arithmetic1D(1, 4)
49 algo2D.LengthFromEdges()