Salome HOME
bf02fc8344c784d10ff467d4d50c8356f4013b38
[plugins/hexoticplugin.git] / doc / salome / examples / hexoticdemo.py
1
2 import salome
3 salome.salome_init()
4 import GEOM
5 from salome.geom import geomBuilder
6 geompy = geomBuilder.New(salome.myStudy)
7
8 import SMESH, SALOMEDS
9 from salome.smesh import smeshBuilder
10 smesh =  smeshBuilder.New(salome.myStudy)
11
12
13 # create a sphere
14 sphere = geompy.MakeSphereR(100.)
15 geompy.addToStudy(sphere, "sphere")
16
17 # create a mesh on the sphere
18 hexoticMesh = smesh.Mesh(sphere,"sphere: BLSurf and Hexotic mesh")
19
20 # create a BLSurf algorithm for faces
21 BLSURF = hexoticMesh.Triangle(algo=smeshBuilder.BLSURF)
22 BLSURF.SetGeometricMesh( 1 )
23
24 # create a Hexotic algorithm for volumes
25 HEXOTIC = hexoticMesh.Hexahedron(algo=smeshBuilder.Hexotic)
26
27 ## compute the mesh
28 #hexoticMesh.Compute()
29
30 # Change the level of subdivision
31 HEXOTIC.SetMinMaxHexes(4, 8)
32
33 ## compute the mesh
34 #hexoticMesh.Compute()
35
36 # Local size
37
38 # Get the sphere skin
39 faces = geompy.SubShapeAll(sphere, geompy.ShapeType["FACE"])
40
41 # Set a local size on the face
42 HEXOTIC.SetMinMaxSize(10, 20)
43 HEXOTIC.SetSizeMap(faces[0], 10)
44
45 # compute the mesh
46 hexoticMesh.Compute()
47
48 # End of script