3 Most basic test of GEOM/SMESH usecase, but it can be tested without any session launched.
10 salome.standalone() # <- key point of test is here
12 import salome_notebook
13 notebook = salome_notebook.NoteBook()
20 from salome.geom import geomBuilder
24 geompy = geomBuilder.New()
25 O = geompy.MakeVertex(0, 0, 0)
26 OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
27 OY = geompy.MakeVectorDXDYDZ(0, 1, 0)
28 OZ = geompy.MakeVectorDXDYDZ(0, 0, 1)
29 Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200)
30 geompy.addToStudy( O, 'O' )
31 geompy.addToStudy( OX, 'OX' )
32 geompy.addToStudy( OY, 'OY' )
33 geompy.addToStudy( OZ, 'OZ' )
34 geompy.addToStudy( Box_1, 'Box_1' )
38 import SMESH, SALOMEDS
39 from salome.smesh import smeshBuilder
41 smesh = smeshBuilder.New()
42 smesh.SetEnablePublish( True ) # Set to False to avoid publish in study if not needed or in some particular situations:
43 # multiples meshes built in parallel, complex and numerous mesh edition (performance)
44 Mesh_1 = smesh.Mesh(Box_1)
45 NETGEN_1D_2D_3D = Mesh_1.Tetrahedron(algo=smeshBuilder.NETGEN_1D2D3D)
46 isDone = Mesh_1.Compute()
49 ## Set names of Mesh objects
50 smesh.SetName(NETGEN_1D_2D_3D.GetAlgorithm(), 'NETGEN 1D-2D-3D')
51 smesh.SetName(Mesh_1.GetMesh(), 'Mesh_1')
53 assert(Mesh_1.GetMesh().NbTetras()>=5)