1 # -*- coding: utf-8 -*-
11 from blocFissure import gmu
18 from salome.geom import geomBuilder
23 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 Vertex_1 = geompy.MakeVertex(0, 0, 100)
31 Disk_1 = geompy.MakeDiskPntVecR(Vertex_1, OZ, 60)
32 Vertex_2 = geompy.MakeVertex(-5, -5, 90)
33 Vertex_3 = geompy.MakeVertex(65, 65, 110)
34 Box_2 = geompy.MakeBoxTwoPnt(Vertex_3, Vertex_2)
35 Common_1 = geompy.MakeCommon(Disk_1, Box_2)
36 geompy.ExportBREP(Common_1, os.path.join(gmu.pathBloc, "materielCasTests/CubeAngleFiss.brep"))
37 geompy.addToStudy( O, 'O' )
38 geompy.addToStudy( OX, 'OX' )
39 geompy.addToStudy( OY, 'OY' )
40 geompy.addToStudy( OZ, 'OZ' )
41 geompy.addToStudy( Box_1, 'Box_1' )
42 geompy.addToStudy( Vertex_1, 'Vertex_1' )
43 geompy.addToStudy( Disk_1, 'Disk_1' )
44 geompy.addToStudy( Vertex_2, 'Vertex_2' )
45 geompy.addToStudy( Vertex_3, 'Vertex_3' )
46 geompy.addToStudy( Box_2, 'Box_2' )
47 geompy.addToStudy( Common_1, 'Common_1' )
53 import SMESH, SALOMEDS
54 from salome.smesh import smeshBuilder
56 smesh = smeshBuilder.New()
57 from salome.StdMeshers import StdMeshersBuilder
58 Mesh_1 = smesh.Mesh(Box_1)
59 Regular_1D = Mesh_1.Segment()
60 Nb_Segments_1 = Regular_1D.NumberOfSegments(15)
61 Nb_Segments_1.SetDistrType( 0 )
62 Quadrangle_2D = Mesh_1.Quadrangle(algo=smeshBuilder.QUADRANGLE)
63 Hexa_3D = Mesh_1.Hexahedron(algo=smeshBuilder.Hexa)
64 isDone = Mesh_1.Compute()
65 smesh.SetName(Mesh_1, 'Mesh_1')
66 Mesh_1.ExportMED( os.path.join(gmu.pathBloc, "materielCasTests/CubeAngle.med"), 0, SMESH.MED_V2_2, 1 )
69 smesh.SetName(Mesh_1.GetMesh(), 'Mesh_1')
70 smesh.SetName(Regular_1D.GetAlgorithm(), 'Regular_1D')
71 smesh.SetName(Nb_Segments_1, 'Nb. Segments_1')
72 smesh.SetName(Quadrangle_2D.GetAlgorithm(), 'Quadrangle_2D')
73 smesh.SetName(Hexa_3D.GetAlgorithm(), 'Hexa_3D')
75 if salome.sg.hasDesktop():
76 salome.sg.updateObjBrowser()