6 smesh = salome.lcc.FindOrLoadComponent("FactoryServer", "SMESH")
\r
7 smesh.SetCurrentStudy(salome.myStudy)
\r
9 # Create box without one plane
\r
11 box = geompy.MakeBox(0., 0., 0., 10., 20., 30.)
\r
12 subShapeList = geompy.SubShapeAll(box, geompy.ShapeType["FACE"])
\r
15 for i in range( 5 ):
\r
16 FaceList.append( subShapeList[ i ] )
\r
18 aComp = geompy.MakeCompound( FaceList )
\r
19 aBox = geompy.Sew( aComp, 1. )
\r
20 idbox = geompy.addToStudy( aBox, "box" )
\r
22 aBox = salome.IDToObject( idbox )
\r
26 hyp1 = smesh.CreateHypothesis("NumberOfSegments", "libStdMeshersEngine.so")
\r
27 hyp1.SetNumberOfSegments(5)
\r
28 hyp2 = smesh.CreateHypothesis("MaxElementArea", "libStdMeshersEngine.so")
\r
29 hyp2.SetMaxElementArea(20)
\r
30 hyp3 = smesh.CreateHypothesis("MaxElementArea", "libStdMeshersEngine.so")
\r
31 hyp3.SetMaxElementArea(50)
\r
33 algo1 = smesh.CreateHypothesis("Regular_1D", "libStdMeshersEngine.so")
\r
34 algo2 = smesh.CreateHypothesis("MEFISTO_2D", "libStdMeshersEngine.so")
\r
36 mesh = smesh.CreateMesh(aBox)
\r
37 mesh.AddHypothesis(aBox,hyp1)
\r
38 mesh.AddHypothesis(aBox,hyp2)
\r
39 mesh.AddHypothesis(aBox,algo1)
\r
40 mesh.AddHypothesis(aBox,algo2)
\r
42 smesh.Compute(mesh,aBox)
\r
44 smeshgui = salome.ImportComponentGUI("SMESH")
\r
45 smeshgui.Init(salome.myStudyId);
\r
46 smeshgui.SetName( salome.ObjectToID( mesh ), "Mesh_freebord" );
\r
48 # Criterion : Free edges
\r
49 aFilterMgr = smesh.CreateFilterManager()
\r
50 aPredicate = aFilterMgr.CreateFreeBorders()
\r
51 aFilter = aFilterMgr.CreateFilter()
\r
52 aFilter.SetPredicate( aPredicate )
\r
54 anIds = aFilter.GetElementsId( mesh )
\r
57 print "Criterion: Free edges Nb = ", len( anIds )
\r
58 for i in range( len( anIds ) ):
\r
62 aGroup = mesh.CreateGroup( SMESH.EDGE, "Free edges" )
\r
66 salome.sg.updateObjBrowser(1)
\r