6 from salome.geom import geomBuilder
7 geompy = geomBuilder.New()
10 from salome.smesh import smeshBuilder
11 smesh = smeshBuilder.New()
13 O = geompy.MakeVertex(0, 0, 0)
14 OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
15 OY = geompy.MakeVectorDXDYDZ(0, 1, 0)
16 OZ = geompy.MakeVectorDXDYDZ(0, 0, 1)
17 Sphere_1 = geompy.MakeSphereR(100)
18 geompy.addToStudy( O, 'O' )
19 geompy.addToStudy( OX, 'OX' )
20 geompy.addToStudy( OY, 'OY' )
21 geompy.addToStudy( OZ, 'OZ' )
22 geompy.addToStudy( Sphere_1, 'Sphere_1' )
24 Mesh_1 = smesh.Mesh(Sphere_1,'Mesh_1')
25 Cartesian_3D = Mesh_1.BodyFitted()
26 Body_Fitting_Parameters_1 = Cartesian_3D.SetGrid([ [ '34.641' ], [ 0, 1 ]],[ [ '34.641' ], [ 0, 1 ]],[ [ '34.641' ], [ 0, 1 ]],4,0)
27 Body_Fitting_Parameters_1.SetToUseQuanta( 1 )
28 Body_Fitting_Parameters_1.SetQuanta( 0.8 )
29 isDone = Mesh_1.Compute()
31 Polys = Mesh_1.NbPolyhedrons()
32 Hexas1 = Mesh_1.NbHexas()
34 #No polyhedrons in the mesh
37 Body_Fitting_Parameters_1.SetQuanta( 0.2 )
38 isDone = Mesh_1.Compute()
40 Polys = Mesh_1.NbPolyhedrons()
41 Hexas2 = Mesh_1.NbHexas()
43 #Still no polyhedrons in the mesh
46 #Numher of hexahedrons is bigger for hexas2 becuase quanta value is smaller
47 assert( Hexas1 < Hexas2 )
49 if salome.sg.hasDesktop():
50 salome.sg.updateObjBrowser()