Salome HOME
Merge from V6_main_20120808 08Aug12
[plugins/netgenplugin.git] / doc / salome / gui / NETGENPLUGIN / input / netgenplugin_python_interface.doc
1 /*!
2
3 \page netgenplugin_python_interface_page Python Interface
4
5 Python package \ref NETGENPluginDC "NETGENPlugin" defines several classes, destined for creation of the 2D and 3D meshes.
6
7 Documentation for NETGENPlugin package is available in linear form grouped by classes, declared in the NETGENPluginDC.py file.
8
9 Below you can see an example of usage of the NETGENPlugin package for mesh generation:
10
11 \code
12
13 import geompy
14 import smesh
15
16 # create a box
17 box = geompy.MakeBoxDXDYDZ(10., 10., 10.)
18 geompy.addToStudy(box, "Box")
19
20
21 # 1. Create a triangular 2D mesh on the box with NETGEN_1D2D algorithm
22 triaN = smesh.Mesh(box, "Box : triangular mesh by NETGEN_1D2D")
23
24 # create a Netgen_1D2D algorithm for solids
25 algo2D = triaN.Triangle(smesh.NETGEN_1D2D)
26
27 # define hypotheses
28 n12_params = algo2D.Parameters()
29
30 # define number of segments
31 n12_params.SetNbSegPerEdge(19)
32
33 # define max element
34 n12_params.SetMaxSize(300)
35
36 # 2. Create a tetrahedral mesh on the box with NETGEN_1D2D3D algorithm (full netgen)
37 tetraN = smesh.Mesh(box, "Box : tetrahedrical mesh by NETGEN_1D2D3D")
38
39 # create a Netgen_1D2D3D algorithm for solids
40 algo3D = tetraN.Tetrahedron(smesh.FULL_NETGEN)
41
42 # define hypotheses
43 n123_params = algo3D.Parameters()
44
45 # define number of segments
46 n123_params.SetNbSegPerEdge(11)
47
48 # define max element size
49 n123_params.SetMaxSize(300)
50
51 # compute the meshes
52 triaN.Compute()
53 tetraN.Compute()
54
55 \endcode
56
57 */
58
59