-# -*- coding: iso-8859-1 -*-
+# -*- coding: utf-8 -*-
import sys
import salome
coupe_vis = geompy.MakePartition([Face_1], [Line_1, Line_2, Line_3, Line_4], [], [], geompy.ShapeType["FACE"], 0, [], 0)
[tige, section, tige_haute, rond, tete, section_tete] = geompy.Propagate(coupe_vis)
conge = geompy.CreateGroup(coupe_vis, geompy.ShapeType["EDGE"])
-geompy.UnionIDs(conge, [21])
+geompy.UnionIDs(conge, [25])
appui = geompy.CreateGroup(coupe_vis, geompy.ShapeType["EDGE"])
-geompy.UnionIDs(appui, [37])
+geompy.UnionIDs(appui, [39])
p_imp = geompy.CreateGroup(coupe_vis, geompy.ShapeType["EDGE"])
-geompy.UnionIDs(p_imp, [4])
+geompy.UnionIDs(p_imp, [11])
Vertex_4 = geompy.MakeVertex(11.25, 98.75, 0)
Vertex_5 = geompy.MakeVertexWithRef(Vertex_4, -0.5, 0.5, 0)
Fissure = geompy.MakeCommonList([Extrusion_1, Revolution_2], True)
fondFiss = geompy.CreateGroup(Fissure, geompy.ShapeType["EDGE"])
geompy.UnionIDs(fondFiss, [9, 7, 4])
-geompy.Export(Fissure, os.path.join(gmu.pathBloc, "materielCasTests/visFiss.brep"), "BREP")
+geompy.ExportBREP(Fissure, os.path.join(gmu.pathBloc, "materielCasTests/visFiss.brep"))
geompy.addToStudy( O, 'O' )
geompy.addToStudy( OX, 'OX' )
coupe_vis_1 = smesh.Mesh(coupe_vis)
Regular_1D = coupe_vis_1.Segment()
Nb_Segments_1 = Regular_1D.NumberOfSegments(10)
-Nb_Segments_1.SetDistrType( 0 )
Quadrangle_2D = coupe_vis_1.Quadrangle(algo=smeshBuilder.QUADRANGLE)
+Regular_1D_1 = coupe_vis_1.Segment(geom=tige)
+Nb_Segments_2 = Regular_1D_1.NumberOfSegments(30)
+Regular_1D_2 = coupe_vis_1.Segment(geom=section)
+Nb_Segments_3 = Regular_1D_2.NumberOfSegments(10,1,[ 7, 11, 16, 23 ])
isDone = coupe_vis_1.Compute()
-Nb_Segments_2 = smesh.CreateHypothesis('NumberOfSegments')
-Nb_Segments_2.SetNumberOfSegments( 30 )
-Nb_Segments_2.SetDistrType( 0 )
-status = coupe_vis_1.AddHypothesis(Regular_1D,tige)
-status = coupe_vis_1.AddHypothesis(Nb_Segments_2,tige)
-isDone = coupe_vis_1.Compute()
-Nb_Segments_3 = smesh.CreateHypothesis('NumberOfSegments')
-Nb_Segments_3.SetNumberOfSegments( 10 )
-Nb_Segments_3.SetScaleFactor( 3 )
-Nb_Segments_3.SetReversedEdges( [ ] )
-Nb_Segments_3.SetObjectEntry( "0:1:1:14" )
-status = coupe_vis_1.AddHypothesis(Regular_1D,section)
-status = coupe_vis_1.AddHypothesis(Nb_Segments_3,section)
-coupe_vis_1.Clear()
-isDone = coupe_vis_1.Compute()
-coupe_vis_1.Clear()
-Nb_Segments_3.SetNumberOfSegments( 10 )
-Nb_Segments_3.SetDistrType( 1 )
-Nb_Segments_3.SetScaleFactor( 3 )
-Nb_Segments_3.SetReversedEdges( [ 23, 4, 9, 16 ] )
-Nb_Segments_3.SetObjectEntry( "0:1:1:14" )
-isDone = coupe_vis_1.Compute()
+isDone = coupe_vis_1.SplitQuad( [ 691 ], 1 )
tige_1 = coupe_vis_1.GroupOnGeom(tige,'tige',SMESH.EDGE)
section_1 = coupe_vis_1.GroupOnGeom(section,'section',SMESH.EDGE)
tige_haute_1 = coupe_vis_1.GroupOnGeom(tige_haute,'tige_haute',SMESH.EDGE)
conge_1 = coupe_vis_1.GroupOnGeom(conge,'conge',SMESH.EDGE)
appui_1 = coupe_vis_1.GroupOnGeom(appui,'appui',SMESH.EDGE)
p_imp_1 = coupe_vis_1.GroupOnGeom(p_imp,'p_imp',SMESH.EDGE)
-isDone = coupe_vis_1.SplitQuad( [ 691 ], 1 )
visHex80 = smesh.CopyMesh( coupe_vis_1, 'visHex80', 1, 0)
[ tige_2, section_2, tige_haute_2, rond_2, tete_2, section_tete_2, conge_2, appui_2, p_imp_2 ] = visHex80.GetGroups()
-[ tige_rotated, section_rotated, tige_haute_rotated, rond_rotated, tete_rotated, section_tete_rotated, conge_rotated, appui_rotated, p_imp_rotated, tige_top, section_top, tige_haute_top, rond_top, tete_top, section_tete_top, conge_top, appui_top, p_imp_top ] = visHex80.RotationSweepObject2D( visHex80, SMESH.AxisStruct( 0, 0, 0, 0, 10, 0 ), math.pi/40, 40, 1e-05 ,True)
+[ tige_rotated, section_rotated, tige_haute_rotated, rond_rotated, tete_rotated, section_tete_rotated, conge_rotated, appui_rotated, p_imp_rotated, tige_top, section_top, tige_haute_top, rond_top, tete_top, section_tete_top, conge_top, appui_top, p_imp_top ] = visHex80.RotationSweepObjects( [ visHex80 ], [ visHex80 ], [ visHex80 ], SMESH.AxisStruct( 0, 0, 0, 0, 10, 0 ), 0.0785398, 40, 1e-05, 1 )
[ tige_2, section_2, tige_haute_2, rond_2, tete_2, section_tete_2, conge_2, appui_2, p_imp_2, tige_rotated, tige_top, section_rotated, section_top, tige_haute_rotated, tige_haute_top, rond_rotated, rond_top, tete_rotated, tete_top, section_tete_rotated, section_tete_top, conge_rotated, conge_top, appui_rotated, appui_top, p_imp_rotated, p_imp_top ] = visHex80.GetGroups()
-[ tige_mirrored, section_mirrored, tige_haute_mirrored, rond_mirrored, tete_mirrored, section_tete_mirrored, conge_mirrored, appui_mirrored, p_imp_mirrored, tige_rotated_mirrored, tige_top_mirrored, section_rotated_mirrored, section_top_mirrored, tige_haute_rotated_mirrored, tige_haute_top_mirrored, rond_rotated_mirrored, rond_top_mirrored, tete_rotated_mirrored, tete_top_mirrored, section_tete_rotated_mirrored, section_tete_top_mirrored, conge_rotated_mirrored, conge_top_mirrored, appui_rotated_mirrored, appui_top_mirrored, p_imp_rotated_mirrored, p_imp_top_mirrored ] = visHex80.MirrorObject( visHex80, SMESH.AxisStruct( 0, 0, 0, 0, 0, 10 ), SMESH.SMESH_MeshEditor.PLANE ,True,True)
-[ tige_2, section_2, tige_haute_2, rond_2, tete_2, section_tete_2, conge_2, appui_2, p_imp_2, tige_rotated, tige_top, section_rotated, section_top, tige_haute_rotated, tige_haute_top, rond_rotated, rond_top, tete_rotated, tete_top, section_tete_rotated, section_tete_top, conge_rotated, conge_top, appui_rotated, appui_top, p_imp_rotated, p_imp_top, tige_mirrored, section_mirrored, tige_haute_mirrored, rond_mirrored, tete_mirrored, section_tete_mirrored, conge_mirrored, appui_mirrored, p_imp_mirrored, tige_rotated_mirrored, tige_top_mirrored, section_rotated_mirrored, section_top_mirrored, tige_haute_rotated_mirrored, tige_haute_top_mirrored, rond_rotated_mirrored, rond_top_mirrored, tete_rotated_mirrored, tete_top_mirrored, section_tete_rotated_mirrored, section_tete_top_mirrored, conge_rotated_mirrored, conge_top_mirrored, appui_rotated_mirrored, appui_top_mirrored, p_imp_rotated_mirrored, p_imp_top_mirrored ] = visHex80.GetGroups()
-coincident_nodes_on_part = visHex80.FindCoincidentNodesOnPart( visHex80, 1e-05, [ ] )
-visHex80.MergeNodes(coincident_nodes_on_part)
-equal_elements = visHex80.FindEqualElements( visHex80 )
-visHex80.MergeElements(equal_elements)
-[ tige_2, section_2, tige_haute_2, rond_2, tete_2, section_tete_2, conge_2, appui_2, p_imp_2, tige_rotated, tige_top, section_rotated, section_top, tige_haute_rotated, tige_haute_top, rond_rotated, rond_top, tete_rotated, tete_top, section_tete_rotated, section_tete_top, conge_rotated, conge_top, appui_rotated, appui_top, p_imp_rotated, p_imp_top, tige_mirrored, section_mirrored, tige_haute_mirrored, rond_mirrored, tete_mirrored, section_tete_mirrored, conge_mirrored, appui_mirrored, p_imp_mirrored, tige_rotated_mirrored, tige_top_mirrored, section_rotated_mirrored, section_top_mirrored, tige_haute_rotated_mirrored, tige_haute_top_mirrored, rond_rotated_mirrored, rond_top_mirrored, tete_rotated_mirrored, tete_top_mirrored, section_tete_rotated_mirrored, section_tete_top_mirrored, conge_rotated_mirrored, conge_top_mirrored, appui_rotated_mirrored, appui_top_mirrored, p_imp_rotated_mirrored, p_imp_top_mirrored ] = visHex80.GetGroups()
-SubMesh_1 = coupe_vis_1.GetSubMesh( tige, 'SubMesh_1' )
-SubMesh_2 = coupe_vis_1.GetSubMesh( section, 'SubMesh_2' )
+Sub_mesh_1 = Regular_1D_1.GetSubMesh()
+Sub_mesh_2 = Regular_1D_2.GetSubMesh()
visHex80.ExportMED( os.path.join(gmu.pathBloc, "materielCasTests/visSain.med"), 0, SMESH.MED_V2_2, 1 )
-
+
## Set names of Mesh objects
-smesh.SetName(appui_rotated, 'appui_rotated')
-smesh.SetName(p_imp_rotated, 'p_imp_rotated')
-smesh.SetName(section_tete_rotated, 'section_tete_rotated')
-smesh.SetName(conge_rotated, 'conge_rotated')
-smesh.SetName(rond_rotated, 'rond_rotated')
-smesh.SetName(tete_rotated, 'tete_rotated')
-smesh.SetName(section_rotated, 'section_rotated')
-smesh.SetName(tige_haute_rotated, 'tige_haute_rotated')
-smesh.SetName(tige_rotated, 'tige_rotated')
-smesh.SetName(SubMesh_2, 'SubMesh_2')
-smesh.SetName(SubMesh_1, 'SubMesh_1')
+smesh.SetName(tige_2, 'tige')
smesh.SetName(Regular_1D.GetAlgorithm(), 'Regular_1D')
smesh.SetName(Quadrangle_2D.GetAlgorithm(), 'Quadrangle_2D')
-smesh.SetName(appui_1, 'appui')
-smesh.SetName(p_imp_1, 'p_imp')
+smesh.SetName(Nb_Segments_2, 'Nb. Segments_2')
+smesh.SetName(Nb_Segments_1, 'Nb. Segments_1')
+smesh.SetName(Nb_Segments_3, 'Nb. Segments_3')
smesh.SetName(coupe_vis_1.GetMesh(), 'coupe_vis')
smesh.SetName(visHex80.GetMesh(), 'visHex80')
+smesh.SetName(p_imp_top, 'p_imp_top')
+smesh.SetName(appui_top, 'appui_top')
+smesh.SetName(conge_top, 'conge_top')
+smesh.SetName(section_tete_top, 'section_tete_top')
+smesh.SetName(tete_top, 'tete_top')
+smesh.SetName(rond_top, 'rond_top')
+smesh.SetName(tige_haute_top, 'tige_haute_top')
+smesh.SetName(section_top, 'section_top')
+smesh.SetName(tige_top, 'tige_top')
+smesh.SetName(Sub_mesh_2, 'Sub-mesh_2')
+smesh.SetName(Sub_mesh_1, 'Sub-mesh_1')
+smesh.SetName(p_imp_1, 'p_imp')
+smesh.SetName(p_imp_rotated, 'p_imp_rotated')
+smesh.SetName(appui_1, 'appui')
+smesh.SetName(appui_rotated, 'appui_rotated')
+smesh.SetName(conge_rotated, 'conge_rotated')
+smesh.SetName(section_tete_rotated, 'section_tete_rotated')
+smesh.SetName(tete_rotated, 'tete_rotated')
+smesh.SetName(rond_rotated, 'rond_rotated')
+smesh.SetName(tige_haute_rotated, 'tige_haute_rotated')
+smesh.SetName(section_rotated, 'section_rotated')
smesh.SetName(tige_1, 'tige')
-smesh.SetName(p_imp_2, 'p_imp')
-smesh.SetName(section_1, 'section')
-smesh.SetName(appui_2, 'appui')
+smesh.SetName(tige_rotated, 'tige_rotated')
smesh.SetName(tige_haute_1, 'tige_haute')
-smesh.SetName(conge_2, 'conge')
-smesh.SetName(rond_1, 'rond')
-smesh.SetName(section_tete_2, 'section_tete')
+smesh.SetName(section_1, 'section')
smesh.SetName(tete_1, 'tete')
-smesh.SetName(tete_2, 'tete')
+smesh.SetName(rond_1, 'rond')
+smesh.SetName(conge_1, 'conge')
+smesh.SetName(appui_2, 'appui')
smesh.SetName(section_tete_1, 'section_tete')
+smesh.SetName(p_imp_2, 'p_imp')
+smesh.SetName(section_tete_2, 'section_tete')
+smesh.SetName(conge_2, 'conge')
smesh.SetName(rond_2, 'rond')
-smesh.SetName(conge_1, 'conge')
-smesh.SetName(tige_haute_2, 'tige_haute')
+smesh.SetName(tete_2, 'tete')
smesh.SetName(section_2, 'section')
-smesh.SetName(tige_2, 'tige')
-smesh.SetName(p_imp_top, 'p_imp_top')
-smesh.SetName(Nb_Segments_3, 'Nb. Segments_3')
-smesh.SetName(conge_top, 'conge_top')
-smesh.SetName(Nb_Segments_2, 'Nb. Segments_2')
-smesh.SetName(appui_top, 'appui_top')
-smesh.SetName(Nb_Segments_1, 'Nb. Segments_1')
-smesh.SetName(tete_top, 'tete_top')
-smesh.SetName(section_tete_top, 'section_tete_top')
-smesh.SetName(tige_haute_top, 'tige_haute_top')
-smesh.SetName(rond_top, 'rond_top')
-smesh.SetName(tige_top, 'tige_top')
-smesh.SetName(section_top, 'section_top')
+smesh.SetName(tige_haute_2, 'tige_haute')
+
if salome.sg.hasDesktop():
salome.sg.updateObjBrowser(1)