Salome HOME
Create LICENSE
[plugins/hexoticplugin.git] / doc / salome / examples / hexoticsubdom4.py
1 import salome
2 salome.salome_init()
3
4 from salome.geom import geomBuilder
5 geompy = geomBuilder.New()
6
7 from salome.smesh import smeshBuilder
8 smesh =  smeshBuilder.New()
9
10 # Create geometry: a box cut by a plane
11 Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200)
12 Translation_1 = geompy.MakeTranslation(Box_1, 0, 200, 0)
13 Partition_1 = geompy.MakePartition([Box_1, Translation_1])
14 geompy.addToStudy( Box_1, 'Box_1' )
15 geompy.addToStudy( Translation_1, 'Translation_1' )
16 geompy.addToStudy( Partition_1, 'Partition_1' )
17
18 # Create mesh of Partition_1 with sd mode 4 (default sd mode in SALOME)
19 Mesh_mghexa_sd4 = smesh.Mesh(Partition_1, "Mesh_mghexa_sd4")
20 Mesh_mghexa_sd4.Triangle(smeshBuilder.MG_CADSurf)
21 Mesh_mghexa_sd4.Hexahedron(smeshBuilder.MG_Hexa).SetMinMaxHexes(4, 8).SetHexoticSdMode( 4 )
22
23 # Compute
24 assert Mesh_mghexa_sd4.Compute(), "Meshing fails"
25
26 # End of script