Salome HOME
Merge from V6_main (04/10/2012)
[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 NETGENPluginDC defines several classes, destined for
6 creation of the 2D and 3D meshes.
7
8 NETGEN meshing plugin dynamically adds several methods to the
9 smesh.Mesh class to create meshing algorithms.
10
11 Below you can see an example of usage of the NETGENPlugin package for mesh generation:
12
13 \code
14
15 import geompy
16 import smesh
17
18 # create a box
19 box = geompy.MakeBoxDXDYDZ(10., 10., 10.)
20 geompy.addToStudy(box, "Box")
21
22
23 # 1. Create a triangular 2D mesh on the box with NETGEN_1D2D algorithm
24 triaN = smesh.Mesh(box, "Box : triangular mesh by NETGEN_1D2D")
25
26 # create a Netgen_1D2D algorithm for solids
27 algo2D = triaN.Triangle(smesh.NETGEN_1D2D)
28
29 # define hypotheses
30 n12_params = algo2D.Parameters()
31
32 # define number of segments
33 n12_params.SetNbSegPerEdge(19)
34
35 # define max element
36 n12_params.SetMaxSize(300)
37
38 # 2. Create a tetrahedral mesh on the box with NETGEN_1D2D3D algorithm (full netgen)
39 tetraN = smesh.Mesh(box, "Box : tetrahedrical mesh by NETGEN_1D2D3D")
40
41 # create a Netgen_1D2D3D algorithm for solids
42 algo3D = tetraN.Tetrahedron(smesh.FULL_NETGEN)
43
44 # define hypotheses
45 n123_params = algo3D.Parameters()
46
47 # define number of segments
48 n123_params.SetNbSegPerEdge(11)
49
50 # define max element size
51 n123_params.SetMaxSize(300)
52
53 # compute the meshes
54 triaN.Compute()
55 tetraN.Compute()
56
57 \endcode
58
59 */
60
61