Salome HOME
correction des scripts de materiel pour les cas tests bloc fissure
[modules/smesh.git] / src / Tools / blocFissure / materielCasTests / cubeAngle.py
1 # -*- coding: utf-8 -*-
2
3 import sys
4 import salome
5
6 salome.salome_init()
7 theStudy = salome.myStudy
8
9 import salome_notebook
10 notebook = salome_notebook.NoteBook(theStudy)
11
12 import os
13 from blocFissure import gmu
14
15 ###
16 ### GEOM component
17 ###
18
19 import GEOM
20 from salome.geom import geomBuilder
21 import math
22 import SALOMEDS
23
24
25 geompy = geomBuilder.New(theStudy)
26
27 O = geompy.MakeVertex(0, 0, 0)
28 OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
29 OY = geompy.MakeVectorDXDYDZ(0, 1, 0)
30 OZ = geompy.MakeVectorDXDYDZ(0, 0, 1)
31 Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200)
32 Vertex_1 = geompy.MakeVertex(0, 0, 100)
33 Disk_1 = geompy.MakeDiskPntVecR(Vertex_1, OZ, 60)
34 Vertex_2 = geompy.MakeVertex(-5, -5, 90)
35 Vertex_3 = geompy.MakeVertex(65, 65, 110)
36 Box_2 = geompy.MakeBoxTwoPnt(Vertex_3, Vertex_2)
37 Common_1 = geompy.MakeCommon(Disk_1, Box_2)
38 geompy.ExportBREP(Common_1, os.path.join(gmu.pathBloc, "materielCasTests/CubeAngleFiss.brep"))
39 geompy.addToStudy( O, 'O' )
40 geompy.addToStudy( OX, 'OX' )
41 geompy.addToStudy( OY, 'OY' )
42 geompy.addToStudy( OZ, 'OZ' )
43 geompy.addToStudy( Box_1, 'Box_1' )
44 geompy.addToStudy( Vertex_1, 'Vertex_1' )
45 geompy.addToStudy( Disk_1, 'Disk_1' )
46 geompy.addToStudy( Vertex_2, 'Vertex_2' )
47 geompy.addToStudy( Vertex_3, 'Vertex_3' )
48 geompy.addToStudy( Box_2, 'Box_2' )
49 geompy.addToStudy( Common_1, 'Common_1' )
50
51 ###
52 ### SMESH component
53 ###
54
55 import  SMESH, SALOMEDS
56 from salome.smesh import smeshBuilder
57
58 smesh = smeshBuilder.New(theStudy)
59 from salome.StdMeshers import StdMeshersBuilder
60 Mesh_1 = smesh.Mesh(Box_1)
61 Regular_1D = Mesh_1.Segment()
62 Nb_Segments_1 = Regular_1D.NumberOfSegments(15)
63 Nb_Segments_1.SetDistrType( 0 )
64 Quadrangle_2D = Mesh_1.Quadrangle(algo=smeshBuilder.QUADRANGLE)
65 Hexa_3D = Mesh_1.Hexahedron(algo=smeshBuilder.Hexa)
66 isDone = Mesh_1.Compute()
67 smesh.SetName(Mesh_1, 'Mesh_1')
68 Mesh_1.ExportMED(  os.path.join(gmu.pathBloc, "materielCasTests/CubeAngle.med"), 0, SMESH.MED_V2_2, 1 )
69
70 ## set object names
71 smesh.SetName(Mesh_1.GetMesh(), 'Mesh_1')
72 smesh.SetName(Regular_1D.GetAlgorithm(), 'Regular_1D')
73 smesh.SetName(Nb_Segments_1, 'Nb. Segments_1')
74 smesh.SetName(Quadrangle_2D.GetAlgorithm(), 'Quadrangle_2D')
75 smesh.SetName(Hexa_3D.GetAlgorithm(), 'Hexa_3D')
76
77 if salome.sg.hasDesktop():
78   salome.sg.updateObjBrowser(1)