Salome HOME
52976: Find Elements by Point - All does not find Ball element
[modules/smesh.git] / doc / salome / examples / defining_hypotheses_ex05.py
1 # Maximum Element Area
2
3 import salome
4 salome.salome_init()
5 import GEOM
6 from salome.geom import geomBuilder
7 geompy = geomBuilder.New(salome.myStudy)
8
9 import SMESH, SALOMEDS
10 from salome.smesh import smeshBuilder
11 smesh =  smeshBuilder.New(salome.myStudy)
12
13 # create a face
14 px   = geompy.MakeVertex(100., 0.  , 0.  )
15 py   = geompy.MakeVertex(0.  , 100., 0.  )
16 pz   = geompy.MakeVertex(0.  , 0.  , 100.)
17
18 vxy = geompy.MakeVector(px, py)
19 arc = geompy.MakeArc(py, pz, px)
20 wire = geompy.MakeWire([vxy, arc])
21
22 isPlanarFace = 1
23 face = geompy.MakeFace(wire, isPlanarFace)
24
25 # add the face in the study
26 id_face = geompy.addToStudy(face, "Face to be meshed")
27
28 # create a mesh
29 tria_mesh = smesh.Mesh(face, "Face : triangulation")
30
31 # define 1D meshing:
32 algo = tria_mesh.Segment()
33 algo.NumberOfSegments(20)
34
35 # define 2D meshing:
36
37 # assign triangulation algorithm
38 algo = tria_mesh.Triangle()
39
40 # assign "Max Element Area" hypothesis
41 algo.MaxElementArea(100)
42
43 # compute the mesh
44 tria_mesh.Compute()