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:
import salome
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
smesh = smeshBuilder.New()
box = geompy.MakeBoxDXDYDZ(10., 10., 10.)
geompy.addToStudy(box, "Box")
triaN = smesh.Mesh(box, "Box : triangular mesh by NETGEN_1D2D")
algo2D = triaN.Triangle(smeshBuilder.NETGEN_1D2D)
n12_params = algo2D.Parameters()
n12_params.SetNbSegPerEdge(19)
n12_params.SetMaxSize(300)
tetraN = smesh.Mesh(box, "Box : tetrahedrical mesh by NETGEN_1D2D3D")
algo3D = tetraN.Tetrahedron(smeshBuilder.FULL_NETGEN)
n123_params = algo3D.Parameters()
n123_params.SetNbSegPerEdge(11)
n123_params.SetMaxSize(300)
triaN.Compute()
tetraN.Compute()
Download this script