4 from salome.geom import geomBuilder
5 geompy = geomBuilder.New()
7 from salome.smesh import smeshBuilder
8 smesh = smeshBuilder.New()
12 sphere = geompy.MakeSphereR(100.)
13 geompy.addToStudy(sphere, "sphere")
15 # create a mesh on the sphere
16 mghexaMesh = smesh.Mesh(sphere,"sphere: MG-CADSurf and MG-Hexa mesh")
18 # create a MG-CADSurf algorithm for faces
19 MG_CADSurf = mghexaMesh.Triangle(algo=smeshBuilder.MG_CADSurf)
20 MG_CADSurf.SetGeometricMesh( 1 )
22 # create a MG-Hexa algorithm for volumes
23 MG_Hexa = mghexaMesh.Hexahedron(algo=smeshBuilder.MG_Hexa)
28 # Change the level of subdivision
29 MG_Hexa.SetMinMaxHexes(4, 8)
37 faces = geompy.SubShapeAll(sphere, geompy.ShapeType["FACE"])
39 # Set a local size on the face
40 MG_Hexa.SetMinMaxSize(10, 20)
41 MG_Hexa.SetSizeMap(faces[0], 10)