Salome HOME
Porting GUI documentation on Doxygen tool.
[modules/smesh.git] / doc / salome / gui / SMESH / transforming_meshes.htm
1 <!doctype HTML public "-//W3C//DTD HTML 4.0 Frameset//EN">
2
3 <html>
4
5 <head>
6 <title>Transforming 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 h3.whs1 { margin-top:0pt; margin-bottom:0pt; }
11 h4.whs2 { margin-top:0pt; margin-bottom:0pt; }
12 p.whs3 { font-family:'Lucida Console' , monospace; margin-top:0pt; margin-bottom:0pt; }
13 p.whs4 { margin-top:0pt; margin-bottom:0pt; font-family:'Lucida Console' , monospace; }
14 p.whs5 { margin-top:0pt; margin-bottom:0pt; font-family:'Times New Roman' , serif; }
15 p.whs6 { margin-top:0pt; margin-bottom:0pt; }
16 -->
17 </style><script type="text/javascript" language="JavaScript">
18 <!--
19 if ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) == 4))
20 {
21   var strNSS = "<style type='text/css'>";
22   strNSS += "h3.whs1 {margin-top:1pt;margin-bottom:1pt; }";
23   strNSS += "h4.whs2 {margin-top:1pt;margin-bottom:1pt; }";
24   strNSS += "p.whs3 {margin-top:1pt;margin-bottom:1pt; }";
25   strNSS += "p.whs4 {margin-top:1pt;margin-bottom:1pt; }";
26   strNSS += "p.whs5 {margin-top:1pt;margin-bottom:1pt; }";
27   strNSS += "p.whs6 {margin-top:1pt;margin-bottom:1pt; }";
28   strNSS +="</style>";
29   document.write(strNSS);
30 }
31 //-->
32 </script>
33 <script type="text/javascript" language="JavaScript" title="WebHelpInlineScript">
34 <!--
35 function reDo() {
36   if (innerWidth != origWidth || innerHeight != origHeight)
37      location.reload();
38 }
39 if ((parseInt(navigator.appVersion) == 4) && (navigator.appName == "Netscape")) {
40         origWidth = innerWidth;
41         origHeight = innerHeight;
42         onresize = reDo;
43 }
44 onerror = null; 
45 //-->
46 </script>
47 <style type="text/css">
48 <!--
49 div.WebHelpPopupMenu { position:absolute; left:0px; top:0px; z-index:4; visibility:hidden; }
50 p.WebHelpNavBar { text-align:right; }
51 -->
52 </style><script type="text/javascript" language="javascript1.2" src="whmsg.js"></script>
53 <script type="text/javascript" language="javascript" src="whver.js"></script>
54 <script type="text/javascript" language="javascript1.2" src="whproxy.js"></script>
55 <script type="text/javascript" language="javascript1.2" src="whutils.js"></script>
56 <script type="text/javascript" language="javascript1.2" src="whtopic.js"></script>
57 <script type="text/javascript" language="javascript1.2">
58 <!--
59 if (window.gbWhTopic)
60 {
61         if (window.setRelStartPage)
62         {
63         addTocInfo("MESH module\nTUI Scripts\nTransforming Meshes");
64 addButton("show",BTN_IMG,"Show","","","","",0,0,"whd_show0.gif","whd_show2.gif","whd_show1.gif");
65 addButton("hide",BTN_IMG,"Hide","","","","",0,0,"whd_hide0.gif","whd_hide2.gif","whd_hide1.gif");
66
67         }
68
69
70         if (window.setRelStartPage)
71         {
72         setRelStartPage("index.htm");
73
74                 autoSync(1);
75                 sendSyncInfo();
76                 sendAveInfoOut();
77         }
78
79 }
80 else
81         if (window.gbIE4)
82                 document.location.reload();
83 //-->
84 </script>
85 </head>
86 <body><script type="text/javascript" language="javascript1.2">
87 <!--
88 if (window.writeIntopicBar)
89         writeIntopicBar(4);
90 //-->
91 </script>
92 <h1>Transforming Meshes</h1>
93
94 <h3 class="whs1">Transforming Meshes</h3>
95
96 <h4 class="whs2">&nbsp;</h4>
97
98 <h4 class="whs2"><a name=bookmark>Translation</a></h4>
99
100 <p class="whs3">&nbsp;</p>
101
102 <p class="whs4">import SMESH_mechanic</p>
103
104 <p class="whs4">&nbsp;</p>
105
106 <p class="whs4"><span style="font-family: 'Lucida Console', monospace;">smesh 
107  = SMESH_mechanic.smesh </span></p>
108
109 <p class="whs4">mesh = SMESH_mechanic.mesh 
110  </p>
111
112 <p class="whs4">&nbsp;</p>
113
114 <p class="whs5"># define translation 
115  vector</p>
116
117 <p class="whs4"><span style="font-family: 'Lucida Console', monospace;">point 
118  = smesh.PointStruct(-150., -150., 0.)</span></p>
119
120 <p class="whs4">vector =smesh.DirStruct(point) 
121  </p>
122
123 <p class="whs4">&nbsp;</p>
124
125 <p class="whs5"># translate a mesh</p>
126
127 <p class="whs4">doCopy = 1</p>
128
129 <p class="whs4">&nbsp;</p>
130
131 <p class="whs4">mesh.Translate([], 
132  vector, doCopy) &nbsp;</p>
133
134 <p class="whs6">&nbsp;</p>
135
136 <h4 class="whs2"><a name=bookmark1>Rotation</a></h4>
137
138 <p class="whs3">&nbsp;</p>
139
140 <p class="whs3">import math</p>
141
142 <p class="whs3">import SMESH_mechanic</p>
143
144 <p class="whs3">&nbsp;</p>
145
146 <p class="whs3"><span style="font-family: 'Lucida Console', monospace;">smesh 
147  = SMESH_mechanic.smesh</span></p>
148
149 <p class="whs3">mesh = SMESH_mechanic.mesh </p>
150
151 <p class="whs3">&nbsp;</p>
152
153 <p class="whs5"># define rotation axis 
154  and angle</p>
155
156 <p class="whs3">axisXYZ = smesh.AxisStruct(0., 0., 0., 
157  5., 5., 20.)</p>
158
159 <p class="whs3">angle270 = 1.5 * math.pi</p>
160
161 <p class="whs3">&nbsp;</p>
162
163 <p class="whs5"># rotate a mesh</p>
164
165 <p class="whs4">mesh.Rotate([], 
166  axisXYZ, angle270, 1) &nbsp;</p>
167
168 <p class="whs6">&nbsp;</p>
169
170 <h4 class="whs2"><a name=bookmark2>Symmetry</a></h4>
171
172 <p class="whs3">&nbsp;</p>
173
174 <p class="whs3">import math</p>
175
176 <p class="whs3">&nbsp;</p>
177
178 <p class="whs3">import SMESH_mechanic</p>
179
180 <p class="whs3">&nbsp;</p>
181
182 <p class="whs3"><span style="font-family: 'Lucida Console', monospace;">smesh 
183  = SMESH_mechanic.smesh</span></p>
184
185 <p class="whs3">mesh = SMESH_mechanic.mesh </p>
186
187 <p class="whs3">&nbsp;</p>
188
189 <p class="whs5"># create a symmetrical 
190  copy of the mesh mirrored through a point</p>
191
192 <p class="whs3">axis = SMESH.AxisStruct(0, 0, 0, 0, 0, 
193  0)</p>
194
195 <p class="whs3">&nbsp;</p>
196
197 <p class="whs3">mesh.Mirror([], axis, smesh.POINT, 1) 
198  </p>
199
200 <p class="whs6">&nbsp;</p>
201
202 <h4 class="whs2"><a name=bookmark3>Merging 
203  Nodes</a></h4>
204
205 <p class="whs3">&nbsp;</p>
206
207 <p class="whs4">import SMESH_mechanic</p>
208
209 <p class="whs4">mesh = SMESH_mechanic.mesh</p>
210
211 <p class="whs4">&nbsp;</p>
212
213 <p class="whs5"># merge nodes</p>
214
215 <p class="whs4">Tolerance = 25.0</p>
216
217 <p class="whs4">&nbsp;</p>
218
219 <p class="whs4">GroupsOfNodes = 
220  &nbsp;mesh.FindCoincidentNodes(Tolerance)</p>
221
222 <p class="whs4">mesh.MergeNodes(GroupsOfNodes) 
223  &nbsp;</p>
224
225 <p class="whs6">&nbsp;</p>
226
227 <h4><a name=bookmark8>Merging Elements</a></h4>
228
229 <p class="whs4">import salome</p>
230
231 <p class="whs4">import geompy</p>
232
233 <p class="whs4">import smesh</p>
234
235 <p class="whs4">&nbsp;</p>
236
237 <p class="whs5"># create a face to 
238  be meshed</p>
239
240 <p class="whs4">px = geompy.MakeVertex(100., 
241  0. &nbsp;, 0. 
242  &nbsp;)</p>
243
244 <p class="whs4">py = geompy.MakeVertex(0. 
245  &nbsp;, 100., 
246  0. &nbsp;)</p>
247
248 <p class="whs4">pz = geompy.MakeVertex(0. 
249  &nbsp;, 0. &nbsp;, 
250  100.)</p>
251
252 <p class="whs4">&nbsp;</p>
253
254 <p class="whs4">vxy = geompy.MakeVector(px, 
255  py)</p>
256
257 <p class="whs4">arc = geompy.MakeArc(py, 
258  pz, px)</p>
259
260 <p class="whs4">&nbsp;</p>
261
262 <p class="whs4">wire = geompy.MakeWire([vxy, 
263  arc])</p>
264
265 <p class="whs4">isPlanarFace = 1</p>
266
267 <p class="whs4">&nbsp;</p>
268
269 <p class="whs4">face1 = geompy.MakeFace(wire, 
270  isPlanarFace)</p>
271
272 <p class="whs4">id_face1 = geompy.addToStudy(face1, 
273  &quot;Face1&quot;)</p>
274
275 <p class="whs4">&nbsp;</p>
276
277 <p class="whs5"># create a circle to 
278  be an extrusion path</p>
279
280 <p class="whs4">px1 = geompy.MakeVertex( 
281  100., &nbsp;100., 
282  &nbsp;0.)</p>
283
284 <p class="whs4">py1 = geompy.MakeVertex(-100., 
285  -100., &nbsp;0.)</p>
286
287 <p class="whs4">pz1 = geompy.MakeVertex( 
288  &nbsp;&nbsp;0., 
289  &nbsp;&nbsp;&nbsp;0., 
290  50.)</p>
291
292 <p class="whs4">&nbsp;</p>
293
294 <p class="whs4">circle = geompy.MakeCircleThreePnt(py1, 
295  pz1, px1)</p>
296
297 <p class="whs4">id_circle = geompy.addToStudy(circle, 
298  &quot;Path&quot;)</p>
299
300 <p class="whs4">&nbsp;</p>
301
302 <p class="whs5"># create a 2D mesh 
303  on the face</p>
304
305 <p class="whs4">trias = smesh.Mesh(face1, 
306  &quot;Face : 2D mesh&quot;)</p>
307
308 <p class="whs4">&nbsp;</p>
309
310 <p class="whs4">algo1D = trias.Segment()</p>
311
312 <p class="whs4">algo1D.NumberOfSegments(6)</p>
313
314 <p class="whs4">algo2D = trias.Triangle()</p>
315
316 <p class="whs4">algo2D.LengthFromEdges()</p>
317
318 <p class="whs4">&nbsp;</p>
319
320 <p class="whs4">trias.Compute()</p>
321
322 <p class="whs5">&nbsp;</p>
323
324 <p class="whs5"># create a path mesh</p>
325
326 <p class="whs4">circlemesh = smesh.Mesh(circle, 
327  &quot;Path mesh&quot;)</p>
328
329 <p class="whs4">algo = circlemesh.Segment()</p>
330
331 <p class="whs4">algo.NumberOfSegments(10)</p>
332
333 <p class="whs4">circlemesh.Compute()</p>
334
335 <p class="whs5">&nbsp;</p>
336
337 <p class="whs5"># extrusion of the 
338  mesh</p>
339
340 <p class="whs4"><span style="font-family: 'Lucida Console', monospace;">trias.ExtrusionAlongPath([], 
341  circlemesh, circle,</span></p>
342
343 <p class="whs4">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1, 
344  0, [], 0, smesh.PointStruct(0, 0, 0))</p>
345
346 <p class="whs4">&nbsp;</p>
347
348 <p class="whs5"># merge nodes</p>
349
350 <p class="whs4">print &quot;Number 
351  of nodes before MergeNodes:&quot;, </p>
352
353 <p class="whs4">trias.NbNodes()</p>
354
355 <p class="whs4">tolerance = 0.001</p>
356
357 <p class="whs4">array_of_nodes_groups 
358  = trias.FindCoincidentNodes(tolerance)</p>
359
360 <p class="whs4">&nbsp;</p>
361
362 <p class="whs4">trias.MergeNodes(array_of_nodes_groups)</p>
363
364 <p class="whs4">&nbsp;</p>
365
366 <p class="whs4">print &quot;Number 
367  of nodes after MergeNodes:&quot;, trias.NbNodes()</p>
368
369 <p class="whs4">print &quot;&quot;</p>
370
371 <p class="whs4">print &quot;Number 
372  of elements before MergeEqualElements:&quot;</p>
373
374 <p class="whs4">print &quot;Edges 
375  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: 
376  &quot;, trias.NbEdges()</p>
377
378 <p class="whs4">print &quot;Triangles 
379  &nbsp;: &quot;, 
380  trias.NbTriangles()</p>
381
382 <p class="whs4">print &quot;Quadrangles: 
383  &quot;, trias.NbQuadrangles()</p>
384
385 <p class="whs4">print &quot;Volumes 
386  &nbsp;&nbsp;&nbsp;: 
387  &quot;, trias.NbVolumes()</p>
388
389 <p class="whs4">&nbsp;</p>
390
391 <p class="whs5"># merge elements</p>
392
393 <p class="whs4">trias.MergeEqualElements()</p>
394
395 <p class="whs4">print &quot;Number 
396  of elements after MergeEqualElements:&quot;</p>
397
398 <p class="whs4">print &quot;Edges 
399  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: 
400  &quot;, trias.NbEdges()</p>
401
402 <p class="whs4">print &quot;Triangles 
403  &nbsp;: &quot;, 
404  trias.NbTriangles()</p>
405
406 <p class="whs4">print &quot;Quadrangles: 
407  &quot;, trias.NbQuadrangles()</p>
408
409 <p class="whs4">print &quot;Volumes 
410  &nbsp;&nbsp;&nbsp;: 
411  &quot;, trias.NbVolumes()</p>
412
413 <p class="whs4">&nbsp;</p>
414
415 <p class="whs4">salome.sg.updateObjBrowser(1) 
416  </p>
417
418 <p class="whs4">&nbsp;</p>
419
420 <h3>Sewing Meshes</h3>
421
422 <h4><a name=bookmark4>Sew Meshes Border to Border</a></h4>
423
424 <p class="whs4">import geompy</p>
425
426 <p class="whs4">import smesh</p>
427
428 <p class="whs4">&nbsp;</p>
429
430 <p class="whs5"># create two faces 
431  of a box</p>
432
433 <p class="whs4">box1 = geompy.MakeBox(0., 
434  0., -10., 30., 20., 25.)</p>
435
436 <p class="whs4">facesList1 = geompy.SubShapeAll(box1, 
437  geompy.ShapeType[&quot;FACE&quot;])</p>
438
439 <p class="whs4">face1 = facesList1[2]</p>
440
441 <p class="whs4">&nbsp;</p>
442
443 <p class="whs4">box2 = geompy.MakeBox(0., 
444  5., 0., 20., 20., 15.)</p>
445
446 <p class="whs4">facesList2 = geompy.SubShapeAll(box2, 
447  geompy.ShapeType[&quot;FACE&quot;])</p>
448
449 <p class="whs4">face2 = facesList2[1]</p>
450
451 <p class="whs4">&nbsp;</p>
452
453 <p class="whs4">edgesList = geompy.SubShapeAll(face2, 
454  geompy.ShapeType[&quot;EDGE&quot;])</p>
455
456 <p class="whs4">edge1 = edgesList[2]</p>
457
458 <p class="whs4">&nbsp;</p>
459
460 <p class="whs4">aComp = geompy.MakeCompound([face1, 
461  face2])</p>
462
463 <p class="whs4">geompy.addToStudy(aComp, 
464  &quot;Two faces&quot;)</p>
465
466 <p class="whs4">&nbsp;</p>
467
468 <p class="whs5"># create a mesh on 
469  two faces</p>
470
471 <p class="whs4">mesh = smesh.Mesh(aComp, 
472  &quot;Two faces : quadrangle mesh&quot;)</p>
473
474 <p class="whs4">&nbsp;</p>
475
476 <p class="whs4">algo1D = mesh.Segment()</p>
477
478 <p class="whs4">algo1D.NumberOfSegments(9)</p>
479
480 <p class="whs4">algo2D = mesh.Quadrangle()</p>
481
482 <p class="whs4">&nbsp;</p>
483
484 <p class="whs4">algo_local = mesh.Segment(edge1)</p>
485
486 <p class="whs4">algo_local.Arithmetic1D(1, 
487  4)</p>
488
489 <p class="whs4">algo_local.Propagation()</p>
490
491 <p class="whs4">&nbsp;</p>
492
493 <p class="whs4">mesh.Compute()</p>
494
495 <p class="whs4">&nbsp;</p>
496
497 <p class="whs5"># sew border to side</p>
498
499 <p class="whs5"># FirstNodeIDOnFreeBorder, 
500  SecondNodeIDOnFreeBorder, LastNodeIDOnFreeBorder,</p>
501
502 <p class="whs5"># FirstNodeIDOnSide, 
503  LastNodeIDOnSide,</p>
504
505 <p class="whs5"># CreatePolygons, CreatePolyedrs</p>
506
507 <p class="whs4">mesh.SewBorderToSide(5, 
508  45, 6, 113, 109, 0, 0) </p>
509
510 <h4><a name=bookmark5>Sew Conform Free Borders</a></h4>
511
512 <p class="whs4">import geompy</p>
513
514 <p class="whs4">import smesh</p>
515
516 <p class="whs4">&nbsp;</p>
517
518 <p class="whs5"># create two faces 
519  of the box</p>
520
521 <p class="whs4">box1 = geompy.MakeBox(0., 
522  0., -10., 20., 20., 15.)</p>
523
524 <p class="whs4">facesList1 = geompy.SubShapeAll(box1, 
525  geompy.ShapeType[&quot;FACE&quot;])</p>
526
527 <p class="whs4">face1 = facesList1[2]</p>
528
529 <p class="whs4">&nbsp;</p>
530
531 <p class="whs4">box2 = geompy.MakeBox(0., 
532  5., 0., 20., 20., 15.)</p>
533
534 <p class="whs4">facesList2 = geompy.SubShapeAll(box2, 
535  geompy.ShapeType[&quot;FACE&quot;])</p>
536
537 <p class="whs4">face2 = facesList2[1]</p>
538
539 <p class="whs4">&nbsp;</p>
540
541 <p class="whs4">edgesList = geompy.SubShapeAll(face2, 
542  geompy.ShapeType[&quot;EDGE&quot;])</p>
543
544 <p class="whs4">edge1 = edgesList[2]</p>
545
546 <p class="whs4">&nbsp;</p>
547
548 <p class="whs4">aComp = geompy.MakeCompound([face1, 
549  face2])</p>
550
551 <p class="whs4">geompy.addToStudy(aComp, 
552  &quot;Two faces&quot;)</p>
553
554 <p class="whs4">&nbsp;</p>
555
556 <p class="whs5"># create a mesh on 
557  two faces</p>
558
559 <p class="whs4">mesh = smesh.Mesh(aComp, 
560  &quot;Two faces : quadrangle mesh&quot;)</p>
561
562 <p class="whs4">&nbsp;</p>
563
564 <p class="whs4">algo1D = mesh.Segment()</p>
565
566 <p class="whs4">algo1D.NumberOfSegments(9)</p>
567
568 <p class="whs4">algo2D = mesh.Quadrangle()</p>
569
570 <p class="whs4">&nbsp;</p>
571
572 <p class="whs4">algo_local = mesh.Segment(edge1)</p>
573
574 <p class="whs4">algo_local.Arithmetic1D(1, 
575  4)</p>
576
577 <p class="whs4">algo_local.Propagation()</p>
578
579 <p class="whs4">&nbsp;</p>
580
581 <p class="whs4">mesh.Compute()</p>
582
583 <p class="whs4">&nbsp;</p>
584
585 <p class="whs5"># sew conform free 
586  borders</p>
587
588 <p class="whs5"># FirstNodeID1, SecondNodeID1, 
589  LastNodeID1, FirstNodeID2, SecondNodeID2</p>
590
591 <p class="whs4">mesh.SewConformFreeBorders(5, 
592  45, 6, 3, 24) &nbsp;</p>
593
594 <h4><a name=bookmark6>Sew Free Borders</a></h4>
595
596 <p class="whs4">import geompy</p>
597
598 <p class="whs4">import smesh</p>
599
600 <p class="whs4">&nbsp;</p>
601
602 <p class="whs5"># create two faces 
603  of the box</p>
604
605 <p class="whs4">box1 = geompy.MakeBox(0., 
606  0., 0., 20., 20., 15.)</p>
607
608 <p class="whs4">facesList1 = geompy.SubShapeAll(box1, 
609  geompy.ShapeType[&quot;FACE&quot;])</p>
610
611 <p class="whs4">face1 = facesList1[2]</p>
612
613 <p class="whs4">&nbsp;</p>
614
615 <p class="whs4">box2 = geompy.MakeBox(0., 
616  5., 0., 20., 20., 15.)</p>
617
618 <p class="whs4">facesList2 = geompy.SubShapeAll(box2, 
619  geompy.ShapeType[&quot;FACE&quot;])</p>
620
621 <p class="whs4">face2 = facesList2[1]</p>
622
623 <p class="whs4">&nbsp;</p>
624
625 <p class="whs4">edgesList = geompy.SubShapeAll(face2, 
626  geompy.ShapeType[&quot;EDGE&quot;])</p>
627
628 <p class="whs4">edge1 = edgesList[2]</p>
629
630 <p class="whs4">&nbsp;</p>
631
632 <p class="whs4">aComp = geompy.MakeCompound([face1, 
633  face2])</p>
634
635 <p class="whs4">geompy.addToStudy(aComp, 
636  &quot;Two faces&quot;)</p>
637
638 <p class="whs4">&nbsp;</p>
639
640 <p class="whs5"># create a mesh on 
641  two faces</p>
642
643 <p class="whs4">mesh = smesh.Mesh(aComp, 
644  &quot;Two faces : quadrangle mesh&quot;)</p>
645
646 <p class="whs4">&nbsp;</p>
647
648 <p class="whs4">algo1D = mesh.Segment()</p>
649
650 <p class="whs4">algo1D.NumberOfSegments(4)</p>
651
652 <p class="whs4">algo2D = mesh.Quadrangle()</p>
653
654 <p class="whs4">&nbsp;</p>
655
656 <p class="whs4">algo_local = mesh.Segment(edge1)</p>
657
658 <p class="whs4">algo_local.Arithmetic1D(1, 
659  4)</p>
660
661 <p class="whs4">algo_local.Propagation()</p>
662
663 <p class="whs4">&nbsp;</p>
664
665 <p class="whs4">mesh.Compute()</p>
666
667 <p class="whs4">&nbsp;</p>
668
669 <p class="whs5"># sew free borders</p>
670
671 <p class="whs5"># FirstNodeID1, SecondNodeID1, 
672  LastNodeID1,</p>
673
674 <p class="whs5"># FirstNodeID2, SecondNodeID2, 
675  LastNodeID2, CreatePolygons, CreatePolyedrs</p>
676
677 <p class="whs6">mesh.SewFreeBorders(6, 
678  21, 5, 1, 12, 3, 0, 0) </p>
679
680 <h4><a name=bookmark7>Sew Side Elements</a></h4>
681
682 <p class="whs4">import geompy</p>
683
684 <p class="whs4">import smesh</p>
685
686 <p class="whs4">&nbsp;</p>
687
688 <p class="whs5"># create two boxes</p>
689
690 <p class="whs4">box1 = geompy.MakeBox(0., 
691  &nbsp;0., 0., 
692  10., 10., 10.)</p>
693
694 <p class="whs4">box2 = geompy.MakeBox(0., 
695  15., 0., 20., 25., 10.)</p>
696
697 <p class="whs4">&nbsp;</p>
698
699 <p class="whs4">EdgesList = geompy.SubShapeAll(box2, 
700  geompy.ShapeType[&quot;EDGE&quot;])</p>
701
702 <p class="whs4">&nbsp;</p>
703
704 <p class="whs4">aComp = geompy.MakeCompound([box1, 
705  box2])</p>
706
707 <p class="whs4">geompy.addToStudy(aComp, 
708  &quot;Two boxes&quot;)</p>
709
710 <p class="whs4">&nbsp;</p>
711
712 <p class="whs5"># create a mesh on 
713  two boxes</p>
714
715 <p class="whs4">mesh = smesh.Mesh(aComp, 
716  &quot;Two faces : quadrangle mesh&quot;)</p>
717
718 <p class="whs4">&nbsp;</p>
719
720 <p class="whs4">algo1D = mesh.Segment()</p>
721
722 <p class="whs4">algo1D.NumberOfSegments(2)</p>
723
724 <p class="whs4">algo2D = mesh.Quadrangle()</p>
725
726 <p class="whs4">&nbsp;</p>
727
728 <p class="whs4">algo_local = mesh.Segment(EdgesList[8])</p>
729
730 <p class="whs4">algo_local.NumberOfSegments(4)</p>
731
732 <p class="whs4">algo_local.Propagation()</p>
733
734 <p class="whs4">&nbsp;</p>
735
736 <p class="whs4">mesh.Compute()</p>
737
738 <p class="whs4">&nbsp;</p>
739
740 <p class="whs5"># sew side elements</p>
741
742 <p class="whs5"># IDsOfSide1Elements, 
743  IDsOfSide2Elements,</p>
744
745 <p class="whs5"># NodeID1OfSide1ToMerge, 
746  NodeID1OfSide2ToMerge, NodeID2OfSide1ToMerge, NodeID2OfSide2ToMerge</p>
747
748 <p class="whs4">mesh.SewSideElements([69, 
749  70, 71, 72], [91, 92, 89, 90], 8, 38, 23, 58) </p>
750
751 <script type="text/javascript" language="javascript1.2">
752 <!--
753 if (window.writeIntopicBar)
754         writeIntopicBar(0);
755 //-->
756 </script>
757 </body>
758 </html>