1 # -*- coding: iso-8859-1 -*-
7 theStudy = salome.myStudy
10 notebook = salome_notebook.notebook
13 from blocFissure import gmu
21 from salome.geom import geomBuilder
26 geompy = geomBuilder.New(theStudy)
28 O = geompy.MakeVertex(0, 0, 0)
29 OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
30 OY = geompy.MakeVectorDXDYDZ(0, 1, 0)
31 OZ = geompy.MakeVectorDXDYDZ(0, 0, 1)
32 Cylinder_1 = geompy.MakeCylinderRH(100, 300)
33 Cylinder_2 = geompy.MakeCylinderRH(600, 200)
34 Cut_1 = geompy.MakeCut(Cylinder_2, Cylinder_1)
35 Face_1 = geompy.MakeFaceHW(500, 1500, 3)
36 Disque = geompy.MakePartition([Cut_1], [Face_1], [], [], geompy.ShapeType["SOLID"], 0, [], 0)
37 [Compound_1, Compound_2, Compound_3, Compound_4] = geompy.Propagate(Disque)
38 geompy.addToStudy( O, 'O' )
39 geompy.addToStudy( OX, 'OX' )
40 geompy.addToStudy( OY, 'OY' )
41 geompy.addToStudy( OZ, 'OZ' )
42 geompy.addToStudy( Cylinder_1, 'Cylinder_1' )
43 geompy.addToStudy( Cylinder_2, 'Cylinder_2' )
44 geompy.addToStudy( Cut_1, 'Cut_1' )
45 geompy.addToStudy( Face_1, 'Face_1' )
46 geompy.addToStudy( Disque, 'Disque' )
47 geompy.addToStudyInFather( Disque, Compound_1, 'Compound_1' )
48 geompy.addToStudyInFather( Disque, Compound_2, 'Compound_2' )
49 geompy.addToStudyInFather( Disque, Compound_3, 'Compound_3' )
50 geompy.addToStudyInFather( Disque, Compound_4, 'Compound_4' )
56 import SMESH, SALOMEDS
57 from salome.smesh import smeshBuilder
59 smesh = smeshBuilder.New(theStudy)
60 from salome.StdMeshers import StdMeshersBuilder
61 Disque_1 = smesh.Mesh(Disque)
62 Regular_1D = Disque_1.Segment()
63 Nb_Segments_1 = Regular_1D.NumberOfSegments(10)
64 Nb_Segments_1.SetDistrType( 0 )
65 Hexa_3D = Disque_1.Hexahedron(algo=smeshBuilder.Hexa)
66 Regular_1D_1 = Disque_1.Segment(geom=Compound_3)
67 Nb_Segments_2 = Regular_1D_1.NumberOfSegments(20)
68 Nb_Segments_2.SetDistrType( 0 )
69 Regular_1D_2 = Disque_1.Segment(geom=Compound_4)
70 status = Disque_1.AddHypothesis(Nb_Segments_2,Compound_4)
71 Quadrangle_2D = Disque_1.Quadrangle(algo=smeshBuilder.QUADRANGLE)
72 isDone = Disque_1.Compute()
73 smesh.SetName(Disque_1, 'Disque')
74 Disque_1.ExportMED( os.path.join(gmu.pathBloc, "materielCasTests/disque.med"), 0, SMESH.MED_V2_2, 1 )
75 SubMesh_1 = Regular_1D_1.GetSubMesh()
76 SubMesh_2 = Regular_1D_2.GetSubMesh()
79 smesh.SetName(Disque_1.GetMesh(), 'Disque')
80 smesh.SetName(Regular_1D.GetAlgorithm(), 'Regular_1D')
81 smesh.SetName(Nb_Segments_1, 'Nb. Segments_1')
82 smesh.SetName(Hexa_3D.GetAlgorithm(), 'Hexa_3D')
83 smesh.SetName(Nb_Segments_2, 'Nb. Segments_2')
84 smesh.SetName(Quadrangle_2D.GetAlgorithm(), 'Quadrangle_2D')
85 smesh.SetName(SubMesh_1, 'SubMesh_1')
86 smesh.SetName(SubMesh_2, 'SubMesh_2')
88 if salome.sg.hasDesktop():
89 salome.sg.updateObjBrowser(True)