6 from salome.geom import geomBuilder
7 geompy = geomBuilder.New(salome.myStudy)
10 from salome.smesh import smeshBuilder
11 smesh = smeshBuilder.New(salome.myStudy)
13 def PrintMeshInfo(theMesh):
14 aMesh = theMesh.GetMesh()
15 print "Information about mesh:"
16 print "Number of nodes : ", aMesh.NbNodes()
17 print "Number of edges : ", aMesh.NbEdges()
18 print "Number of faces : ", aMesh.NbFaces()
19 print "Number of volumes : ", aMesh.NbVolumes()
23 box = geompy.MakeBox(0., 0., 0., 20., 20., 20.)
24 geompy.addToStudy(box, "box")
26 # select one edge of the box for definition of a local hypothesis
27 subShapeList = geompy.SubShapeAll(box, geompy.ShapeType["EDGE"])
28 edge = subShapeList[0]
29 name = geompy.SubShapeName(edge, box)
30 geompy.addToStudyInFather(box, edge, name)
33 tria = smesh.Mesh(box, "Mesh 2D")
34 algo1D = tria.Segment()
35 hyp1 = algo1D.NumberOfSegments(3)
36 algo2D = tria.Triangle()
37 hyp2 = algo2D.MaxElementArea(10.)
40 algo_local = tria.Segment(edge)
41 hyp3 = algo_local.Arithmetic1D(1, 6)
42 hyp4 = algo_local.Propagation()
48 # remove a local hypothesis
49 tria.RemoveHypothesis(hyp4, edge)
55 # change the value of the 2D hypothesis
56 hyp2.SetMaxElementArea(2.)