6 def PrintMeshInfo(theMesh):
7 aMesh = theMesh.GetMesh()
8 print "Information about mesh:"
9 print "Number of nodes : ", aMesh.NbNodes()
10 print "Number of edges : ", aMesh.NbEdges()
11 print "Number of faces : ", aMesh.NbFaces()
12 print "Number of volumes : ", aMesh.NbVolumes()
16 box = geompy.MakeBox(0., 0., 0., 20., 20., 20.)
17 geompy.addToStudy(box, "box")
19 # select one edge of the box for definition of a local hypothesis
20 subShapeList = geompy.SubShapeAll(box, geompy.ShapeType["EDGE"])
21 edge = subShapeList[0]
22 name = geompy.SubShapeName(edge, box)
23 geompy.addToStudyInFather(box, edge, name)
26 tria = smesh.Mesh(box, "Mesh 2D")
27 algo1D = tria.Segment()
28 hyp1 = algo1D.NumberOfSegments(3)
29 algo2D = tria.Triangle()
30 hyp2 = algo2D.MaxElementArea(10.)
33 algo_local = tria.Segment(edge)
34 hyp3 = algo_local.Arithmetic1D(1, 6)
35 hyp4 = algo_local.Propagation()
41 # remove a local hypothesis
43 mesh.RemoveHypothesis(edge, hyp4)
49 # change the value of the 2D hypothesis
50 hyp2.SetMaxElementArea(2.)