Salome HOME
0023591: [EDF] Add test to check meshing plug-ins to SMESH module
[modules/smesh.git] / doc / salome / examples / defining_hypotheses_len_near_vertex.py
1 # Usage of Segments around Vertex algorithm
2
3 # for meshing a box with quadrangles with refinement near vertices
4
5 import salome
6 salome.salome_init()
7 from salome.geom import geomBuilder
8 geompy = geomBuilder.New()
9 from salome.smesh import smeshBuilder
10 smesh =  smeshBuilder.New()
11
12 # create a box
13 box = geompy.MakeBoxDXDYDZ( 10, 10, 10 )
14
15 # make a mesh
16 mesh = smesh.Mesh( box )
17
18 # define quadrangle meshing
19 algo1d = mesh.Segment()
20 algo1d.LocalLength( 1. )
21 mesh.Quadrangle()
22
23 # add Hexahedron algo to assure that there are no triangles
24 mesh.Hexahedron()
25
26 # define refinement near vertices
27 algo1d.LengthNearVertex( 0.2 )
28
29 mesh.Compute()