<h4><a name=bookmark4>Maximum Element Area</a></h4>\r
\r
<p class="whs4"><span style="font-family: 'Lucida Console', monospace;">import \r
- smesh</span></p>\r
+ geompy</span></p>\r
+\r
+<p class="whs4">import smesh</p>\r
\r
-<p class="whs4">import salome</p>\r
+<p class="whs4">import salome </p>\r
\r
<p class="whs4"> </p>\r
\r
<p class="whs6"># create a Netgen_2D3D \r
algorithm for solids</p>\r
\r
-<p class="whs4">is3D = 1</p>\r
-\r
-<p class="whs4">algo3D = tetraN.Netgen(is3D)</p>\r
+<p class="whs4">algo3D = tetraN.Tetrahedron(smesh.FULL_NETGEN) \r
+ </p>\r
\r
<p class="whs6"> </p>\r
\r
<meta http-equiv="content-type" content="text/html; charset=windows-1252">\r
<meta name="generator" content="RoboHelp by eHelp Corporation www.ehelp.com"><style type="text/css">\r
<!--\r
-p.whs1 { margin-top:0pt; margin-bottom:0pt; font-weight:bold; color:#ff0000; }\r
-p.whs2 { margin-top:0pt; margin-bottom:0pt; }\r
-p.whs3 { margin-top:0pt; margin-bottom:0pt; font-family:'Lucida Console' , monospace; }\r
-p.whs4 { margin-top:0pt; margin-bottom:0pt; font-family:'Times New Roman' , serif; }\r
-img_whs5 { border:none; width:430px; height:391px; float:none; border-style:none; }\r
-p.whs6 { margin-top:0pt; margin-bottom:0pt; color:#ff0000; font-weight:bold; }\r
-img_whs7 { border:none; float:none; width:463px; height:417px; border-style:none; }\r
-img_whs8 { border:none; width:541px; height:417px; float:none; border-style:none; }\r
-img_whs9 { border:none; width:394px; height:425px; float:none; border-style:none; }\r
-img_whs10 { border:none; float:none; width:368px; height:379px; border-style:none; }\r
-img_whs11 { border:none; float:none; width:344px; height:381px; border-style:none; }\r
-img_whs12 { border:none; width:314px; height:351px; float:none; border-style:none; }\r
-img_whs13 { border:none; float:none; width:319px; height:351px; border-style:none; }\r
-img_whs14 { border:none; float:none; width:304px; height:352px; border-style:none; }\r
-img_whs15 { border:none; width:318px; height:355px; float:none; border-style:none; }\r
-img_whs16 { border:none; float:none; width:318px; height:355px; border-style:none; }\r
-img_whs17 { border:none; float:none; width:320px; height:354px; border-style:none; }\r
+p.whs1 { margin-top:0pt; margin-bottom:0pt; font-family:'Lucida Console' , monospace; }\r
+p.whs2 { margin-top:0pt; margin-bottom:0pt; font-family:'Times New Roman' , serif; }\r
+p.whs3 { margin-top:0pt; margin-bottom:0pt; }\r
+img_whs4 { border:none; width:430px; height:391px; float:none; border-style:none; }\r
+img_whs5 { border:none; float:none; width:463px; height:417px; border-style:none; }\r
+img_whs6 { border:none; width:541px; height:417px; float:none; border-style:none; }\r
+img_whs7 { border:none; width:394px; height:425px; float:none; border-style:none; }\r
+img_whs8 { border:none; float:none; width:368px; height:379px; border-style:none; }\r
+img_whs9 { border:none; float:none; width:344px; height:381px; border-style:none; }\r
+img_whs10 { border:none; width:314px; height:351px; float:none; border-style:none; }\r
+img_whs11 { border:none; float:none; width:319px; height:351px; border-style:none; }\r
+img_whs12 { border:none; float:none; width:304px; height:352px; border-style:none; }\r
+img_whs13 { border:none; width:318px; height:355px; float:none; border-style:none; }\r
+img_whs14 { border:none; float:none; width:318px; height:355px; border-style:none; }\r
+img_whs15 { border:none; float:none; width:320px; height:354px; border-style:none; }\r
-->\r
</style><script type="text/javascript" language="JavaScript">\r
<!--\r
strNSS += "p.whs1 {margin-top:1pt;margin-bottom:1pt; }";\r
strNSS += "p.whs2 {margin-top:1pt;margin-bottom:1pt; }";\r
strNSS += "p.whs3 {margin-top:1pt;margin-bottom:1pt; }";\r
- strNSS += "p.whs4 {margin-top:1pt;margin-bottom:1pt; }";\r
- strNSS += "p.whs6 {margin-top:1pt;margin-bottom:1pt; }";\r
strNSS +="</style>";\r
document.write(strNSS);\r
}\r
\r
<h3><a name=bookmark>Create a Standalone Group</a></h3>\r
\r
-<p class="whs1"># Attention! This script has been written \r
- using the old approach basing on direct usage of SMESH idl interface.</p>\r
+<p class="whs1">import SMESH_mechanic</p>\r
\r
-<p class="whs1"># For the moment smesh package doesn't provide \r
- methods to create a standalone group. </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs1"># In the next SALOME version the scripts will \r
- be updated to use only the commands from smesh package.</p>\r
-\r
-<p class="whs2"> </p>\r
-\r
-<p class="whs3">import SMESH</p>\r
-\r
-<p class="whs3">import SMESH_mechanic</p>\r
-\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs3">smesh = \r
+<p class="whs1">smesh = \r
SMESH_mechanic.smesh</p>\r
\r
-<p class="whs3">mesh = \r
+<p class="whs1">mesh = \r
SMESH_mechanic.mesh</p>\r
\r
-<p class="whs3">salome = SMESH_mechanic.salome</p>\r
+<p class="whs1">salome = SMESH_mechanic.salome</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs4"># Get ids of all faces \r
+<p class="whs2"># Get ids of all faces \r
with area > 100 </p>\r
\r
-<p class="whs3">aFilterMgr = smesh.CreateFilterManager()</p>\r
-\r
-<p class="whs3">aFunctor = aFilterMgr.CreateArea()</p>\r
-\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs3">aPredicate = aFilterMgr.CreateMoreThan()</p>\r
-\r
-<p class="whs3">aPredicate.SetNumFunctor( \r
- aFunctor )</p>\r
+<p class="whs1">aFilter = smesh.GetFilter(smesh.FACE, \r
+ smesh.FT_Area, smesh.FT_MoreThan, 100.)</p>\r
\r
-<p class="whs3">aPredicate.SetMargin( \r
- 100 )</p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs3">aFilter = aFilterMgr.CreateFilter()</p>\r
-\r
-<p class="whs3">aFilter.SetPredicate( \r
- aPredicate )</p>\r
-\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs3">anIds = aFilter.GetElementsId( \r
- mesh )</p>\r
-\r
-<p class="whs2"> </p>\r
+<p class="whs1">anIds = mesh.GetIdsFromFilter(aFilter) \r
+ </p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs2"># create a group consisting \r
+<p class="whs3"># create a group consisting \r
of faces with area > 100</p>\r
\r
-<p class="whs3">aGroup = mesh.CreateGroup( \r
- SMESH.FACE, "Area > 100" )</p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3">aGroup.Add( anIds \r
- )</p>\r
+<p class="whs1">aGroup = mesh.MakeGroupByIds("Area \r
+ > 100", smesh.FACE, anIds)</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs2"><span style="font-family: 'Lucida Console', monospace;">salome.sg.updateObjBrowser(1)</span> \r
+<p class="whs3"><span style="font-family: 'Lucida Console', monospace;">salome.sg.updateObjBrowser(1)</span> \r
</p>\r
\r
-<p class="whs2"> </p>\r
+<p class="whs3"> </p>\r
\r
-<p class="whs2"><img src="pics/create_group.png" x-maintain-ratio="TRUE" width="430px" height="391px" border="0" class="img_whs5"></p>\r
+<p class="whs3"><img src="pics/create_group.png" x-maintain-ratio="TRUE" width="430px" height="391px" border="0" class="img_whs4"></p>\r
\r
<h3><a name=bookmark5>Create a Group on Geometry</a></h3>\r
\r
-<p class="whs3">import salome</p>\r
+<p class="whs1">import salome</p>\r
\r
-<p class="whs3">import geompy</p>\r
+<p class="whs1">import geompy</p>\r
\r
-<p class="whs3">import smesh</p>\r
+<p class="whs1">import smesh</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs4"># create a box</p>\r
+<p class="whs2"># create a box</p>\r
\r
-<p class="whs3">box = geompy.MakeBox(0., \r
+<p class="whs1">box = geompy.MakeBox(0., \r
0., 0., 100., 100., 100.)</p>\r
\r
-<p class="whs3">geompy.addToStudy(box, \r
+<p class="whs1">geompy.addToStudy(box, \r
"box")</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs4"># add the first face \r
+<p class="whs2"># add the first face \r
of the box to the study</p>\r
\r
-<p class="whs3">subShapeList = geompy.SubShapeAll(box, \r
- geompy.ShapeType["FACE"])</p>\r
+<p class="whs1"><span style="font-family: 'Lucida Console', monospace;">subShapeList \r
+ = geompy.SubShapeAll(box, geompy.ShapeType["FACE"])</span></p>\r
\r
-<p class="whs3">face = subShapeList[0]</p>\r
+<p class="whs1">face = subShapeList[0]</p>\r
\r
-<p class="whs3">geompy.addToStudyInFather(box, \r
- face, "face 1")</p>\r
+<p class="whs1">geompy.addToStudyInFather(box, \r
+ face, "face 1") </p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs4"># create group of edges \r
+<p class="whs2"># create group of edges \r
on the face</p>\r
\r
-<p class="whs3">aGeomGroupE = geompy.CreateGroup(face, \r
- geompy.ShapeType["EDGE"])</p>\r
+<p class="whs1"><span style="font-family: 'Lucida Console', monospace;">aGeomGroupE \r
+ = geompy.CreateGroup(face, geompy.ShapeType["EDGE"])</span></p>\r
\r
-<p class="whs3">geompy.AddObject(aGeomGroupE, \r
+<p class="whs1">geompy.AddObject(aGeomGroupE, \r
3)</p>\r
\r
-<p class="whs3">geompy.AddObject(aGeomGroupE, \r
+<p class="whs1">geompy.AddObject(aGeomGroupE, \r
6)</p>\r
\r
-<p class="whs3">geompy.AddObject(aGeomGroupE, \r
+<p class="whs1">geompy.AddObject(aGeomGroupE, \r
8)</p>\r
\r
-<p class="whs3">geompy.AddObject(aGeomGroupE, \r
+<p class="whs1">geompy.AddObject(aGeomGroupE, \r
10)</p>\r
\r
-<p class="whs3">geompy.addToStudyInFather(face, \r
+<p class="whs1">geompy.addToStudyInFather(face, \r
aGeomGroupE, "Group of Edges")</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs4"># create quadrangle \r
+<p class="whs2"># create quadrangle \r
2D mesh on the box</p>\r
\r
-<p class="whs3">quadra = smesh.Mesh(box, \r
- "Box : quadrangle 2D mesh")</p>\r
+<p class="whs1"><span style="font-family: 'Lucida Console', monospace;">quadra \r
+ = smesh.Mesh(box, "Box : quadrangle 2D mesh")</span></p>\r
\r
-<p class="whs3">algo1D = quadra.Segment()</p>\r
+<p class="whs1">algo1D = quadra.Segment()</p>\r
\r
-<p class="whs3">quadra.Quadrangle()</p>\r
+<p class="whs1">quadra.Quadrangle()</p>\r
\r
-<p class="whs3">algo1D.NumberOfSegments(7)</p>\r
+<p class="whs1">algo1D.NumberOfSegments(7) \r
+ </p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs4"># compute the mesh</p>\r
+<p class="whs2"># compute the mesh</p>\r
\r
-<p class="whs3">quadra.Compute()</p>\r
+<p class="whs1">quadra.Compute()</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs4"># create SMESH group \r
+<p class="whs2"># create SMESH group \r
on the face with name "SMESHGroup1"</p>\r
\r
-<p class="whs3">aSmeshGroup1 = quadra.Group(face, \r
- "SMESHGroup1")</p>\r
+<p class="whs1"><span style="font-family: 'Lucida Console', monospace;">aSmeshGroup1 \r
+ = quadra.GroupOnGeom(face, "SMESHGroup1")</span></p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs4"># create SMESH group \r
+<p class="whs2"># create SMESH group \r
on <aGeomGroupE> with default name</p>\r
\r
-<p class="whs3">aSmeshGroup2 = quadra.Group(aGeomGroupE)</p>\r
+<p class="whs1">aSmeshGroup2 = quadra.GroupOnGeom(aGeomGroupE) \r
+ </p>\r
\r
-<p class="whs2"> </p>\r
+<p class="whs3"> </p>\r
\r
-<p class="whs2"><span style="font-family: 'Lucida Console', monospace;">salome.sg.updateObjBrowser(1)</span> \r
+<p class="whs3"><span style="font-family: 'Lucida Console', monospace;">salome.sg.updateObjBrowser(1)</span> \r
</p>\r
\r
<h3><a name=bookmark1>Edit a Group</a></h3>\r
\r
-<p class="whs6"># Attention! This script has been written \r
- using the old approach basing on direct usage of SMESH idl interface.</p>\r
-\r
-<p class="whs6"># For the moment smesh package doesn't \r
- provide methods to edit a group. </p>\r
+<p class="whs1">import SMESH_mechanic</p>\r
\r
-<p class="whs6"># In the next SALOME version the scripts \r
- will be updated to use only the commands from smesh package.</p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs3">import SMESH</p>\r
-\r
-<p class="whs3">import SMESH_mechanic</p>\r
-\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs3">smesh = \r
+<p class="whs1">smesh = \r
SMESH_mechanic.smesh</p>\r
\r
-<p class="whs3">mesh = \r
+<p class="whs1">mesh = \r
SMESH_mechanic.mesh</p>\r
\r
-<p class="whs3">salome = SMESH_mechanic.salome</p>\r
+<p class="whs1">salome = SMESH_mechanic.salome</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs4"># Get ids of all faces \r
+<p class="whs2"># Get ids of all faces \r
with area > 35</p>\r
\r
-<p class="whs3">aFilterMgr = smesh.CreateFilterManager()</p>\r
-\r
-<p class="whs3">aFunctor = aFilterMgr.CreateArea()</p>\r
-\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs3">aPredicate = aFilterMgr.CreateMoreThan()</p>\r
-\r
-<p class="whs3">aPredicate.SetNumFunctor(aFunctor)</p>\r
+<p class="whs1">aFilter = smesh.GetFilter(smesh.FACE, \r
+ smesh.FT_Area, smesh.FT_MoreThan, 35.)</p>\r
\r
-<p class="whs3">aPredicate.SetMargin(35.)</p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs3">aFilter = aFilterMgr.CreateFilter()</p>\r
-\r
-<p class="whs3">aFilter.SetPredicate(aPredicate)</p>\r
-\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs3">anIds = aFilter.GetElementsId(mesh)</p>\r
+<p class="whs1">anIds = mesh.GetIdsFromFilter(aFilter) \r
+ </p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3">print "Criterion: \r
+<p class="whs1">print "Criterion: \r
Area > 35, Nb = ", len(anIds)</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs4"># create a group by \r
+<p class="whs2"># create a group by \r
adding elements with area > 35</p>\r
\r
-<p class="whs3">aGroup = mesh.CreateGroup(SMESH.FACE, \r
- "Area > 35")</p>\r
+<p class="whs1"><span style="font-family: 'Lucida Console', monospace;">aGroup \r
+ = mesh.CreateEmptyGroup(smesh.FACE, "Area > 35")</span></p>\r
\r
-<p class="whs3">aGroup.Add(anIds)</p>\r
+<p class="whs1">aGroup.Add(anIds) \r
+ </p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs4"># Get ids of all faces \r
+<p class="whs2"># Get ids of all faces \r
with area > 40</p>\r
\r
-<p class="whs3">aFunctor = aFilterMgr.CreateArea()</p>\r
-\r
-<p class="whs3">aPredicate = aFilterMgr.CreateMoreThan()</p>\r
+<p class="whs1">aFilter = smesh.GetFilter(smesh.FACE, \r
+ smesh.FT_Area, smesh.FT_MoreThan, 40.)</p>\r
\r
-<p class="whs3">aPredicate.SetNumFunctor(aFunctor)</p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3">aPredicate.SetMargin(40.)</p>\r
+<p class="whs1">anIds = mesh.GetIdsFromFilter(aFilter)</p>\r
\r
-<p class="whs3">aFilter = aFilterMgr.CreateFilter()</p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3">aFilter.SetPredicate(aPredicate)</p>\r
+<p class="whs1">print "Criterion: \r
+ Area > 40, Nb = ", len(anIds) </p>\r
\r
-<p class="whs3">anIds = aFilter.GetElementsId(mesh)</p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3">print "Criterion: \r
- Area > 40, Nb = ", len(anIds)</p>\r
-\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs4"># create a group of \r
+<p class="whs2"># create a group of \r
elements with area [35; 40] by removing elements with area > 40 from \r
group aGroup</p>\r
\r
-<p class="whs3">aGroup.Remove(anIds)</p>\r
+<p class="whs1">aGroup.Remove(anIds) \r
+ </p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs4"># print the result</p>\r
+<p class="whs2"># print the result</p>\r
\r
-<p class="whs3">aGroupElemIDs = \r
+<p class="whs1">aGroupElemIDs = \r
aGroup.GetListOfID()</p>\r
\r
-<p class="whs3">print "Criterion: \r
+<p class="whs1"> </p>\r
+\r
+<p class="whs1">print "Criterion: \r
35 < Area < 40, Nb = ", len(aGroupElemIDs)</p>\r
\r
-<p class="whs3">j = 1</p>\r
+<p class="whs1">j = 1</p>\r
\r
-<p class="whs3">for i in range(len(aGroupElemIDs)):</p>\r
+<p class="whs1">for i in range(len(aGroupElemIDs)):</p>\r
\r
-<p class="whs3"> if \r
+<p class="whs1"> if \r
j > 20: j = 1; print ""</p>\r
\r
-<p class="whs3"> print \r
+<p class="whs1"> print \r
aGroupElemIDs[i],</p>\r
\r
-<p class="whs3"> j \r
+<p class="whs1"> j \r
= j + 1</p>\r
\r
-<p class="whs3"> pass</p>\r
+<p class="whs1"> pass</p>\r
\r
-<p class="whs3">print ""</p>\r
+<p class="whs1">print ""</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3">salome.sg.updateObjBrowser(1) \r
+<p class="whs1">salome.sg.updateObjBrowser(1) \r
</p>\r
\r
-<p class="whs2"> </p>\r
+<p class="whs3"> </p>\r
\r
-<p class="whs2"><img src="pics/editing_groups1.png" x-maintain-ratio="TRUE" width="463px" height="417px" border="0" class="img_whs7"> <img src="pics/editing_groups2.png" x-maintain-ratio="TRUE" width="541px" height="417px" border="0" class="img_whs8"></p>\r
+<p class="whs3"><img src="pics/editing_groups1.png" x-maintain-ratio="TRUE" width="463px" height="417px" border="0" class="img_whs5"> <img src="pics/editing_groups2.png" x-maintain-ratio="TRUE" width="541px" height="417px" border="0" class="img_whs6"></p>\r
\r
<h3><a name=bookmark2>Union of two groups</a></h3>\r
\r
-<p class="whs1"># Attention! This script has been written \r
- using the old approach basing on direct usage of SMESH idl interface.</p>\r
-\r
-<p class="whs1"># For the moment smesh package doesn't provide \r
- methods to create a union of two groups. </p>\r
-\r
-<p class="whs1"># In the next SALOME version the scripts will \r
- be updated to use only the commands from smesh package.</p>\r
-\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs3"><span style="font-family: 'Lucida Console', monospace;">import \r
- SMESH</span></p>\r
-\r
-<p class="whs3">import SMESH_mechanic</p>\r
+<p class="whs1">import SMESH_mechanic</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3">smesh = \r
+<p class="whs1">smesh = \r
SMESH_mechanic.smesh</p>\r
\r
-<p class="whs3">mesh = \r
+<p class="whs1">mesh = \r
SMESH_mechanic.mesh</p>\r
\r
-<p class="whs3">salome = SMESH_mechanic.salome</p>\r
-\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs3">aFilterMgr = smesh.CreateFilterManager()</p>\r
+<p class="whs1">salome = SMESH_mechanic.salome</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs4"># Criterion : AREA \r
+<p class="whs2"># Criterion : AREA \r
> 20</p>\r
\r
-<p class="whs3">aFunctor = aFilterMgr.CreateArea()</p>\r
-\r
-<p class="whs3">aPredicate = aFilterMgr.CreateMoreThan()</p>\r
+<p class="whs1">aFilter = smesh.GetFilter(smesh.FACE, \r
+ smesh.FT_Area, smesh.FT_MoreThan, 20.)</p>\r
\r
-<p class="whs3">aPredicate.SetNumFunctor(aFunctor)</p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3">aPredicate.SetMargin(20.)</p>\r
+<p class="whs1">anIds = mesh.GetIdsFromFilter(aFilter)</p>\r
\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs3">aFilter = aFilterMgr.CreateFilter()</p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3">aFilter.SetPredicate(aPredicate)</p>\r
+<p class="whs1">print "Criterion: \r
+ Area > 20, Nb = ", len( anIds ) </p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3">anIds = aFilter.GetElementsId(mesh)</p>\r
-\r
-<p class="whs3">print "Criterion: \r
- Area > 20, Nb = ", len( anIds )</p>\r
-\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs4"># create a group by \r
+<p class="whs2"># create a group by \r
adding elements with area > 20</p>\r
\r
-<p class="whs3">aGroup1 = mesh.CreateGroup(SMESH.FACE, \r
+<p class="whs1">aGroup1 = mesh.CreateGroup(SMESH.FACE, \r
"Area > 20")</p>\r
\r
-<p class="whs3">aGroup1.Add(anIds)</p>\r
+<p class="whs1">aGroup1.Add(anIds)</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs4"># Criterion : AREA \r
+<p class="whs2"># Criterion : AREA \r
= 20</p>\r
\r
-<p class="whs3">aFunctor = aFilterMgr.CreateArea()</p>\r
-\r
-<p class="whs3">aPredicate = aFilterMgr.CreateEqualTo()</p>\r
-\r
-<p class="whs3">aPredicate.SetNumFunctor(aFunctor)</p>\r
-\r
-<p class="whs3">aPredicate.SetMargin(20.)</p>\r
-\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs3">aFilter = aFilterMgr.CreateFilter()</p>\r
+<p class="whs1"><span style="font-family: 'Lucida Console', monospace;">aFilter \r
+ = smesh.GetFilter(smesh.FACE, smesh.FT_Area, smesh.FT_EqualTo, 20.)</span></p>\r
\r
-<p class="whs3">aFilter.SetPredicate(aPredicate)</p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs3">anIds = aFilter.GetElementsId(mesh)</p>\r
+<p class="whs1">anIds = mesh.GetIdsFromFilter(aFilter)</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3">print "Criterion: \r
- Area = 20, Nb = ", len( anIds )</p>\r
+<p class="whs1">print "Criterion: \r
+ Area = 20, Nb = ", len( anIds ) </p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs4"># create a group by \r
+<p class="whs2"># create a group by \r
adding elements with area = 20</p>\r
\r
-<p class="whs3">aGroup2 = mesh.CreateGroup( \r
- SMESH.FACE, "Area = 20" )</p>\r
+<p class="whs1">aGroup2 = mesh.CreateEmptyGroup( \r
+ smesh.FACE, "Area = 20" )</p>\r
\r
-<p class="whs3">aGroup2.Add(anIds)</p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1">aGroup2.Add(anIds)</p>\r
+\r
+<p class="whs1"> </p>\r
\r
-<p class="whs4"># create union group \r
+<p class="whs2"># create union group \r
: area >= 20</p>\r
\r
-<p class="whs3">aGroup3 = mesh.UnionGroups(aGroup1, \r
- aGroup2, "Area >= 20")</p>\r
+<p class="whs1"><span style="font-family: 'Lucida Console', monospace;">aGroup3 \r
+ = mesh.UnionGroups(aGroup1, aGroup2, "Area >= 20")</span></p>\r
\r
-<p class="whs3">print "Criterion: \r
+<p class="whs1">print "Criterion: \r
Area >= 20, Nb = ", len(aGroup3.GetListOfID())</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs4"># Criterion : AREA \r
+<p class="whs2"># Criterion : AREA \r
< 20</p>\r
\r
-<p class="whs3">aFunctor = aFilterMgr.CreateArea()</p>\r
-\r
-<p class="whs3">aPredicate = aFilterMgr.CreateLessThan()</p>\r
-\r
-<p class="whs3">aPredicate.SetNumFunctor(aFunctor)</p>\r
+<p class="whs1"><span style="font-family: 'Lucida Console', monospace;">aFilter \r
+ = smesh.GetFilter(smesh.FACE, smesh.FT_Area, smesh.FT_LessThan, 20.)</span></p>\r
\r
-<p class="whs3">aPredicate.SetMargin(20.)</p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs3">aFilter = aFilterMgr.CreateFilter()</p>\r
+<p class="whs1">anIds = mesh.GetIdsFromFilter(aFilter)</p>\r
\r
-<p class="whs3">aFilter.SetPredicate(aPredicate)</p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs3">anIds = aFilter.GetElementsId(mesh)</p>\r
-\r
-<p class="whs3">print "Criterion: \r
+<p class="whs1">print "Criterion: \r
Area < 20, Nb = ", len(anIds)</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs4"># create a group by \r
+<p class="whs2"># create a group by \r
adding elements with area < 20</p>\r
\r
-<p class="whs3">aGroup4 = mesh.CreateGroup(SMESH.FACE, \r
- "Area < 20")</p>\r
+<p class="whs1"><span style="font-family: 'Lucida Console', monospace;">aGroup4 \r
+ = mesh.CreateEmptyGroup(smesh.FACE, "Area < 20")</span></p>\r
\r
-<p class="whs3">aGroup4.Add(anIds)</p>\r
+<p class="whs1">aGroup4.Add(anIds)</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs4"># create union group \r
+<p class="whs2"># create union group \r
: area >= 20 and area < 20</p>\r
\r
-<p class="whs3">aGroup5 = mesh.UnionGroups(aGroup3, \r
- aGroup4, "Any Area")</p>\r
+<p class="whs1"><span style="font-family: 'Lucida Console', monospace;">aGroup5 \r
+ = mesh.UnionGroups(aGroup3, aGroup4, "Any Area")</span></p>\r
\r
-<p class="whs3">print "Criterion: \r
+<p class="whs1">print "Criterion: \r
Any Area, Nb = ", len(aGroup5.GetListOfID())</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3">salome.sg.updateObjBrowser(1) \r
+<p class="whs1">salome.sg.updateObjBrowser(1) \r
</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3"><img src="pics/union_groups1.png" x-maintain-ratio="TRUE" width="394px" height="425px" border="0" class="img_whs9"></p>\r
+<p class="whs1"><img src="pics/union_groups1.png" x-maintain-ratio="TRUE" width="394px" height="425px" border="0" class="img_whs7"></p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3"><img src="pics/union_groups2.png" x-maintain-ratio="TRUE" width="368px" height="379px" border="0" class="img_whs10"> <img src="pics/union_groups3.png" x-maintain-ratio="TRUE" width="344px" height="381px" border="0" class="img_whs11"></p>\r
+<p class="whs1"><img src="pics/union_groups2.png" x-maintain-ratio="TRUE" width="368px" height="379px" border="0" class="img_whs8"> <img src="pics/union_groups3.png" x-maintain-ratio="TRUE" width="344px" height="381px" border="0" class="img_whs9"></p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
<h3><a name=bookmark3>Intersection of two groups</a></h3>\r
\r
-<p class="whs6"># Attention! This script has been written \r
- using the old approach basing on direct usage of SMESH idl interface.</p>\r
-\r
-<p class="whs6"># For the moment smesh package doesn't \r
- provide methods to create an intersection of two groups. </p>\r
-\r
-<p class="whs6"># In the next SALOME version the scripts \r
- will be updated to use only the commands from smesh package.</p>\r
-\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs3">import SMESH</p>\r
-\r
-<p class="whs3">import SMESH_mechanic</p>\r
+<p class="whs1">import SMESH_mechanic</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3">smesh = \r
+<p class="whs1">smesh = \r
SMESH_mechanic.smesh</p>\r
\r
-<p class="whs3">mesh = \r
+<p class="whs1">mesh = \r
SMESH_mechanic.mesh</p>\r
\r
-<p class="whs3">salome = SMESH_mechanic.salome</p>\r
-\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs3">aFilterMgr = smesh.CreateFilterManager()</p>\r
+<p class="whs1">salome = SMESH_mechanic.salome</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs4"># Criterion : AREA \r
+<p class="whs2"># Criterion : AREA \r
> 20</p>\r
\r
-<p class="whs3">aFunctor = aFilterMgr.CreateArea()</p>\r
-\r
-<p class="whs3">aPredicate = aFilterMgr.CreateMoreThan()</p>\r
+<p class="whs1">aFilter = smesh.GetFilter(smesh.FACE, \r
+ smesh.FT_Area, smesh.FT_MoreThan, 20.)</p>\r
\r
-<p class="whs3">aPredicate.SetNumFunctor(aFunctor)</p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3">aPredicate.SetMargin(20.)</p>\r
+<p class="whs1">anIds = mesh.GetIdsFromFilter(aFilter)</p>\r
\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs3">aFilter = aFilterMgr.CreateFilter()</p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3">aFilter.SetPredicate(aPredicate)</p>\r
+<p class="whs1">print "Criterion: \r
+ Area > 20, Nb = ", len(anIds) </p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3">anIds = aFilter.GetElementsId(mesh)</p>\r
-\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs3">print "Criterion: \r
- Area > 20, Nb = ", len(anIds)</p>\r
-\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs4"># create a group by \r
+<p class="whs2"># create a group by \r
adding elements with area > 20</p>\r
\r
-<p class="whs3">aGroup1 = mesh.CreateGroup(SMESH.FACE, \r
+<p class="whs1">aGroup1 = mesh.CreateGroup(SMESH.FACE, \r
"Area > 20")</p>\r
\r
-<p class="whs3">aGroup1.Add(anIds)</p>\r
+<p class="whs1">aGroup1.Add(anIds)</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs4"># Criterion : AREA \r
+<p class="whs2"># Criterion : AREA \r
< 60</p>\r
\r
-<p class="whs3">aFunctor = aFilterMgr.CreateArea()</p>\r
-\r
-<p class="whs3">aPredicate = aFilterMgr.CreateLessThan()</p>\r
-\r
-<p class="whs3">aPredicate.SetNumFunctor(aFunctor)</p>\r
-\r
-<p class="whs3">aPredicate.SetMargin(60)</p>\r
-\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs3">aFilter = aFilterMgr.CreateFilter()</p>\r
-\r
-<p class="whs3">aFilter.SetPredicate(aPredicate)</p>\r
+<p class="whs1">aFilter = smesh.GetFilter(smesh.FACE, \r
+ smesh.FT_Area, smesh.FT_LessThan, 60.)</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3">anIds = aFilter.GetElementsId(mesh)</p>\r
+<p class="whs1">anIds = mesh.GetIdsFromFilter(aFilter)</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3">print "Criterion: \r
- Area < 60, Nb = ", len(anIds)</p>\r
+<p class="whs1">print "Criterion: \r
+ Area < 60, Nb = ", len(anIds) </p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs4"># create a group by \r
+<p class="whs2"># create a group by \r
adding elements with area < 60</p>\r
\r
-<p class="whs3">aGroup2 = mesh.CreateGroup(SMESH.FACE, \r
+<p class="whs1">aGroup2 = mesh.CreateGroup(SMESH.FACE, \r
"Area < 60")</p>\r
\r
-<p class="whs3">aGroup2.Add(anIds)</p>\r
+<p class="whs1">aGroup2.Add(anIds)</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs4"># create an intersection \r
+<p class="whs2"># create an intersection \r
of groups : 20 < area < 60</p>\r
\r
-<p class="whs3">aGroup3 = mesh.IntersectGroups(aGroup1, \r
- aGroup2, "20 < Area < 60")</p>\r
+<p class="whs1"><span style="font-family: 'Lucida Console', monospace;">aGroup3 \r
+ = mesh.IntersectGroups(aGroup1, aGroup2, "20 < Area < 60")</span></p>\r
\r
-<p class="whs3">print "Criterion: \r
+<p class="whs1">print "Criterion: \r
20 < Area < 60, Nb = ", len(aGroup3.GetListOfID())</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3">salome.sg.updateObjBrowser(1) \r
+<p class="whs1">salome.sg.updateObjBrowser(1) \r
</p>\r
\r
-<p class="whs2"> </p>\r
+<p class="whs3"> </p>\r
\r
-<p class="whs2"><img src="pics/intersect_groups1.png" x-maintain-ratio="TRUE" width="314px" height="351px" border="0" class="img_whs12"> <img src="pics/intersect_groups2.png" x-maintain-ratio="TRUE" width="319px" height="351px" border="0" class="img_whs13"> <img src="pics/intersect_groups3.png" x-maintain-ratio="TRUE" width="304px" height="352px" border="0" class="img_whs14"></p>\r
+<p class="whs3"><img src="pics/intersect_groups1.png" x-maintain-ratio="TRUE" width="314px" height="351px" border="0" class="img_whs10"> <img src="pics/intersect_groups2.png" x-maintain-ratio="TRUE" width="319px" height="351px" border="0" class="img_whs11"> <img src="pics/intersect_groups3.png" x-maintain-ratio="TRUE" width="304px" height="352px" border="0" class="img_whs12"></p>\r
\r
<h3><a name=bookmark4>Cut of two groups</a></h3>\r
\r
-<p class="whs1"># Attention! This script has been written \r
- using the old approach basing on direct usage of SMESH idl interface.</p>\r
+<p class="whs1">import SMESH_mechanic</p>\r
\r
-<p class="whs1"># For the moment smesh package doesn't provide \r
- methods to create a cut of two groups. </p>\r
-\r
-<p class="whs1"># In the next SALOME version the scripts will \r
- be updated to use only the commands from smesh package.</p>\r
-\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3">import SMESH</p>\r
-\r
-<p class="whs3">import SMESH_mechanic</p>\r
-\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs3">smesh = \r
+<p class="whs1">smesh = \r
SMESH_mechanic.smesh</p>\r
\r
-<p class="whs3">mesh = \r
+<p class="whs1">mesh = \r
SMESH_mechanic.mesh</p>\r
\r
-<p class="whs3">salome = SMESH_mechanic.salome</p>\r
-\r
-<p class="whs3"> </p>\r
+<p class="whs1">salome = SMESH_mechanic.salome</p>\r
\r
-<p class="whs3">aFilterMgr = smesh.CreateFilterManager()</p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs4"># Criterion : AREA \r
+<p class="whs2"># Criterion : AREA \r
> 20</p>\r
\r
-<p class="whs3">aFunctor = aFilterMgr.CreateArea()</p>\r
-\r
-<p class="whs3">aPredicate = aFilterMgr.CreateMoreThan()</p>\r
-\r
-<p class="whs3">aPredicate.SetNumFunctor(aFunctor)</p>\r
-\r
-<p class="whs3">aPredicate.SetMargin(20.)</p>\r
+<p class="whs1">aFilter = smesh.GetFilter(smesh.FACE, \r
+ smesh.FT_Area, smesh.FT_MoreThan, 20.)</p>\r
\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs3">aFilter = aFilterMgr.CreateFilter()</p>\r
-\r
-<p class="whs3">aFilter.SetPredicate(aPredicate)</p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1">anIds = mesh.GetIdsFromFilter(aFilter)</p>\r
\r
-<p class="whs3">anIds = aFilter.GetElementsId(mesh)</p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3">print "Criterion: \r
- Area > 20, Nb = ", len(anIds)</p>\r
+<p class="whs1">print "Criterion: \r
+ Area > 20, Nb = ", len(anIds) </p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs4"># create a group by \r
+<p class="whs2"># create a group by \r
adding elements with area > 20</p>\r
\r
-<p class="whs3">aGroupMain = mesh.CreateGroup(SMESH.FACE, \r
- "Area > 20")</p>\r
-\r
-<p class="whs3">aGroupMain.Add(anIds)</p>\r
+<p class="whs1"><span style="font-family: 'Lucida Console', monospace;">aGroupMain \r
+ = mesh.MakeGroupByIds("Area > 20", smesh.FACE, anIds)</span></p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs4"># Criterion : AREA \r
+<p class="whs2"># Criterion : AREA \r
< 60</p>\r
\r
-<p class="whs3">aFunctor = aFilterMgr.CreateArea()</p>\r
-\r
-<p class="whs3">aPredicate = aFilterMgr.CreateLessThan()</p>\r
+<p class="whs1">aFilter = smesh.GetFilter(smesh.FACE, \r
+ smesh.FT_Area, smesh.FT_LessThan, 60.)</p>\r
\r
-<p class="whs3">aPredicate.SetNumFunctor(aFunctor)</p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3">aPredicate.SetMargin(60.)</p>\r
+<p class="whs1">anIds = mesh.GetIdsFromFilter(aFilter)</p>\r
\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs3">aFilter = aFilterMgr.CreateFilter()</p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3">aFilter.SetPredicate(aPredicate)</p>\r
+<p class="whs1">print "Criterion: \r
+ Area < 60, Nb = ", len(anIds) </p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3">anIds = aFilter.GetElementsId(mesh)</p>\r
-\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs3">print "Criterion: \r
- Area < 60, Nb = ", len(anIds)</p>\r
-\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs4"># create a group by \r
+<p class="whs2"># create a group by \r
adding elements with area < 60</p>\r
\r
-<p class="whs3">aGroupTool = mesh.CreateGroup(SMESH.FACE, \r
- "Area < 60")</p>\r
-\r
-<p class="whs3">aGroupTool.Add(anIds)</p>\r
+<p class="whs1"><span style="font-family: 'Lucida Console', monospace;">aGroupTool \r
+ = mesh.MakeGroupByIds("Area < 60", smesh.FACE, anIds)</span></p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs4"># create a cut of groups \r
+<p class="whs2"># create a cut of groups \r
: area >= 60</p>\r
\r
-<p class="whs3">aGroupRes = mesh.CutGroups(aGroupMain, \r
- aGroupTool, "Area >= 60")</p>\r
+<p class="whs1"><span style="font-family: 'Lucida Console', monospace;">aGroupRes \r
+ = mesh.CutGroups(aGroupMain, aGroupTool, "Area >= 60")</span></p>\r
\r
-<p class="whs3">print "Criterion: \r
+<p class="whs1">print "Criterion: \r
Area >= 60, Nb = ", len(aGroupRes.GetListOfID())</p>\r
\r
-<p class="whs3">salome.sg.updateObjBrowser(1) \r
+<p class="whs1"> </p>\r
+\r
+<p class="whs1">salome.sg.updateObjBrowser(1) \r
</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs2"><img src="pics/cut_groups1.png" x-maintain-ratio="TRUE" width="318px" height="355px" border="0" class="img_whs15"> <img src="pics/cut_groups2.png" x-maintain-ratio="TRUE" width="318px" height="355px" border="0" class="img_whs16"> <img src="pics/cut_groups3.png" x-maintain-ratio="TRUE" width="320px" height="354px" border="0" class="img_whs17"></p>\r
+<p class="whs3"><img src="pics/cut_groups1.png" x-maintain-ratio="TRUE" width="318px" height="355px" border="0" class="img_whs13"> <img src="pics/cut_groups2.png" x-maintain-ratio="TRUE" width="318px" height="355px" border="0" class="img_whs14"> <img src="pics/cut_groups3.png" x-maintain-ratio="TRUE" width="320px" height="354px" border="0" class="img_whs15"></p>\r
\r
<script type="text/javascript" language="javascript1.2">\r
<!--\r
-->\r
</style><style type="text/css">\r
<!--\r
-p.whs1 { margin-top:0pt; margin-bottom:0pt; font-weight:bold; color:#ff0000; }\r
-p.whs2 { margin-top:0pt; margin-bottom:0pt; }\r
-p.whs3 { margin-top:0pt; margin-bottom:0pt; font-family:'Lucida Console' , monospace; }\r
-p.whs4 { margin-top:0pt; margin-bottom:0pt; font-family:'Times New Roman' , serif; }\r
-h4.whs5 { margin-top:0pt; margin-bottom:0pt; }\r
-p.whs6 { margin-top:0.5pt; margin-bottom:0pt; font-family:'Lucida Console' , monospace; }\r
-p.whs7 { margin-top:0.5pt; margin-bottom:0pt; }\r
-p.whs8 { margin-top:0.5pt; margin-bottom:0pt; font-family:'Times New Roman' , serif; }\r
-p.whs9 { font-family:'Lucida Console' , monospace; }\r
-p.whs10 { font-family:'Times New Roman' , serif; }\r
-p.whs11 { margin-left:36px; font-family:'Lucida Console' , monospace; }\r
-p.whs12 { margin-left:36px; }\r
-p.whs13 { margin-left:192px; font-family:'Lucida Console' , monospace; }\r
-p.whs14 { font-family:'Lucida Console' , monospace; margin-left:0px; }\r
+p.whs1 { margin-top:0pt; margin-bottom:0pt; font-family:'Lucida Console' , monospace; }\r
+p.whs2 { margin-top:0pt; margin-bottom:0pt; font-family:'Times New Roman' , serif; }\r
+p.whs3 { margin-top:0pt; margin-bottom:0pt; }\r
+h4.whs4 { margin-top:0pt; margin-bottom:0pt; }\r
+p.whs5 { margin-top:0.5pt; margin-bottom:0pt; font-family:'Lucida Console' , monospace; }\r
+p.whs6 { margin-top:0.5pt; margin-bottom:0pt; }\r
+p.whs7 { margin-top:0.5pt; margin-bottom:0pt; font-family:'Times New Roman' , serif; }\r
+p.whs8 { font-family:'Lucida Console' , monospace; }\r
+p.whs9 { font-family:'Times New Roman' , serif; }\r
+p.whs10 { margin-left:36px; font-family:'Lucida Console' , monospace; }\r
+p.whs11 { margin-left:36px; }\r
+p.whs12 { margin-left:0px; font-family:'Times New Roman' , serif; }\r
+p.whs13 { font-family:'Lucida Console' , monospace; margin-left:0px; }\r
-->\r
</style><script type="text/javascript" language="JavaScript">\r
<!--\r
strNSS += "p.whs1 {margin-top:1pt;margin-bottom:1pt; }";\r
strNSS += "p.whs2 {margin-top:1pt;margin-bottom:1pt; }";\r
strNSS += "p.whs3 {margin-top:1pt;margin-bottom:1pt; }";\r
- strNSS += "p.whs4 {margin-top:1pt;margin-bottom:1pt; }";\r
- strNSS += "h4.whs5 {margin-top:1pt;margin-bottom:1pt; }";\r
+ strNSS += "h4.whs4 {margin-top:1pt;margin-bottom:1pt; }";\r
+ strNSS += "p.whs5 {margin-top:1pt;margin-bottom:1pt; }";\r
strNSS += "p.whs6 {margin-top:1pt;margin-bottom:1pt; }";\r
strNSS += "p.whs7 {margin-top:1pt;margin-bottom:1pt; }";\r
- strNSS += "p.whs8 {margin-top:1pt;margin-bottom:1pt; }";\r
- strNSS += "p.whs14 {margin-left:1pt; }";\r
+ strNSS += "p.whs12 {margin-left:1pt; }";\r
+ strNSS += "p.whs13 {margin-left:1pt; }";\r
strNSS +="</style>";\r
document.write(strNSS);\r
}\r
\r
<h3><a name=bookmark>Adding Nodes and Elements</a></h3>\r
\r
-<p class="whs1"># Attention! The scripts for Adding nodes \r
- and Elements have \r
- been written using the old approach basing on direct usage of SMESH idl \r
- interface.</p>\r
-\r
-<p class="whs1"># For the moment smesh package doesn't provide \r
- methods to add nodes and elements. </p>\r
-\r
-<p class="whs2"><span style="font-weight: bold; color: #ff0000;"><font color=red ><B># \r
- In the next SALOME version the scripts will be updated to use only the \r
- commands from smesh package.</B></font></span></p>\r
-\r
<h4>Add Node</h4>\r
\r
-<p class="whs3"><span style="font-family: 'Lucida Console', monospace;">import \r
- SMESH</span></p>\r
-\r
-<p class="whs3">import SMESH_mechanic</p>\r
-\r
-<p class="whs3"> </p>\r
+<p class="whs1">import SMESH_mechanic</p>\r
\r
-<p class="whs3">mesh = SMESH_mechanic.mesh</p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3">aMeshEditor = mesh.GetMeshEditor()</p>\r
+<p class="whs1">mesh = SMESH_mechanic.mesh</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs4"># add node</p>\r
+<p class="whs2"># add node</p>\r
\r
-<p class="whs3">new_id = aMeshEditor.AddNode(50, \r
- 10, 0)</p>\r
+<p class="whs1"><span style="font-family: 'Lucida Console', monospace;">new_id \r
+ = mesh.AddNode(50, 10, 0)</span></p>\r
\r
-<p class="whs3">print ""</p>\r
+<p class="whs1">print ""</p>\r
\r
-<p class="whs3">if new_id == 0: \r
+<p class="whs1">if new_id == 0: \r
print "KO node addition."</p>\r
\r
-<p class="whs3">else: print \r
- "New Node has been added with ID ", new_id </p>\r
+<p class="whs1">else: print \r
+ "New Node has been added with ID ", new_id </p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
<h4>Add Edge</h4>\r
\r
-<p class="whs3"><span style="font-family: 'Lucida Console', monospace;">import \r
- SMESH</span></p>\r
-\r
-<p class="whs3">import SMESH_mechanic</p>\r
+<p class="whs1">import SMESH_mechanic</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3">mesh = SMESH_mechanic.mesh</p>\r
+<p class="whs1">mesh = SMESH_mechanic.mesh</p>\r
\r
-<p class="whs3">aMeshEditor = mesh.GetMeshEditor()</p>\r
+<p class="whs1">print ""</p>\r
\r
-<p class="whs3">print ""</p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs2"># add node</p>\r
\r
-<p class="whs4"># add node</p>\r
+<p class="whs1"><span style="font-family: 'Lucida Console', monospace;">n1 \r
+ = mesh.AddNode(50, 10, 0)</span></p>\r
\r
-<p class="whs3">n1 = aMeshEditor.AddNode(50, \r
- 10, 0)</p>\r
+<p class="whs1">if n1 == 0: print \r
+ "KO node addition." </p>\r
\r
-<p class="whs3">if n1 == 0: print \r
- "KO node addition."</p>\r
-\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs4"># add edge</p>\r
+<p class="whs2"># add edge</p>\r
\r
-<p class="whs3">e1 = aMeshEditor.AddEdge([n1, \r
- 38])</p>\r
+<p class="whs1"><span style="font-family: 'Lucida Console', monospace;">e1 \r
+ = mesh.AddEdge([n1, 38])</span></p>\r
\r
-<p class="whs3">if e1 == 0: print \r
+<p class="whs1">if e1 == 0: print \r
"KO edge addition."</p>\r
\r
-<p class="whs3">else: print \r
+<p class="whs1">else: print \r
"New Edge has been added with ID ", e1 </p>\r
\r
-<p class="whs3"> </p>\r
-\r
<h4>Add Triangle</h4>\r
\r
-<p class="whs3"><span style="font-family: 'Lucida Console', monospace;">import \r
- SMESH</span></p>\r
+<p class="whs1">import SMESH_mechanic</p>\r
\r
-<p class="whs3">import SMESH_mechanic</p>\r
-\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs3">mesh = SMESH_mechanic.mesh</p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3">aMeshEditor = mesh.GetMeshEditor()</p>\r
+<p class="whs1">mesh = SMESH_mechanic.mesh</p>\r
\r
-<p class="whs3">print ""</p>\r
+<p class="whs1">print ""</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs4"># add node</p>\r
+<p class="whs2"># add node</p>\r
\r
-<p class="whs3">n1 = aMeshEditor.AddNode(50, \r
+<p class="whs1">n1 = mesh.AddNode(50, \r
10, 0)</p>\r
\r
-<p class="whs3">if n1 == 0: print \r
+<p class="whs1">if n1 == 0: print \r
"KO node addition."</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs4"># add triangle</p>\r
+<p class="whs2"># add triangle</p>\r
\r
-<p class="whs3">t1 = aMeshEditor.AddFace([n1, \r
+<p class="whs1">t1 = mesh.AddFace([n1, \r
38, 39])</p>\r
\r
-<p class="whs3">if t1 == 0: print \r
+<p class="whs1">if t1 == 0: print \r
"KO triangle addition."</p>\r
\r
-<p class="whs3">else: print \r
+<p class="whs1">else: print \r
"New Triangle has been added with ID ", t1 </p>\r
\r
<h4>Add Quadrangle</h4>\r
\r
-<p class="whs3">import SMESH</p>\r
-\r
-<p class="whs3">import SMESH_mechanic</p>\r
+<p class="whs1">import SMESH_mechanic</p>\r
\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs3">mesh = SMESH_mechanic.mesh</p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3">aMeshEditor = mesh.GetMeshEditor()</p>\r
+<p class="whs1">mesh = SMESH_mechanic.mesh</p>\r
\r
-<p class="whs3">print ""</p>\r
+<p class="whs1">print ""</p>\r
\r
-<p class="whs2"> </p>\r
+<p class="whs3"> </p>\r
\r
-<p class="whs2"># add node</p>\r
+<p class="whs3"># add node</p>\r
\r
-<p class="whs3">n1 = aMeshEditor.AddNode(50, \r
+<p class="whs1">n1 = mesh.AddNode(50, \r
10, 0)</p>\r
\r
-<p class="whs3">if n1 == 0: print \r
+<p class="whs1">if n1 == 0: print \r
"KO node addition."</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3">n2 = aMeshEditor.AddNode(40, \r
+<p class="whs1">n2 = mesh.AddNode(40, \r
20, 0)</p>\r
\r
-<p class="whs3">if n2 == 0: print \r
+<p class="whs1">if n2 == 0: print \r
"KO node addition."</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs2"># add quadrangle</p>\r
+<p class="whs3"># add quadrangle</p>\r
\r
-<p class="whs3">q1 = aMeshEditor.AddFace([n2, \r
+<p class="whs1">q1 = mesh.AddFace([n2, \r
n1, 38, 39])</p>\r
\r
-<p class="whs3">if q1 == 0: print \r
+<p class="whs1">if q1 == 0: print \r
"KO quadrangle addition."</p>\r
\r
-<p class="whs2"><span style="font-family: 'Lucida Console', monospace;">else: \r
+<p class="whs3"><span style="font-family: 'Lucida Console', monospace;">else: \r
print \r
"New Quadrangle has been added with ID ", q1</span> </p>\r
\r
<h4>Add Tetrahedron</h4>\r
\r
-<p class="whs3">import SMESH </p>\r
-\r
-<p class="whs3">import SMESH_mechanic</p>\r
+<p class="whs1">import SMESH_mechanic</p>\r
\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs3">mesh = SMESH_mechanic.mesh</p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3">aMeshEditor = mesh.GetMeshEditor()</p>\r
+<p class="whs1">mesh = SMESH_mechanic.mesh</p>\r
\r
-<p class="whs3">print ""</p>\r
+<p class="whs1">print ""</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs4"># add node</p>\r
+<p class="whs2"># add node</p>\r
\r
-<p class="whs3">n1 = aMeshEditor.AddNode(50, \r
+<p class="whs1">n1 = mesh.AddNode(50, \r
10, 0)</p>\r
\r
-<p class="whs3">if n1 == 0: print \r
+<p class="whs1">if n1 == 0: print \r
"KO node addition."</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs4"># add tetrahedron</p>\r
+<p class="whs2"># add tetrahedron</p>\r
\r
-<p class="whs3">t1 = aMeshEditor.AddVolume([n1, \r
+<p class="whs1">t1 = mesh.AddVolume([n1, \r
38, 39, 246])</p>\r
\r
-<p class="whs3">if t1 == 0: print \r
+<p class="whs1">if t1 == 0: print \r
"KO tetrahedron addition."</p>\r
\r
-<p class="whs2"><span style="font-family: 'Lucida Console', monospace;">else: \r
+<p class="whs3"><span style="font-family: 'Lucida Console', monospace;">else: \r
print \r
"New Tetrahedron has been added with ID ", t1</span> </p>\r
\r
<h4>Add Hexahedron</h4>\r
\r
-<p class="whs3"><span style="font-family: 'Lucida Console', monospace;">import \r
- SMESH</span></p>\r
-\r
-<p class="whs3">import SMESH_mechanic</p>\r
-\r
-<p class="whs3"> </p>\r
+<p class="whs1">import SMESH_mechanic</p>\r
\r
-<p class="whs3">mesh = SMESH_mechanic.mesh</p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3">aMeshEditor = mesh.GetMeshEditor()</p>\r
+<p class="whs1">mesh = SMESH_mechanic.mesh</p>\r
\r
-<p class="whs3">print ""</p>\r
+<p class="whs1">print ""</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs4"># add nodes</p>\r
+<p class="whs2"># add nodes</p>\r
\r
-<p class="whs3">nId1 = aMeshEditor.AddNode(50, \r
+<p class="whs1">nId1 = mesh.AddNode(50, \r
10, 0)</p>\r
\r
-<p class="whs3">nId2 = aMeshEditor.AddNode(47, \r
+<p class="whs1">nId2 = mesh.AddNode(47, \r
12, 0)</p>\r
\r
-<p class="whs3">nId3 = aMeshEditor.AddNode(50, \r
+<p class="whs1">nId3 = mesh.AddNode(50, \r
10, 10)</p>\r
\r
-<p class="whs3">nId4 = aMeshEditor.AddNode(47, \r
+<p class="whs1">nId4 = mesh.AddNode(47, \r
12, 10)</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3">if nId1 == 0 or \r
+<p class="whs1">if nId1 == 0 or \r
nId2 == 0 or nId3 == 0 or nId4 == 0: print "KO node addition."</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs4"># add hexahedron</p>\r
+<p class="whs2"># add hexahedron</p>\r
\r
-<p class="whs3">vId = aMeshEditor.AddVolume([nId2, \r
+<p class="whs1">vId = mesh.AddVolume([nId2, \r
nId1, 38, 39, nId4, nId3, 245, 246])</p>\r
\r
-<p class="whs3">if vId == 0: print \r
+<p class="whs1">if vId == 0: print \r
"KO Hexahedron addition."</p>\r
\r
-<p class="whs3">else: print \r
+<p class="whs1">else: print \r
"New Hexahedron has been added with ID ", vId </p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
<h4>Add Polygon</h4>\r
\r
-<p class="whs3"><span style="font-family: 'Lucida Console', monospace;">import \r
+<p class="whs1"><span style="font-family: 'Lucida Console', monospace;">import \r
math</span></p>\r
\r
-<p class="whs3">import salome</p>\r
+<p class="whs1">import salome</p>\r
\r
-<p class="whs3">import smesh</p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1">import smesh</p>\r
\r
-<p class="whs4"># create an empty mesh \r
- structure</p>\r
-\r
-<p class="whs3">gen = smesh.smesh</p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3">mesh = gen.CreateEmptyMesh()</p>\r
+<p class="whs2"># create an empty mesh \r
+ structure</p>\r
\r
-<p class="whs3">MeshEditor = mesh.GetMeshEditor()</p>\r
+<p class="whs1">mesh = smesh.Mesh() \r
+ </p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs4"># a method to build \r
+<p class="whs2"># a method to build \r
a polygonal mesh element with <nb_vert> angles:</p>\r
\r
-<p class="whs3">def MakePolygon \r
+<p class="whs1">def MakePolygon \r
(a_mesh, x0, y0, z0, radius, nb_vert):</p>\r
\r
-<p class="whs3"> al \r
+<p class="whs1"> al \r
= 2.0 * math.pi / nb_vert</p>\r
\r
-<p class="whs3"> node_ids \r
+<p class="whs1"> node_ids \r
= []</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs4"> # \r
+<p class="whs2"> # \r
Create nodes for a polygon</p>\r
\r
-<p class="whs3"> for \r
+<p class="whs1"> for \r
ii in range(nb_vert):</p>\r
\r
-<p class="whs3"> nid \r
- = MeshEditor.AddNode(x0 + radius * math.cos(ii*al),</p>\r
+<p class="whs1"> nid \r
+ = mesh.AddNode(x0 + radius * math.cos(ii*al),</p>\r
\r
-<p class="whs3"> y0 \r
+<p class="whs1"> y0 \r
+ radius * math.sin(ii*al),</p>\r
\r
-<p class="whs3"> z0)</p>\r
+<p class="whs1"> z0)</p>\r
\r
-<p class="whs3"> node_ids.append(nid)</p>\r
+<p class="whs1"> node_ids.append(nid)</p>\r
\r
-<p class="whs3"> pass</p>\r
+<p class="whs1"> pass</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs4"> # \r
+<p class="whs2"> # \r
Create a polygon</p>\r
\r
-<p class="whs3"> return \r
- MeshEditor.AddPolygonalFace(node_ids)</p>\r
+<p class="whs1"> return \r
+ mesh.AddPolygonalFace(node_ids)</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs4"># Create three polygons</p>\r
+<p class="whs2"># Create three polygons</p>\r
\r
-<p class="whs3">f1 = MakePolygon(mesh, \r
+<p class="whs1">f1 = MakePolygon(mesh, \r
0, 0, 0, \r
30, 13)</p>\r
\r
-<p class="whs3">f2 = MakePolygon(mesh, \r
+<p class="whs1">f2 = MakePolygon(mesh, \r
0, 0, 10, 21, 9)</p>\r
\r
-<p class="whs3">f3 = MakePolygon(mesh, \r
+<p class="whs1">f3 = MakePolygon(mesh, \r
0, 0, 20, 13, 6)</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3">salome.sg.updateObjBrowser(1) \r
+<p class="whs1">salome.sg.updateObjBrowser(1) \r
</p>\r
\r
<h4>Add Polyhedron</h4>\r
\r
-<p class="whs3"><span style="font-family: 'Lucida Console', monospace;">import \r
+<p class="whs1"><span style="font-family: 'Lucida Console', monospace;">import \r
salome</span></p>\r
\r
-<p class="whs3">import math</p>\r
-\r
-<p class="whs3">import smesh</p>\r
+<p class="whs1">import math</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs4"># create an empty mesh \r
+<p class="whs2"># create an empty mesh \r
structure</p>\r
\r
-<p class="whs3">gen = smesh.smesh</p>\r
-\r
-<p class="whs3">mesh = gen.CreateEmptyMesh()</p>\r
+<p class="whs1">mesh = smesh.Mesh() \r
+ </p>\r
\r
-<p class="whs3">MeshEditor = mesh.GetMeshEditor()</p>\r
-\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs4"># Create nodes for \r
+<p class="whs2"># Create nodes for \r
12-hedron with pentagonal faces</p>\r
\r
-<p class="whs3">al = 2 * math.pi \r
+<p class="whs1">al = 2 * math.pi \r
/ 5.0</p>\r
\r
-<p class="whs3">cosal = math.cos(al)</p>\r
+<p class="whs1">cosal = math.cos(al)</p>\r
\r
-<p class="whs3">aa = 13</p>\r
+<p class="whs1">aa = 13</p>\r
\r
-<p class="whs3">rr = aa / (2.0 * \r
+<p class="whs1">rr = aa / (2.0 * \r
math.sin(al/2.0))</p>\r
\r
-<p class="whs3">dr = 2.0 * rr * \r
+<p class="whs1">dr = 2.0 * rr * \r
cosal</p>\r
\r
-<p class="whs3">r1 = rr + dr</p>\r
+<p class="whs1">r1 = rr + dr</p>\r
\r
-<p class="whs3">dh = rr * math.sqrt(2.0 \r
+<p class="whs1">dh = rr * math.sqrt(2.0 \r
* (1.0 - cosal * (1.0 + 2.0 * cosal)))</p>\r
\r
-<p class="whs3">hh = 2.0 * dh - \r
+<p class="whs1">hh = 2.0 * dh - \r
dr * (rr*(cosal - 1) + (rr + dr)*(math.cos(al/2) - 1)) / dh</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3">dd = [] <span style="font-family: 'Times New Roman', serif;"># \r
+<p class="whs1">dd = [] <span style="font-family: 'Times New Roman', serif;"># \r
top</span></p>\r
\r
-<p class="whs3">cc = [] <span style="font-family: 'Times New Roman', serif;"># \r
+<p class="whs1">cc = [] <span style="font-family: 'Times New Roman', serif;"># \r
below top</span></p>\r
\r
-<p class="whs3">bb = [] <span style="font-family: 'Times New Roman', serif;"># \r
+<p class="whs1">bb = [] <span style="font-family: 'Times New Roman', serif;"># \r
above bottom</span></p>\r
\r
-<p class="whs3">aa = [] <span style="font-family: 'Times New Roman', serif;"># \r
+<p class="whs1">aa = [] <span style="font-family: 'Times New Roman', serif;"># \r
bottom</span></p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3">for i in range(5):</p>\r
+<p class="whs1">for i in range(5):</p>\r
\r
-<p class="whs3"> cos_bot \r
+<p class="whs1"> cos_bot \r
= math.cos(i*al)</p>\r
\r
-<p class="whs3"> sin_bot \r
+<p class="whs1"> sin_bot \r
= math.sin(i*al)</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3"> <span \r
+<p class="whs1"> <span \r
style="margin-top: 0pt;\r
margin-bottom: 0pt;\r
font-family: 'Lucida Console', monospace;">cos_top \r
= math.cos(i*al + al/2.0)</span></p>\r
\r
-<p class="whs3"> sin_top \r
+<p class="whs1"> sin_top \r
= math.sin(i*al + al/2.0)</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3"> nd \r
- = MeshEditor.AddNode(rr * cos_top, rr * sin_top, hh ) \r
+<p class="whs1"> nd \r
+ = mesh.AddNode(rr * cos_top, rr * sin_top, hh ) \r
<span style="font-family: 'Times New Roman', serif;"># top</span></p>\r
\r
-<p class="whs3"> nc \r
- = MeshEditor.AddNode(r1 * cos_top, r1 * sin_top, hh - dh) <span style="font-family: 'Times New Roman', serif;"># \r
+<p class="whs1"> nc \r
+ = mesh.AddNode(r1 * cos_top, r1 * sin_top, hh - dh) <span style="font-family: 'Times New Roman', serif;"># \r
below top</span></p>\r
\r
-<p class="whs3"> nb \r
- = MeshEditor.AddNode(r1 * cos_bot, r1 * sin_bot, dh) \r
+<p class="whs1"> nb \r
+ = mesh.AddNode(r1 * cos_bot, r1 * sin_bot, dh) \r
<span style="font-family: 'Times New Roman', serif;"># above bottom</span></p>\r
\r
-<p class="whs3"> na \r
- = MeshEditor.AddNode(rr * cos_bot, rr * sin_bot, 0) \r
+<p class="whs1"> na \r
+ = mesh.AddNode(rr * cos_bot, rr * sin_bot, 0) \r
<span style="font-family: 'Times New Roman', serif;"># bottom</span></p>\r
\r
-<p class="whs3"> dd.append(nd) \r
+<p class="whs1"> dd.append(nd) \r
<span style="font-family: 'Times New Roman', serif;"># top</span></p>\r
\r
-<p class="whs3"> cc.append(nc) \r
+<p class="whs1"> cc.append(nc) \r
<span style="font-family: 'Times New Roman', serif;"># below top</span></p>\r
\r
-<p class="whs3"> bb.append(nb) \r
+<p class="whs1"> bb.append(nb) \r
<span style="font-family: 'Times New Roman', serif;"># above bottom</span></p>\r
\r
-<p class="whs3"> aa.append(na) \r
+<p class="whs1"> aa.append(na) \r
<span style="font-family: 'Times New Roman', serif;"># bottom</span></p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3"> pass</p>\r
+<p class="whs1"> pass</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs4"># Create a polyhedral \r
+<p class="whs2"># Create a polyhedral \r
volume (12-hedron with pentagonal faces)</p>\r
\r
-<p class="whs3">MeshEditor.AddPolyhedralVolume([dd[0], \r
+<p class="whs1">MeshEditor.AddPolyhedralVolume([dd[0], \r
dd[1], dd[2], dd[3], dd[4], <span style="font-family: 'Times New Roman', serif;"># \r
top</span></p>\r
\r
-<p class="whs3"> dd[0], \r
+<p class="whs1"> dd[0], \r
cc[0], bb[1], cc[1], dd[1], # \r
-</p>\r
\r
-<p class="whs3"> dd[1], \r
+<p class="whs1"> dd[1], \r
cc[1], bb[2], cc[2], dd[2], # \r
-</p>\r
\r
-<p class="whs3"> dd[2], \r
+<p class="whs1"> dd[2], \r
cc[2], bb[3], cc[3], dd[3], <span style="font-family: 'Times New Roman', serif;"># \r
- below top</span></p>\r
\r
-<p class="whs3"> dd[3], \r
+<p class="whs1"> dd[3], \r
cc[3], bb[4], cc[4], dd[4], # \r
-</p>\r
\r
-<p class="whs3"> dd[4], \r
+<p class="whs1"> dd[4], \r
cc[4], bb[0], cc[0], dd[0], # \r
-</p>\r
\r
-<p class="whs3"> aa[4], \r
+<p class="whs1"> aa[4], \r
bb[4], cc[4], bb[0], aa[0], # \r
.</p>\r
\r
-<p class="whs3"> aa[3], \r
+<p class="whs1"> aa[3], \r
bb[3], cc[3], bb[4], aa[4], # \r
.</p>\r
\r
-<p class="whs3"> aa[2], \r
+<p class="whs1"> aa[2], \r
bb[2], cc[2], bb[3], aa[3], <span style="font-family: 'Times New Roman', serif;"># \r
. above bottom</span></p>\r
\r
-<p class="whs3"> aa[1], \r
+<p class="whs1"> aa[1], \r
bb[1], cc[1], bb[2], aa[2], # \r
.</p>\r
\r
-<p class="whs3"> aa[0], \r
+<p class="whs1"> aa[0], \r
bb[0], cc[0], bb[1], aa[1], # \r
.</p>\r
\r
-<p class="whs3"> aa[0], \r
+<p class="whs1"> aa[0], \r
aa[1], aa[2], aa[3], aa[4]], <span style="font-family: 'Times New Roman', serif;"># \r
bottom</span></p>\r
\r
-<p class="whs3"> [5,5,5,5,5,5,5,5,5,5,5,5])</p>\r
+<p class="whs1"> [5,5,5,5,5,5,5,5,5,5,5,5])</p>\r
\r
-<p class="whs3">salome.sg.updateObjBrowser(1) \r
+<p class="whs1">salome.sg.updateObjBrowser(1) \r
</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
<h3><a name=bookmark1>Removing Nodes and Elements</a></h3>\r
\r
-<p class="whs1"><span style="font-weight: bold; color: #ff0000;"><font color=red ><B># \r
- Attention! This script has been written using the old approach basing \r
- on direct usage of SMESH idl interface.</B></font></span></p>\r
-\r
-<p class="whs1"># For the moment smesh package doesn't provide \r
- methods to remove nodes and elements. </p>\r
-\r
-<p class="whs1"># In the next SALOME version the scripts will \r
- be updated to use only the commands from smesh package.</p>\r
-\r
-<h4 class="whs5"> </h4>\r
+<h4 class="whs4">Removing Nodes</h4>\r
\r
-<h4 class="whs5">Removing Nodes</h4>\r
-\r
-<p class="whs2"> </p>\r
+<p class="whs3"> </p>\r
\r
-<p class="whs3"><span style="font-family: 'Lucida Console', monospace;">import \r
+<p class="whs1"><span style="font-family: 'Lucida Console', monospace;">import \r
SMESH_mechanic</span></p>\r
\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs3">mesh = SMESH_mechanic.mesh</p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3">aMeshEditor = mesh.GetMeshEditor()</p>\r
+<p class="whs1">mesh = SMESH_mechanic.mesh</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs4"># remove nodes #246 \r
+<p class="whs2"># remove nodes #246 \r
and #255</p>\r
\r
-<p class="whs3">res = aMeshEditor.RemoveNodes([246, \r
+<p class="whs1">res = mesh.RemoveNodes([246, \r
255])</p>\r
\r
-<p class="whs3">if res == 1: print \r
+<p class="whs1">if res == 1: print \r
"Nodes removing is OK!"</p>\r
\r
-<p class="whs3">else: print \r
+<p class="whs1">else: print \r
"KO nodes removing." </p>\r
\r
-<p class="whs2"> </p>\r
+<p class="whs3"> </p>\r
\r
<h4>Removing Elements</h4>\r
\r
-<p class="whs3"><span style="font-family: 'Lucida Console', monospace;">import \r
- SMESH_mechanic</span></p>\r
-\r
-<p class="whs3">mesh = SMESH_mechanic.mesh</p>\r
+<p class="whs1">import SMESH_mechanic</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3">anEditor = mesh.GetMeshEditor()</p>\r
+<p class="whs1">mesh = SMESH_mechanic.mesh</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs4"># remove three elements: \r
+<p class="whs2"># remove three elements: \r
#850, #859 and #814</p>\r
\r
-<p class="whs3">res = anEditor.RemoveElements([850, \r
+<p class="whs1">res = mesh.RemoveElements([850, \r
859, 814])</p>\r
\r
-<p class="whs3">if res == 1: print \r
+<p class="whs1">if res == 1: print \r
"Elements removing is OK!"</p>\r
\r
-<p class="whs3">else: print \r
+<p class="whs1">else: print \r
"KO Elements removing." </p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
<h3><a name=bookmark2>Renumbering Nodes and Elements</a></h3>\r
\r
-<p class="whs1"><span style="font-weight: bold; color: #ff0000;"><font color=red ><B># \r
- Attention! This script has been written using the old approach basing \r
- on direct usage of SMESH idl interface.</B></font></span></p>\r
+<p class="whs5">import SMESH_mechanic</p>\r
\r
-<p class="whs1"># For the moment smesh package doesn't provide \r
- methods to renumber nodes and elements. </p>\r
+<p class="whs5"> </p>\r
\r
-<p class="whs1"># In the next SALOME version the scripts will \r
- be updated to use only the commands from smesh package.</p>\r
+<p class="whs5">mesh = SMESH_mechanic.mesh</p>\r
\r
<p class="whs6"> </p>\r
\r
-<p class="whs6">import SMESH_mechanic</p>\r
-\r
-<p class="whs6"> </p>\r
-\r
-<p class="whs6">mesh = SMESH_mechanic.mesh</p>\r
-\r
-<p class="whs6">anEditor = mesh.GetMeshEditor()</p>\r
-\r
-<p class="whs7"> </p>\r
-\r
-<p class="whs7"><span style="font-family: 'Lucida Console', monospace;">anEditor.RenumberNodes()</span> \r
+<p class="whs6"><span style="font-family: 'Lucida Console', monospace;">mesh.RenumberNodes()</span> \r
</p>\r
\r
<h3><a name=bookmark3>Moving Nodes</a></h3>\r
\r
-<p class="whs1"><span style="font-weight: bold; color: #ff0000;"><font color=red ><B># \r
- Attention! This script has been written using the old approach basing \r
- on direct usage of SMESH idl interface.</B></font></span></p>\r
-\r
-<p class="whs1"># For the moment smesh package doesn't provide \r
- methods to move nodes. </p>\r
-\r
-<p class="whs1"># In the next SALOME version the scripts will \r
- be updated to use only the commands from smesh package.</p>\r
-\r
-<p class="whs3"> </p>\r
+<p class="whs1">import SMESH_mechanic</p>\r
\r
-<p class="whs3">import SMESH</p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3">import SMESH_mechanic</p>\r
+<p class="whs1">mesh = SMESH_mechanic.mesh</p>\r
\r
<p class="whs3"> </p>\r
\r
-<p class="whs3">mesh = SMESH_mechanic.mesh</p>\r
-\r
-<p class="whs3">aMeshEditor = mesh.GetMeshEditor()</p>\r
-\r
-<p class="whs2"> </p>\r
-\r
-<p class="whs2"># move node #38</p>\r
+<p class="whs3"># move node #38</p>\r
\r
-<p class="whs3">aMeshEditor.MoveNode(38, \r
+<p class="whs1">mesh.MoveNode(38, \r
20., 10., 0.) </p>\r
\r
-<p class="whs2"> </p>\r
+<p class="whs3"> </p>\r
\r
<h3><a name=bookmark4>Diagonal Inversion</a></h3>\r
\r
-<p class="whs1"><span style="font-weight: bold; color: #ff0000;"><font color=red ><B># \r
- Attention! This script has been written using the old approach basing \r
- on direct usage of SMESH idl interface.</B></font></span></p>\r
-\r
-<p class="whs1"># For the moment smesh package doesn't provide \r
- methods to produce a diagonal inversion. </p>\r
-\r
-<p class="whs1"># In the next SALOME version the scripts will \r
- be updated to use only the commands from smesh package.</p>\r
-\r
-<p class="whs7"> </p>\r
-\r
-<p class="whs6">import salome</p>\r
+<p class="whs5">import salome</p>\r
\r
-<p class="whs6">import smesh</p>\r
+<p class="whs5">import smesh</p>\r
\r
-<p class="whs6"> </p>\r
+<p class="whs5"> </p>\r
\r
-<p class="whs8"># create an empty mesh \r
+<p class="whs7"># create an empty mesh \r
structure</p>\r
\r
-<p class="whs6">gen = smesh.smesh</p>\r
-\r
-<p class="whs6">mesh = gen.CreateEmptyMesh()</p>\r
-\r
-<p class="whs6">aMeshEditor = mesh.GetMeshEditor()</p>\r
+<p class="whs5">mesh = smesh.Mesh() \r
+ </p>\r
\r
-<p class="whs6"> </p>\r
+<p class="whs5"> </p>\r
\r
-<p class="whs8"># create the following \r
+<p class="whs7"># create the following \r
mesh:</p>\r
\r
-<p class="whs6"># .----.----.----.</p>\r
+<p class="whs5"># .----.----.----.</p>\r
\r
-<p class="whs6"># | /| \r
+<p class="whs5"># | /| \r
/| \r
/|</p>\r
\r
-<p class="whs6"># | / \r
+<p class="whs5"># | / \r
| / | / \r
|</p>\r
\r
-<p class="whs6"># | / | \r
+<p class="whs5"># | / | \r
/ | / |</p>\r
\r
-<p class="whs6"># |/ |/ \r
+<p class="whs5"># |/ |/ \r
|/ \r
|</p>\r
\r
-<p class="whs6"># .----.----.----.</p>\r
+<p class="whs5"># .----.----.----.</p>\r
\r
-<p class="whs6"> </p>\r
+<p class="whs5"> </p>\r
\r
-<p class="whs6">bb = [0, 0, 0, 0]</p>\r
+<p class="whs5">bb = [0, 0, 0, 0]</p>\r
\r
-<p class="whs6">tt = [0, 0, 0, 0]</p>\r
+<p class="whs5">tt = [0, 0, 0, 0]</p>\r
\r
-<p class="whs6">ff = [0, 0, 0, 0, \r
+<p class="whs5">ff = [0, 0, 0, 0, \r
0, 0]</p>\r
\r
-<p class="whs6"> </p>\r
+<p class="whs5"> </p>\r
\r
-<p class="whs6">bb[0] = aMeshEditor.AddNode( \r
+<p class="whs5">bb[0] = mesh.AddNode( \r
0., 0., 0.)</p>\r
\r
-<p class="whs6">bb[1] = aMeshEditor.AddNode(10., \r
+<p class="whs5">bb[1] = mesh.AddNode(10., \r
0., 0.)</p>\r
\r
-<p class="whs6">bb[2] = aMeshEditor.AddNode(20., \r
+<p class="whs5">bb[2] = mesh.AddNode(20., \r
0., 0.)</p>\r
\r
-<p class="whs6">bb[3] = aMeshEditor.AddNode(30., \r
+<p class="whs5">bb[3] = mesh.AddNode(30., \r
0., 0.)</p>\r
\r
-<p class="whs6"> </p>\r
+<p class="whs5"> </p>\r
\r
-<p class="whs6">tt[0] = aMeshEditor.AddNode( \r
+<p class="whs5">tt[0] = mesh.AddNode( \r
0., 15., 0.)</p>\r
\r
-<p class="whs6">tt[1] = aMeshEditor.AddNode(10., \r
+<p class="whs5">tt[1] = mesh.AddNode(10., \r
15., 0.)</p>\r
\r
-<p class="whs6">tt[2] = aMeshEditor.AddNode(20., \r
+<p class="whs5">tt[2] = mesh.AddNode(20., \r
15., 0.)</p>\r
\r
-<p class="whs6">tt[3] = aMeshEditor.AddNode(30., \r
+<p class="whs5">tt[3] = mesh.AddNode(30., \r
15., 0.)</p>\r
\r
-<p class="whs6"> </p>\r
+<p class="whs5"> </p>\r
\r
-<p class="whs6">ff[0] = aMeshEditor.AddFace([bb[0], \r
+<p class="whs5">ff[0] = mesh.AddFace([bb[0], \r
bb[1], tt[1]])</p>\r
\r
-<p class="whs6">ff[1] = aMeshEditor.AddFace([bb[0], \r
+<p class="whs5">ff[1] = mesh.AddFace([bb[0], \r
tt[1], tt[0]])</p>\r
\r
-<p class="whs6">ff[2] = aMeshEditor.AddFace([bb[1], \r
+<p class="whs5">ff[2] = mesh.AddFace([bb[1], \r
bb[2], tt[2]])</p>\r
\r
-<p class="whs6">ff[3] = aMeshEditor.AddFace([bb[1], \r
+<p class="whs5">ff[3] = mesh.AddFace([bb[1], \r
tt[2], tt[1]])</p>\r
\r
-<p class="whs6">ff[4] = aMeshEditor.AddFace([bb[2], \r
+<p class="whs5">ff[4] = mesh.AddFace([bb[2], \r
bb[3], tt[3]])</p>\r
\r
-<p class="whs6">ff[5] = aMeshEditor.AddFace([bb[2], \r
+<p class="whs5">ff[5] = mesh.AddFace([bb[2], \r
tt[3], tt[2]])</p>\r
\r
-<p class="whs6"> </p>\r
+<p class="whs5"> </p>\r
\r
-<p class="whs8"># inverse the diagonal \r
+<p class="whs7"># inverse the diagonal \r
bb[1] - tt[2]</p>\r
\r
-<p class="whs6">print "\nDiagonal \r
+<p class="whs5">print "\nDiagonal \r
inversion ... ",</p>\r
\r
-<p class="whs6">res = aMeshEditor.InverseDiag(bb[1], \r
+<p class="whs5">res = mesh.InverseDiag(bb[1], \r
tt[2])</p>\r
\r
-<p class="whs6">if not res: print \r
+<p class="whs5">if not res: print \r
"failed!"</p>\r
\r
-<p class="whs6">else: print \r
+<p class="whs5">else: print \r
"done."</p>\r
\r
-<p class="whs7"> </p>\r
+<p class="whs6"> </p>\r
\r
-<p class="whs7"><span style="font-family: 'Lucida Console', monospace;">salome.sg.updateObjBrowser(1)</span> \r
+<p class="whs6"><span style="font-family: 'Lucida Console', monospace;">salome.sg.updateObjBrowser(1)</span> \r
</p>\r
\r
<h3><a name=bookmark5>Uniting two Triangles</a></h3>\r
\r
-<p class="whs1"><span style="font-weight: bold; color: #ff0000;"><font color=red ><B># \r
- Attention! This script has been written using the old approach basing \r
- on direct usage of SMESH idl interface.</B></font></span></p>\r
-\r
-<p class="whs1"># For the moment smesh package doesn't provide \r
- methods to unite two triangles. </p>\r
-\r
-<p class="whs1"># In the next SALOME version the scripts will \r
- be updated to use only the commands from smesh package.</p>\r
-\r
-<p> </p>\r
-\r
-<p class="whs9">import salome</p>\r
+<p class="whs8">import salome</p>\r
\r
-<p class="whs9">import smesh</p>\r
+<p class="whs8">import smesh</p>\r
\r
<p> </p>\r
\r
<p># create an empty mesh structure</p>\r
\r
-<p class="whs9">gen = smesh.smesh</p>\r
-\r
-<p class="whs9">mesh = gen.CreateEmptyMesh()</p>\r
-\r
-<p class="whs9">aMeshEditor = mesh.GetMeshEditor()</p>\r
+<p class="whs8">mesh = smesh.Mesh() \r
+ </p>\r
\r
<p> </p>\r
\r
<p># create the following mesh:</p>\r
\r
-<p class="whs9"># .----.----.----.</p>\r
+<p class="whs8"># .----.----.----.</p>\r
\r
-<p class="whs9"># | /| \r
+<p class="whs8"># | /| \r
/| \r
/|</p>\r
\r
-<p class="whs9"># | / \r
+<p class="whs8"># | / \r
| / | / \r
|</p>\r
\r
-<p class="whs9"># | / | \r
+<p class="whs8"># | / | \r
/ | / |</p>\r
\r
-<p class="whs9"># |/ |/ \r
+<p class="whs8"># |/ |/ \r
|/ \r
|</p>\r
\r
-<p class="whs9"># .----.----.----.</p>\r
+<p class="whs8"># .----.----.----.</p>\r
\r
<p> </p>\r
\r
-<p class="whs9">bb = [0, 0, 0, 0]</p>\r
+<p class="whs8">bb = [0, 0, 0, 0]</p>\r
\r
-<p class="whs9">tt = [0, 0, 0, 0]</p>\r
+<p class="whs8">tt = [0, 0, 0, 0]</p>\r
\r
-<p class="whs9">ff = [0, 0, 0, 0, \r
+<p class="whs8">ff = [0, 0, 0, 0, \r
0, 0]</p>\r
\r
-<p class="whs9"> </p>\r
+<p class="whs8"> </p>\r
\r
-<p class="whs9">bb[0] = aMeshEditor.AddNode( \r
- 0., 0., 0.)</p>\r
+<p class="whs8"><span style="font-family: 'Lucida Console', monospace;">bb[0] \r
+ = mesh.AddNode( 0., 0., 0.)</span></p>\r
\r
-<p class="whs9">bb[1] = aMeshEditor.AddNode(10., \r
+<p class="whs8">bb[1] = mesh.AddNode(10., \r
0., 0.)</p>\r
\r
-<p class="whs9">bb[2] = aMeshEditor.AddNode(20., \r
+<p class="whs8">bb[2] = mesh.AddNode(20., \r
0., 0.)</p>\r
\r
-<p class="whs9">bb[3] = aMeshEditor.AddNode(30., \r
+<p class="whs8">bb[3] = mesh.AddNode(30., \r
0., 0.)</p>\r
\r
-<p class="whs9"> </p>\r
+<p class="whs8"> </p>\r
\r
-<p class="whs9">tt[0] = aMeshEditor.AddNode( \r
+<p class="whs8">tt[0] = mesh.AddNode( \r
0., 15., 0.)</p>\r
\r
-<p class="whs9">tt[1] = aMeshEditor.AddNode(10., \r
+<p class="whs8">tt[1] = mesh.AddNode(10., \r
15., 0.)</p>\r
\r
-<p class="whs9">tt[2] = aMeshEditor.AddNode(20., \r
+<p class="whs8">tt[2] = mesh.AddNode(20., \r
15., 0.)</p>\r
\r
-<p class="whs9">tt[3] = aMeshEditor.AddNode(30., \r
+<p class="whs8">tt[3] = mesh.AddNode(30., \r
15., 0.)</p>\r
\r
-<p class="whs9"> </p>\r
+<p class="whs8"> </p>\r
\r
-<p class="whs9">ff[0] = aMeshEditor.AddFace([bb[0], \r
+<p class="whs8">ff[0] = mesh.AddFace([bb[0], \r
bb[1], tt[1]])</p>\r
\r
-<p class="whs9">ff[1] = aMeshEditor.AddFace([bb[0], \r
+<p class="whs8">ff[1] = mesh.AddFace([bb[0], \r
tt[1], tt[0]])</p>\r
\r
-<p class="whs9">ff[2] = aMeshEditor.AddFace([bb[1], \r
+<p class="whs8">ff[2] = mesh.AddFace([bb[1], \r
bb[2], tt[2]])</p>\r
\r
-<p class="whs9">ff[3] = aMeshEditor.AddFace([bb[1], \r
+<p class="whs8">ff[3] = mesh.AddFace([bb[1], \r
tt[2], tt[1]])</p>\r
\r
-<p class="whs9">ff[4] = aMeshEditor.AddFace([bb[2], \r
+<p class="whs8">ff[4] = mesh.AddFace([bb[2], \r
bb[3], tt[3]])</p>\r
\r
-<p class="whs9">ff[5] = aMeshEditor.AddFace([bb[2], \r
- tt[3], tt[2]])</p>\r
+<p class="whs8">ff[5] = mesh.AddFace([bb[2], \r
+ tt[3], tt[2]]) </p>\r
\r
<p> </p>\r
\r
<p># delete the diagonal bb[1] - tt[2]</p>\r
\r
-<p class="whs9">print "\nUnite \r
+<p class="whs8">print "\nUnite \r
two triangles ... ",</p>\r
\r
-<p class="whs9">res = aMeshEditor.DeleteDiag(bb[1], \r
+<p class="whs8">res = mesh.DeleteDiag(bb[1], \r
tt[2])</p>\r
\r
-<p class="whs9">if not res: print \r
+<p class="whs8">if not res: print \r
"failed!"</p>\r
\r
-<p class="whs9">else: print \r
+<p class="whs8">else: print \r
"done."</p>\r
\r
-<p class="whs9"> </p>\r
+<p class="whs8"> </p>\r
\r
<p><span style="font-family: 'Lucida Console', monospace;">salome.sg.updateObjBrowser(1)</span> \r
</p>\r
\r
<h3><a name=bookmark6>Uniting a Set of Triangles</a></h3>\r
\r
-<p class="whs1"><span style="font-weight: bold; color: #ff0000;"><font color=red ><B># \r
- Attention! This script has been written using the old approach basing \r
- on direct usage of SMESH idl interface.</B></font></span></p>\r
-\r
-<p class="whs1"># For the moment smesh package doesn't provide \r
- methods to unite a set of triangles. </p>\r
+<p class="whs8">import salome</p>\r
\r
-<p class="whs1"># In the next SALOME version the scripts will \r
- be updated to use only the commands from smesh package.</p>\r
+<p class="whs8">import smesh</p>\r
\r
-<p class="whs10"> </p>\r
+<p class="whs8"> </p>\r
\r
-<p class="whs9">import salome</p>\r
-\r
-<p class="whs9">import smesh</p>\r
-\r
-<p class="whs9"> </p>\r
-\r
-<p class="whs10"># create an empty mesh \r
+<p class="whs9"># create an empty mesh \r
structure</p>\r
\r
-<p class="whs9">gen = smesh.smesh</p>\r
-\r
-<p class="whs9">mesh = gen.CreateEmptyMesh()</p>\r
-\r
-<p class="whs9">aMeshEditor = mesh.GetMeshEditor()</p>\r
+<p class="whs8">mesh = smesh.Mesh() \r
+ </p>\r
\r
-<p class="whs9"> </p>\r
+<p class="whs8"> </p>\r
\r
-<p class="whs10"># create the following \r
+<p class="whs9"># create the following \r
mesh:</p>\r
\r
-<p class="whs9"># .----.----.----.</p>\r
+<p class="whs8"># .----.----.----.</p>\r
\r
-<p class="whs9"># | /| \r
+<p class="whs8"># | /| \r
/| \r
/|</p>\r
\r
-<p class="whs9"># | / \r
+<p class="whs8"># | / \r
| / | / \r
|</p>\r
\r
-<p class="whs9"># | / | \r
+<p class="whs8"># | / | \r
/ | / |</p>\r
\r
-<p class="whs9"># |/ |/ \r
+<p class="whs8"># |/ |/ \r
|/ \r
|</p>\r
\r
-<p class="whs9"># .----.----.----.</p>\r
+<p class="whs8"># .----.----.----.</p>\r
\r
-<p class="whs9"> </p>\r
+<p class="whs8"> </p>\r
\r
-<p class="whs9">bb = [0, 0, 0, 0]</p>\r
+<p class="whs8">bb = [0, 0, 0, 0]</p>\r
\r
-<p class="whs9">tt = [0, 0, 0, 0]</p>\r
+<p class="whs8">tt = [0, 0, 0, 0]</p>\r
\r
-<p class="whs9">ff = [0, 0, 0, 0, \r
+<p class="whs8">ff = [0, 0, 0, 0, \r
0, 0]</p>\r
\r
-<p class="whs9"> </p>\r
+<p class="whs8"> </p>\r
\r
-<p class="whs9">bb[0] = aMeshEditor.AddNode( \r
- 0., 0., 0.)</p>\r
+<p class="whs8"><span style="font-family: 'Lucida Console', monospace;">bb[0] \r
+ = mesh.AddNode( 0., 0., 0.)</span></p>\r
\r
-<p class="whs9">bb[1] = aMeshEditor.AddNode(10., \r
+<p class="whs8">bb[1] = mesh.AddNode(10., \r
0., 0.)</p>\r
\r
-<p class="whs9">bb[2] = aMeshEditor.AddNode(20., \r
+<p class="whs8">bb[2] = mesh.AddNode(20., \r
0., 0.)</p>\r
\r
-<p class="whs9">bb[3] = aMeshEditor.AddNode(30., \r
+<p class="whs8">bb[3] = mesh.AddNode(30., \r
0., 0.)</p>\r
\r
-<p class="whs9"> </p>\r
+<p class="whs8"> </p>\r
\r
-<p class="whs9">tt[0] = aMeshEditor.AddNode( \r
+<p class="whs8">tt[0] = mesh.AddNode( \r
0., 15., 0.)</p>\r
\r
-<p class="whs9">tt[1] = aMeshEditor.AddNode(10., \r
+<p class="whs8">tt[1] = mesh.AddNode(10., \r
15., 0.)</p>\r
\r
-<p class="whs9">tt[2] = aMeshEditor.AddNode(20., \r
+<p class="whs8">tt[2] = mesh.AddNode(20., \r
15., 0.)</p>\r
\r
-<p class="whs9">tt[3] = aMeshEditor.AddNode(30., \r
+<p class="whs8">tt[3] = mesh.AddNode(30., \r
15., 0.)</p>\r
\r
-<p class="whs9"> </p>\r
+<p class="whs8"> </p>\r
\r
-<p class="whs9">ff[0] = aMeshEditor.AddFace([bb[0], \r
+<p class="whs8">ff[0] = mesh.AddFace([bb[0], \r
bb[1], tt[1]])</p>\r
\r
-<p class="whs9">ff[1] = aMeshEditor.AddFace([bb[0], \r
+<p class="whs8">ff[1] = mesh.AddFace([bb[0], \r
tt[1], tt[0]])</p>\r
\r
-<p class="whs9">ff[2] = aMeshEditor.AddFace([bb[1], \r
+<p class="whs8">ff[2] = mesh.AddFace([bb[1], \r
bb[2], tt[2]])</p>\r
\r
-<p class="whs9">ff[3] = aMeshEditor.AddFace([bb[1], \r
+<p class="whs8">ff[3] = mesh.AddFace([bb[1], \r
tt[2], tt[1]])</p>\r
\r
-<p class="whs9">ff[4] = aMeshEditor.AddFace([bb[2], \r
+<p class="whs8">ff[4] = mesh.AddFace([bb[2], \r
bb[3], tt[3]])</p>\r
\r
-<p class="whs9">ff[5] = aMeshEditor.AddFace([bb[2], \r
+<p class="whs8">ff[5] = mesh.AddFace([bb[2], \r
tt[3], tt[2]])</p>\r
\r
-<p class="whs9"> </p>\r
-\r
-<p class="whs10"># unite a set of triangles</p>\r
+<p class="whs8"> </p>\r
\r
-<p class="whs9">aFilterMgr = smesh.smesh.CreateFilterManager()</p>\r
+<p class="whs9"># unite a set of triangles</p>\r
\r
-<p class="whs9">aFunctor = aFilterMgr.CreateMinimumAngle()</p>\r
+<p class="whs8"><span style="font-family: 'Lucida Console', monospace;">print \r
+ "\nUnite a set of triangles ... ",</span></p>\r
\r
-<p class="whs9">print "\nUnite \r
- a set of triangles ... ",</p>\r
+<p class="whs8">res = mesh.TriToQuad([ff[2], \r
+ ff[3], ff[4], ff[5]], smesh.FT_MinimumAngle, 60.)</p>\r
\r
-<p class="whs9">res = aMeshEditor.TriToQuad([ff[2], \r
- ff[3], ff[4], ff[5]], aFunctor, 60.)</p>\r
-\r
-<p class="whs9">if not res: print \r
+<p class="whs8">if not res: print \r
"failed!"</p>\r
\r
-<p class="whs9">else: print \r
+<p class="whs8">else: print \r
"done."</p>\r
\r
-<p class="whs9"> </p>\r
+<p class="whs8"> </p>\r
\r
-<p class="whs9">salome.sg.updateObjBrowser(1) \r
- </p>\r
+<p class="whs8">salome.sg.updateObjBrowser(1) \r
+ </p>\r
\r
<h3><a name=bookmark12>Orientation</a></h3>\r
\r
-<p class="whs1"><span style="font-weight: bold; color: #ff0000;"><font color=red ><B># \r
- Attention! This script has been written using the old approach basing \r
- on direct usage of SMESH idl interface.</B></font></span></p>\r
-\r
-<p class="whs1"># For the moment smesh package doesn't provide \r
- methods to change orientation. </p>\r
-\r
-<p class="whs1"># In the next SALOME version the scripts will \r
- be updated to use only the commands from smesh package.</p>\r
-\r
-<p class="whs9"> </p>\r
-\r
-<p class="whs9">import salome</p>\r
-\r
-<p class="whs9">import smesh</p>\r
-\r
-<p class="whs9"> </p>\r
+<p class="whs8">import salome</p>\r
\r
-<p class="whs10"># SMESH module</p>\r
+<p class="whs8">import smesh</p>\r
\r
-<p class="whs9">gen = smesh.smesh</p>\r
+<p class="whs8"> </p>\r
\r
-<p class="whs9">mesh = gen.CreateEmptyMesh()</p>\r
+<p># create an empty mesh structure</p>\r
\r
-<p class="whs9">MeshEditor = mesh.GetMeshEditor()</p>\r
+<p class="whs8">mesh = smesh.Mesh() \r
+ </p>\r
\r
-<p class="whs9"> </p>\r
+<p class="whs8"> </p>\r
\r
-<p class="whs10"># build five quadrangles:</p>\r
+<p class="whs9"># build five quadrangles:</p>\r
\r
-<p class="whs9">dx = 10</p>\r
+<p class="whs8">dx = 10</p>\r
\r
-<p class="whs9">dy = 20</p>\r
+<p class="whs8">dy = 20</p>\r
\r
-<p class="whs9"> </p>\r
+<p class="whs8"> </p>\r
\r
-<p class="whs9">n1 = \r
- MeshEditor.AddNode(0.0 * dx, 0, 0)</p>\r
+<p class="whs8"><span style="font-family: 'Lucida Console', monospace;">n1 \r
+ = mesh.AddNode(0.0 \r
+ * dx, 0, 0)</span></p>\r
\r
-<p class="whs9">n2 = \r
- MeshEditor.AddNode(1.0 * dx, 0, 0)</p>\r
+<p class="whs8">n2 = \r
+ mesh.AddNode(1.0 * dx, 0, 0)</p>\r
\r
-<p class="whs9">n3 = \r
- MeshEditor.AddNode(2.0 * dx, 0, 0)</p>\r
+<p class="whs8">n3 = \r
+ mesh.AddNode(2.0 * dx, 0, 0)</p>\r
\r
-<p class="whs9">n4 = \r
- MeshEditor.AddNode(3.0 * dx, 0, 0)</p>\r
+<p class="whs8">n4 = \r
+ mesh.AddNode(3.0 * dx, 0, 0)</p>\r
\r
-<p class="whs9">n5 = \r
- MeshEditor.AddNode(4.0 * dx, 0, 0)</p>\r
+<p class="whs8">n5 = \r
+ mesh.AddNode(4.0 * dx, 0, 0)</p>\r
\r
-<p class="whs9">n6 = \r
- MeshEditor.AddNode(5.0 * dx, 0, 0)</p>\r
+<p class="whs8">n6 = \r
+ mesh.AddNode(5.0 * dx, 0, 0)</p>\r
\r
-<p class="whs9">n7 = \r
- MeshEditor.AddNode(0.0 * dx, dy, 0)</p>\r
+<p class="whs8">n7 = \r
+ mesh.AddNode(0.0 * dx, dy, 0)</p>\r
\r
-<p class="whs9">n8 = \r
- MeshEditor.AddNode(1.0 * dx, dy, 0)</p>\r
+<p class="whs8">n8 = \r
+ mesh.AddNode(1.0 * dx, dy, 0)</p>\r
\r
-<p class="whs9">n9 = \r
- MeshEditor.AddNode(2.0 * dx, dy, 0)</p>\r
+<p class="whs8">n9 = \r
+ mesh.AddNode(2.0 * dx, dy, 0)</p>\r
\r
-<p class="whs9">n10 = MeshEditor.AddNode(3.0 \r
+<p class="whs8">n10 = mesh.AddNode(3.0 \r
* dx, dy, 0)</p>\r
\r
-<p class="whs9">n11 = MeshEditor.AddNode(4.0 \r
+<p class="whs8">n11 = mesh.AddNode(4.0 \r
* dx, dy, 0)</p>\r
\r
-<p class="whs9">n12 = MeshEditor.AddNode(5.0 \r
+<p class="whs8">n12 = mesh.AddNode(5.0 \r
* dx, dy, 0)</p>\r
\r
-<p class="whs9"> </p>\r
+<p class="whs8"> </p>\r
\r
-<p class="whs9">f1 = MeshEditor.AddFace([n1, \r
+<p class="whs8">f1 = mesh.AddFace([n1, \r
n2, n8 , n7 ])</p>\r
\r
-<p class="whs9">f2 = MeshEditor.AddFace([n2, \r
+<p class="whs8">f2 = mesh.AddFace([n2, \r
n3, n9 , n8 ])</p>\r
\r
-<p class="whs9">f3 = MeshEditor.AddFace([n3, \r
+<p class="whs8">f3 = mesh.AddFace([n3, \r
n4, n10, n9 ])</p>\r
\r
-<p class="whs9">f4 = MeshEditor.AddFace([n4, \r
+<p class="whs8">f4 = mesh.AddFace([n4, \r
n5, n11, n10])</p>\r
\r
-<p class="whs9">f5 = MeshEditor.AddFace([n5, \r
- n6, n12, n11])</p>\r
+<p class="whs8">f5 = mesh.AddFace([n5, \r
+ n6, n12, n11]) </p>\r
\r
-<p class="whs9"> </p>\r
+<p class="whs8"> </p>\r
\r
-<p class="whs10"># Change the orientation \r
+<p class="whs9"># Change the orientation \r
of the second and the fourth faces.</p>\r
\r
-<p class="whs9">MeshEditor.Reorient([2, \r
+<p class="whs8">mesh.Reorient([2, \r
4])</p>\r
\r
-<p class="whs9"> </p>\r
+<p class="whs8"> </p>\r
\r
-<p class="whs9">salome.sg.updateObjBrowser(1) \r
+<p class="whs8">salome.sg.updateObjBrowser(1) \r
</p>\r
\r
-<p class="whs9"> </p>\r
+<p class="whs8"> </p>\r
\r
<h3><a name=bookmark7>Cutting Quadrangles</a></h3>\r
\r
-<p class="whs1"><span style="font-weight: bold; color: #ff0000;"><font color=red ><B># \r
- Attention! This script has been written using the old approach basing \r
- on direct usage of SMESH idl interface.</B></font></span></p>\r
+<p class="whs8">import SMESH_mechanic</p>\r
\r
-<p class="whs1"># For the moment smesh package doesn't provide \r
- methods to cut quadrangles. </p>\r
+<p class="whs8"> </p>\r
\r
-<p class="whs1"># In the next SALOME version the scripts will \r
- be updated to use only the commands from smesh package.</p>\r
+<p class="whs8">smesh = SMESH_mechanic.smesh</p>\r
\r
-<p class="whs9"> </p>\r
-\r
-<p class="whs9">import SMESH</p>\r
-\r
-<p class="whs9">import SMESH_mechanic</p>\r
-\r
-<p class="whs9"> </p>\r
-\r
-<p class="whs9">smesh = SMESH_mechanic.smesh</p>\r
-\r
-<p class="whs9">mesh = \r
+<p class="whs8">mesh = \r
SMESH_mechanic.mesh</p>\r
\r
-<p class="whs9"> </p>\r
+<p class="whs8"> </p>\r
\r
-<p class="whs10"># cut two quadrangles: \r
+<p class="whs9"># cut two quadrangles: \r
405 and 406</p>\r
\r
-<p class="whs9">aFilterMgr = smesh.CreateFilterManager()</p>\r
-\r
-<p class="whs9">aFunctor = aFilterMgr.CreateMinimumAngle()</p>\r
+<p class="whs8">mesh.QuadToTri([405, \r
+ 406], smesh.FT_MinimumAngle) </p>\r
\r
<p class="whs9"> </p>\r
\r
-<p class="whs9">aMeshEditor = mesh.GetMeshEditor()</p>\r
-\r
-<p class="whs9">aMeshEditor.QuadToTri([405, \r
- 406], aFunctor) </p>\r
-\r
-<p class="whs10"> </p>\r
-\r
<h3><a name=bookmark8>Smoothing</a></h3>\r
\r
-<p class="whs1"><span style="font-weight: bold; color: #ff0000;"><font color=red ><B># \r
- Attention! This script has been written using the old approach basing \r
- on direct usage of SMESH idl interface.</B></font></span></p>\r
-\r
-<p class="whs1"># For the moment smesh package doesn't provide \r
- methods to perform smoothing. </p>\r
-\r
-<p class="whs1"># In the next SALOME version the scripts will \r
- be updated to use only the commands from smesh package.</p>\r
-\r
-<p class="whs1"> </p>\r
-\r
-<p class="whs9">import salome</p>\r
+<p class="whs8">import salome</p>\r
\r
-<p class="whs9">import geompy</p>\r
+<p class="whs8">import geompy</p>\r
\r
-<p class="whs9"> </p>\r
+<p class="whs8"> </p>\r
\r
-<p class="whs9">import SMESH</p>\r
+<p class="whs8">import SMESH_mechanic</p>\r
\r
-<p class="whs9">import SMESH_mechanic</p>\r
+<p class="whs8"> </p>\r
\r
-<p class="whs9"> </p>\r
+<p class="whs8"><span style="font-family: 'Lucida Console', monospace;">smesh \r
+ = SMESH_mechanic.smesh</span></p>\r
\r
-<p class="whs9">mesh = SMESH_mechanic.mesh</p>\r
+<p class="whs8">mesh = SMESH_mechanic.mesh</p>\r
\r
-<p class="whs9">aMeshEditor = mesh.GetMeshEditor()</p>\r
-\r
-<p class="whs9"> </p>\r
+<p class="whs8"> </p>\r
\r
-<p class="whs10"># select the top face</p>\r
+<p class="whs9"># select the top face</p>\r
\r
-<p class="whs9">faces = geompy.SubShapeAllSorted(SMESH_mechanic.shape_mesh, \r
- geompy.ShapeType["FACE"])</p>\r
+<p class="whs8"><span style="font-family: 'Lucida Console', monospace;">faces \r
+ = geompy.SubShapeAllSorted(SMESH_mechanic.shape_mesh, geompy.ShapeType["FACE"])</span></p>\r
\r
-<p class="whs9">face = faces[3]</p>\r
+<p class="whs8">face = faces[3]</p>\r
\r
-<p class="whs9">geompy.addToStudyInFather(SMESH_mechanic.shape_mesh, \r
+<p class="whs8">geompy.addToStudyInFather(SMESH_mechanic.shape_mesh, \r
face, "face planar with hole")</p>\r
\r
-<p class="whs9"> </p>\r
+<p class="whs8"> </p>\r
\r
-<p class="whs10"># create a group of faces \r
- to be smoothed</p>\r
+<p class="whs8"># create a group of \r
+ faces to be smoothed</p>\r
\r
-<p class="whs9">GroupSmooth = mesh.CreateGroupFromGEOM(SMESH.FACE, \r
- "Group of faces (smooth)", face)</p>\r
+<p class="whs8">GroupSmooth = mesh.GroupOnGeom(face, \r
+ "Group of faces (smooth)", smesh.FACE)</p>\r
\r
-<p class="whs9"> </p>\r
+<p class="whs8"> </p>\r
\r
-<p class="whs10"># perform smoothing</p>\r
+<p class="whs8"># perform smoothing</p>\r
\r
-<p class="whs10"># boolean SmoothObject(Object, \r
- IDsOfFixedNodes, MaxNbOfIterations, MaxAspectRatio, Method)</p>\r
+<p class="whs8"> </p>\r
\r
-<p class="whs9">res = aMeshEditor.SmoothObject(GroupSmooth, \r
- [], 20, 2., SMESH.SMESH_MeshEditor.CENTROIDAL_SMOOTH)</p>\r
+<p class="whs8"># boolean SmoothObject(Object, \r
+ IDsOfFixedNodes, MaxNbOfIterations, MaxAspectRatio, Method)</p>\r
\r
-<p class="whs9"> </p>\r
+<p class="whs8">res = mesh.SmoothObject(GroupSmooth, \r
+ [], 20, 2., smesh.CENTROIDAL_SMOOTH)</p>\r
\r
-<p class="whs9">print "\nSmoothing \r
+<p class="whs8">print "\nSmoothing \r
... ",</p>\r
\r
-<p class="whs9">if not res: print \r
+<p class="whs8">if not res: print \r
"failed!"</p>\r
\r
-<p class="whs9">else: print \r
+<p class="whs8">else: print \r
"done."</p>\r
\r
-<p class="whs9"> </p>\r
+<p class="whs8"> </p>\r
\r
-<p class="whs9">salome.sg.updateObjBrowser(1) \r
+<p class="whs8">salome.sg.updateObjBrowser(1) \r
</p>\r
\r
-<p class="whs9"> </p>\r
+<p class="whs8"> </p>\r
\r
<h3><a name=bookmark9>Extrusion</a></h3>\r
\r
-<p class="whs1"><span style="font-weight: bold; color: #ff0000;"><font color=red ><B># \r
- Attention! This script has been written using the old approach basing \r
- on direct usage of SMESH idl interface.</B></font></span></p>\r
-\r
-<p class="whs1"># For the moment smesh package doesn't provide \r
- methods to perform extrusion. </p>\r
-\r
-<p class="whs1"># In the next SALOME version the scripts will \r
- be updated to use only the commands from smesh package.</p>\r
+<p class="whs8">import salome</p>\r
\r
-<p class="whs9"> </p>\r
-\r
-<p class="whs9">import salome</p>\r
-\r
-<p class="whs9">import geompy</p>\r
-\r
-<p class="whs9"> </p>\r
+<p class="whs8">import geompy</p>\r
\r
-<p class="whs9">import SMESH</p>\r
+<p class="whs8"> </p>\r
\r
-<p class="whs9">import SMESH_mechanic</p>\r
+<p class="whs8">import SMESH_mechanic</p>\r
\r
-<p class="whs9"> </p>\r
+<p class="whs8"> </p>\r
\r
-<p class="whs9">mesh = SMESH_mechanic.mesh</p>\r
+<p class="whs8"><span style="font-family: 'Lucida Console', monospace;">smesh \r
+ = SMESH_mechanic.smesh</span></p>\r
\r
-<p class="whs9">aMeshEditor = mesh.GetMeshEditor()</p>\r
+<p class="whs8">mesh = SMESH_mechanic.mesh \r
+ </p>\r
\r
-<p class="whs9"> </p>\r
+<p class="whs8"> </p>\r
\r
-<p class="whs10"># select the top face</p>\r
+<p class="whs9"># select the top face</p>\r
\r
-<p class="whs9">faces = geompy.SubShapeAllSorted(SMESH_mechanic.shape_mesh, \r
+<p class="whs8">faces = geompy.SubShapeAllSorted(SMESH_mechanic.shape_mesh, \r
geompy.ShapeType["FACE"])</p>\r
\r
-<p class="whs9">face = faces[7]</p>\r
+<p class="whs8">face = faces[7]</p>\r
\r
-<p class="whs9">geompy.addToStudyInFather(SMESH_mechanic.shape_mesh, \r
+<p class="whs8">geompy.addToStudyInFather(SMESH_mechanic.shape_mesh, \r
face, "face circular top")</p>\r
\r
-<p class="whs9"> </p>\r
+<p class="whs8"> </p>\r
\r
-<p class="whs10"># create a vector for \r
- extrusion</p>\r
+<p class="whs8"># create a vector \r
+ for extrusion</p>\r
\r
-<p class="whs9">point = SMESH.PointStruct(0., \r
+<p class="whs8">point = smesh.PointStruct(0., \r
0., 5.)</p>\r
\r
-<p class="whs9">vector = SMESH.DirStruct(point)</p>\r
+<p class="whs8">vector = smesh.DirStruct(point)</p>\r
\r
-<p class="whs9"> </p>\r
+<p class="whs8"> </p>\r
\r
-<p class="whs10"># create a group to be \r
- extruded</p>\r
+<p class="whs8"># create a group to \r
+ be extruded</p>\r
\r
-<p class="whs9">GroupTri = mesh.CreateGroupFromGEOM(SMESH.FACE, \r
- "Group of faces (extrusion)", face)</p>\r
+<p class="whs8">GroupTri = mesh.GroupOnGeom(face, \r
+ "Group of faces (extrusion)", smesh.FACE)</p>\r
\r
-<p class="whs9"> </p>\r
+<p class="whs8"> </p>\r
\r
-<p class="whs10"># perform extrusion of \r
- the group</p>\r
+<p class="whs8"># perform extrusion \r
+ of the group</p>\r
\r
-<p class="whs9">aMeshEditor.ExtrusionSweepObject(GroupTri, \r
+<p class="whs8">mesh.ExtrusionSweepObject(GroupTri, \r
vector, 5)</p>\r
\r
-<p class="whs10"> </p>\r
+<p class="whs8"> </p>\r
\r
-<p class="whs10"><span style="font-family: 'Lucida Console', monospace;">salome.sg.updateObjBrowser(1)</span> \r
+<p class="whs9"><span style="font-family: 'Lucida Console', monospace;">salome.sg.updateObjBrowser(1)</span> \r
</p>\r
\r
<h3><a name=bookmark10>Extrusion along a Path</a></h3>\r
\r
-<p class="whs1"><span style="font-weight: bold; color: #ff0000;"><font color=red ><B># \r
- Attention! This script has been written using the old approach basing \r
- on direct usage of SMESH idl interface.</B></font></span></p>\r
-\r
-<p class="whs1"># For the moment smesh package doesn't provide \r
- methods to perform extrusion along a path. </p>\r
+<p class="whs8">import math</p>\r
\r
-<p class="whs1"># In the next SALOME version the scripts will \r
- be updated to use only the commands from smesh package.</p>\r
+<p class="whs8">import salome</p>\r
\r
-<p class="whs9"> </p>\r
+<p class="whs8"> </p>\r
\r
-<p class="whs9">import math</p>\r
+<p class="whs9"># Geometry</p>\r
\r
-<p class="whs9">import salome</p>\r
+<p class="whs8">import geompy</p>\r
\r
<p class="whs9"> </p>\r
\r
-<p class="whs10"># Geometry</p>\r
-\r
-<p class="whs9">import geompy</p>\r
-\r
-<p class="whs10"> </p>\r
+<p class="whs9"># 1. Create points</p>\r
\r
-<p class="whs10"># 1. Create points</p>\r
-\r
-<p class="whs9">points = [[0, 0], \r
+<p class="whs8">points = [[0, 0], \r
[50, 30], [50, 110], [0, 150], [-80, 150], [-130, 70], [-130, -20]]</p>\r
\r
-<p class="whs9"> </p>\r
+<p class="whs8"> </p>\r
\r
-<p class="whs9">iv = 1</p>\r
+<p class="whs8">iv = 1</p>\r
\r
-<p class="whs9">vertices = []</p>\r
+<p class="whs8">vertices = []</p>\r
\r
-<p class="whs9">for point in points:</p>\r
+<p class="whs8">for point in points:</p>\r
\r
-<p class="whs11">vert \r
+<p class="whs10">vert \r
= geompy.MakeVertex(point[0], point[1], 0)</p>\r
\r
-<p class="whs11">geompy.addToStudy(vert, \r
+<p class="whs10">geompy.addToStudy(vert, \r
"Vertex_" + `iv`)</p>\r
\r
-<p class="whs11">vertices.append(vert)</p>\r
+<p class="whs10">vertices.append(vert)</p>\r
\r
-<p class="whs11">iv \r
+<p class="whs10">iv \r
+= 1</p>\r
\r
-<p class="whs11">pass</p>\r
+<p class="whs10">pass</p>\r
\r
-<p class="whs10"> </p>\r
+<p class="whs9"> </p>\r
\r
-<p class="whs10"># 2. Create edges and \r
+<p class="whs9"># 2. Create edges and \r
wires</p>\r
\r
-<p class="whs9">Edge_straight = geompy.MakeEdge(vertices[0], \r
+<p class="whs8">Edge_straight = geompy.MakeEdge(vertices[0], \r
vertices[4])</p>\r
\r
-<p class="whs9">Edge_bezierrr = geompy.MakeBezier(vertices)</p>\r
+<p class="whs8">Edge_bezierrr = geompy.MakeBezier(vertices)</p>\r
\r
-<p class="whs9">Wire_polyline = geompy.MakePolyline(vertices)</p>\r
+<p class="whs8">Wire_polyline = geompy.MakePolyline(vertices)</p>\r
\r
-<p class="whs9">Edge_Circle = \r
+<p class="whs8">Edge_Circle = \r
geompy.MakeCircleThreePnt(vertices[0], vertices[1], vertices[2])</p>\r
\r
-<p class="whs9"> </p>\r
+<p class="whs8"> </p>\r
\r
-<p class="whs9">geompy.addToStudy(Edge_straight, \r
+<p class="whs8">geompy.addToStudy(Edge_straight, \r
"Edge_straight")</p>\r
\r
-<p class="whs9">geompy.addToStudy(Edge_bezierrr, \r
+<p class="whs8">geompy.addToStudy(Edge_bezierrr, \r
"Edge_bezierrr")</p>\r
\r
-<p class="whs9">geompy.addToStudy(Wire_polyline, \r
+<p class="whs8">geompy.addToStudy(Wire_polyline, \r
"Wire_polyline")</p>\r
\r
-<p class="whs9">geompy.addToStudy(Edge_Circle \r
+<p class="whs8">geompy.addToStudy(Edge_Circle \r
, "Edge_Circle")</p>\r
\r
-<p class="whs10"> </p>\r
+<p class="whs9"> </p>\r
\r
-<p class="whs10"># 3. Explode wire on \r
+<p class="whs9"># 3. Explode wire on \r
edges, as they will be used for mesh extrusion</p>\r
\r
-<p class="whs9">Wire_polyline_edges \r
+<p class="whs8">Wire_polyline_edges \r
= geompy.SubShapeAll(Wire_polyline, geompy.ShapeType["EDGE"])</p>\r
\r
-<p class="whs9">for ii in range(len(Wire_polyline_edges)):</p>\r
+<p class="whs8">for ii in range(len(Wire_polyline_edges)):</p>\r
\r
-<p class="whs11">geompy.addToStudyInFather(Wire_polyline, \r
+<p class="whs10">geompy.addToStudyInFather(Wire_polyline, \r
Wire_polyline_edges[ii], "Edge_" + `ii + 1`)</p>\r
\r
-<p class="whs11">pass</p>\r
-\r
-<p class="whs12"> </p>\r
-\r
-<p class="whs10"># Mesh</p>\r
-\r
-<p class="whs9">import smesh</p>\r
-\r
-<p class="whs9">import SMESH</p>\r
-\r
-<p class="whs9"> </p>\r
-\r
-<p class="whs9">gen = smesh.smesh</p>\r
-\r
-<p class="whs9"> </p>\r
-\r
-<p class="whs9">smeshgui = salome.ImportComponentGUI("SMESH")</p>\r
+<p class="whs10">pass</p>\r
\r
-<p class="whs9">smeshgui.Init(salome.myStudyId)</p>\r
+<p class="whs11"> </p>\r
\r
-<p class="whs10"> </p>\r
+<p class="whs9"># Mesh</p>\r
\r
-<p class="whs10"># 1D algorithm and three \r
- 1D hypotheses</p>\r
+<p class="whs8">import smesh</p>\r
\r
-<p class="whs9">Wire_discretisation \r
- = gen.CreateHypothesis('Regular_1D', 'libStdMeshersEngine.so')</p>\r
+<p class="whs8"> </p>\r
\r
-<p class="whs9"> </p>\r
-\r
-<p class="whs9">Nb_Segments_3 = gen.CreateHypothesis('NumberOfSegments', \r
- 'libStdMeshersEngine.so')</p>\r
-\r
-<p class="whs9">Nb_Segments_7 = gen.CreateHypothesis('NumberOfSegments', \r
- 'libStdMeshersEngine.so')</p>\r
-\r
-<p class="whs9">Nb_Segments_8 = gen.CreateHypothesis('NumberOfSegments', \r
- 'libStdMeshersEngine.so')</p>\r
-\r
-<p class="whs9"> </p>\r
-\r
-<p class="whs9">Nb_Segments_3.SetNumberOfSegments(3)</p>\r
-\r
-<p class="whs9">Nb_Segments_7.SetNumberOfSegments(7)</p>\r
-\r
-<p class="whs9">Nb_Segments_8.SetNumberOfSegments(8)</p>\r
-\r
-<p class="whs10"> </p>\r
+<p class="whs12"># Mesh \r
+ the given shape with the given 1d hypothesis</p>\r
\r
-<p class="whs10"># Mesh given shape with \r
- given 1d hypothesis</p>\r
+<p class="whs13">def \r
+ Mesh1D(shape1d, nbSeg, name):</p>\r
\r
-<p class="whs9">def Mesh1D(shape1d, \r
- hyp1d, name):</p>\r
+<p class="whs13"> mesh1d_tool \r
+ = smesh.Mesh(shape1d, name)</p>\r
\r
-<p class="whs11">mesh1d_tool \r
- = smesh.Mesh(shape1d)</p>\r
+<p class="whs13"> algo \r
+ = mesh1d_tool.Segment()</p>\r
\r
-<p class="whs11">mesh1d \r
- = mesh1d_tool.GetMesh()</p>\r
+<p class="whs13"> hyp \r
+ = algo.NumberOfSegments(nbSeg)</p>\r
\r
-<p class="whs11">status \r
- = mesh1d.AddHypothesis(shape1d, hyp1d)</p>\r
-\r
-<p class="whs11">status \r
- = mesh1d.AddHypothesis(shape1d, Wire_discretisation)</p>\r
-\r
-<p class="whs11">isDone \r
+<p class="whs13"> isDone \r
= mesh1d_tool.Compute()</p>\r
\r
-<p class="whs11">if \r
+<p class="whs13"> if \r
not isDone: print 'Mesh ', name, ': computation failed'</p>\r
\r
-<p class="whs11">return \r
- mesh1d</p>\r
-\r
-<p class="whs9"> </p>\r
-\r
-<p class="whs10"># Create a mesh with \r
- six nodes, seven edges and two quadrangle faces</p>\r
+<p class="whs13"> return \r
+ mesh1d_tool</p>\r
\r
-<p class="whs9">def MakeQuadMesh2(mesh_name):</p>\r
+<p class="whs12"># Create \r
+ a mesh with six nodes, seven edges and two quadrangle faces</p>\r
\r
-<p class="whs11">quad_1 \r
- = gen.CreateEmptyMesh()</p>\r
+<p class="whs13">def \r
+ MakeQuadMesh2(mesh_name):</p>\r
\r
-<p class="whs11">smeshgui.SetName(salome.ObjectToID(quad_1), \r
- mesh_name)</p>\r
+<p class="whs13"> quad_1 \r
+ = smesh.Mesh(name = mesh_name)</p>\r
\r
-<p class="whs11">editor_1 \r
- = quad_1.GetMeshEditor()</p>\r
+<p class="whs13"> </p>\r
\r
-<p class="whs12"> </p>\r
+<p class="whs13"> <span \r
+ style="font-family: 'Times New Roman', serif;"># \r
+ six nodes</span></p>\r
\r
-<p class="whs12"># six nodes</p>\r
+<p class="whs13"> n1 \r
+ = quad_1.AddNode(0, 20, 10)</p>\r
\r
-<p class="whs11">n1 \r
- = editor_1.AddNode(0, 20, 10)</p>\r
+<p class="whs13"> n2 \r
+ = quad_1.AddNode(0, 40, 10)</p>\r
\r
-<p class="whs11">n2 \r
- = editor_1.AddNode(0, 40, 10)</p>\r
+<p class="whs13"> n3 \r
+ = quad_1.AddNode(0, 40, 30)</p>\r
\r
-<p class="whs11">n3 \r
- = editor_1.AddNode(0, 40, 30)</p>\r
+<p class="whs13"> n4 \r
+ = quad_1.AddNode(0, 20, 30)</p>\r
\r
-<p class="whs11">n4 \r
- = editor_1.AddNode(0, 20, 30)</p>\r
-\r
-<p class="whs11">n5 \r
- = editor_1.AddNode(0, 0, \r
+<p class="whs13"> n5 \r
+ = quad_1.AddNode(0, 0, \r
30)</p>\r
\r
-<p class="whs11">n6 \r
- = editor_1.AddNode(0, 0, \r
+<p class="whs13"> n6 \r
+ = quad_1.AddNode(0, 0, \r
10)</p>\r
\r
-<p class="whs12"> </p>\r
+<p class="whs13"> </p>\r
\r
-<p class="whs12"># seven edges</p>\r
+<p class="whs13"> <span \r
+ style="font-family: 'Times New Roman', serif;"># \r
+ seven edges</span></p>\r
\r
-<p class="whs11">editor_1.AddEdge([n1, \r
+<p class="whs13"> quad_1.AddEdge([n1, \r
n2]) # 1</p>\r
\r
-<p class="whs11">editor_1.AddEdge([n2, \r
+<p class="whs13"> quad_1.AddEdge([n2, \r
n3]) # 2</p>\r
\r
-<p class="whs11">editor_1.AddEdge([n3, \r
+<p class="whs13"> quad_1.AddEdge([n3, \r
n4]) # 3</p>\r
\r
-<p class="whs11">editor_1.AddEdge([n4, \r
+<p class="whs13"> quad_1.AddEdge([n4, \r
n1]) # 4</p>\r
\r
-<p class="whs11">editor_1.AddEdge([n4, \r
+<p class="whs13"> quad_1.AddEdge([n4, \r
n5]) # 5</p>\r
\r
-<p class="whs11">editor_1.AddEdge([n5, \r
+<p class="whs13"> quad_1.AddEdge([n5, \r
n6]) # 6</p>\r
\r
-<p class="whs11">editor_1.AddEdge([n6, \r
+<p class="whs13"> quad_1.AddEdge([n6, \r
n1]) # 7</p>\r
\r
-<p class="whs12"> </p>\r
+<p class="whs13"> </p>\r
\r
-<p class="whs12"># two quadrangle faces</p>\r
+<p class="whs13"> <span \r
+ style="font-family: 'Times New Roman', serif;"># \r
+ two quadrangle faces</span></p>\r
\r
-<p class="whs11">editor_1.AddFace([n1, \r
+<p class="whs13"> quad_1.AddFace([n1, \r
n2, n3, n4]) # 8</p>\r
\r
-<p class="whs11">editor_1.AddFace([n1, \r
+<p class="whs13"> quad_1.AddFace([n1, \r
n4, n5, n6]) # 9</p>\r
\r
-<p class="whs11">return \r
- [quad_1, editor_1, [1,2,3,4,5,6,7], [8,9]]</p>\r
+<p class="whs13"> return \r
+ [quad_1, [1,2,3,4,5,6,7], [8,9]]</p>\r
\r
-<p class="whs10"> </p>\r
+<p class="whs13"> </p>\r
\r
-<p class="whs10"># Path meshes</p>\r
+<p class="whs12"># Path \r
+ meshes</p>\r
\r
-<p class="whs9">Edge_straight_mesh \r
- = Mesh1D(Edge_straight, Nb_Segments_7, "Edge_straight")</p>\r
+<p class="whs13">Edge_straight_mesh \r
+ = Mesh1D(Edge_straight, 7, "Edge_straight")</p>\r
\r
-<p class="whs9">Edge_bezierrr_mesh \r
- = Mesh1D(Edge_bezierrr, Nb_Segments_7, "Edge_bezierrr")</p>\r
+<p class="whs13">Edge_bezierrr_mesh \r
+ = Mesh1D(Edge_bezierrr, 7, "Edge_bezierrr")</p>\r
\r
-<p class="whs9">Wire_polyline_mesh \r
- = Mesh1D(Wire_polyline, Nb_Segments_3, "Wire_polyline")</p>\r
+<p class="whs13">Wire_polyline_mesh \r
+ = Mesh1D(Wire_polyline, 3, "Wire_polyline")</p>\r
\r
-<p class="whs9">Edge_Circle_mesh = \r
+<p class="whs13">Edge_Circle_mesh \r
+ = \r
Mesh1D(Edge_Circle , \r
- Nb_Segments_8, "Edge_Circle")</p>\r
+ 8, "Edge_Circle")</p>\r
\r
-<p class="whs10"> </p>\r
+<p class="whs13"> </p>\r
\r
-<p class="whs10"># Initial meshes (to \r
- be extruded)</p>\r
+<p class="whs12"># Initial \r
+ meshes (to be extruded)</p>\r
\r
-<p class="whs9">[quad_1, editor_1, \r
+<p class="whs13">[quad_1, \r
ee_1, ff_1] = MakeQuadMesh2("quad_1")</p>\r
\r
-<p class="whs9">[quad_2, editor_2, \r
+<p class="whs13">[quad_2, \r
ee_2, ff_2] = MakeQuadMesh2("quad_2")</p>\r
\r
-<p class="whs9">[quad_3, editor_3, \r
+<p class="whs13">[quad_3, \r
ee_3, ff_3] = MakeQuadMesh2("quad_3")</p>\r
\r
-<p class="whs9">[quad_4, editor_4, \r
+<p class="whs13">[quad_4, \r
ee_4, ff_4] = MakeQuadMesh2("quad_4")</p>\r
\r
-<p class="whs9">[quad_5, editor_5, \r
+<p class="whs13">[quad_5, \r
ee_5, ff_5] = MakeQuadMesh2("quad_5")</p>\r
\r
-<p class="whs9">[quad_6, editor_6, \r
+<p class="whs13">[quad_6, \r
ee_6, ff_6] = MakeQuadMesh2("quad_6")</p>\r
\r
-<p class="whs9">[quad_7, editor_7, \r
+<p class="whs13">[quad_7, \r
ee_7, ff_7] = MakeQuadMesh2("quad_7")</p>\r
\r
-<p class="whs10"> </p>\r
-\r
-<p class="whs10"># ExtrusionAlongPath</p>\r
+<p class="whs13"> </p>\r
\r
-<p class="whs10"># IDsOfElements, PathMesh, \r
- PathShape, NodeStart,</p>\r
+<p class="whs12"># ExtrusionAlongPath</p>\r
\r
-<p class="whs10"># HasAngles, Angles, \r
- HasRefPoint, RefPoint</p>\r
+<p class="whs12"># IDsOfElements, \r
+ PathMesh, PathShape, NodeStart,</p>\r
\r
-<p class="whs10"> </p>\r
+<p class="whs12"># HasAngles, \r
+ Angles, HasRefPoint, RefPoint</p>\r
\r
-<p class="whs9">refPoint = SMESH.PointStruct(0, \r
- 0, 0)</p>\r
+<p class="whs13">refPoint \r
+ = smesh.PointStruct(0, 0, 0)</p>\r
\r
-<p class="whs9"> </p>\r
+<p class="whs13">a10 \r
+ = 10.0*math.pi/180.0</p>\r
\r
-<p class="whs9">a10 = 10.0*math.pi/180.0</p>\r
+<p class="whs13">a45 \r
+ = 45.0*math.pi/180.0</p>\r
\r
-<p class="whs9">a45 = 45.0*math.pi/180.0</p>\r
-\r
-<p class="whs10"> </p>\r
+<p class="whs13"> </p>\r
\r
-<p class="whs10"># 1. Extrusion of two \r
- mesh edges along a straight path</p>\r
+<p class="whs12"># 1. \r
+ Extrusion of two mesh edges along a straight path</p>\r
\r
-<p class="whs9">error = editor_1.ExtrusionAlongPath([1,2], \r
- Edge_straight_mesh, Edge_straight, 1,</p>\r
+<p class="whs13">error \r
+ = quad_1.ExtrusionAlongPath([1,2], Edge_straight_mesh, Edge_straight, \r
+ 1,</p>\r
\r
-<p class="whs13"> 0, \r
+<p class="whs13"> 0, \r
[], 0, refPoint)</p>\r
\r
-<p class="whs10"> </p>\r
+<p class="whs13"> </p>\r
\r
-<p class="whs10"># 2. Extrusion of one \r
- mesh edge along a curved path</p>\r
+<p class="whs12"># 2. \r
+ Extrusion of one mesh edge along a curved path</p>\r
\r
-<p class="whs9">error = editor_2.ExtrusionAlongPath([2], \r
- Edge_bezierrr_mesh, Edge_bezierrr, 1,</p>\r
+<p class="whs13">error \r
+ = quad_2.ExtrusionAlongPath([2], Edge_bezierrr_mesh, Edge_bezierrr, 1,</p>\r
\r
-<p class="whs13"> 0, \r
+<p class="whs13"> 0, \r
[], 0, refPoint)</p>\r
\r
-<p class="whs10"> </p>\r
+<p class="whs13"> </p>\r
\r
-<p class="whs10"># 3. Extrusion of one \r
- mesh edge along a curved path with usage of angles </p>\r
+<p class="whs12"># 3. \r
+ Extrusion of one mesh edge along a curved path with usage of angles</p>\r
\r
-<p class="whs9">error = editor_3.ExtrusionAlongPath([2], \r
- Edge_bezierrr_mesh, Edge_bezierrr, 1,</p>\r
+<p class="whs13">error \r
+ = quad_3.ExtrusionAlongPath([2], Edge_bezierrr_mesh, Edge_bezierrr, 1,</p>\r
\r
-<p class="whs13"> 1, \r
+<p class="whs13"> 1, \r
[a45, a45, a45, 0, -a45, -a45, -a45], 0, refPoint)</p>\r
\r
-<p class="whs10"> </p>\r
+<p class="whs13"> </p>\r
\r
-<p class="whs10"># 4. Extrusion of one \r
- mesh edge along the path, which is a part of a meshed wire</p>\r
+<p class="whs12"># 4. \r
+ Extrusion of one mesh edge along the path, which is a part of a meshed \r
+ wire</p>\r
\r
-<p class="whs9">error = editor_4.ExtrusionAlongPath([4], \r
- Wire_polyline_mesh, Wire_polyline_edges[0], 1,</p>\r
+<p class="whs13">error \r
+ = quad_4.ExtrusionAlongPath([4], Wire_polyline_mesh, Wire_polyline_edges[0], \r
+ 1,</p>\r
\r
-<p class="whs13"> 1, \r
+<p class="whs13"> 1, \r
[a10, a10, a10], 0, refPoint)</p>\r
\r
-<p class="whs10"> </p>\r
+<p class="whs13"> </p>\r
\r
-<p class="whs10"># 5. Extrusion of two \r
- mesh faces along the path, which is a part of a meshed wire</p>\r
+<p class="whs12"># 5. \r
+ Extrusion of two mesh faces along the path, which is a part of a meshed \r
+ wire</p>\r
\r
-<p class="whs9">error = editor_5.ExtrusionAlongPath(ff_5 \r
- , Wire_polyline_mesh, Wire_polyline_edges[2], 4,</p>\r
+<p class="whs13">error \r
+ = quad_5.ExtrusionAlongPath(ff_5 , Wire_polyline_mesh, Wire_polyline_edges[2], \r
+ 4,</p>\r
\r
-<p class="whs13"> 0, \r
+<p class="whs13"> 0, \r
[], 0, refPoint)</p>\r
\r
-<p class="whs10"> </p>\r
+<p class="whs13"> </p>\r
\r
-<p class="whs10"># 6. Extrusion of two \r
- mesh faces along a closed path</p>\r
+<p class="whs12"># 6. \r
+ Extrusion of two mesh faces along a closed path</p>\r
\r
-<p class="whs9">error = editor_6.ExtrusionAlongPath(ff_6 \r
- , Edge_Circle_mesh, Edge_Circle, 1,</p>\r
+<p class="whs13">error \r
+ = quad_6.ExtrusionAlongPath(ff_6 , Edge_Circle_mesh, Edge_Circle, 1,</p>\r
\r
-<p class="whs13"> 0, \r
+<p class="whs13"> 0, \r
[], 0, refPoint)</p>\r
\r
-<p class="whs10"> </p>\r
+<p class="whs13"> </p>\r
\r
-<p class="whs10"># 7. Extrusion of two \r
- mesh faces along a closed path with usage of angles </p>\r
+<p class="whs12"># 7. \r
+ Extrusion of two mesh faces along a closed path with usage of angles</p>\r
\r
-<p class="whs9">error = editor_7.ExtrusionAlongPath(ff_7, \r
- Edge_Circle_mesh, Edge_Circle, 1,</p>\r
+<p class="whs13">error \r
+ = quad_7.ExtrusionAlongPath(ff_7, Edge_Circle_mesh, Edge_Circle, 1,</p>\r
\r
-<p class="whs13"> 1, \r
- [a45, -a45, a45, -a45, a45, -a45, a45, -a45], 0, refPoint</p>\r
+<p class="whs13"> 1, \r
+ [a45, -a45, a45, -a45, a45, -a45, a45, -a45], 0, refPoint)</p>\r
\r
<p class="whs13"> </p>\r
\r
-<p class="whs14">salome.sg.updateObjBrowser(1)</p>\r
+<p class="whs13">salome.sg.updateObjBrowser(1) \r
+ </p>\r
\r
<h3><a name=bookmark11>Revolution</a></h3>\r
\r
-<p class="whs1"><span style="font-weight: bold; color: #ff0000;"><font color=red ><B># \r
- Attention! This script has been written using the old approach basing \r
- on direct usage of SMESH idl interface.</B></font></span></p>\r
-\r
-<p class="whs1"># For the moment smesh package doesn't provide \r
- methods to perform revolution. </p>\r
-\r
-<p class="whs1"># In the next SALOME version the scripts will \r
- be updated to use only the commands from smesh package.</p>\r
-\r
-<p class="whs1"> </p>\r
+<p class="whs8">import math</p>\r
\r
-<p class="whs9">import math</p>\r
+<p class="whs8"> </p>\r
\r
-<p class="whs9">import SMESH</p>\r
+<p class="whs8">import SMESH_mechanic</p>\r
\r
-<p class="whs9">import SMESH_mechanic</p>\r
+<p class="whs8"> </p>\r
\r
-<p class="whs9"> </p>\r
+<p class="whs8"><span style="font-family: 'Lucida Console', monospace;">mesh \r
+ = SMESH_mechanic.mesh</span></p>\r
\r
-<p class="whs9">mesh = SMESH_mechanic.mesh</p>\r
+<p class="whs8">smesh = SMESH_mechanic.smesh</p>\r
\r
-<p class="whs9">aMeshEditor = mesh.GetMeshEditor()</p>\r
+<p class="whs8"> </p>\r
\r
-<p class="whs9"> </p>\r
-\r
-<p class="whs10"># create a group of faces \r
+<p class="whs9"># create a group of faces \r
to be revolved</p>\r
\r
-<p class="whs9">FacesRotate = [492, \r
+<p class="whs8">FacesRotate = [492, \r
493, 502, 503]</p>\r
\r
-<p class="whs9">GroupRotate = mesh.CreateGroup(SMESH.FACE,"Group \r
+<p class="whs8">GroupRotate = mesh.CreateGroup(SMESH.FACE,"Group \r
of faces (rotate)")</p>\r
\r
-<p class="whs9">GroupRotate.Add(FacesRotate)</p>\r
+<p class="whs8">GroupRotate.Add(FacesRotate)</p>\r
\r
-<p class="whs10"> </p>\r
+<p class="whs9"> </p>\r
\r
-<p class="whs10"># define revolution angle \r
+<p class="whs9"># define revolution angle \r
and axis</p>\r
\r
-<p class="whs9">angle45 = 45 * math.pi \r
+<p class="whs8">angle45 = 45 * math.pi \r
/ 180</p>\r
\r
-<p class="whs9">axisXYZ = SMESH.AxisStruct(-38.3128, \r
+<p class="whs8">axisXYZ = SMESH.AxisStruct(-38.3128, \r
-73.3658, -23.321, -13.3402, -13.3265, 6.66632)</p>\r
\r
-<p class="whs9"> </p>\r
+<p class="whs8"> </p>\r
\r
-<p class="whs10"># perform revolution \r
+<p class="whs9"># perform revolution \r
of an object</p>\r
\r
-<p class="whs9">aMeshEditor.RotationSweepObject(GroupRotate, \r
+<p class="whs8">mesh.RotationSweepObject(GroupRotate, \r
axisXYZ, angle45, 4, 1e-5) </p>\r
\r
-<p class="whs10"> </p>\r
+<p class="whs9"> </p>\r
\r
<h3><a name=bookmark13>Pattern Mapping</a></h3>\r
\r
-<p class="whs1"><span style="font-weight: bold; color: #ff0000;"><font color=red ><B># \r
- Attention! This script has been written using the old approach basing \r
- on direct usage of SMESH idl interface.</B></font></span></p>\r
-\r
-<p class="whs1"># For the moment smesh package doesn't provide \r
- methods to perform pattern mapping. </p>\r
-\r
-<p class="whs1"># In the next SALOME version the scripts will \r
- be updated to use only the commands from smesh package.</p>\r
-\r
-<p class="whs9"> </p>\r
+<p class="whs8">import geompy</p>\r
\r
-<p class="whs9">import geompy</p>\r
+<p class="whs8"> </p>\r
\r
-<p class="whs9">import smesh</p>\r
+<p class="whs8">import smesh</p>\r
\r
-<p class="whs9"> </p>\r
+<p class="whs8"> </p>\r
\r
-<p class="whs10"># define the geometry</p>\r
+<p class="whs8"># define the geometry</p>\r
\r
<p class="whs9">Box_1 = geompy.MakeBoxDXDYDZ(200., \r
200., 200.)</p>\r
\r
<p class="whs9">Face_2 = faces[1]</p>\r
\r
+<p class="whs9"> </p>\r
+\r
<p class="whs9">geompy.addToStudyInFather(Box_1, \r
Face_1, "Face_1")</p>\r
\r
\r
<p class="whs9"> </p>\r
\r
-<p class="whs10"># build a quadrangle \r
+<p class="whs8"># build a quadrangle \r
mesh 3x3 on Face_1</p>\r
\r
<p class="whs9">Mesh_1 = smesh.Mesh(Face_1)</p>\r
\r
<p class="whs9"> </p>\r
\r
-<p class="whs10"># build a triangle mesh \r
- on Face_2</p>\r
+<p class="whs8"># build a triangle \r
+ mesh on Face_2</p>\r
\r
<p class="whs9">Mesh_2 = smesh.Mesh(Face_2)</p>\r
\r
+<p class="whs9"> </p>\r
+\r
<p class="whs9">algo1D = Mesh_2.Segment()</p>\r
\r
<p class="whs9">algo1D.NumberOfSegments(1)</p>\r
\r
<p class="whs9">algo2D.MaxElementArea(240)</p>\r
\r
+<p class="whs9"> </p>\r
+\r
<p class="whs9">isDone = Mesh_2.Compute()</p>\r
\r
<p class="whs9">if not isDone: print \r
\r
<p class="whs9"> </p>\r
\r
-<p class="whs10"># create a pattern</p>\r
+<p class="whs8"># create a pattern</p>\r
\r
-<p class="whs9">pattern = smesh.smesh.GetPattern()</p>\r
+<p class="whs9">pattern = smesh.GetPattern()</p>\r
+\r
+<p class="whs9"> </p>\r
\r
<p class="whs9">isDone = pattern.LoadFromFace(Mesh_2.GetMesh(), \r
Face_2, 0)</p>\r
\r
-<p class="whs9">if (isDone != 1): \r
- print 'LoadFromFace :', pattern.GetErrorCode()</p>\r
+<p class="whs9">if (isDone != 1): print \r
+ 'LoadFromFace :', pattern.GetErrorCode()</p>\r
\r
<p class="whs9"> </p>\r
\r
-<p class="whs10"># apply the pattern to \r
- a face of the first mesh</p>\r
+<p class="whs8"># apply the pattern \r
+ to a face of the first mesh</p>\r
\r
<p class="whs9">pattern.ApplyToMeshFaces(Mesh_1.GetMesh(), \r
[17], 0, 0)</p>\r
\r
+<p class="whs9"> </p>\r
+\r
<p class="whs9">isDone = pattern.MakeMesh(Mesh_1.GetMesh(), \r
0, 0)</p>\r
\r
-<p class="whs9">if (isDone != 1): \r
- print 'MakeMesh :', pattern.GetErrorCode() </p>\r
-\r
-<p class="whs9"> </p>\r
-\r
-<p class="whs10"> </p>\r
+<p class="whs9">if (isDone != 1): print \r
+ 'MakeMesh :', pattern.GetErrorCode() </p>\r
\r
<script type="text/javascript" language="javascript1.2">\r
<!--\r
<meta http-equiv="content-type" content="text/html; charset=windows-1252">\r
<meta name="generator" content="RoboHelp by eHelp Corporation www.ehelp.com"><style type="text/css">\r
<!--\r
-p.whs1 { margin-top:0pt; margin-bottom:0pt; font-weight:bold; color:#ff0000; }\r
+p.whs1 { margin-top:0pt; margin-bottom:0pt; font-family:'Lucida Console' , monospace; }\r
p.whs2 { margin-top:0pt; margin-bottom:0pt; }\r
-p.whs3 { margin-top:0pt; margin-bottom:0pt; font-family:'Lucida Console' , monospace; }\r
-p.whs4 { margin-top:0pt; margin-bottom:0pt; font-family:'Times New Roman' , serif; }\r
+p.whs3 { margin-top:0pt; margin-bottom:0pt; font-family:'Times New Roman' , serif; }\r
-->\r
</style><script type="text/javascript" language="JavaScript">\r
<!--\r
strNSS += "p.whs1 {margin-top:1pt;margin-bottom:1pt; }";\r
strNSS += "p.whs2 {margin-top:1pt;margin-bottom:1pt; }";\r
strNSS += "p.whs3 {margin-top:1pt;margin-bottom:1pt; }";\r
- strNSS += "p.whs4 {margin-top:1pt;margin-bottom:1pt; }";\r
strNSS +="</style>";\r
document.write(strNSS);\r
}\r
\r
<h3><a name=bookmark>Free Borders</a></h3>\r
\r
-<p class="whs1"># Attention! This script has been written \r
- using the old approach basing on direct usage of SMESH idl interface.</p>\r
+<p class="whs1">import salome</p>\r
\r
-<p class="whs1"># For the moment smesh package doesn't provide \r
- methods to check free borders. </p>\r
+<p class="whs1">import geompy</p>\r
\r
-<p class="whs1"># In the next SALOME version the scripts will \r
- be updated to use only the commands from smesh package.</p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs2"> </p>\r
-\r
-<p class="whs3">import salome</p>\r
-\r
-<p class="whs3">import geompy</p>\r
-\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs3">import smesh</p>\r
-\r
-<p class="whs3">import SMESH</p>\r
+<p class="whs1">import smesh</p>\r
\r
<p class="whs2"> </p>\r
\r
<p class="whs2"># create open shell: a \r
box without one plane</p>\r
\r
-<p class="whs3">box = geompy.MakeBox(0., \r
- 0., 0., 20., 20., 15.)</p>\r
+<p class="whs1"><span style="font-family: 'Lucida Console', monospace;">box \r
+ = geompy.MakeBox(0., 0., 0., 20., 20., 15.)</span></p>\r
\r
-<p class="whs3">FaceList = geompy.SubShapeAll(box, \r
+<p class="whs1">FaceList = geompy.SubShapeAll(box, \r
geompy.ShapeType["FACE"])</p>\r
\r
-<p class="whs3">FaceList.remove(FaceList[5])</p>\r
+<p class="whs1">FaceList.remove(FaceList[5])</p>\r
\r
-<p class="whs3">box = geompy.MakeShell(FaceList)</p>\r
+<p class="whs1">box = geompy.MakeShell(FaceList)</p>\r
\r
-<p class="whs3">idbox = geompy.addToStudy(box, \r
+<p class="whs1">idbox = geompy.addToStudy(box, \r
"box")</p>\r
\r
-<p class="whs2"> </p>\r
+<p class="whs1"> </p>\r
\r
<p class="whs2"># create a mesh</p>\r
\r
-<p class="whs3">tria = smesh.Mesh(box, \r
- "Mesh_free_borders")</p>\r
-\r
-<p class="whs3">algo = tria.Segment()</p>\r
-\r
-<p class="whs3">algo.NumberOfSegments(5)</p>\r
+<p class="whs1"><span style="font-family: 'Lucida Console', monospace;">mesh \r
+ = smesh.Mesh(box, "Mesh_free_borders")</span></p>\r
\r
-<p class="whs3">algo = tria.Triangle()</p>\r
+<p class="whs1">algo = mesh.Segment()</p>\r
\r
-<p class="whs3">algo.MaxElementArea(20.)</p>\r
+<p class="whs1">algo.NumberOfSegments(5)</p>\r
\r
-<p class="whs3">tria.Compute()</p>\r
+<p class="whs1">algo = mesh.Triangle()</p>\r
\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs3">mesh = tria.GetMesh()</p>\r
+<p class="whs1">algo.MaxElementArea(20.)</p>\r
\r
-<p class="whs3">gen = smesh.smesh</p>\r
+<p class="whs1">mesh.Compute() </p>\r
\r
-<p class="whs2"> </p>\r
+<p class="whs1"> </p>\r
\r
<p class="whs2"># criterion : free borders</p>\r
\r
-<p class="whs3">aFilterMgr = gen.CreateFilterManager()</p>\r
+<p class="whs1"><span style="font-family: 'Lucida Console', monospace;">aFilter \r
+ = smesh.GetFilter(smesh.EDGE, smesh.FT_FreeBorders)</span><span style="margin-top: 0pt;\r
+ margin-bottom: 0pt;\r
+ font-family: 'Lucida Console', monospace;"> </span></p>\r
\r
-<p class="whs3">aPredicate = aFilterMgr.CreateFreeBorders()</p>\r
+<p class="whs1">anIds = mesh.GetIdsFromFilter(aFilter)</p>\r
\r
-<p class="whs3">aFilter = aFilterMgr.CreateFilter()</p>\r
-\r
-<p class="whs3">aFilter.SetPredicate(aPredicate)</p>\r
-\r
-<p class="whs3">anIds = aFilter.GetElementsId(mesh)</p>\r
+<p class="whs1"> </p>\r
\r
<p class="whs2"> </p>\r
\r
<p class="whs2"># print the result</p>\r
\r
-<p class="whs3">print "Criterion: \r
+<p class="whs1">print "Criterion: \r
Free borders Nb = ", len(anIds)</p>\r
\r
-<p class="whs3">j = 1</p>\r
+<p class="whs1">j = 1</p>\r
\r
-<p class="whs3">for i in range(len(anIds)):</p>\r
+<p class="whs1">for i in range(len(anIds)):</p>\r
\r
-<p class="whs3"> if \r
+<p class="whs1"> if \r
j > 20: j = 1; print ""</p>\r
\r
-<p class="whs3"> print \r
+<p class="whs1"> print \r
anIds[i],</p>\r
\r
-<p class="whs3"> j \r
+<p class="whs1"> j \r
= j + 1</p>\r
\r
-<p class="whs3"> pass</p>\r
+<p class="whs1"> pass</p>\r
\r
-<p class="whs3">print ""</p>\r
+<p class="whs1">print ""</p>\r
\r
<p class="whs2"> </p>\r
\r
<p class="whs2"># create a group</p>\r
\r
-<p class="whs3">aGroup = mesh.CreateGroup(SMESH.EDGE, \r
+<p class="whs1">aGroup = mesh.CreateGroup(SMESH.EDGE, \r
"Free borders")</p>\r
\r
-<p class="whs3">aGroup.Add(anIds)</p>\r
+<p class="whs1">aGroup.Add(anIds)</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
<p class="whs2"><span style="font-family: 'Lucida Console', monospace;">salome.sg.updateObjBrowser(1)</span> \r
</p>\r
\r
<h3><a name=bookmark1>Borders at Multiconnection</a></h3>\r
\r
-<p class="whs1"><span style="font-weight: bold; color: #ff0000;"><font color=red ><B># \r
- Attention! This script has been written using the old approach basing \r
- on direct usage of SMESH idl interface.</B></font></span></p>\r
-\r
-<p class="whs1"># For the moment smesh package doesn't provide \r
- methods to check borders at multiconnection. </p>\r
-\r
-<p class="whs1"># In the next SALOME version the scripts will \r
- be updated to use only the commands from smesh package.</p>\r
-\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs3">import salome</p>\r
+<p class="whs1">import salome</p>\r
\r
-<p class="whs3">import geompy</p>\r
+<p class="whs1">import geompy</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3">import smesh</p>\r
+<p class="whs1">import smesh</p>\r
\r
-<p class="whs3">import SMESH</p>\r
+<p class="whs1">import SMESH</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs4"># create open shell: \r
+<p class="whs3"># create open shell: \r
a box without one plane</p>\r
\r
-<p class="whs3">box = geompy.MakeBox(0., \r
+<p class="whs1">box = geompy.MakeBox(0., \r
0., 0., 20., 20., 15.)</p>\r
\r
-<p class="whs3">FaceList = geompy.SubShapeAll(box, \r
+<p class="whs1">FaceList = geompy.SubShapeAll(box, \r
geompy.ShapeType["FACE"])</p>\r
\r
-<p class="whs3">FaceList.remove(FaceList[5])</p>\r
+<p class="whs1">FaceList.remove(FaceList[5])</p>\r
\r
-<p class="whs3">box = geompy.MakeShell(FaceList)</p>\r
+<p class="whs1">box = geompy.MakeShell(FaceList)</p>\r
\r
-<p class="whs3">idbox = geompy.addToStudy(box, \r
+<p class="whs1">idbox = geompy.addToStudy(box, \r
"box")</p>\r
\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs4"># create a mesh</p>\r
-\r
-<p class="whs3">tria = smesh.Mesh(box, \r
- "Mesh_borders_at_multi-connections")</p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3">algo = tria.Segment()</p>\r
+<p class="whs3"># create a mesh</p>\r
\r
-<p class="whs3">algo.NumberOfSegments(5)</p>\r
+<p class="whs1"><span style="font-family: 'Lucida Console', monospace;">mesh \r
+ = smesh.Mesh(box, "Mesh_borders_at_multi-connections")</span></p>\r
\r
-<p class="whs3">algo = tria.Triangle()</p>\r
+<p class="whs1">algo = mesh.Segment()</p>\r
\r
-<p class="whs3">algo.MaxElementArea(20.)</p>\r
+<p class="whs1">algo.NumberOfSegments(5)</p>\r
\r
-<p class="whs3">tria.Compute()</p>\r
+<p class="whs1">algo = mesh.Triangle()</p>\r
\r
-<p class="whs3">mesh = tria.GetMesh()</p>\r
+<p class="whs1">algo.MaxElementArea(20.)</p>\r
\r
-<p class="whs3">gen = smesh.smesh</p>\r
+<p class="whs1">mesh.Compute() </p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs4"># Criterion : Borders \r
+<p class="whs3"># Criterion : Borders \r
at multi-connection</p>\r
\r
-<p class="whs3">nb_conn = 2</p>\r
-\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs3">aFilterMgr = gen.CreateFilterManager()</p>\r
-\r
-<p class="whs3">aFunctor = aFilterMgr.CreateMultiConnection()</p>\r
-\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs3">aPredicate = aFilterMgr.CreateEqualTo()</p>\r
-\r
-<p class="whs3">aPredicate.SetNumFunctor(aFunctor)</p>\r
+<p class="whs1">nb_conn = 2</p>\r
\r
-<p class="whs3">aPredicate.SetMargin(nb_conn)</p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"><span style="font-family: 'Lucida Console', monospace;">aFilter \r
+ = smesh.GetFilter(smesh.EDGE, smesh.FT_MultiConnection, smesh.FT_EqualTo, \r
+ nb_conn)</span></p>\r
\r
-<p class="whs3">aFilter = aFilterMgr.CreateFilter()</p>\r
+<p class="whs1">anIds = mesh.GetIdsFromFilter(aFilter)</p>\r
\r
-<p class="whs3">aFilter.SetPredicate(aPredicate)</p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3">anIds = aFilter.GetElementsId(mesh)</p>\r
+<p class="whs3"># print the result</p>\r
\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs4"># print the result</p>\r
-\r
-<p class="whs3">print "Criterion: \r
+<p class="whs1">print "Criterion: \r
Borders at multi-connections Nb = ", len(anIds)</p>\r
\r
-<p class="whs3">j = 1</p>\r
+<p class="whs1">j = 1</p>\r
\r
-<p class="whs3">for i in range(len(anIds)):</p>\r
+<p class="whs1">for i in range(len(anIds)):</p>\r
\r
-<p class="whs3"> if \r
+<p class="whs1"> if \r
j > 20: j = 1; print ""</p>\r
\r
-<p class="whs3"> print \r
+<p class="whs1"> print \r
anIds[i],</p>\r
\r
-<p class="whs3"> j \r
+<p class="whs1"> j \r
= j + 1</p>\r
\r
-<p class="whs3"> pass</p>\r
+<p class="whs1"> pass</p>\r
\r
-<p class="whs3">print ""</p>\r
+<p class="whs1">print ""</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs4"># create a group</p>\r
+<p class="whs3"># create a group</p>\r
\r
-<p class="whs3">aGroup = mesh.CreateGroup(SMESH.EDGE, \r
+<p class="whs1">aGroup = mesh.CreateGroup(SMESH.EDGE, \r
"Borders at multi-connections")</p>\r
\r
-<p class="whs3">aGroup.Add(anIds)</p>\r
+<p class="whs1">aGroup.Add(anIds)</p>\r
\r
-<p class="whs3">salome.sg.updateObjBrowser(1) \r
+<p class="whs1">salome.sg.updateObjBrowser(1) \r
</p>\r
\r
<h3><a name=bookmark2>Length 1D</a></h3>\r
\r
-<p class="whs1"><span style="font-weight: bold; color: #ff0000;"><font color=red ><B># \r
- Attention! This script has been written using the old approach basing \r
- on direct usage of SMESH idl interface.</B></font></span></p>\r
-\r
-<p class="whs1"># For the moment smesh package doesn't provide \r
- methods to check length 1D. </p>\r
-\r
-<p class="whs1"># In the next SALOME version the scripts will \r
- be updated to use only the commands from smesh package.</p>\r
+<p class="whs1">import salome</p>\r
\r
-<p class="whs2"> </p>\r
-\r
-<p class="whs3">import salome</p>\r
-\r
-<p class="whs3">import geompy</p>\r
+<p class="whs1">import geompy</p>\r
\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs3">import smesh</p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3">import SMESH</p>\r
+<p class="whs1">import smesh</p>\r
\r
<p class="whs2"> </p>\r
\r
<p class="whs2"># create open shell: a \r
box without one plane</p>\r
\r
-<p class="whs3">box = geompy.MakeBox(0., \r
+<p class="whs1">box = geompy.MakeBox(0., \r
0., 0., 20., 20., 15.)</p>\r
\r
-<p class="whs3">FaceList = geompy.SubShapeAll(box, \r
+<p class="whs1">FaceList = geompy.SubShapeAll(box, \r
geompy.ShapeType["FACE"])</p>\r
\r
-<p class="whs3">FaceList.remove(FaceList[5])</p>\r
+<p class="whs1">FaceList.remove(FaceList[5])</p>\r
\r
-<p class="whs3">box = geompy.MakeShell(FaceList)</p>\r
+<p class="whs1">box = geompy.MakeShell(FaceList)</p>\r
\r
-<p class="whs3">idbox = geompy.addToStudy(box, \r
+<p class="whs1">idbox = geompy.addToStudy(box, \r
"box")</p>\r
\r
<p class="whs2"> </p>\r
\r
<p class="whs2"># create a mesh</p>\r
\r
-<p class="whs3">tria = smesh.Mesh(box, \r
- "Mesh_Length_1D")</p>\r
-\r
-<p class="whs3">algo = tria.Segment()</p>\r
+<p class="whs1"><span style="font-family: 'Lucida Console', monospace;">mesh \r
+ = smesh.Mesh(box, "Mesh_Length_1D")</span></p>\r
\r
-<p class="whs3">algo.NumberOfSegments(5)</p>\r
+<p class="whs1">algo = mesh.Segment()</p>\r
\r
-<p class="whs3">algo = tria.Triangle()</p>\r
+<p class="whs1">algo.NumberOfSegments(5)</p>\r
\r
-<p class="whs3">algo.MaxElementArea(20.)</p>\r
+<p class="whs1">algo = mesh.Triangle()</p>\r
\r
-<p class="whs3">tria.Compute()</p>\r
+<p class="whs1">algo.MaxElementArea(20.)</p>\r
\r
-<p class="whs3">mesh = tria.GetMesh()</p>\r
-\r
-<p class="whs3">gen = smesh.smesh</p>\r
+<p class="whs1">mesh.Compute() </p>\r
\r
<p class="whs2"> </p>\r
\r
<p class="whs2"># Criterion : Length > \r
3.</p>\r
\r
-<p class="whs3">length_margin = \r
+<p class="whs1">length_margin = \r
3.</p>\r
\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs3">aFilterMgr = gen.CreateFilterManager()</p>\r
-\r
-<p class="whs3">aFunctor = aFilterMgr.CreateLength()</p>\r
-\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs3">aPredicate = aFilterMgr.CreateMoreThan()</p>\r
-\r
-<p class="whs3">aPredicate.SetNumFunctor(aFunctor)</p>\r
-\r
-<p class="whs3">aPredicate.SetMargin(length_margin)</p>\r
-\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3">aFilter = aFilterMgr.CreateFilter()</p>\r
+<p class="whs1"><span style="font-family: 'Lucida Console', monospace;">aFilter \r
+ = smesh.GetFilter(smesh.EDGE, smesh.FT_Length, smesh.FT_MoreThan, length_margin)</span></p>\r
\r
-<p class="whs3">aFilter.SetPredicate(aPredicate)</p>\r
-\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs3">anIds = aFilter.GetElementsId(mesh)</p>\r
+<p class="whs1">anIds = mesh.GetIdsFromFilter(aFilter) \r
+ </p>\r
\r
<p class="whs2"> </p>\r
\r
<p class="whs2"># print the result</p>\r
\r
-<p class="whs3">print "Criterion: \r
+<p class="whs1">print "Criterion: \r
Edges length > ", length_margin, " Nb = ", len(anIds)</p>\r
\r
-<p class="whs3">j = 1</p>\r
+<p class="whs1">j = 1</p>\r
\r
-<p class="whs3">for i in range(len(anIds)):</p>\r
+<p class="whs1">for i in range(len(anIds)):</p>\r
\r
-<p class="whs3"> if \r
+<p class="whs1"> if \r
j > 20: j = 1; print ""</p>\r
\r
-<p class="whs3"> print \r
+<p class="whs1"> print \r
anIds[i],</p>\r
\r
-<p class="whs3"> j \r
+<p class="whs1"> j \r
= j + 1</p>\r
\r
-<p class="whs3"> pass</p>\r
+<p class="whs1"> pass</p>\r
\r
-<p class="whs3">print ""</p>\r
+<p class="whs1">print ""</p>\r
\r
<p class="whs2"> </p>\r
\r
<p class="whs2"># create a group</p>\r
\r
-<p class="whs3">aGroup = mesh.CreateGroup(SMESH.EDGE, \r
+<p class="whs1">aGroup = mesh.CreateGroup(SMESH.EDGE, \r
"Edges with length > " + `length_margin`)</p>\r
\r
-<p class="whs3">aGroup.Add(anIds)</p>\r
+<p class="whs1">aGroup.Add(anIds)</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
<p class="whs2"><span style="font-family: 'Lucida Console', monospace;">salome.sg.updateObjBrowser(1)</span> \r
</p>\r
\r
<h3><a name=bookmark3>Free Edges</a></h3>\r
\r
-<p class="whs1"><span style="font-weight: bold; color: #ff0000;"><font color=red ><B># \r
- Attention! This script has been written using the old approach basing \r
- on direct usage of SMESH idl interface.</B></font></span></p>\r
+<p class="whs1">import SMESH_mechanic</p>\r
\r
-<p class="whs1"># For the moment smesh package doesn't provide \r
- methods to check free edges. </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs1"># In the next SALOME version the scripts will \r
- be updated to use only the commands from smesh package.</p>\r
-\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs3">import SMESH</p>\r
-\r
-<p class="whs3">import SMESH_mechanic</p>\r
-\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs3">smesh = \r
+<p class="whs1">smesh = \r
SMESH_mechanic.smesh</p>\r
\r
-<p class="whs3">mesh = \r
+<p class="whs1">mesh = \r
SMESH_mechanic.mesh</p>\r
\r
-<p class="whs3">salome = SMESH_mechanic.salome</p>\r
+<p class="whs1">salome = SMESH_mechanic.salome</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3">aFilterMgr = smesh.CreateFilterManager()</p>\r
+<p class="whs1">aFilterMgr = smesh.CreateFilterManager()</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs4"># Remove some elements \r
+<p class="whs3"># Remove some elements \r
to obtain free edges</p>\r
\r
-<p class="whs4"># Criterion : AREA \r
+<p class="whs3"># Criterion : AREA \r
> 95.</p>\r
\r
-<p class="whs3">area_margin = 95.</p>\r
-\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs3">aFunctor = aFilterMgr.CreateArea()</p>\r
-\r
-<p class="whs3">aPredicate = aFilterMgr.CreateMoreThan()</p>\r
-\r
-<p class="whs3">aPredicate.SetNumFunctor(aFunctor)</p>\r
+<p class="whs1">area_margin = 95.</p>\r
\r
-<p class="whs3">aPredicate.SetMargin(area_margin)</p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs3">aFilter = aFilterMgr.CreateFilter()</p>\r
+<p class="whs1"><span style="font-family: 'Lucida Console', monospace;">aFilter \r
+ = smesh.GetFilter(smesh.FACE, smesh.FT_Area, smesh.FT_MoreThan, area_margin)</span></p>\r
\r
-<p class="whs3">aFilter.SetPredicate(aPredicate)</p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1">anIds = mesh.GetIdsFromFilter(aFilter)</p>\r
\r
-<p class="whs3">anIds = aFilter.GetElementsId(mesh)</p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3">anEditor = mesh.GetMeshEditor()</p>\r
+<p class="whs1">mesh.RemoveElements(anIds)</p>\r
\r
-<p class="whs3">anEditor.RemoveElements(anIds)</p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs4"># Criterion : Free \r
+<p class="whs3"># Criterion : Free \r
Edges</p>\r
\r
-<p class="whs3">aPredicate = aFilterMgr.CreateFreeEdges()</p>\r
-\r
-<p class="whs3">aPredicate.SetMesh(mesh)</p>\r
-\r
-<p class="whs3">aBorders = aPredicate.GetBorders()</p>\r
+<p class="whs1">aBorders = mesh.GetFreeBorders() \r
+ </p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs4"># create groups</p>\r
+<p class="whs3"># create groups</p>\r
\r
-<p class="whs3">aGroupF = mesh.CreateGroup(SMESH.FACE, \r
+<p class="whs1">aGroupF = mesh.CreateGroup(SMESH.FACE, \r
"Faces with free edges")</p>\r
\r
-<p class="whs3">aGroupN = mesh.CreateGroup(SMESH.NODE, \r
+<p class="whs1">aGroupN = mesh.CreateGroup(SMESH.NODE, \r
"Nodes on free edges")</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs4"># fill groups with \r
+<p class="whs3"># fill groups with \r
elements, corresponding to the criterion</p>\r
\r
-<p class="whs3">print ""</p>\r
+<p class="whs1">print ""</p>\r
\r
-<p class="whs3">print "Criterion: \r
+<p class="whs1">print "Criterion: \r
Free edges Nb = ", len(aBorders)</p>\r
\r
-<p class="whs3">for i in range(len(aBorders)):</p>\r
+<p class="whs1">for i in range(len(aBorders)):</p>\r
\r
-<p class="whs3"> aBorder \r
+<p class="whs1"> aBorder \r
= aBorders[i]</p>\r
\r
-<p class="whs3"> print \r
+<p class="whs1"> print \r
"Face # ", aBorder.myElemId, " : Edge between nodes (",</p>\r
\r
-<p class="whs3"> print \r
+<p class="whs1"> print \r
aBorder.myPnt1, ", ", aBorder.myPnt2, ")"</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3"> <span \r
+<p class="whs1"> <span \r
style="margin-top: 0pt;\r
margin-bottom: 0pt;\r
font-family: 'Lucida Console', monospace;">aGroupF.Add([aBorder.myElemId])</span></p>\r
\r
-<p class="whs3"> aGroupN.Add([aBorder.myPnt1, \r
+<p class="whs1"> aGroupN.Add([aBorder.myPnt1, \r
aBorder.myPnt2])</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3">salome.sg.updateObjBrowser(1) \r
+<p class="whs1">salome.sg.updateObjBrowser(1) \r
</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
<h3><a name=bookmark4>Length 2D</a></h3>\r
\r
-<p class="whs1"><span><font color=red ><B><span style="font-weight: bold; color: #ff0000;"><font color=red ><B># \r
- Attention! This script has been written using the old approach basing \r
- on direct usage of SMESH idl interface.</B></font></span></B></font></span></p>\r
-\r
-<p class="whs1"># For the moment smesh package doesn't provide \r
- methods to check length 2D. </p>\r
-\r
-<p class="whs1"># In the next SALOME version the scripts will \r
- be updated to use only the commands from smesh package.</p>\r
-\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs3">import salome</p>\r
-\r
-<p class="whs3">import geompy</p>\r
+<p class="whs1">import salome</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1">import geompy</p>\r
\r
-<p class="whs3">import smesh</p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3">import SMESH</p>\r
+<p class="whs1">import smesh</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs4"># create open shell: \r
+<p class="whs3"># create open shell: \r
a box without one plane</p>\r
\r
-<p class="whs3">box = geompy.MakeBox(0., \r
+<p class="whs1">box = geompy.MakeBox(0., \r
0., 0., 20., 20., 15.)</p>\r
\r
-<p class="whs3">FaceList = geompy.SubShapeAll(box, \r
+<p class="whs1">FaceList = geompy.SubShapeAll(box, \r
geompy.ShapeType["FACE"])</p>\r
\r
-<p class="whs3">FaceList.remove(FaceList[5])</p>\r
+<p class="whs1">FaceList.remove(FaceList[5])</p>\r
\r
-<p class="whs3">box = geompy.MakeShell(FaceList)</p>\r
+<p class="whs1">box = geompy.MakeShell(FaceList)</p>\r
\r
-<p class="whs3">idbox = geompy.addToStudy(box, \r
+<p class="whs1">idbox = geompy.addToStudy(box, \r
"box")</p>\r
\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs4"># create a mesh</p>\r
-\r
-<p class="whs3">tria = smesh.Mesh(box, \r
- "Mesh_Length_2D")</p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3">algo = tria.Segment()</p>\r
+<p class="whs3"># create a mesh</p>\r
\r
-<p class="whs3">algo.NumberOfSegments(5)</p>\r
+<p class="whs1"><span style="font-family: 'Lucida Console', monospace;">mesh \r
+ = smesh.Mesh(box, "Mesh_Length_2D")</span></p>\r
\r
-<p class="whs3">algo = tria.Triangle()</p>\r
+<p class="whs1">algo = mesh.Segment()</p>\r
\r
-<p class="whs3">algo.MaxElementArea(20.)</p>\r
+<p class="whs1">algo.NumberOfSegments(5)</p>\r
\r
-<p class="whs3">tria.Compute()</p>\r
+<p class="whs1">algo = mesh.Triangle()</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1">algo.MaxElementArea(20.)</p>\r
\r
-<p class="whs3">mesh = tria.GetMesh()</p>\r
+<p class="whs1">mesh.Compute()</p>\r
\r
-<p class="whs3">gen = smesh.smesh</p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs4"># Criterion : Length \r
+<p class="whs3"># Criterion : Length \r
2D > 5.7</p>\r
\r
-<p class="whs3">length_margin = \r
+<p class="whs1">length_margin = \r
5.7</p>\r
\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs3">aFilterMgr = gen.CreateFilterManager()</p>\r
-\r
-<p class="whs3">aFunctor = aFilterMgr.CreateLength2D()</p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs3">aPredicate = aFilterMgr.CreateMoreThan()</p>\r
-\r
-<p class="whs3">aPredicate.SetNumFunctor(aFunctor)</p>\r
+<p class="whs1"><span style="font-family: 'Lucida Console', monospace;">aFilter \r
+ = smesh.GetFilter(smesh.FACE, smesh.FT_Length2D, smesh.FT_MoreThan, length_margin)</span></p>\r
\r
-<p class="whs3">aPredicate.SetMargin(length_margin)</p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs3">aFilter = aFilterMgr.CreateFilter()</p>\r
+<p class="whs1">anIds = mesh.GetIdsFromFilter(aFilter)</p>\r
\r
-<p class="whs3">aFilter.SetPredicate(aPredicate)</p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs3"># print the result</p>\r
\r
-<p class="whs3">anIds = aFilter.GetElementsId(mesh)</p>\r
-\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs4"># print the result</p>\r
-\r
-<p class="whs3">print "Criterion: \r
+<p class="whs1">print "Criterion: \r
Edges length 2D > ", length_margin, " Nb = ", len(anIds)</p>\r
\r
-<p class="whs3">j = 1</p>\r
+<p class="whs1">j = 1</p>\r
\r
-<p class="whs3">for i in range(len(anIds)):</p>\r
+<p class="whs1">for i in range(len(anIds)):</p>\r
\r
-<p class="whs3"> if \r
+<p class="whs1"> if \r
j > 20: j = 1; print ""</p>\r
\r
-<p class="whs3"> print \r
+<p class="whs1"> print \r
anIds[i],</p>\r
\r
-<p class="whs3"> j \r
+<p class="whs1"> j \r
= j + 1</p>\r
\r
-<p class="whs3"> pass</p>\r
+<p class="whs1"> pass</p>\r
\r
-<p class="whs3">print ""</p>\r
+<p class="whs1">print ""</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs4"># create a group</p>\r
+<p class="whs3"># create a group</p>\r
\r
-<p class="whs3">aGroup = mesh.CreateGroup(SMESH.FACE, \r
- "Faces with length 2D > " + `length_margin`)</p>\r
+<p class="whs1"><span style="font-family: 'Lucida Console', monospace;">aGroup \r
+ = mesh.CreateEmptyGroup(smesh.FACE, "Faces with length 2D > " \r
+ + `length_margin`)</span></p>\r
\r
-<p class="whs3">aGroup.Add(anIds)</p>\r
+<p class="whs1">aGroup.Add(anIds)</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3">salome.sg.updateObjBrowser(1) \r
+<p class="whs1">salome.sg.updateObjBrowser(1) \r
</p>\r
\r
<p class="whs2"> </p>\r
\r
<h3><a name=bookmark5>Borders at Multiconnection 2D</a></h3>\r
\r
-<p class="whs1"><span style="font-weight: bold; color: #ff0000;"><font color=red ><B><span \r
- style="font-weight: bold; color: #ff0000;"><font color=red ><B># Attention! This script has \r
- been written using the old approach basing on direct usage of SMESH idl \r
- interface.</B></font></span></B></font></span></p>\r
-\r
-<p class="whs1"># For the moment smesh package doesn't provide \r
- methods to check borders at multiconnection 2D. </p>\r
-\r
-<p class="whs1"># In the next SALOME version the scripts will \r
- be updated to use only the commands from smesh package.</p>\r
+<p class="whs1">import salome</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1">import geompy</p>\r
\r
-<p class="whs3">import salome</p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3">import geompy</p>\r
+<p class="whs1">import smesh</p>\r
\r
<p class="whs3"> </p>\r
\r
-<p class="whs3">import smesh</p>\r
-\r
-<p class="whs3">import SMESH</p>\r
-\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs4"># create a compound \r
+<p class="whs3"># create a compound \r
of two glued boxes</p>\r
\r
-<p class="whs3">box1 = geompy.MakeBox(0., \r
+<p class="whs1">box1 = geompy.MakeBox(0., \r
0., 0., 20., 20., 15.)</p>\r
\r
-<p class="whs3">box2 = geompy.MakeTranslation(box1, \r
+<p class="whs1">box2 = geompy.MakeTranslation(box1, \r
0., 20., 0)</p>\r
\r
-<p class="whs3">comp = geompy.MakeCompound([box1, \r
+<p class="whs1">comp = geompy.MakeCompound([box1, \r
box2])</p>\r
\r
-<p class="whs3">box = geompy.MakeGlueFaces(comp, \r
+<p class="whs1">box = geompy.MakeGlueFaces(comp, \r
0.000001)</p>\r
\r
-<p class="whs3">idbox = geompy.addToStudy(box, \r
+<p class="whs1">idbox = geompy.addToStudy(box, \r
"box")</p>\r
\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs4"># create a mesh</p>\r
-\r
-<p class="whs3">tria = smesh.Mesh(box, \r
- "Box compound : 2D triangle mesh")</p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3">algo = tria.Segment()</p>\r
+<p class="whs3"># create a mesh</p>\r
\r
-<p class="whs3">algo.NumberOfSegments(5)</p>\r
+<p class="whs1"><span style="font-family: 'Lucida Console', monospace;">mesh \r
+ = smesh.Mesh(box, "Box compound : 2D triangle mesh")</span></p>\r
\r
-<p class="whs3">algo = tria.Triangle()</p>\r
+<p class="whs1">algo = mesh.Segment()</p>\r
\r
-<p class="whs3">algo.MaxElementArea(20.)</p>\r
+<p class="whs1">algo.NumberOfSegments(5)</p>\r
\r
-<p class="whs3">tria.Compute()</p>\r
+<p class="whs1">algo = mesh.Triangle()</p>\r
\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs3">mesh = tria.GetMesh()</p>\r
+<p class="whs1">algo.MaxElementArea(20.)</p>\r
\r
-<p class="whs3">gen = smesh.smesh</p>\r
+<p class="whs1">mesh.Compute() </p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs4"># Criterion : MULTI-CONNECTION \r
+<p class="whs3"># Criterion : MULTI-CONNECTION \r
2D = 3</p>\r
\r
-<p class="whs3">nb_conn = 3</p>\r
-\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs3">aFilterMgr = gen.CreateFilterManager()</p>\r
-\r
-<p class="whs3">aFunctor = aFilterMgr.CreateMultiConnection2D()</p>\r
-\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs3">aPredicate = aFilterMgr.CreateEqualTo()</p>\r
-\r
-<p class="whs3">aPredicate.SetNumFunctor(aFunctor)</p>\r
+<p class="whs1">nb_conn = 3</p>\r
\r
-<p class="whs3">aPredicate.SetMargin(nb_conn)</p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs3">aFilter = aFilterMgr.CreateFilter()</p>\r
-\r
-<p class="whs3">aFilter.SetPredicate(aPredicate)</p>\r
+<p class="whs1"><span style="font-family: 'Lucida Console', monospace;">aFilter \r
+ = smesh.GetFilter(smesh.FACE, smesh.FT_MultiConnection2D, smesh.FT_EqualTo, \r
+ nb_conn)</span></p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3">anIds = aFilter.GetElementsId(mesh)</p>\r
+<p class="whs1">anIds = mesh.GetIdsFromFilter(aFilter) \r
+ </p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs4"># print the result</p>\r
+<p class="whs3"># print the result</p>\r
\r
-<p class="whs3">print "Criterion: \r
+<p class="whs1">print "Criterion: \r
Borders at multi-connection 2D = ", nb_conn, " Nb = ", \r
len(anIds)</p>\r
\r
-<p class="whs3">j = 1</p>\r
+<p class="whs1">j = 1</p>\r
\r
-<p class="whs3">for i in range(len(anIds)):</p>\r
+<p class="whs1">for i in range(len(anIds)):</p>\r
\r
-<p class="whs3"> if \r
+<p class="whs1"> if \r
j > 20: j = 1; print ""</p>\r
\r
-<p class="whs3"> print \r
+<p class="whs1"> print \r
anIds[i],</p>\r
\r
-<p class="whs3"> j \r
+<p class="whs1"> j \r
= j + 1</p>\r
\r
-<p class="whs3"> pass</p>\r
+<p class="whs1"> pass</p>\r
\r
-<p class="whs3">print ""</p>\r
+<p class="whs1">print ""</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs4"># create a group</p>\r
+<p class="whs3"># create a group</p>\r
\r
-<p class="whs3">aGroup = mesh.CreateGroup(SMESH.FACE, \r
- "Borders at multi-connection 2D = " + `nb_conn`)</p>\r
+<p class="whs1"><span style="font-family: 'Lucida Console', monospace;">aGroup \r
+ = mesh.CreateEmptyGroup(smesh.FACE, "Borders at multi-connection \r
+ 2D = " + `nb_conn`)</span></p>\r
\r
-<p class="whs3">aGroup.Add(anIds)</p>\r
+<p class="whs1">aGroup.Add(anIds)</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3">salome.sg.updateObjBrowser(1) \r
+<p class="whs1">salome.sg.updateObjBrowser(1) \r
</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
<h3><a name=bookmark6>Area</a></h3>\r
\r
-<p class="whs1"><span style="font-weight: bold; color: #ff0000;"><font color=red ><B><span \r
- style="font-weight: bold; color: #ff0000;"><font color=red ><B># Attention! This script has \r
- been written using the old approach basing on direct usage of SMESH idl \r
- interface.</B></font></span></B></font></span></p>\r
-\r
-<p class="whs1"># For the moment smesh package doesn't provide \r
- methods to check area. </p>\r
-\r
-<p class="whs1"># In the next SALOME version the scripts will \r
- be updated to use only the commands from smesh package.</p>\r
+<p class="whs1">import SMESH_mechanic</p>\r
\r
-<p class="whs2"> </p>\r
-\r
-<p class="whs3">import SMESH</p>\r
-\r
-<p class="whs3">import SMESH_mechanic</p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs3">smesh = \r
+<p class="whs1">smesh = \r
SMESH_mechanic.smesh</p>\r
\r
-<p class="whs3">mesh = \r
+<p class="whs1">mesh = \r
SMESH_mechanic.mesh</p>\r
\r
-<p class="whs3">salome = SMESH_mechanic.salome</p>\r
+<p class="whs1">salome = SMESH_mechanic.salome</p>\r
\r
<p class="whs2"> </p>\r
\r
<p class="whs2"># Criterion : AREA > \r
100.</p>\r
\r
-<p class="whs3">area_margin = 100.</p>\r
-\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs3">aFilterMgr = smesh.CreateFilterManager()</p>\r
-\r
-<p class="whs3">aFunctor = aFilterMgr.CreateArea()</p>\r
-\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs3">aPredicate = aFilterMgr.CreateMoreThan()</p>\r
-\r
-<p class="whs3">aPredicate.SetNumFunctor(aFunctor)</p>\r
-\r
-<p class="whs3">aPredicate.SetMargin(area_margin)</p>\r
+<p class="whs1">area_margin = 100.</p>\r
\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs3">aFilter = aFilterMgr.CreateFilter()</p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3">aFilter.SetPredicate(aPredicate)</p>\r
+<p class="whs1">aFilter = smesh.GetFilter(smesh.FACE, \r
+ smesh.FT_Area, smesh.FT_MoreThan, area_margin)</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3">anIds = aFilter.GetElementsId(mesh)</p>\r
+<p class="whs1">anIds = mesh.GetIdsFromFilter(aFilter) \r
+ </p>\r
\r
<p class="whs2"> </p>\r
\r
<p class="whs2"># print the result</p>\r
\r
-<p class="whs3">print "Criterion: \r
+<p class="whs1">print "Criterion: \r
Area > ", area_margin, " Nb = ", len(anIds)</p>\r
\r
-<p class="whs3">j = 1</p>\r
+<p class="whs1">j = 1</p>\r
\r
-<p class="whs3">for i in range(len(anIds)):</p>\r
+<p class="whs1">for i in range(len(anIds)):</p>\r
\r
-<p class="whs3"> if \r
+<p class="whs1"> if \r
j > 20: j = 1; print ""</p>\r
\r
-<p class="whs3"> print \r
+<p class="whs1"> print \r
anIds[i],</p>\r
\r
-<p class="whs3"> j \r
+<p class="whs1"> j \r
= j + 1</p>\r
\r
-<p class="whs3"> pass</p>\r
+<p class="whs1"> pass</p>\r
\r
-<p class="whs3">print ""</p>\r
+<p class="whs1">print ""</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
<p class="whs2"># create a group</p>\r
\r
-<p class="whs3">aGroup = mesh.CreateGroup(SMESH.FACE, \r
+<p class="whs1">aGroup = mesh.CreateEmptyGroup(smesh.FACE, \r
"Area > " + `area_margin`)</p>\r
\r
-<p class="whs3">aGroup.Add(anIds)</p>\r
+<p class="whs1">aGroup.Add(anIds)</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
<p class="whs2"><span style="font-family: 'Lucida Console', monospace;">salome.sg.updateObjBrowser(1)</span> \r
- </p>\r
+ </p>\r
\r
<h3><a name=bookmark7>Taper</a></h3>\r
\r
-<p class="whs1"><span style="font-weight: bold; color: #ff0000;"><font color=red ><B><span \r
- style="font-weight: bold; color: #ff0000;"><font color=red ><B># Attention! This script has \r
- been written using the old approach basing on direct usage of SMESH idl \r
- interface.</B></font></span></B></font></span></p>\r
-\r
-<p class="whs1"># For the moment smesh package doesn't provide \r
- methods to check taper. </p>\r
+<p class="whs1">import SMESH_mechanic</p>\r
\r
-<p class="whs1"># In the next SALOME version the scripts will \r
- be updated to use only the commands from smesh package.</p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs3">import SMESH</p>\r
-\r
-<p class="whs3">import SMESH_mechanic</p>\r
-\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs3">smesh = \r
+<p class="whs1">smesh = \r
SMESH_mechanic.smesh</p>\r
\r
-<p class="whs3">mesh = \r
+<p class="whs1">mesh = \r
SMESH_mechanic.mesh</p>\r
\r
-<p class="whs3">salome = SMESH_mechanic.salome</p>\r
+<p class="whs1">salome = SMESH_mechanic.salome</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs4"># Criterion : Taper \r
+<p class="whs3"># Criterion : Taper \r
> 3e-20</p>\r
\r
-<p class="whs3">taper_margin = 3e-20</p>\r
-\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs3">aFilterMgr = smesh.CreateFilterManager()</p>\r
-\r
-<p class="whs3">aFunctor = aFilterMgr.CreateTaper()</p>\r
+<p class="whs1">taper_margin = 3e-20</p>\r
\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs3">aPredicate = aFilterMgr.CreateMoreThan()</p>\r
-\r
-<p class="whs3">aPredicate.SetNumFunctor(aFunctor)</p>\r
-\r
-<p class="whs3">aPredicate.SetMargin(taper_margin)</p>\r
-\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3">aFilter = aFilterMgr.CreateFilter()</p>\r
+<p class="whs1">aFilter = smesh.GetFilter(smesh.FACE, \r
+ smesh.FT_Taper, smesh.FT_MoreThan, taper_margin)</p>\r
\r
-<p class="whs3">aFilter.SetPredicate(aPredicate)</p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1">anIds = mesh.GetIdsFromFilter(aFilter) \r
+ </p>\r
\r
-<p class="whs3">anIds = aFilter.GetElementsId(mesh)</p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs3"># print the result</p>\r
\r
-<p class="whs4"># print the result</p>\r
-\r
-<p class="whs3">print "Criterion: \r
+<p class="whs1">print "Criterion: \r
Taper > ", taper_margin, " Nb = ", len(anIds)</p>\r
\r
-<p class="whs3">j = 1</p>\r
+<p class="whs1">j = 1</p>\r
\r
-<p class="whs3">for i in range(len(anIds)):</p>\r
+<p class="whs1">for i in range(len(anIds)):</p>\r
\r
-<p class="whs3"> if \r
+<p class="whs1"> if \r
j > 20: j = 1; print ""</p>\r
\r
-<p class="whs3"> print \r
+<p class="whs1"> print \r
anIds[i],</p>\r
\r
-<p class="whs3"> j \r
+<p class="whs1"> j \r
= j + 1</p>\r
\r
-<p class="whs3"> pass</p>\r
+<p class="whs1"> pass</p>\r
\r
-<p class="whs3">print ""</p>\r
+<p class="whs1">print ""</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs4"># create a group</p>\r
+<p class="whs3"># create a group</p>\r
\r
-<p class="whs3">aGroup = mesh.CreateGroup(SMESH.FACE, \r
- "Taper > " + `taper_margin`)</p>\r
+<p class="whs1"><span style="font-family: 'Lucida Console', monospace;">aGroup \r
+ = mesh.CreateEmptyGroup(smesh.FACE, "Taper > " + `taper_margin`)</span></p>\r
\r
-<p class="whs3">aGroup.Add(anIds)</p>\r
+<p class="whs1">aGroup.Add(anIds)</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3">salome.sg.updateObjBrowser(1) \r
- </p>\r
+<p class="whs1">salome.sg.updateObjBrowser(1) \r
+ </p>\r
\r
<h3><a name=bookmark8>Aspect Ratio</a></h3>\r
\r
-<p class="whs1"><span style="font-weight: bold; color: #ff0000;"><font color=red ><B><span \r
- style="font-weight: bold; color: #ff0000;"><font color=red ><B># Attention! This script has \r
- been written using the old approach basing on direct usage of SMESH idl \r
- interface.</B></font></span></B></font></span></p>\r
-\r
-<p class="whs1"># For the moment smesh package doesn't provide \r
- methods to check aspect ratio. </p>\r
-\r
-<p class="whs1"># In the next SALOME version the scripts will \r
- be updated to use only the commands from smesh package.</p>\r
-\r
-<p class="whs3"> </p>\r
+<p class="whs1">import SMESH_mechanic</p>\r
\r
-<p class="whs3">import SMESH</p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3">import SMESH_mechanic</p>\r
-\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs3">smesh = \r
+<p class="whs1">smesh = \r
SMESH_mechanic.smesh</p>\r
\r
-<p class="whs3">mesh = \r
+<p class="whs1">mesh = \r
SMESH_mechanic.mesh</p>\r
\r
-<p class="whs3">salome = SMESH_mechanic.salome</p>\r
+<p class="whs1">salome = SMESH_mechanic.salome</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs4"># Criterion : ASPECT \r
+<p class="whs3"># Criterion : ASPECT \r
RATIO > 1.8</p>\r
\r
-<p class="whs3">ar_margin = 1.8</p>\r
-\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs3">aFilterMgr = smesh.CreateFilterManager()</p>\r
-\r
-<p class="whs3">aFunctor = aFilterMgr.CreateAspectRatio()</p>\r
-\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs3">aPredicate = aFilterMgr.CreateMoreThan()</p>\r
+<p class="whs1">ar_margin = 1.8</p>\r
\r
-<p class="whs3">aPredicate.SetNumFunctor(aFunctor)</p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3">aPredicate.SetMargin(ar_margin)</p>\r
+<p class="whs1"><span style="font-family: 'Lucida Console', monospace;">aFilter \r
+ = smesh.GetFilter(smesh.FACE, smesh.FT_AspectRatio, smesh.FT_MoreThan, \r
+ ar_margin)</span></p>\r
\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs3">aFilter = aFilterMgr.CreateFilter()</p>\r
-\r
-<p class="whs3">aFilter.SetPredicate(aPredicate)</p>\r
-\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3">anIds = aFilter.GetElementsId(mesh)</p>\r
+<p class="whs1">anIds = mesh.GetIdsFromFilter(aFilter) \r
+ </p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs4"># print the result</p>\r
+<p class="whs3"># print the result</p>\r
\r
-<p class="whs3">print "Criterion: \r
+<p class="whs1">print "Criterion: \r
Aspect Ratio > ", ar_margin, " Nb = ", len(anIds)</p>\r
\r
-<p class="whs3">j = 1</p>\r
+<p class="whs1">j = 1</p>\r
\r
-<p class="whs3">for i in range(len(anIds)):</p>\r
+<p class="whs1">for i in range(len(anIds)):</p>\r
\r
-<p class="whs3"> if \r
+<p class="whs1"> if \r
j > 20: j = 1; print ""</p>\r
\r
-<p class="whs3"> print \r
+<p class="whs1"> print \r
anIds[i],</p>\r
\r
-<p class="whs3"> j \r
+<p class="whs1"> j \r
= j + 1</p>\r
\r
-<p class="whs3"> pass</p>\r
+<p class="whs1"> pass</p>\r
\r
-<p class="whs3">print ""</p>\r
+<p class="whs1">print ""</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs4"># create a group</p>\r
+<p class="whs3"># create a group</p>\r
\r
-<p class="whs3">aGroup = mesh.CreateGroup(SMESH.FACE, \r
- "Aspect Ratio > " + `ar_margin`)</p>\r
+<p class="whs1"><span style="font-family: 'Lucida Console', monospace;">aGroup \r
+ = mesh.CreateEmptyGroup(smesh.FACE, "Aspect Ratio > " + `ar_margin`)</span></p>\r
\r
-<p class="whs3">aGroup.Add(anIds)</p>\r
+<p class="whs1">aGroup.Add(anIds)</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3">salome.sg.updateObjBrowser(1) \r
+<p class="whs1">salome.sg.updateObjBrowser(1) \r
</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
<h3><a name=bookmark9>Minimum Angle</a></h3>\r
\r
-<p class="whs1"><span style="font-weight: bold; color: #ff0000;"><font color=red ><B><span \r
- style="font-weight: bold; color: #ff0000;"><font color=red ><B># Attention! This script has \r
- been written using the old approach basing on direct usage of SMESH idl \r
- interface.</B></font></span></B></font></span></p>\r
-\r
-<p class="whs1"># For the moment smesh package doesn't provide \r
- methods to check minimum angle. </p>\r
-\r
-<p class="whs1"># In the next SALOME version the scripts will \r
- be updated to use only the commands from smesh package.</p>\r
-\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs3">import SMESH</p>\r
-\r
-<p class="whs3">import SMESH_mechanic</p>\r
+<p class="whs1">import SMESH_mechanic</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3">smesh = \r
+<p class="whs1">smesh = \r
SMESH_mechanic.smesh</p>\r
\r
-<p class="whs3">mesh = \r
+<p class="whs1">mesh = \r
SMESH_mechanic.mesh</p>\r
\r
-<p class="whs3">salome = SMESH_mechanic.salome</p>\r
+<p class="whs1">salome = SMESH_mechanic.salome</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs4"># Criterion : MINIMUM \r
+<p class="whs3"># Criterion : MINIMUM \r
ANGLE < 35.</p>\r
\r
-<p class="whs3">min_angle = 35.</p>\r
-\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs3">aFilterMgr = smesh.CreateFilterManager()</p>\r
-\r
-<p class="whs3">aFunctor = aFilterMgr.CreateMinimumAngle()</p>\r
-\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs3">aPredicate = aFilterMgr.CreateLessThan()</p>\r
-\r
-<p class="whs3">aPredicate.SetNumFunctor(aFunctor)</p>\r
-\r
-<p class="whs3">aPredicate.SetMargin(min_angle)</p>\r
+<p class="whs1">min_angle = 35.</p>\r
\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs3">aFilter = aFilterMgr.CreateFilter()</p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3">aFilter.SetPredicate(aPredicate)</p>\r
+<p class="whs1">aFilter = smesh.GetFilter(smesh.FACE, \r
+ smesh.FT_MinimumAngle, smesh.FT_LessThan, min_angle)</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3">anIds = aFilter.GetElementsId(mesh)</p>\r
+<p class="whs1">anIds = mesh.GetIdsFromFilter(aFilter) \r
+ </p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs4"># print the result</p>\r
+<p class="whs3"># print the result</p>\r
\r
-<p class="whs3">print "Criterion: \r
+<p class="whs1">print "Criterion: \r
Minimum Angle < ", min_angle, " Nb = ", len(anIds)</p>\r
\r
-<p class="whs3">j = 1</p>\r
+<p class="whs1">j = 1</p>\r
\r
-<p class="whs3">for i in range(len(anIds)):</p>\r
+<p class="whs1">for i in range(len(anIds)):</p>\r
\r
-<p class="whs3"> if \r
+<p class="whs1"> if \r
j > 20: j = 1; print ""</p>\r
\r
-<p class="whs3"> print \r
+<p class="whs1"> print \r
anIds[i],</p>\r
\r
-<p class="whs3"> j \r
+<p class="whs1"> j \r
= j + 1</p>\r
\r
-<p class="whs3"> pass</p>\r
+<p class="whs1"> pass</p>\r
\r
-<p class="whs3">print ""</p>\r
+<p class="whs1">print ""</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs4"># create a group</p>\r
+<p class="whs3"># create a group</p>\r
\r
-<p class="whs3">aGroup = mesh.CreateGroup(SMESH.FACE, \r
- "Minimum Angle < " + `min_angle`)</p>\r
+<p class="whs1"><span style="font-family: 'Lucida Console', monospace;">aGroup \r
+ = mesh.CreateEmptyGroup(smesh.FACE, "Minimum Angle < " + \r
+ `min_angle`)</span></p>\r
\r
-<p class="whs3">aGroup.Add(anIds)</p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1">aGroup.Add(anIds)</p>\r
+\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3">salome.sg.updateObjBrowser(1) \r
+<p class="whs1">salome.sg.updateObjBrowser(1) \r
</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
<h3><a name=bookmark10>Warping</a></h3>\r
\r
-<p class="whs1"><span style="font-weight: bold; color: #ff0000;"><font color=red ><B><span \r
- style="font-weight: bold; color: #ff0000;"><font color=red ><B># Attention! This script has \r
- been written using the old approach basing on direct usage of SMESH idl \r
- interface.</B></font></span></B></font></span></p>\r
-\r
-<p class="whs1"># For the moment smesh package doesn't provide \r
- methods to check warping. </p>\r
-\r
-<p class="whs1"># In the next SALOME version the scripts will \r
- be updated to use only the commands from smesh package.</p>\r
+<p class="whs1">import SMESH_mechanic</p>\r
\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs3">import SMESH</p>\r
-\r
-<p class="whs3">import SMESH_mechanic</p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs3">smesh = \r
+<p class="whs1">smesh = \r
SMESH_mechanic.smesh</p>\r
\r
-<p class="whs3">mesh = \r
+<p class="whs1">mesh = \r
SMESH_mechanic.mesh</p>\r
\r
-<p class="whs3">salome = SMESH_mechanic.salome</p>\r
+<p class="whs1">salome = SMESH_mechanic.salome</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs4"># Criterion : WARP \r
+<p class="whs3"># Criterion : WARP \r
ANGLE > 1e-15</p>\r
\r
-<p class="whs3">wa_margin = 1e-15</p>\r
-\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs3">aFilterMgr = smesh.CreateFilterManager()</p>\r
-\r
-<p class="whs3">aFunctor = aFilterMgr.CreateWarping()</p>\r
-\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs3">aPredicate = aFilterMgr.CreateMoreThan()</p>\r
-\r
-<p class="whs3">aPredicate.SetNumFunctor(aFunctor)</p>\r
+<p class="whs1">wa_margin = 1e-15</p>\r
\r
-<p class="whs3">aPredicate.SetMargin(wa_margin)</p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs3">aFilter = aFilterMgr.CreateFilter()</p>\r
+<p class="whs1">aFilter = smesh.GetFilter(smesh.FACE, \r
+ smesh.FT_Warping, smesh.FT_MoreThan, wa_margin)</p>\r
\r
-<p class="whs3">aFilter.SetPredicate(aPredicate)</p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs3">anIds = aFilter.GetElementsId(mesh)</p>\r
+<p class="whs1">anIds = mesh.GetIdsFromFilter(aFilter) \r
+ </p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs4"># print the result</p>\r
+<p class="whs3"># print the result</p>\r
\r
-<p class="whs3">print "Criterion: \r
+<p class="whs1">print "Criterion: \r
Warp > ", wa_margin, " Nb = ", len(anIds)</p>\r
\r
-<p class="whs3">j = 1</p>\r
+<p class="whs1">j = 1</p>\r
\r
-<p class="whs3">for i in range(len(anIds)):</p>\r
+<p class="whs1">for i in range(len(anIds)):</p>\r
\r
-<p class="whs3"> if \r
+<p class="whs1"> if \r
j > 20: j = 1; print ""</p>\r
\r
-<p class="whs3"> print \r
+<p class="whs1"> print \r
anIds[i],</p>\r
\r
-<p class="whs3"> j \r
+<p class="whs1"> j \r
= j + 1</p>\r
\r
-<p class="whs3"> pass</p>\r
+<p class="whs1"> pass</p>\r
\r
-<p class="whs3">print ""</p>\r
+<p class="whs1">print ""</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs4"># create a group</p>\r
+<p class="whs3"># create a group</p>\r
\r
-<p class="whs3">aGroup = mesh.CreateGroup(SMESH.FACE, \r
+<p class="whs1">aGroup = mesh.CreateEmptyGroup(smesh.FACE, \r
"Warp > " + `wa_margin`)</p>\r
\r
-<p class="whs3">aGroup.Add(anIds)</p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1">aGroup.Add(anIds)</p>\r
\r
-<p class="whs3">salome.sg.updateObjBrowser(1) \r
+<p class="whs1"> </p>\r
+\r
+<p class="whs1">salome.sg.updateObjBrowser(1) \r
</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
<h3><a name=bookmark12>Skew</a></h3>\r
\r
-<p class="whs1"><span style="font-weight: bold; color: #ff0000;"><font color=red ><B><span \r
- style="font-weight: bold; color: #ff0000;"><font color=red ><B># Attention! This script has \r
- been written using the old approach basing on direct usage of SMESH idl \r
- interface.</B></font></span></B></font></span></p>\r
-\r
-<p class="whs1"># For the moment smesh package doesn't provide \r
- methods to check skew. </p>\r
-\r
-<p class="whs1"># In the next SALOME version the scripts will \r
- be updated to use only the commands from smesh package.</p>\r
-\r
-<p class="whs3"> </p>\r
+<p class="whs1">import SMESH_mechanic</p>\r
\r
-<p class="whs3">import SMESH</p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3">import SMESH_mechanic</p>\r
-\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs3">smesh = \r
+<p class="whs1">smesh = \r
SMESH_mechanic.smesh</p>\r
\r
-<p class="whs3">mesh = \r
+<p class="whs1">mesh = \r
SMESH_mechanic.mesh</p>\r
\r
-<p class="whs3">salome = SMESH_mechanic.salome</p>\r
+<p class="whs1">salome = SMESH_mechanic.salome</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs4"># Criterion : Skew \r
+<p class="whs3"># Criterion : Skew \r
> 38.</p>\r
\r
-<p class="whs3">skew_margin = 38.</p>\r
-\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs3">aFilterMgr = smesh.CreateFilterManager()</p>\r
-\r
-<p class="whs3">aFunctor = aFilterMgr.CreateSkew()</p>\r
-\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs3">aPredicate = aFilterMgr.CreateMoreThan()</p>\r
+<p class="whs1">skew_margin = 38.</p>\r
\r
-<p class="whs3">aPredicate.SetNumFunctor(aFunctor)</p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3">aPredicate.SetMargin(skew_margin)</p>\r
+<p class="whs1">aFilter = smesh.GetFilter(smesh.FACE, \r
+ smesh.FT_Skew, smesh.FT_MoreThan, skew_margin)</p>\r
\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs3">aFilter = aFilterMgr.CreateFilter()</p>\r
-\r
-<p class="whs3">aFilter.SetPredicate(aPredicate)</p>\r
-\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3">anIds = aFilter.GetElementsId(mesh)</p>\r
+<p class="whs1">anIds = mesh.GetIdsFromFilter(aFilter)</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs4"># print the result</p>\r
+<p class="whs3"># print the result</p>\r
\r
-<p class="whs3">print "Criterion: \r
+<p class="whs1">print "Criterion: \r
Skew > ", skew_margin, " Nb = ", len(anIds)</p>\r
\r
-<p class="whs3">j = 1</p>\r
+<p class="whs1">j = 1</p>\r
\r
-<p class="whs3">for i in range(len(anIds)):</p>\r
+<p class="whs1">for i in range(len(anIds)):</p>\r
\r
-<p class="whs3"> if \r
+<p class="whs1"> if \r
j > 20: j = 1; print ""</p>\r
\r
-<p class="whs3"> print \r
+<p class="whs1"> print \r
anIds[i],</p>\r
\r
-<p class="whs3"> j \r
+<p class="whs1"> j \r
= j + 1</p>\r
\r
-<p class="whs3"> pass</p>\r
+<p class="whs1"> pass</p>\r
\r
-<p class="whs3">print ""</p>\r
+<p class="whs1">print ""</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs4"># create a group</p>\r
+<p class="whs3"># create a group</p>\r
\r
-<p class="whs3">aGroup = mesh.CreateGroup(SMESH.FACE, \r
- "Skew > " + `skew_margin`)</p>\r
+<p class="whs1"><span style="font-family: 'Lucida Console', monospace;">aGroup \r
+ = mesh.CreateEmptyGroup(smesh.FACE, "Skew > " + `skew_margin`)</span></p>\r
\r
-<p class="whs3">aGroup.Add(anIds)</p>\r
+<p class="whs1">aGroup.Add(anIds)</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3">salome.sg.updateObjBrowser(1) \r
+<p class="whs1">salome.sg.updateObjBrowser(1) \r
</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
<h3><a name=bookmark11>Aspect Ratio 3D</a></h3>\r
\r
-<p class="whs1"><span style="font-weight: bold; color: #ff0000;"><font color=red ><B><span \r
- style="font-weight: bold; color: #ff0000;"><font color=red ><B># Attention! This script has \r
- been written using the old approach basing on direct usage of SMESH idl \r
- interface.</B></font></span></B></font></span></p>\r
-\r
-<p class="whs1"># For the moment smesh package doesn't provide \r
- methods to check aspect ratio 3D. </p>\r
-\r
-<p class="whs1"># In the next SALOME version the scripts will \r
- be updated to use only the commands from smesh package.</p>\r
-\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs3">import SMESH</p>\r
-\r
-<p class="whs3">import SMESH_mechanic_tetra</p>\r
+<p class="whs1">import SMESH_mechanic_tetra \r
+ </p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3">smesh = \r
+<p class="whs1">smesh = \r
SMESH_mechanic_tetra.smesh</p>\r
\r
-<p class="whs3">mesh = \r
+<p class="whs1">mesh = \r
SMESH_mechanic_tetra.mesh</p>\r
\r
-<p class="whs3">salome = SMESH_mechanic_tetra.salome</p>\r
+<p class="whs1">salome = SMESH_mechanic_tetra.salome</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs4"># Criterion : ASPECT \r
+<p class="whs3"># Criterion : ASPECT \r
RATIO 3D > 4.5</p>\r
\r
-<p class="whs3">ar_margin = 4.5</p>\r
-\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs3">aFilterMgr = smesh.CreateFilterManager()</p>\r
-\r
-<p class="whs3">aFunctor = aFilterMgr.CreateAspectRatio3D()</p>\r
-\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs3">aPredicate = aFilterMgr.CreateMoreThan()</p>\r
-\r
-<p class="whs3">aPredicate.SetNumFunctor(aFunctor)</p>\r
-\r
-<p class="whs3">aPredicate.SetMargin(ar_margin)</p>\r
+<p class="whs1">ar_margin = 4.5</p>\r
\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs3">aFilter = aFilterMgr.CreateFilter()</p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3">aFilter.SetPredicate(aPredicate)</p>\r
+<p class="whs1">aFilter = smesh.GetFilter(smesh.VOLUME, \r
+ smesh.FT_AspectRatio3D, smesh.FT_MoreThan, ar_margin)</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3">anIds = aFilter.GetElementsId(mesh)</p>\r
+<p class="whs1">anIds = mesh.GetIdsFromFilter(aFilter) \r
+ </p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs4"># print the result</p>\r
+<p class="whs3"># print the result</p>\r
\r
-<p class="whs3">print "Criterion: \r
+<p class="whs1">print "Criterion: \r
Aspect Ratio 3D > ", ar_margin, " Nb = ", len(anIds)</p>\r
\r
-<p class="whs3">j = 1</p>\r
+<p class="whs1">j = 1</p>\r
\r
-<p class="whs3">for i in range(len(anIds)):</p>\r
+<p class="whs1">for i in range(len(anIds)):</p>\r
\r
-<p class="whs3"> if \r
+<p class="whs1"> if \r
j > 20: j = 1; print ""</p>\r
\r
-<p class="whs3"> print \r
+<p class="whs1"> print \r
anIds[i],</p>\r
\r
-<p class="whs3"> j \r
+<p class="whs1"> j \r
= j + 1</p>\r
\r
-<p class="whs3"> pass</p>\r
+<p class="whs1"> pass</p>\r
\r
-<p class="whs3">print ""</p>\r
+<p class="whs1">print ""</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs4"># create a group</p>\r
+<p class="whs3"># create a group</p>\r
\r
-<p class="whs3">aGroup = mesh.CreateGroup(SMESH.VOLUME, \r
+<p class="whs1">aGroup = mesh.CreateEmptyGroup(smesh.VOLUME, \r
"Aspect Ratio 3D > " + `ar_margin`)</p>\r
\r
-<p class="whs3">aGroup.Add(anIds)</p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1">aGroup.Add(anIds)</p>\r
+\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3">salome.sg.updateObjBrowser(1) \r
+<p class="whs1">salome.sg.updateObjBrowser(1) \r
</p>\r
\r
<h3><a name=Volume>Volume</a></h3>\r
\r
-<p class="whs1"><span style="font-weight: bold; color: #ff0000;"><font color=red ><B><span \r
- style="font-weight: bold; color: #ff0000;"><font color=red ><B># Attention! This script has \r
- been written using the old approach basing on direct usage of SMESH idl \r
- interface.</B></font></span></B></font></span></p>\r
-\r
-<p class="whs1"># For the moment smesh package doesn't provide \r
- methods to check volume. </p>\r
-\r
-<p class="whs1"># In the next SALOME version the scripts will \r
- be updated to use only the commands from smesh package.</p>\r
-\r
-<p class="whs2"> </p>\r
-\r
-<p class="whs3">import SMESH</p>\r
-\r
-<p class="whs3">import SMESH_mechanic_tetra</p>\r
+<p class="whs1">import SMESH_mechanic_tetra</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3">smesh = \r
+<p class="whs1">smesh = \r
SMESH_mechanic_tetra.smesh</p>\r
\r
-<p class="whs3">mesh = \r
+<p class="whs1">mesh = \r
SMESH_mechanic_tetra.mesh</p>\r
\r
-<p class="whs3">salome = SMESH_mechanic_tetra.salome</p>\r
+<p class="whs1">salome = SMESH_mechanic_tetra.salome</p>\r
\r
<p class="whs2"> </p>\r
\r
<p class="whs2"># Criterion : VOLUME < \r
7.</p>\r
\r
-<p class="whs3">volume_margin = \r
+<p class="whs1">volume_margin = \r
7.</p>\r
\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs3">aFilterMgr = smesh.CreateFilterManager()</p>\r
-\r
-<p class="whs3">aFunctor = aFilterMgr.CreateVolume3D()</p>\r
-\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs3">aPredicate = aFilterMgr.CreateLessThan()</p>\r
-\r
-<p class="whs3">aPredicate.SetNumFunctor(aFunctor)</p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3">aPredicate.SetMargin(volume_margin)</p>\r
+<p class="whs1">aFilter = smesh.GetFilter(smesh.VOLUME, \r
+ smesh.FT_Volume3D, smesh.FT_LessThan, volume_margin)</p>\r
\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs3">aFilter = aFilterMgr.CreateFilter()</p>\r
-\r
-<p class="whs3">aFilter.SetPredicate(aPredicate)</p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs3">anIds = aFilter.GetElementsId(mesh)</p>\r
+<p class="whs1">anIds = mesh.GetIdsFromFilter(aFilter) \r
+ </p>\r
\r
<p class="whs2"> </p>\r
\r
<p class="whs2"># print the result</p>\r
\r
-<p class="whs3">print ""</p>\r
+<p class="whs1">print ""</p>\r
\r
-<p class="whs3">print "Criterion: \r
+<p class="whs1">print "Criterion: \r
Volume < ", volume_margin, " Nb = ", len(anIds)</p>\r
\r
-<p class="whs3">j = 1</p>\r
+<p class="whs1">j = 1</p>\r
\r
-<p class="whs3">for i in range(len(anIds)):</p>\r
+<p class="whs1">for i in range(len(anIds)):</p>\r
\r
-<p class="whs3"> if \r
+<p class="whs1"> if \r
j > 20: j = 1; print ""</p>\r
\r
-<p class="whs3"> print \r
+<p class="whs1"> print \r
anIds[i],</p>\r
\r
-<p class="whs3"> j \r
+<p class="whs1"> j \r
= j + 1</p>\r
\r
-<p class="whs3"> pass</p>\r
+<p class="whs1"> pass</p>\r
\r
-<p class="whs3">print ""</p>\r
+<p class="whs1">print ""</p>\r
\r
<p class="whs2"> </p>\r
\r
<p class="whs2"># create a group</p>\r
\r
-<p class="whs3">aGroup = mesh.CreateGroup(SMESH.VOLUME, \r
+<p class="whs1">aGroup = mesh.CreateEmptyGroup(smesh.VOLUME, \r
"Volume < " + `volume_margin`)</p>\r
\r
-<p class="whs3">aGroup.Add(anIds)</p>\r
+<p class="whs1"> </p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs1">aGroup.Add(anIds)</p>\r
\r
-<p class="whs2"><span style="font-family: 'Lucida Console', monospace;">salome.sg.updateObjBrowser(1)</span> \r
- </p>\r
+<p class="whs2"> </p>\r
+\r
+<p class="whs2"><span style="font-family: 'Lucida Console', monospace;">salome.sg.updateObjBrowser(1) \r
+ </span> </p>\r
\r
<script type="text/javascript" language="javascript1.2">\r
<!--\r
h3.whs1 { margin-top:0pt; margin-bottom:0pt; }\r
h4.whs2 { margin-top:0pt; margin-bottom:0pt; }\r
p.whs3 { font-family:'Lucida Console' , monospace; margin-top:0pt; margin-bottom:0pt; }\r
-p.whs4 { margin-top:0pt; margin-bottom:0pt; font-weight:bold; color:#ff0000; }\r
-p.whs5 { margin-top:0pt; margin-bottom:0pt; font-family:'Lucida Console' , monospace; }\r
-p.whs6 { margin-top:0pt; margin-bottom:0pt; font-family:'Times New Roman' , serif; }\r
-p.whs7 { margin-top:0pt; margin-bottom:0pt; }\r
+p.whs4 { margin-top:0pt; margin-bottom:0pt; font-family:'Lucida Console' , monospace; }\r
+p.whs5 { margin-top:0pt; margin-bottom:0pt; font-family:'Times New Roman' , serif; }\r
+p.whs6 { margin-top:0pt; margin-bottom:0pt; }\r
-->\r
</style><script type="text/javascript" language="JavaScript">\r
<!--\r
strNSS += "p.whs4 {margin-top:1pt;margin-bottom:1pt; }";\r
strNSS += "p.whs5 {margin-top:1pt;margin-bottom:1pt; }";\r
strNSS += "p.whs6 {margin-top:1pt;margin-bottom:1pt; }";\r
- strNSS += "p.whs7 {margin-top:1pt;margin-bottom:1pt; }";\r
strNSS +="</style>";\r
document.write(strNSS);\r
}\r
\r
<p class="whs3"> </p>\r
\r
-<p class="whs4"><span style="font-weight: bold; color: #ff0000;"><font color=red ><B># \r
- Attention! This script has been written using the old approach basing \r
- on direct usage of SMESH idl interface.</B></font></span></p>\r
+<p class="whs4">import SMESH_mechanic</p>\r
\r
-<p class="whs4"># For the moment smesh package doesn't provide \r
- methods to translate meshes. </p>\r
+<p class="whs4"> </p>\r
\r
-<p class="whs4"># In the next SALOME version the scripts will \r
- be updated to use only the commands from smesh package.</p>\r
+<p class="whs4"><span style="font-family: 'Lucida Console', monospace;">smesh \r
+ = SMESH_mechanic.smesh </span></p>\r
\r
-<p class="whs5"> </p>\r
-\r
-<p class="whs5">import SMESH</p>\r
-\r
-<p class="whs5">import SMESH_mechanic</p>\r
-\r
-<p class="whs5"> </p>\r
-\r
-<p class="whs5">mesh = SMESH_mechanic.mesh</p>\r
-\r
-<p class="whs5">anEditor = mesh.GetMeshEditor()</p>\r
+<p class="whs4">mesh = SMESH_mechanic.mesh \r
+ </p>\r
\r
-<p class="whs5"> </p>\r
+<p class="whs4"> </p>\r
\r
-<p class="whs6"># define translation \r
+<p class="whs5"># define translation \r
vector</p>\r
\r
-<p class="whs5">point = SMESH.PointStruct(-150., \r
- -150., 0.)</p>\r
+<p class="whs4"><span style="font-family: 'Lucida Console', monospace;">point \r
+ = smesh.PointStruct(-150., -150., 0.)</span></p>\r
\r
-<p class="whs5">vector = SMESH.DirStruct(point)</p>\r
-\r
-<p class="whs5"> </p>\r
-\r
-<p class="whs6"># translate a mesh</p>\r
-\r
-<p class="whs5">doCopy = 1</p>\r
+<p class="whs4">vector =smesh.DirStruct(point) \r
+ </p>\r
\r
-<p class="whs5">anEditor.TranslateObject(mesh, \r
- vector, doCopy) </p>\r
+<p class="whs4"> </p>\r
\r
-<p class="whs7"> </p>\r
+<p class="whs5"># translate a mesh</p>\r
\r
-<h4 class="whs2"><a name=bookmark1>Rotation</a></h4>\r
+<p class="whs4">doCopy = 1</p>\r
\r
-<p class="whs3"> </p>\r
+<p class="whs4"> </p>\r
\r
-<p class="whs4"><span style="font-weight: bold; color: #ff0000;"><font color=red ><B># \r
- Attention! This script has been written using the old approach basing \r
- on direct usage of SMESH idl interface.</B></font></span></p>\r
+<p class="whs4">mesh.Translate([], \r
+ vector, doCopy) </p>\r
\r
-<p class="whs4"># For the moment smesh package doesn't provide \r
- methods to rotate meshes. </p>\r
+<p class="whs6"> </p>\r
\r
-<p class="whs4"># In the next SALOME version the scripts will \r
- be updated to use only the commands from smesh package.</p>\r
+<h4 class="whs2"><a name=bookmark1>Rotation</a></h4>\r
\r
<p class="whs3"> </p>\r
\r
<p class="whs3">import math</p>\r
\r
-<p class="whs3">import SMESH</p>\r
-\r
<p class="whs3">import SMESH_mechanic</p>\r
\r
<p class="whs3"> </p>\r
\r
-<p class="whs3">mesh = SMESH_mechanic.mesh</p>\r
+<p class="whs3"><span style="font-family: 'Lucida Console', monospace;">smesh \r
+ = SMESH_mechanic.smesh</span></p>\r
\r
-<p class="whs3">anEditor = mesh.GetMeshEditor()</p>\r
+<p class="whs3">mesh = SMESH_mechanic.mesh </p>\r
\r
<p class="whs3"> </p>\r
\r
-<p class="whs6"># define rotation axis \r
+<p class="whs5"># define rotation axis \r
and angle</p>\r
\r
-<p class="whs3">axisXYZ = SMESH.AxisStruct(0., 0., 0., \r
+<p class="whs3">axisXYZ = smesh.AxisStruct(0., 0., 0., \r
5., 5., 20.)</p>\r
\r
<p class="whs3">angle270 = 1.5 * math.pi</p>\r
\r
<p class="whs3"> </p>\r
\r
-<p class="whs6"># rotate a mesh</p>\r
+<p class="whs5"># rotate a mesh</p>\r
\r
-<p class="whs3">anEditor.RotateObject(mesh, axisXYZ, angle270, \r
- 1) </p>\r
+<p class="whs4">mesh.Rotate([], \r
+ axisXYZ, angle270, 1) </p>\r
\r
-<p class="whs7"> </p>\r
+<p class="whs6"> </p>\r
\r
<h4 class="whs2"><a name=bookmark2>Symmetry</a></h4>\r
\r
<p class="whs3"> </p>\r
\r
-<p class="whs4"><span style="font-weight: bold; color: #ff0000;"><font color=red ><B># \r
- Attention! This script has been written using the old approach basing \r
- on direct usage of SMESH idl interface.</B></font></span></p>\r
-\r
-<p class="whs4"># For the moment smesh package doesn't provide \r
- methods to create symmetrical copies of meshes. </p>\r
-\r
-<p class="whs4"># In the next SALOME version the scripts will \r
- be updated to use only the commands from smesh package.</p>\r
-\r
-<p class="whs3"> </p>\r
-\r
<p class="whs3">import math</p>\r
\r
-<p class="whs3">import SMESH</p>\r
+<p class="whs3"> </p>\r
\r
<p class="whs3">import SMESH_mechanic</p>\r
\r
<p class="whs3"> </p>\r
\r
-<p class="whs3">mesh = SMESH_mechanic.mesh</p>\r
+<p class="whs3"><span style="font-family: 'Lucida Console', monospace;">smesh \r
+ = SMESH_mechanic.smesh</span></p>\r
\r
-<p class="whs3">anEditor = mesh.GetMeshEditor()</p>\r
+<p class="whs3">mesh = SMESH_mechanic.mesh </p>\r
\r
<p class="whs3"> </p>\r
\r
-<p class="whs6"># create a symmetrical \r
+<p class="whs5"># create a symmetrical \r
copy of the mesh mirrored through a point</p>\r
\r
<p class="whs3">axis = SMESH.AxisStruct(0, 0, 0, 0, 0, \r
0)</p>\r
\r
-<p class="whs3">anEditor.MirrorObject(mesh, axis, SMESH.SMESH_MeshEditor.POINT, \r
- 1) </p>\r
-\r
-<p class="whs7"> </p>\r
-\r
-<h4 class="whs2"><a name=bookmark3>Merging \r
- Nodes</a></h4>\r
-\r
<p class="whs3"> </p>\r
\r
-<p class="whs4"><span style="font-weight: bold; color: #ff0000;"><font color=red ><B># \r
- Attention! This script has been written using the old approach basing \r
- on direct usage of SMESH idl interface.</B></font></span></p>\r
-\r
-<p class="whs4"># For the moment smesh package doesn't provide \r
- methods to merge nodes. </p>\r
-\r
-<p class="whs4"># In the next SALOME version the scripts will \r
- be updated to use only the commands from smesh package.</p>\r
+<p class="whs3">mesh.Mirror([], axis, smesh.POINT, 1) \r
+ </p>\r
\r
<p class="whs6"> </p>\r
\r
-<p class="whs5">import SMESH_mechanic</p>\r
-\r
-<p class="whs5">mesh = SMESH_mechanic.mesh</p>\r
-\r
-<p class="whs5"> </p>\r
-\r
-<p class="whs5">aMeshEditor = mesh.GetMeshEditor()</p>\r
-\r
-<p class="whs5"> </p>\r
-\r
-<p class="whs6"># merge nodes</p>\r
+<h4 class="whs2"><a name=bookmark3>Merging \r
+ Nodes</a></h4>\r
\r
-<p class="whs5">Tolerance = 25.0</p>\r
+<p class="whs3"> </p>\r
\r
-<p class="whs5"> </p>\r
+<p class="whs4">import SMESH_mechanic</p>\r
\r
-<p class="whs5">GroupsOfNodes = \r
- aMeshEditor.FindCoincidentNodes(Tolerance)</p>\r
+<p class="whs4">mesh = SMESH_mechanic.mesh</p>\r
\r
-<p class="whs7"><span style="font-family: 'Lucida Console', monospace;">aMeshEditor.MergeNodes(GroupsOfNodes)</span> \r
- </p>\r
+<p class="whs4"> </p>\r
\r
-<p class="whs7"> </p>\r
+<p class="whs5"># merge nodes</p>\r
\r
-<h4><a name=bookmark8>Merging Elements</a></h4>\r
+<p class="whs4">Tolerance = 25.0</p>\r
\r
-<p class="whs4"><span style="font-weight: bold; color: #ff0000;"><font color=red ><B># \r
- Attention! This script has been written using the old approach basing \r
- on direct usage of SMESH idl interface.</B></font></span></p>\r
+<p class="whs4"> </p>\r
\r
-<p class="whs4"># For the moment smesh package doesn't provide \r
- methods to merge elements. </p>\r
+<p class="whs4">GroupsOfNodes = \r
+ mesh.FindCoincidentNodes(Tolerance)</p>\r
\r
-<p class="whs4"># In the next SALOME version the scripts will \r
- be updated to use only the commands from smesh package.</p>\r
+<p class="whs4">mesh.MergeNodes(GroupsOfNodes) \r
+ </p>\r
\r
<p class="whs6"> </p>\r
\r
-<p class="whs5">import salome</p>\r
+<h4><a name=bookmark8>Merging Elements</a></h4>\r
\r
-<p class="whs5">import geompy</p>\r
+<p class="whs4">import salome</p>\r
\r
-<p class="whs5">import smesh</p>\r
+<p class="whs4">import geompy</p>\r
\r
-<p class="whs5">import SMESH</p>\r
+<p class="whs4">import smesh</p>\r
\r
-<p class="whs5"> </p>\r
+<p class="whs4"> </p>\r
\r
-<p class="whs6"># create a face to \r
+<p class="whs5"># create a face to \r
be meshed</p>\r
\r
-<p class="whs5">px = geompy.MakeVertex(100., \r
+<p class="whs4">px = geompy.MakeVertex(100., \r
0. , 0. \r
)</p>\r
\r
-<p class="whs5">py = geompy.MakeVertex(0. \r
+<p class="whs4">py = geompy.MakeVertex(0. \r
, 100., \r
0. )</p>\r
\r
-<p class="whs5">pz = geompy.MakeVertex(0. \r
+<p class="whs4">pz = geompy.MakeVertex(0. \r
, 0. , \r
100.)</p>\r
\r
-<p class="whs5"> </p>\r
+<p class="whs4"> </p>\r
\r
-<p class="whs5">vxy = geompy.MakeVector(px, \r
+<p class="whs4">vxy = geompy.MakeVector(px, \r
py)</p>\r
\r
-<p class="whs5">arc = geompy.MakeArc(py, \r
+<p class="whs4">arc = geompy.MakeArc(py, \r
pz, px)</p>\r
\r
-<p class="whs5"> </p>\r
+<p class="whs4"> </p>\r
\r
-<p class="whs5">wire = geompy.MakeWire([vxy, \r
+<p class="whs4">wire = geompy.MakeWire([vxy, \r
arc])</p>\r
\r
-<p class="whs5">isPlanarFace = 1</p>\r
+<p class="whs4">isPlanarFace = 1</p>\r
\r
-<p class="whs5"> </p>\r
+<p class="whs4"> </p>\r
\r
-<p class="whs5">face1 = geompy.MakeFace(wire, \r
+<p class="whs4">face1 = geompy.MakeFace(wire, \r
isPlanarFace)</p>\r
\r
-<p class="whs5">id_face1 = geompy.addToStudy(face1, \r
+<p class="whs4">id_face1 = geompy.addToStudy(face1, \r
"Face1")</p>\r
\r
-<p class="whs5"> </p>\r
+<p class="whs4"> </p>\r
\r
-<p class="whs6"># create a circle to \r
+<p class="whs5"># create a circle to \r
be an extrusion path</p>\r
\r
-<p class="whs5">px1 = geompy.MakeVertex( \r
+<p class="whs4">px1 = geompy.MakeVertex( \r
100., 100., \r
0.)</p>\r
\r
-<p class="whs5">py1 = geompy.MakeVertex(-100., \r
+<p class="whs4">py1 = geompy.MakeVertex(-100., \r
-100., 0.)</p>\r
\r
-<p class="whs5">pz1 = geompy.MakeVertex( \r
+<p class="whs4">pz1 = geompy.MakeVertex( \r
0., \r
0., \r
50.)</p>\r
\r
-<p class="whs5"> </p>\r
+<p class="whs4"> </p>\r
\r
-<p class="whs5">circle = geompy.MakeCircleThreePnt(py1, \r
+<p class="whs4">circle = geompy.MakeCircleThreePnt(py1, \r
pz1, px1)</p>\r
\r
-<p class="whs5">id_circle = geompy.addToStudy(circle, \r
+<p class="whs4">id_circle = geompy.addToStudy(circle, \r
"Path")</p>\r
\r
-<p class="whs5"> </p>\r
+<p class="whs4"> </p>\r
\r
-<p class="whs6"># create a 2D mesh \r
+<p class="whs5"># create a 2D mesh \r
on the face</p>\r
\r
-<p class="whs5">trias = smesh.Mesh(face1, \r
+<p class="whs4">trias = smesh.Mesh(face1, \r
"Face : 2D mesh")</p>\r
\r
-<p class="whs5"> </p>\r
-\r
-<p class="whs5">algo1D = trias.Segment()</p>\r
+<p class="whs4"> </p>\r
\r
-<p class="whs5">algo1D.NumberOfSegments(6)</p>\r
+<p class="whs4">algo1D = trias.Segment()</p>\r
\r
-<p class="whs5">algo2D = trias.Triangle()</p>\r
+<p class="whs4">algo1D.NumberOfSegments(6)</p>\r
\r
-<p class="whs5">algo2D.LengthFromEdges()</p>\r
+<p class="whs4">algo2D = trias.Triangle()</p>\r
\r
-<p class="whs5"> </p>\r
+<p class="whs4">algo2D.LengthFromEdges()</p>\r
\r
-<p class="whs5">trias.Compute()</p>\r
+<p class="whs4"> </p>\r
\r
-<p class="whs5">tri_mesh = trias.GetMesh()</p>\r
+<p class="whs4">trias.Compute()</p>\r
\r
-<p class="whs6"> </p>\r
+<p class="whs5"> </p>\r
\r
-<p class="whs6"># create a path mesh</p>\r
+<p class="whs5"># create a path mesh</p>\r
\r
-<p class="whs5">circlemesh = smesh.Mesh(circle, \r
+<p class="whs4">circlemesh = smesh.Mesh(circle, \r
"Path mesh")</p>\r
\r
-<p class="whs5">algo = circlemesh.Segment()</p>\r
+<p class="whs4">algo = circlemesh.Segment()</p>\r
\r
-<p class="whs5">algo.NumberOfSegments(10)</p>\r
+<p class="whs4">algo.NumberOfSegments(10)</p>\r
\r
-<p class="whs5">circlemesh.Compute()</p>\r
+<p class="whs4">circlemesh.Compute()</p>\r
\r
-<p class="whs6"> </p>\r
+<p class="whs5"> </p>\r
\r
-<p class="whs6"># extrusion of the \r
+<p class="whs5"># extrusion of the \r
mesh</p>\r
\r
-<p class="whs5">aMeshEditor = tri_mesh.GetMeshEditor()</p>\r
+<p class="whs4"><span style="font-family: 'Lucida Console', monospace;">trias.ExtrusionAlongPath([], \r
+ circlemesh, circle,</span></p>\r
\r
-<p class="whs5">aMeshEditor.ExtrusionAlongPathObject(tri_mesh, \r
- circlemesh.GetMesh(), circle,</p>\r
+<p class="whs4"> 1, \r
+ 0, [], 0, smesh.PointStruct(0, 0, 0))</p>\r
\r
-<p class="whs5"> 1, \r
- 0, [], 0, SMESH.PointStruct(0, 0, 0))</p>\r
+<p class="whs4"> </p>\r
\r
-<p class="whs6"># merge nodes</p>\r
+<p class="whs5"># merge nodes</p>\r
\r
-<p class="whs5">print "Number \r
- of nodes before MergeNodes:", tri_mesh.NbNodes()</p>\r
+<p class="whs4">print "Number \r
+ of nodes before MergeNodes:", </p>\r
\r
-<p class="whs5"> </p>\r
+<p class="whs4">trias.NbNodes()</p>\r
\r
-<p class="whs5">tolerance = 0.001</p>\r
+<p class="whs4">tolerance = 0.001</p>\r
\r
-<p class="whs5">array_of_nodes_groups \r
- = aMeshEditor.FindCoincidentNodes(tolerance)</p>\r
+<p class="whs4">array_of_nodes_groups \r
+ = trias.FindCoincidentNodes(tolerance)</p>\r
\r
-<p class="whs5">aMeshEditor.MergeNodes(array_of_nodes_groups)</p>\r
+<p class="whs4"> </p>\r
\r
-<p class="whs5"> </p>\r
+<p class="whs4">trias.MergeNodes(array_of_nodes_groups)</p>\r
\r
-<p class="whs5">print "Number \r
- of nodes after MergeNodes:", tri_mesh.NbNodes()</p>\r
+<p class="whs4"> </p>\r
\r
-<p class="whs5">print ""</p>\r
+<p class="whs4">print "Number \r
+ of nodes after MergeNodes:", trias.NbNodes()</p>\r
\r
-<p class="whs5">print "Number \r
+<p class="whs4">print ""</p>\r
+\r
+<p class="whs4">print "Number \r
of elements before MergeEqualElements:"</p>\r
\r
-<p class="whs5">print "Edges \r
+<p class="whs4">print "Edges \r
: \r
- ", tri_mesh.NbEdges()</p>\r
+ ", trias.NbEdges()</p>\r
\r
-<p class="whs5">print "Triangles \r
+<p class="whs4">print "Triangles \r
: ", \r
- tri_mesh.NbTriangles()</p>\r
+ trias.NbTriangles()</p>\r
\r
-<p class="whs5">print "Quadrangles: \r
- ", tri_mesh.NbQuadrangles()</p>\r
+<p class="whs4">print "Quadrangles: \r
+ ", trias.NbQuadrangles()</p>\r
\r
-<p class="whs5">print "Volumes \r
+<p class="whs4">print "Volumes \r
: \r
- ", tri_mesh.NbVolumes()</p>\r
+ ", trias.NbVolumes()</p>\r
\r
-<p class="whs6"> </p>\r
+<p class="whs4"> </p>\r
\r
-<p class="whs6"># merge elements</p>\r
+<p class="whs5"># merge elements</p>\r
\r
-<p class="whs5">aMeshEditor.MergeEqualElements()</p>\r
+<p class="whs4">trias.MergeEqualElements()</p>\r
\r
-<p class="whs5"> </p>\r
-\r
-<p class="whs5">print "Number \r
+<p class="whs4">print "Number \r
of elements after MergeEqualElements:"</p>\r
\r
-<p class="whs5">print "Edges \r
+<p class="whs4">print "Edges \r
: \r
- ", tri_mesh.NbEdges()</p>\r
+ ", trias.NbEdges()</p>\r
\r
-<p class="whs5">print "Triangles \r
+<p class="whs4">print "Triangles \r
: ", \r
- tri_mesh.NbTriangles()</p>\r
+ trias.NbTriangles()</p>\r
\r
-<p class="whs5">print "Quadrangles: \r
- ", tri_mesh.NbQuadrangles()</p>\r
+<p class="whs4">print "Quadrangles: \r
+ ", trias.NbQuadrangles()</p>\r
\r
-<p class="whs5">print "Volumes \r
+<p class="whs4">print "Volumes \r
: \r
- ", tri_mesh.NbVolumes()</p>\r
+ ", trias.NbVolumes()</p>\r
\r
-<p class="whs5"> </p>\r
+<p class="whs4"> </p>\r
\r
-<p class="whs5">salome.sg.updateObjBrowser(1) \r
+<p class="whs4">salome.sg.updateObjBrowser(1) \r
</p>\r
\r
-<p class="whs5"> </p>\r
+<p class="whs4"> </p>\r
\r
<h3>Sewing Meshes</h3>\r
\r
<h4><a name=bookmark4>Sew Meshes Border to Border</a></h4>\r
\r
-<p class="whs4"><span style="font-weight: bold; color: #ff0000;"><font color=red ><B># \r
- Attention! This script has been written using the old approach basing \r
- on direct usage of SMESH idl interface.</B></font></span></p>\r
-\r
-<p class="whs4"># For the moment smesh package doesn't provide \r
- methods to sew meshes border to border. </p>\r
+<p class="whs4">import geompy</p>\r
\r
-<p class="whs4"># In the next SALOME version the scripts will \r
- be updated to use only the commands from smesh package.</p>\r
+<p class="whs4">import smesh</p>\r
\r
-<p class="whs7"> </p>\r
-\r
-<p class="whs5">import geompy</p>\r
-\r
-<p class="whs5">import smesh</p>\r
-\r
-<p class="whs5"> </p>\r
+<p class="whs4"> </p>\r
\r
-<p class="whs6"># create two faces \r
+<p class="whs5"># create two faces \r
of a box</p>\r
\r
-<p class="whs5">box1 = geompy.MakeBox(0., \r
+<p class="whs4">box1 = geompy.MakeBox(0., \r
0., -10., 30., 20., 25.)</p>\r
\r
-<p class="whs5">facesList1 = geompy.SubShapeAll(box1, \r
+<p class="whs4">facesList1 = geompy.SubShapeAll(box1, \r
geompy.ShapeType["FACE"])</p>\r
\r
-<p class="whs5">face1 = facesList1[2]</p>\r
+<p class="whs4">face1 = facesList1[2]</p>\r
\r
-<p class="whs5"> </p>\r
+<p class="whs4"> </p>\r
\r
-<p class="whs5">box2 = geompy.MakeBox(0., \r
+<p class="whs4">box2 = geompy.MakeBox(0., \r
5., 0., 20., 20., 15.)</p>\r
\r
-<p class="whs5">facesList2 = geompy.SubShapeAll(box2, \r
+<p class="whs4">facesList2 = geompy.SubShapeAll(box2, \r
geompy.ShapeType["FACE"])</p>\r
\r
-<p class="whs5">face2 = facesList2[1]</p>\r
+<p class="whs4">face2 = facesList2[1]</p>\r
\r
-<p class="whs5"> </p>\r
+<p class="whs4"> </p>\r
\r
-<p class="whs5">edgesList = geompy.SubShapeAll(face2, \r
+<p class="whs4">edgesList = geompy.SubShapeAll(face2, \r
geompy.ShapeType["EDGE"])</p>\r
\r
-<p class="whs5">edge1 = edgesList[2]</p>\r
+<p class="whs4">edge1 = edgesList[2]</p>\r
\r
-<p class="whs5"> </p>\r
+<p class="whs4"> </p>\r
\r
-<p class="whs5">aComp = geompy.MakeCompound([face1, \r
+<p class="whs4">aComp = geompy.MakeCompound([face1, \r
face2])</p>\r
\r
-<p class="whs5">geompy.addToStudy(aComp, \r
+<p class="whs4">geompy.addToStudy(aComp, \r
"Two faces")</p>\r
\r
-<p class="whs5"> </p>\r
+<p class="whs4"> </p>\r
\r
-<p class="whs6"># create a mesh on \r
+<p class="whs5"># create a mesh on \r
two faces</p>\r
\r
-<p class="whs5">mesh = smesh.Mesh(aComp, \r
+<p class="whs4">mesh = smesh.Mesh(aComp, \r
"Two faces : quadrangle mesh")</p>\r
\r
-<p class="whs5"> </p>\r
+<p class="whs4"> </p>\r
\r
-<p class="whs5">algo1D = mesh.Segment()</p>\r
+<p class="whs4">algo1D = mesh.Segment()</p>\r
\r
-<p class="whs5">algo1D.NumberOfSegments(9)</p>\r
+<p class="whs4">algo1D.NumberOfSegments(9)</p>\r
\r
-<p class="whs5">algo2D = mesh.Quadrangle()</p>\r
+<p class="whs4">algo2D = mesh.Quadrangle()</p>\r
\r
-<p class="whs5"> </p>\r
+<p class="whs4"> </p>\r
\r
-<p class="whs5">algo_local = mesh.Segment(edge1)</p>\r
+<p class="whs4">algo_local = mesh.Segment(edge1)</p>\r
\r
-<p class="whs5">algo_local.Arithmetic1D(1, \r
+<p class="whs4">algo_local.Arithmetic1D(1, \r
4)</p>\r
\r
-<p class="whs5">algo_local.Propagation()</p>\r
+<p class="whs4">algo_local.Propagation()</p>\r
\r
-<p class="whs5"> </p>\r
+<p class="whs4"> </p>\r
\r
-<p class="whs5">mesh.Compute()</p>\r
+<p class="whs4">mesh.Compute()</p>\r
\r
-<p class="whs5"> </p>\r
+<p class="whs4"> </p>\r
\r
-<p class="whs5">anEditor = mesh.GetMesh().GetMeshEditor()</p>\r
+<p class="whs5"># sew border to side</p>\r
\r
-<p class="whs5"> </p>\r
-\r
-<p class="whs6"># sew border to side</p>\r
-\r
-<p class="whs6"># FirstNodeIDOnFreeBorder, \r
+<p class="whs5"># FirstNodeIDOnFreeBorder, \r
SecondNodeIDOnFreeBorder, LastNodeIDOnFreeBorder,</p>\r
\r
-<p class="whs6"># FirstNodeIDOnSide, \r
+<p class="whs5"># FirstNodeIDOnSide, \r
LastNodeIDOnSide,</p>\r
\r
-<p class="whs6"># CreatePolygons, CreatePolyedrs</p>\r
+<p class="whs5"># CreatePolygons, CreatePolyedrs</p>\r
\r
-<p class="whs5">anEditor.SewBorderToSide(5, \r
+<p class="whs4">mesh.SewBorderToSide(5, \r
45, 6, 113, 109, 0, 0) </p>\r
\r
<h4><a name=bookmark5>Sew Conform Free Borders</a></h4>\r
\r
-<p class="whs4"><span style="font-weight: bold; color: #ff0000;"><font color=red ><B># \r
- Attention! This script has been written using the old approach basing \r
- on direct usage of SMESH idl interface.</B></font></span></p>\r
-\r
-<p class="whs4"># For the moment smesh package doesn't provide \r
- methods to sew conform free borders. </p>\r
-\r
-<p class="whs4"># In the next SALOME version the scripts will \r
- be updated to use only the commands from smesh package.</p>\r
-\r
-<p class="whs5"> </p>\r
-\r
-<p class="whs5">import geompy</p>\r
+<p class="whs4">import geompy</p>\r
\r
-<p class="whs5">import smesh</p>\r
+<p class="whs4">import smesh</p>\r
\r
-<p class="whs5"> </p>\r
+<p class="whs4"> </p>\r
\r
-<p class="whs6"># create two faces \r
+<p class="whs5"># create two faces \r
of the box</p>\r
\r
-<p class="whs5">box1 = geompy.MakeBox(0., \r
+<p class="whs4">box1 = geompy.MakeBox(0., \r
0., -10., 20., 20., 15.)</p>\r
\r
-<p class="whs5">facesList1 = geompy.SubShapeAll(box1, \r
+<p class="whs4">facesList1 = geompy.SubShapeAll(box1, \r
geompy.ShapeType["FACE"])</p>\r
\r
-<p class="whs5">face1 = facesList1[2]</p>\r
+<p class="whs4">face1 = facesList1[2]</p>\r
\r
-<p class="whs5"> </p>\r
+<p class="whs4"> </p>\r
\r
-<p class="whs5">box2 = geompy.MakeBox(0., \r
+<p class="whs4">box2 = geompy.MakeBox(0., \r
5., 0., 20., 20., 15.)</p>\r
\r
-<p class="whs5">facesList2 = geompy.SubShapeAll(box2, \r
+<p class="whs4">facesList2 = geompy.SubShapeAll(box2, \r
geompy.ShapeType["FACE"])</p>\r
\r
-<p class="whs5">face2 = facesList2[1]</p>\r
+<p class="whs4">face2 = facesList2[1]</p>\r
\r
-<p class="whs5"> </p>\r
+<p class="whs4"> </p>\r
\r
-<p class="whs5">edgesList = geompy.SubShapeAll(face2, \r
+<p class="whs4">edgesList = geompy.SubShapeAll(face2, \r
geompy.ShapeType["EDGE"])</p>\r
\r
-<p class="whs5">edge1 = edgesList[2]</p>\r
+<p class="whs4">edge1 = edgesList[2]</p>\r
\r
-<p class="whs5"> </p>\r
+<p class="whs4"> </p>\r
\r
-<p class="whs5">aComp = geompy.MakeCompound([face1, \r
+<p class="whs4">aComp = geompy.MakeCompound([face1, \r
face2])</p>\r
\r
-<p class="whs5">geompy.addToStudy(aComp, \r
+<p class="whs4">geompy.addToStudy(aComp, \r
"Two faces")</p>\r
\r
-<p class="whs5"> </p>\r
+<p class="whs4"> </p>\r
\r
-<p class="whs6"># create a mesh on \r
+<p class="whs5"># create a mesh on \r
two faces</p>\r
\r
-<p class="whs5">mesh = smesh.Mesh(aComp, \r
+<p class="whs4">mesh = smesh.Mesh(aComp, \r
"Two faces : quadrangle mesh")</p>\r
\r
-<p class="whs5"> </p>\r
+<p class="whs4"> </p>\r
\r
-<p class="whs5">algo1D = mesh.Segment()</p>\r
+<p class="whs4">algo1D = mesh.Segment()</p>\r
\r
-<p class="whs5">algo1D.NumberOfSegments(9)</p>\r
+<p class="whs4">algo1D.NumberOfSegments(9)</p>\r
\r
-<p class="whs5">algo2D = mesh.Quadrangle()</p>\r
+<p class="whs4">algo2D = mesh.Quadrangle()</p>\r
\r
-<p class="whs5"> </p>\r
+<p class="whs4"> </p>\r
\r
-<p class="whs5">algo_local = mesh.Segment(edge1)</p>\r
+<p class="whs4">algo_local = mesh.Segment(edge1)</p>\r
\r
-<p class="whs5">algo_local.Arithmetic1D(1, \r
+<p class="whs4">algo_local.Arithmetic1D(1, \r
4)</p>\r
\r
-<p class="whs5">algo_local.Propagation()</p>\r
+<p class="whs4">algo_local.Propagation()</p>\r
\r
-<p class="whs5"> </p>\r
+<p class="whs4"> </p>\r
\r
-<p class="whs5">mesh.Compute()</p>\r
+<p class="whs4">mesh.Compute()</p>\r
\r
-<p class="whs5"> </p>\r
-\r
-<p class="whs5">anEditor = mesh.GetMesh().GetMeshEditor()</p>\r
-\r
-<p class="whs5"> </p>\r
+<p class="whs4"> </p>\r
\r
-<p class="whs6"># sew conform free \r
+<p class="whs5"># sew conform free \r
borders</p>\r
\r
-<p class="whs6"># FirstNodeID1, SecondNodeID1, \r
+<p class="whs5"># FirstNodeID1, SecondNodeID1, \r
LastNodeID1, FirstNodeID2, SecondNodeID2</p>\r
\r
-<p class="whs5">anEditor.SewConformFreeBorders(5, \r
- 45, 6, 3, 24) </p>\r
+<p class="whs4">mesh.SewConformFreeBorders(5, \r
+ 45, 6, 3, 24) </p>\r
\r
<h4><a name=bookmark6>Sew Free Borders</a></h4>\r
\r
-<p class="whs4"><span style="font-weight: bold; color: #ff0000;"><font color=red ><B># \r
- Attention! This script has been written using the old approach basing \r
- on direct usage of SMESH idl interface.</B></font></span></p>\r
-\r
-<p class="whs4"># For the moment smesh package doesn't provide \r
- methods to sew free borders. </p>\r
-\r
-<p class="whs4"># In the next SALOME version the scripts will \r
- be updated to use only the commands from smesh package.</p>\r
-\r
-<p class="whs7"> </p>\r
-\r
-<p class="whs5">import geompy</p>\r
+<p class="whs4">import geompy</p>\r
\r
-<p class="whs5">import smesh</p>\r
+<p class="whs4">import smesh</p>\r
\r
-<p class="whs5"> </p>\r
+<p class="whs4"> </p>\r
\r
-<p class="whs6"># create two faces \r
+<p class="whs5"># create two faces \r
of the box</p>\r
\r
-<p class="whs5">box1 = geompy.MakeBox(0., \r
+<p class="whs4">box1 = geompy.MakeBox(0., \r
0., 0., 20., 20., 15.)</p>\r
\r
-<p class="whs5">facesList1 = geompy.SubShapeAll(box1, \r
+<p class="whs4">facesList1 = geompy.SubShapeAll(box1, \r
geompy.ShapeType["FACE"])</p>\r
\r
-<p class="whs5">face1 = facesList1[2]</p>\r
+<p class="whs4">face1 = facesList1[2]</p>\r
\r
-<p class="whs5"> </p>\r
+<p class="whs4"> </p>\r
\r
-<p class="whs5">box2 = geompy.MakeBox(0., \r
+<p class="whs4">box2 = geompy.MakeBox(0., \r
5., 0., 20., 20., 15.)</p>\r
\r
-<p class="whs5">facesList2 = geompy.SubShapeAll(box2, \r
+<p class="whs4">facesList2 = geompy.SubShapeAll(box2, \r
geompy.ShapeType["FACE"])</p>\r
\r
-<p class="whs5">face2 = facesList2[1]</p>\r
+<p class="whs4">face2 = facesList2[1]</p>\r
\r
-<p class="whs5"> </p>\r
+<p class="whs4"> </p>\r
\r
-<p class="whs5">edgesList = geompy.SubShapeAll(face2, \r
+<p class="whs4">edgesList = geompy.SubShapeAll(face2, \r
geompy.ShapeType["EDGE"])</p>\r
\r
-<p class="whs5">edge1 = edgesList[2]</p>\r
+<p class="whs4">edge1 = edgesList[2]</p>\r
\r
-<p class="whs5"> </p>\r
+<p class="whs4"> </p>\r
\r
-<p class="whs5">aComp = geompy.MakeCompound([face1, \r
+<p class="whs4">aComp = geompy.MakeCompound([face1, \r
face2])</p>\r
\r
-<p class="whs5">geompy.addToStudy(aComp, \r
+<p class="whs4">geompy.addToStudy(aComp, \r
"Two faces")</p>\r
\r
-<p class="whs5"> </p>\r
+<p class="whs4"> </p>\r
\r
-<p class="whs6"># create a mesh on \r
+<p class="whs5"># create a mesh on \r
two faces</p>\r
\r
-<p class="whs5">mesh = smesh.Mesh(aComp, \r
+<p class="whs4">mesh = smesh.Mesh(aComp, \r
"Two faces : quadrangle mesh")</p>\r
\r
-<p class="whs5"> </p>\r
+<p class="whs4"> </p>\r
\r
-<p class="whs5">algo1D = mesh.Segment()</p>\r
+<p class="whs4">algo1D = mesh.Segment()</p>\r
\r
-<p class="whs5">algo1D.NumberOfSegments(4)</p>\r
+<p class="whs4">algo1D.NumberOfSegments(4)</p>\r
\r
-<p class="whs5">algo2D = mesh.Quadrangle()</p>\r
+<p class="whs4">algo2D = mesh.Quadrangle()</p>\r
\r
-<p class="whs5"> </p>\r
+<p class="whs4"> </p>\r
\r
-<p class="whs5">algo_local = mesh.Segment(edge1)</p>\r
+<p class="whs4">algo_local = mesh.Segment(edge1)</p>\r
\r
-<p class="whs5">algo_local.Arithmetic1D(1, \r
+<p class="whs4">algo_local.Arithmetic1D(1, \r
4)</p>\r
\r
-<p class="whs5">algo_local.Propagation()</p>\r
+<p class="whs4">algo_local.Propagation()</p>\r
\r
-<p class="whs5"> </p>\r
+<p class="whs4"> </p>\r
\r
-<p class="whs5">mesh.Compute()</p>\r
+<p class="whs4">mesh.Compute()</p>\r
\r
-<p class="whs5"> </p>\r
+<p class="whs4"> </p>\r
\r
-<p class="whs6"># sew free borders</p>\r
+<p class="whs5"># sew free borders</p>\r
\r
-<p class="whs6"># FirstNodeID1, SecondNodeID1, \r
+<p class="whs5"># FirstNodeID1, SecondNodeID1, \r
LastNodeID1,</p>\r
\r
-<p class="whs6"># FirstNodeID2, SecondNodeID2, \r
+<p class="whs5"># FirstNodeID2, SecondNodeID2, \r
LastNodeID2, CreatePolygons, CreatePolyedrs</p>\r
\r
-<p class="whs5">anEditor = mesh.GetMesh().GetMeshEditor()</p>\r
-\r
-<p class="whs7"><span style="font-family: 'Lucida Console', monospace;">anEditor.SewFreeBorders(6, \r
- 21, 5, 1, 12, 3, 0, 0)</span> </p>\r
+<p class="whs6">mesh.SewFreeBorders(6, \r
+ 21, 5, 1, 12, 3, 0, 0) </p>\r
\r
<h4><a name=bookmark7>Sew Side Elements</a></h4>\r
\r
-<p class="whs4"><span style="font-weight: bold; color: #ff0000;"><font color=red ><B># \r
- Attention! This script has been written using the old approach basing \r
- on direct usage of SMESH idl interface.</B></font></span></p>\r
-\r
-<p class="whs4"># For the moment smesh package doesn't provide \r
- methods to sew side elements. </p>\r
-\r
-<p class="whs4"># In the next SALOME version the scripts will \r
- be updated to use only the commands from smesh package.</p>\r
+<p class="whs4">import geompy</p>\r
\r
-<p class="whs5">import geompy</p>\r
+<p class="whs4">import smesh</p>\r
\r
-<p class="whs5">import smesh</p>\r
+<p class="whs4"> </p>\r
\r
-<p class="whs5"> </p>\r
-\r
-<p class="whs6"># create two boxes</p>\r
+<p class="whs5"># create two boxes</p>\r
\r
-<p class="whs5">box1 = geompy.MakeBox(0., \r
+<p class="whs4">box1 = geompy.MakeBox(0., \r
0., 0., \r
10., 10., 10.)</p>\r
\r
-<p class="whs5">box2 = geompy.MakeBox(0., \r
+<p class="whs4">box2 = geompy.MakeBox(0., \r
15., 0., 20., 25., 10.)</p>\r
\r
-<p class="whs5"> </p>\r
+<p class="whs4"> </p>\r
\r
-<p class="whs5">EdgesList = geompy.SubShapeAll(box2, \r
+<p class="whs4">EdgesList = geompy.SubShapeAll(box2, \r
geompy.ShapeType["EDGE"])</p>\r
\r
-<p class="whs5"> </p>\r
+<p class="whs4"> </p>\r
\r
-<p class="whs5">aComp = geompy.MakeCompound([box1, \r
+<p class="whs4">aComp = geompy.MakeCompound([box1, \r
box2])</p>\r
\r
-<p class="whs5">geompy.addToStudy(aComp, \r
+<p class="whs4">geompy.addToStudy(aComp, \r
"Two boxes")</p>\r
\r
-<p class="whs5"> </p>\r
+<p class="whs4"> </p>\r
\r
-<p class="whs6"># create a mesh on \r
+<p class="whs5"># create a mesh on \r
two boxes</p>\r
\r
-<p class="whs5">mesh = smesh.Mesh(aComp, \r
+<p class="whs4">mesh = smesh.Mesh(aComp, \r
"Two faces : quadrangle mesh")</p>\r
\r
-<p class="whs5"> </p>\r
-\r
-<p class="whs5">algo1D = mesh.Segment()</p>\r
-\r
-<p class="whs5">algo1D.NumberOfSegments(2)</p>\r
+<p class="whs4"> </p>\r
\r
-<p class="whs5">algo2D = mesh.Quadrangle()</p>\r
+<p class="whs4">algo1D = mesh.Segment()</p>\r
\r
-<p class="whs5"> </p>\r
+<p class="whs4">algo1D.NumberOfSegments(2)</p>\r
\r
-<p class="whs5">algo_local = mesh.Segment(EdgesList[8])</p>\r
+<p class="whs4">algo2D = mesh.Quadrangle()</p>\r
\r
-<p class="whs5">algo_local.NumberOfSegments(4)</p>\r
+<p class="whs4"> </p>\r
\r
-<p class="whs5">algo_local.Propagation()</p>\r
+<p class="whs4">algo_local = mesh.Segment(EdgesList[8])</p>\r
\r
-<p class="whs5"> </p>\r
+<p class="whs4">algo_local.NumberOfSegments(4)</p>\r
\r
-<p class="whs5">mesh.Compute()</p>\r
+<p class="whs4">algo_local.Propagation()</p>\r
\r
-<p class="whs5"> </p>\r
+<p class="whs4"> </p>\r
\r
-<p class="whs5">anEditor = mesh.GetMesh().GetMeshEditor()</p>\r
+<p class="whs4">mesh.Compute()</p>\r
\r
-<p class="whs5"> </p>\r
+<p class="whs4"> </p>\r
\r
-<p class="whs6"># sew side elements</p>\r
+<p class="whs5"># sew side elements</p>\r
\r
-<p class="whs6"># IDsOfSide1Elements, \r
+<p class="whs5"># IDsOfSide1Elements, \r
IDsOfSide2Elements,</p>\r
\r
-<p class="whs6"># NodeID1OfSide1ToMerge, \r
+<p class="whs5"># NodeID1OfSide1ToMerge, \r
NodeID1OfSide2ToMerge, NodeID2OfSide1ToMerge, NodeID2OfSide2ToMerge</p>\r
\r
-<p class="whs5">anEditor.SewSideElements([69, \r
- 70, 71, 72], [91, 92, 89, 90], 8, 38, 23, 58)</p>\r
+<p class="whs4">mesh.SewSideElements([69, \r
+ 70, 71, 72], [91, 92, 89, 90], 8, 38, 23, 58) </p>\r
\r
<script type="text/javascript" language="javascript1.2">\r
<!--\r
\r
<p class="whs1"> </p>\r
\r
-<p class="whs2"># print informations \r
+<p class="whs2"># print information \r
about the mesh</p>\r
\r
-<p class="whs1">mesh = tetra.GetMesh()</p>\r
-\r
-<p class="whs1">print "Information about mesh:"</p>\r
+<p class="whs1">print "Information about mesh:" \r
+ </p>\r
\r
<p class="whs1">print "Number of nodes : \r
- ", mesh.NbNodes()</p>\r
+ ", tetra.NbNodes()</p>\r
\r
<p class="whs1">print "Number of edges : \r
- ", mesh.NbEdges()</p>\r
+ ", tetra.NbEdges()</p>\r
\r
<p class="whs1">print "Number of faces : \r
- ", mesh.NbFaces()</p>\r
+ ", tetra.NbFaces()</p>\r
\r
<p class="whs1">print " triangles \r
: \r
- ", mesh.NbTriangles()</p>\r
+ ", tetra.NbTriangles()</p>\r
\r
<p class="whs1">print " quadrangles \r
- : ", mesh.NbQuadrangles()</p>\r
+ : ", tetra.NbQuadrangles()</p>\r
\r
<p class="whs1">print " polygons \r
: \r
- ", mesh.NbPolygons()</p>\r
+ ", tetra.NbPolygons()</p>\r
\r
<p class="whs1">print "Number of volumes : \r
- ", mesh.NbVolumes()</p>\r
+ ", tetra.NbVolumes()</p>\r
\r
<p class="whs1">print " tetrahedrons: \r
- ", mesh.NbTetras()</p>\r
+ ", tetra.NbTetras()</p>\r
\r
<p class="whs1">print " hexahedrons \r
- : ", mesh.NbHexas()</p>\r
+ : ", tetra.NbHexas()</p>\r
\r
<p class="whs1">print " prisms \r
: \r
- ", mesh.NbPrisms()</p>\r
+ ", tetra.NbPrisms()</p>\r
\r
<p class="whs1">print " pyramids \r
: \r
- ", mesh.NbPyramids()</p>\r
+ ", tetra.NbPyramids()</p>\r
\r
<p class="whs1">print " polyhedrons \r
- : ", mesh.NbPolyhedrons() </p>\r
+ : ", tetra.NbPolyhedrons() </p>\r
\r
<script type="text/javascript" language="javascript1.2">\r
<!--\r