1 # Using SALOME NoteBook
7 from salome.geom import geomBuilder
8 geompy = geomBuilder.New()
10 import SMESH, SALOMEDS
11 from salome.smesh import smeshBuilder
12 smesh = smeshBuilder.New()
13 import salome_notebook
16 notebook = salome_notebook.notebook
17 notebook.set("Length", 100)
18 notebook.set("Width", 200)
19 notebook.set("Offset", 50)
21 notebook.set("NbSegments", 7)
22 notebook.set("MaxElementArea", 800)
23 notebook.set("MaxElementVolume", 900)
26 box = geompy.MakeBoxDXDYDZ("Length", "Width", 300)
27 idbox = geompy.addToStudy(box, "Box")
30 tetra = smesh.Mesh(box, "MeshBox")
32 algo1D = tetra.Segment()
33 algo1D.NumberOfSegments("NbSegments")
35 algo2D = tetra.Triangle()
36 algo2D.MaxElementArea("MaxElementArea")
38 algo3D = tetra.Tetrahedron()
39 algo3D.MaxElementVolume("MaxElementVolume")
45 point = SMESH.PointStruct("Offset", 0., 0.)
46 vector = SMESH.DirStruct(point)
47 tetra.TranslateObject(tetra, vector, 0)