8 box = geompy.MakeBox(0., 0., 0., 20., 20., 20.)
9 geompy.addToStudy(box, "box")
10 [Face_1,Face_2,Face_3,Face_4,Face_5,Face_5] = geompy.SubShapeAll(box, geompy.ShapeType["FACE"])
13 tetra = smesh.Mesh(box, "MeshBox")
15 algo1D = tetra.Segment()
16 algo1D.NumberOfSegments(3)
18 algo2D = tetra.Triangle()
19 algo2D.MaxElementArea(10.)
21 algo3D = tetra.Tetrahedron()
22 algo3D.MaxElementVolume(900.)
25 Regular_1D_1_1 = tetra.Segment(geom=Face_1)
26 Nb_Segments_1 = Regular_1D_1_1.NumberOfSegments(5)
27 Nb_Segments_1.SetDistrType( 0 )
28 Quadrangle_2D = tetra.Quadrangle(geom=Face_1)
29 isDone = tetra.Compute()
30 submesh = Regular_1D_1_1.GetSubMesh()
36 group = tetra.CreateEmptyGroup( SMESH.FACE, 'Group' )
37 nbAdd = group.Add( [ 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76 ] )
39 # Print information about the mesh
40 print "Information about mesh:"
41 print "Number of nodes : ", tetra.NbNodes()
42 print "Number of edges : ", tetra.NbEdges()
43 print "Number of faces : ", tetra.NbFaces()
44 print " triangles : ", tetra.NbTriangles()
45 print " quadrangles : ", tetra.NbQuadrangles()
46 print " polygons : ", tetra.NbPolygons()
47 print "Number of volumes : ", tetra.NbVolumes()
48 print " tetrahedrons: ", tetra.NbTetras()
49 print " hexahedrons : ", tetra.NbHexas()
50 print " prisms : ", tetra.NbPrisms()
51 print " pyramids : ", tetra.NbPyramids()
52 print " polyhedrons : ", tetra.NbPolyhedrons()
54 # Get Information About Mesh by GetMeshInfo
55 print "\nInformation about mesh by GetMeshInfo:"
56 info = smesh.GetMeshInfo(tetra)
57 keys = info.keys(); keys.sort()
59 print " %s : %d" % ( i, info[i] )
62 # Get Information About Group by GetMeshInfo
63 print "\nInformation about group by GetMeshInfo:"
64 info = smesh.GetMeshInfo(group)
65 keys = info.keys(); keys.sort()
67 print " %s : %d" % ( i, info[i] )
70 # Get Information About SubMesh by GetMeshInfo
71 print "\nInformation about Submesh by GetMeshInfo:"
72 info = smesh.GetMeshInfo(submesh)
73 keys = info.keys(); keys.sort()
75 print " %s : %d" % ( i, info[i] )