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