Salome HOME
Merge from V6_main 28/02/2013
[modules/smesh.git] / doc / salome / examples / defining_hypotheses_ex05.py
1 # Maximum Element Area
2
3 import geompy
4 import smesh
5 import salome 
6
7 # create a face
8 px   = geompy.MakeVertex(100., 0.  , 0.  )
9 py   = geompy.MakeVertex(0.  , 100., 0.  )
10 pz   = geompy.MakeVertex(0.  , 0.  , 100.)
11
12 vxy = geompy.MakeVector(px, py)
13 arc = geompy.MakeArc(py, pz, px)
14 wire = geompy.MakeWire([vxy, arc])
15
16 isPlanarFace = 1
17 face = geompy.MakeFace(wire, isPlanarFace)
18
19 # add the face in the study
20 id_face = geompy.addToStudy(face, "Face to be meshed")
21
22 # create a mesh
23 tria_mesh = smesh.Mesh(face, "Face : triangulation")
24
25 # define 1D meshing:
26 algo = tria_mesh.Segment()
27 algo.NumberOfSegments(20)
28
29 # define 2D meshing:
30
31 # assign triangulation algorithm
32 algo = tria_mesh.Triangle()
33
34 # apply "Max Element Area" hypothesis to each triangle
35 algo.MaxElementArea(100)
36
37 # compute the mesh
38 tria_mesh.Compute()