1 # Quadrangle Parameters example 2 (using different types)
5 from salome.geom import geomBuilder
6 geompy = geomBuilder.New()
7 from salome.smesh import smeshBuilder
8 smesh = smeshBuilder.New()
10 # Make quadrangle face and explode it on edges.
11 Vertex_1 = geompy.MakeVertex(0, 0, 0)
12 Vertex_2 = geompy.MakeVertex(40, 0, 0)
13 Vertex_3 = geompy.MakeVertex(40, 30, 0)
14 Vertex_4 = geompy.MakeVertex(0, 30, 0)
15 Quadrangle_Face_1 = geompy.MakeQuad4Vertices(Vertex_1, Vertex_4, Vertex_3, Vertex_2)
16 [Edge_1,Edge_2,Edge_3,Edge_4] = geompy.SubShapeAllSorted(Quadrangle_Face_1, geompy.ShapeType["EDGE"])
17 geompy.addToStudy( Quadrangle_Face_1, "Quadrangle Face_1" )
18 geompy.addToStudyInFather( Quadrangle_Face_1, Edge_2, "Edge_2" )
20 # Set the Geometry for meshing
21 Mesh_1 = smesh.Mesh(Quadrangle_Face_1)
23 # Create Quadrangle parameters and
24 # define the Type as Quadrangle Preference
25 Quad_algo = Mesh_1.Quadrangle()
26 Quadrangle_Parameters_1 = Quad_algo.QuadrangleParameters( smeshBuilder.QUAD_QUADRANGLE_PREF )
28 # Define other hypotheses and algorithms
29 Regular_1D = Mesh_1.Segment()
30 Nb_Segments_1 = Regular_1D.NumberOfSegments(4)
32 # Define submesh on one edge to provide different number of segments
33 Regular_1D_1 = Mesh_1.Segment(geom=Edge_2)
34 Nb_Segments_2 = Regular_1D_1.NumberOfSegments(10)
36 # Compute mesh (with Quadrangle Preference type)
37 isDone = Mesh_1.Compute()
39 # Change type to Reduced and compute again
40 Quadrangle_Parameters_1.SetQuadType( smeshBuilder.QUAD_REDUCED )
41 isDone = Mesh_1.Compute()