7 from salome.geom import geomBuilder
8 geompy = geomBuilder.New()
10 import SMESH, SALOMEDS
11 from salome.smesh import smeshBuilder
12 smesh = smeshBuilder.New()
14 ####### GEOM part ########
16 Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200)
17 Box_1_vertex_6 = geompy.GetSubShape(Box_1, [6])
18 Box_1 = geompy.GetMainShape(Box_1_vertex_6)
19 Box_1_vertex_16 = geompy.GetSubShape(Box_1, [16])
20 Box_1 = geompy.GetMainShape(Box_1_vertex_16)
21 Box_1_vertex_11 = geompy.GetSubShape(Box_1, [11])
22 Box_1 = geompy.GetMainShape(Box_1_vertex_11)
23 Plane_1 = geompy.MakePlaneThreePnt(Box_1_vertex_6, Box_1_vertex_16, Box_1_vertex_11, 2000)
24 Partition_1 = geompy.MakePartition([Box_1], [Plane_1], [], [], geompy.ShapeType["SOLID"], 0, [], 0)
26 Box_1_vertex_19 = geompy.GetSubShape(Box_1, [19])
27 Box_1_vertex_21 = geompy.GetSubShape(Box_1, [21])
28 Plane_2 = geompy.MakePlaneThreePnt(Box_1_vertex_16, Box_1_vertex_19, Box_1_vertex_21, 2000)
30 geompy.addToStudy( Box_1, "Box_1" )
31 geompy.addToStudyInFather( Box_1, Box_1_vertex_6, "Box_1:vertex_6" )
32 geompy.addToStudyInFather( Box_1, Box_1_vertex_16, "Box_1:vertex_16" )
33 geompy.addToStudyInFather( Box_1, Box_1_vertex_11, "Box_1:vertex_11" )
34 geompy.addToStudy( Plane_1, "Plane_1" )
35 geompy.addToStudy( Partition_1, "Partition_1" )
36 geompy.addToStudyInFather( Box_1, Box_1_vertex_19, "Box_1:vertex_19" )
37 geompy.addToStudyInFather( Box_1, Box_1_vertex_21, "Box_1:vertex_21" )
38 geompy.addToStudy( Plane_2, "Plane_2" )
40 ###### SMESH part ######
42 Mesh_1 = smesh.Mesh(Partition_1)
43 Regular_1D = Mesh_1.Segment()
44 Max_Size_1 = Regular_1D.MaxSize(34.641)
45 MEFISTO_2D = Mesh_1.Triangle()
46 Tetrahedronn = Mesh_1.Tetrahedron()
47 isDone = Mesh_1.Compute()
49 # create a group of free faces
50 aFilter = smesh.GetFilter(SMESH.FACE, SMESH.FT_FreeFaces )
51 aFaceIds = Mesh_1.GetIdsFromFilter(aFilter)
53 aGroup = Mesh_1.CreateEmptyGroup(SMESH.FACE, "Free_faces")
57 print "Criterion: Free faces Nb = ", len(aFaceIds)
59 for i in range(len(aFaceIds)):
60 if j > 20: j = 1; print ""
66 #filter faces from plane 2
67 aFilter = smesh.GetFilter(SMESH.FACE, SMESH.FT_BelongToPlane, Plane_2)
68 aFaceIds = Mesh_1.GetIdsFromFilter(aFilter)
69 aGroup.Remove(aFaceIds)
71 # create a group of shared faces (located on partition boundary inside box)
72 aFilter = smesh.GetFilter(SMESH.FACE, SMESH.FT_BelongToPlane, Plane_1)
73 aFaceIds = Mesh_1.GetIdsFromFilter(aFilter)
75 aGroup = Mesh_1.CreateEmptyGroup(SMESH.FACE, "Shared_faces")
78 salome.sg.updateObjBrowser()