]> SALOME platform Git repositories - modules/smesh.git/blob - doc/salome/examples/extrusion_penta_biquad.py
Salome HOME
Fix for issue '[EDF]: Broken links in the Developer's user guide in GEOM and SMESH'
[modules/smesh.git] / doc / salome / examples / extrusion_penta_biquad.py
1 # -*- coding: utf-8 -*-
2
3 import sys
4 import salome
5
6 salome.salome_init()
7
8 import GEOM
9 from salome.geom import geomBuilder
10 import math
11 import SALOMEDS
12
13 geompy = geomBuilder.New()
14
15 O = geompy.MakeVertex(0, 0, 0)
16 OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
17 OY = geompy.MakeVectorDXDYDZ(0, 1, 0)
18 OZ = geompy.MakeVectorDXDYDZ(0, 0, 1)
19 Divided_Disk_1 = geompy.MakeDividedDisk(100, 1, GEOM.SQUARE)
20 geompy.addToStudy( O, 'O' )
21 geompy.addToStudy( OX, 'OX' )
22 geompy.addToStudy( OY, 'OY' )
23 geompy.addToStudy( OZ, 'OZ' )
24 geompy.addToStudy( Divided_Disk_1, 'Divided Disk_1' )
25
26 import  SMESH, SALOMEDS
27 from salome.smesh import smeshBuilder
28
29 smesh = smeshBuilder.New()
30 aFilterManager = smesh.CreateFilterManager()
31 Mesh_1 = smesh.Mesh(Divided_Disk_1)
32 Regular_1D = Mesh_1.Segment()
33 Number_of_Segments_1 = Regular_1D.NumberOfSegments(6)
34 Quadrangle_2D = Mesh_1.Quadrangle(algo=smeshBuilder.QUADRANGLE)
35 isDone = Mesh_1.Compute()
36 aMaxElementLength2D0x5d7fdf0 = aFilterManager.CreateMaxElementLength2D()
37 isDone = Mesh_1.QuadToTriObject( Mesh_1,  )
38 Mesh_1.ExtrusionSweepObjects( [ Mesh_1 ], [ Mesh_1 ], [ Mesh_1 ], [ 0, 0, 50 ], 3, 1 )
39 Mesh_1.ConvertToQuadratic(0, Mesh_1,True)
40
41 infos = Mesh_1.GetMeshInfo()
42 print("Number of biquadratic pentahedrons:", infos[SMESH.Entity_BiQuad_Penta])
43 if (infos[SMESH.Entity_BiQuad_Penta] != 1080):
44   raise RuntimeError("Bad number of biquadratic pentahedrons: should be 1080")
45   
46 ## Set names of Mesh objects
47 smesh.SetName(Regular_1D.GetAlgorithm(), 'Regular_1D')
48 smesh.SetName(Quadrangle_2D.GetAlgorithm(), 'Quadrangle_2D')
49 smesh.SetName(Number_of_Segments_1, 'Number of Segments_1')
50 smesh.SetName(Mesh_1.GetMesh(), 'Mesh_1')
51
52
53 if salome.sg.hasDesktop():
54   salome.sg.updateObjBrowser()