Salome HOME
PR: synchro V6_main tag mergeto_V7_main_11Feb13
[modules/smesh.git] / doc / salome / examples / defining_hypotheses_ex13.py
1 # Radial Quadrangle 1D2D example
2
3 from smesh import *
4
5 SetCurrentStudy(salome.myStudy)
6
7 # Create face from the wire and add to study
8 Face = geompy.MakeSketcher("Sketcher:F 0 0:TT 20 0:R 90:C 20 90:WF", [0, 0, 0, 1, 0, 0, 0, 0, 1])
9 geompy.addToStudy(Face,"Face")
10 edges = geompy.SubShapeAllSorted(Face, geompy.ShapeType["EDGE"])
11 circle, radius1, radius2 = edges
12 geompy.addToStudyInFather(Face, radius1,"radius1")
13 geompy.addToStudyInFather(Face, radius2,"radius2")
14 geompy.addToStudyInFather(Face, circle,"circle")
15
16
17 # Define geometry for mesh, and Radial Quadrange algorithm
18 mesh = smesh.Mesh(Face)
19 radial_Quad_algo = mesh.Quadrangle(algo=RADIAL_QUAD)
20
21 # The Radial Quadrange algorithm can work without any hypothesis
22 # In this case it uses "Default Nb of Segments" preferences parameter to discretize edges
23 mesh.Compute()
24
25 # The Radial Quadrange uses global or local 1d hypotheses if it does
26 # not have its own hypotheses.
27 # Define global hypotheses to discretize radial edges and a local one for circular edge
28 global_Nb_Segments = mesh.Segment().NumberOfSegments(5)
29 local_Nb_Segments  = mesh.Segment(circle).NumberOfSegments(10)
30 mesh.Compute()
31
32 # Define own parameters of Radial Quadrange algorithm
33 radial_Quad_algo.NumberOfLayers( 4 )
34 mesh.Compute()