Python package NETGENPluginBuilder defines several classes, destined for creation of the 2D and 3D meshes.
NETGEN meshing plugin dynamically adds several methods to the smeshBuilder.Mesh to create meshing algorithms.
Below you can see an example of usage of the NETGENPluginBuilder package for mesh generation:
Example of 2d and 3d mesh generation with NETGEN:
6 from salome.geom
import geomBuilder
7 geompy = geomBuilder.New(salome.myStudy)
10 from salome.smesh
import smeshBuilder
11 smesh = smeshBuilder.New(salome.myStudy)
14 box = geompy.MakeBoxDXDYDZ(10., 10., 10.)
15 geompy.addToStudy(box,
"Box")
19 triaN = smesh.Mesh(box,
"Box : triangular mesh by NETGEN_1D2D")
22 algo2D = triaN.Triangle(smeshBuilder.NETGEN_1D2D)
25 n12_params = algo2D.Parameters()
28 n12_params.SetNbSegPerEdge(19)
31 n12_params.SetMaxSize(300)
34 tetraN = smesh.Mesh(box,
"Box : tetrahedrical mesh by NETGEN_1D2D3D")
37 algo3D = tetraN.Tetrahedron(smeshBuilder.FULL_NETGEN)
40 n123_params = algo3D.Parameters()
43 n123_params.SetNbSegPerEdge(11)
46 n123_params.SetMaxSize(300)
Download this script