Salome HOME
743b8912880dfdf1e0c539dc65c8d22b40cfac65
[modules/smesh.git] / doc / salome / gui / SMESH / viewing_meshes.htm
1 <!doctype HTML public "-//W3C//DTD HTML 4.0 Frameset//EN">
2
3 <html>
4
5 <head>
6 <title>Viewing Meshes</title>
7 <meta http-equiv="content-type" content="text/html; charset=windows-1252">
8 <meta name="generator" content="RoboHelp by eHelp Corporation www.ehelp.com"><style type="text/css">
9 <!--
10 p.whs1 { font-family:'Lucida Console' , monospace; margin-top:0pt; margin-bottom:0pt; }
11 p.whs2 { margin-top:0pt; margin-bottom:0pt; font-family:'Times New Roman' , serif; }
12 -->
13 </style><script type="text/javascript" language="JavaScript">
14 <!--
15 if ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) == 4))
16 {
17   var strNSS = "<style type='text/css'>";
18   strNSS += "p.whs1 {margin-top:1pt;margin-bottom:1pt; }";
19   strNSS += "p.whs2 {margin-top:1pt;margin-bottom:1pt; }";
20   strNSS +="</style>";
21   document.write(strNSS);
22 }
23 //-->
24 </script>
25 <script type="text/javascript" language="JavaScript" title="WebHelpInlineScript">
26 <!--
27 function reDo() {
28   if (innerWidth != origWidth || innerHeight != origHeight)
29      location.reload();
30 }
31 if ((parseInt(navigator.appVersion) == 4) && (navigator.appName == "Netscape")) {
32         origWidth = innerWidth;
33         origHeight = innerHeight;
34         onresize = reDo;
35 }
36 onerror = null; 
37 //-->
38 </script>
39 <style type="text/css">
40 <!--
41 div.WebHelpPopupMenu { position:absolute; left:0px; top:0px; z-index:4; visibility:hidden; }
42 p.WebHelpNavBar { text-align:right; }
43 -->
44 </style><script type="text/javascript" language="javascript1.2" src="whmsg.js"></script>
45 <script type="text/javascript" language="javascript" src="whver.js"></script>
46 <script type="text/javascript" language="javascript1.2" src="whproxy.js"></script>
47 <script type="text/javascript" language="javascript1.2" src="whutils.js"></script>
48 <script type="text/javascript" language="javascript1.2" src="whtopic.js"></script>
49 <script type="text/javascript" language="javascript1.2">
50 <!--
51 if (window.gbWhTopic)
52 {
53         if (window.setRelStartPage)
54         {
55         addTocInfo("MESH module\nTUI Scripts\nViewing Meshes");
56 addButton("show",BTN_IMG,"Show","","","","",0,0,"whd_show0.gif","whd_show2.gif","whd_show1.gif");
57 addButton("hide",BTN_IMG,"Hide","","","","",0,0,"whd_hide0.gif","whd_hide2.gif","whd_hide1.gif");
58
59         }
60
61
62         if (window.setRelStartPage)
63         {
64         setRelStartPage("index.htm");
65
66                 autoSync(1);
67                 sendSyncInfo();
68                 sendAveInfoOut();
69         }
70
71 }
72 else
73         if (window.gbIE4)
74                 document.location.reload();
75 //-->
76 </script>
77 </head>
78 <body><script type="text/javascript" language="javascript1.2">
79 <!--
80 if (window.writeIntopicBar)
81         writeIntopicBar(4);
82 //-->
83 </script>
84 <h1>Viewing Meshes</h1>
85
86 <h3>Viewing Mesh Infos</h3>
87
88 <p class="whs1"><span style="font-family: 'Lucida Console', monospace;">import 
89  geompy</span></p>
90
91 <p class="whs1">import smesh</p>
92
93 <p class="whs1">&nbsp;</p>
94
95 <p class="whs2"># create a box</p>
96
97 <p class="whs1">box = geompy.MakeBox(0., 0., 0., 20., 
98  20., 20.)</p>
99
100 <p class="whs1">geompy.addToStudy(box, &quot;box&quot;)</p>
101
102 <p class="whs1">&nbsp;</p>
103
104 <p class="whs2"># create a mesh</p>
105
106 <p class="whs1">tetra = smesh.Mesh(box, &quot;MeshBox&quot;)</p>
107
108 <p class="whs1">&nbsp;</p>
109
110 <p class="whs1">algo1D = tetra.Segment()</p>
111
112 <p class="whs1">algo1D.NumberOfSegments(3)</p>
113
114 <p class="whs1">&nbsp;</p>
115
116 <p class="whs1">algo2D = tetra.Triangle()</p>
117
118 <p class="whs1">algo2D.MaxElementArea(10.)</p>
119
120 <p class="whs1">&nbsp;</p>
121
122 <p class="whs1">algo3D = tetra.Tetrahedron(smesh.NETGEN)</p>
123
124 <p class="whs1">algo3D.MaxElementVolume(900.)</p>
125
126 <p class="whs1">&nbsp;</p>
127
128 <p class="whs2"># compute the mesh</p>
129
130 <p class="whs1">tetra.Compute()</p>
131
132 <p class="whs1">&nbsp;</p>
133
134 <p class="whs2"># print informations 
135  about the mesh</p>
136
137 <p class="whs1">mesh = tetra.GetMesh()</p>
138
139 <p class="whs1">print &quot;Information about mesh:&quot;</p>
140
141 <p class="whs1">print &quot;Number of nodes &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: 
142  &quot;, mesh.NbNodes()</p>
143
144 <p class="whs1">print &quot;Number of edges &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: 
145  &quot;, mesh.NbEdges()</p>
146
147 <p class="whs1">print &quot;Number of faces &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: 
148  &quot;, mesh.NbFaces()</p>
149
150 <p class="whs1">print &quot; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;triangles 
151  &nbsp;&nbsp;: 
152  &quot;, mesh.NbTriangles()</p>
153
154 <p class="whs1">print &quot; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;quadrangles 
155  : &quot;, mesh.NbQuadrangles()</p>
156
157 <p class="whs1">print &quot; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;polygons 
158  &nbsp;&nbsp;&nbsp;: 
159  &quot;, mesh.NbPolygons()</p>
160
161 <p class="whs1">print &quot;Number of volumes &nbsp;&nbsp;&nbsp;&nbsp;: 
162  &quot;, mesh.NbVolumes()</p>
163
164 <p class="whs1">print &quot; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tetrahedrons: 
165  &quot;, mesh.NbTetras()</p>
166
167 <p class="whs1">print &quot; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;hexahedrons 
168  : &quot;, mesh.NbHexas()</p>
169
170 <p class="whs1">print &quot; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;prisms 
171  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: 
172  &quot;, mesh.NbPrisms()</p>
173
174 <p class="whs1">print &quot; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pyramids 
175  &nbsp;&nbsp;&nbsp;: 
176  &quot;, mesh.NbPyramids()</p>
177
178 <p class="whs1">print &quot; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;polyhedrons 
179  : &quot;, mesh.NbPolyhedrons() </p>
180
181 <script type="text/javascript" language="javascript1.2">
182 <!--
183 if (window.writeIntopicBar)
184         writeIntopicBar(0);
185 //-->
186 </script>
187 </body>
188 </html>