Version: 8.3.0
 All Classes Namespaces Files Functions Variables Pages
Python Interface

Python package HYBRIDPluginBuilder defines several classes, destined for creation of the 3D meshes.

HYBRID meshing plugin dynamically adds several methods to the smeshBuilder.Mesh class to create meshing algorithms.

Below you can see an example of usage of the HYBRIDPluginBuilder Python API for mesh generation:

  1. Construction of Mesh using MG-Hybrid algorithm

Construction of Mesh using MG-Hybrid algorithm

Example of mesh generation with HYBRID algorithm:

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 # create a box
13 box = geompy.MakeBoxDXDYDZ(200., 200., 200.)
14 geompy.addToStudy(box, "box")
15 
16 # create a mesh on the box
17 hybridMesh = smesh.Mesh(box,"box: MG-Hybrid and BLSurf mesh")
18 
19 # create a BLSurf algorithm for faces
20 BLSURF = hybridMesh.Triangle(algo=smeshBuilder.BLSURF)
21 HYBRID = hybridMesh.Tetrahedron(algo=smeshBuilder.HYBRID)
22 
23 # compute the mesh
24 hybridMesh.Compute()
25 
26 # End of script
27 

Download this script

Back to top