smesh/doc/salome/gui/SMESH/quality_controls.htm
2007-02-07 12:14:23 +00:00

1271 lines
28 KiB
HTML
Executable File

<!doctype HTML public "-//W3C//DTD HTML 4.0 Frameset//EN">
<html>
<head>
<title>Quality Controls</title>
<meta http-equiv="content-type" content="text/html; charset=windows-1252">
<meta name="generator" content="RoboHelp by eHelp Corporation www.ehelp.com"><style type="text/css">
<!--
p.whs1 { margin-top:0pt; margin-bottom:0pt; font-family:'Lucida Console' , monospace; }
p.whs2 { margin-top:0pt; margin-bottom:0pt; }
p.whs3 { margin-top:0pt; margin-bottom:0pt; font-family:'Times New Roman' , serif; }
-->
</style><script type="text/javascript" language="JavaScript">
<!--
if ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) == 4))
{
var strNSS = "<style type='text/css'>";
strNSS += "p.whs1 {margin-top:1pt;margin-bottom:1pt; }";
strNSS += "p.whs2 {margin-top:1pt;margin-bottom:1pt; }";
strNSS += "p.whs3 {margin-top:1pt;margin-bottom:1pt; }";
strNSS +="</style>";
document.write(strNSS);
}
//-->
</script>
<script type="text/javascript" language="JavaScript" title="WebHelpInlineScript">
<!--
function reDo() {
if (innerWidth != origWidth || innerHeight != origHeight)
location.reload();
}
if ((parseInt(navigator.appVersion) == 4) && (navigator.appName == "Netscape")) {
origWidth = innerWidth;
origHeight = innerHeight;
onresize = reDo;
}
onerror = null;
//-->
</script>
<style type="text/css">
<!--
div.WebHelpPopupMenu { position:absolute; left:0px; top:0px; z-index:4; visibility:hidden; }
p.WebHelpNavBar { text-align:right; }
-->
</style><script type="text/javascript" language="javascript1.2" src="whmsg.js"></script>
<script type="text/javascript" language="javascript" src="whver.js"></script>
<script type="text/javascript" language="javascript1.2" src="whproxy.js"></script>
<script type="text/javascript" language="javascript1.2" src="whutils.js"></script>
<script type="text/javascript" language="javascript1.2" src="whtopic.js"></script>
<script type="text/javascript" language="javascript1.2">
<!--
if (window.gbWhTopic)
{
if (window.setRelStartPage)
{
addTocInfo("MESH module\nTUI Scripts\nQuality Controls");
addButton("show",BTN_IMG,"Show","","","","",0,0,"whd_show0.gif","whd_show2.gif","whd_show1.gif");
addButton("hide",BTN_IMG,"Hide","","","","",0,0,"whd_hide0.gif","whd_hide2.gif","whd_hide1.gif");
}
if (window.setRelStartPage)
{
setRelStartPage("index.htm");
autoSync(1);
sendSyncInfo();
sendAveInfoOut();
}
}
else
if (window.gbIE4)
document.location.reload();
//-->
</script>
</head>
<body><script type="text/javascript" language="javascript1.2">
<!--
if (window.writeIntopicBar)
writeIntopicBar(4);
//-->
</script>
<h1>Quality Controls</h1>
<h3><a name=bookmark>Free Borders</a></h3>
<p class="whs1">import salome</p>
<p class="whs1">import geompy</p>
<p class="whs1">&nbsp;</p>
<p class="whs1">import smesh</p>
<p class="whs2">&nbsp;</p>
<p class="whs2"># create open shell: a
box without one plane</p>
<p class="whs1"><span style="font-family: 'Lucida Console', monospace;">box
= geompy.MakeBox(0., 0., 0., 20., 20., 15.)</span></p>
<p class="whs1">FaceList = geompy.SubShapeAll(box,
geompy.ShapeType[&quot;FACE&quot;])</p>
<p class="whs1">FaceList.remove(FaceList[5])</p>
<p class="whs1">box = geompy.MakeShell(FaceList)</p>
<p class="whs1">idbox = geompy.addToStudy(box,
&quot;box&quot;)</p>
<p class="whs1">&nbsp;</p>
<p class="whs2"># create a mesh</p>
<p class="whs1"><span style="font-family: 'Lucida Console', monospace;">mesh
= smesh.Mesh(box, &quot;Mesh_free_borders&quot;)</span></p>
<p class="whs1">algo = mesh.Segment()</p>
<p class="whs1">algo.NumberOfSegments(5)</p>
<p class="whs1">algo = mesh.Triangle()</p>
<p class="whs1">algo.MaxElementArea(20.)</p>
<p class="whs1">mesh.Compute() </p>
<p class="whs1">&nbsp;</p>
<p class="whs2"># criterion : free borders</p>
<p class="whs1"><span style="font-family: 'Lucida Console', monospace;">aFilter
= smesh.GetFilter(smesh.EDGE, smesh.FT_FreeBorders)</span><span style="margin-top: 0pt;
margin-bottom: 0pt;
font-family: 'Lucida Console', monospace;"> </span></p>
<p class="whs1">anIds = mesh.GetIdsFromFilter(aFilter)</p>
<p class="whs1">&nbsp;</p>
<p class="whs2">&nbsp;</p>
<p class="whs2"># print the result</p>
<p class="whs1">print &quot;Criterion:
Free borders Nb = &quot;, len(anIds)</p>
<p class="whs1">j = 1</p>
<p class="whs1">for i in range(len(anIds)):</p>
<p class="whs1">&nbsp;&nbsp;if
j &gt; 20: j = 1; print &quot;&quot;</p>
<p class="whs1">&nbsp;&nbsp;print
anIds[i],</p>
<p class="whs1">&nbsp;&nbsp;j
= j + 1</p>
<p class="whs1">&nbsp;&nbsp;pass</p>
<p class="whs1">print &quot;&quot;</p>
<p class="whs2">&nbsp;</p>
<p class="whs2"># create a group</p>
<p class="whs1">aGroup = mesh.CreateGroup(SMESH.EDGE,
&quot;Free borders&quot;)</p>
<p class="whs1">aGroup.Add(anIds)</p>
<p class="whs1">&nbsp;</p>
<p class="whs2"><span style="font-family: 'Lucida Console', monospace;">salome.sg.updateObjBrowser(1)</span>
</p>
<h3><a name=bookmark1>Borders at Multiconnection</a></h3>
<p class="whs1">import salome</p>
<p class="whs1">import geompy</p>
<p class="whs1">&nbsp;</p>
<p class="whs1">import smesh</p>
<p class="whs1">import SMESH</p>
<p class="whs1">&nbsp;</p>
<p class="whs3"># create open shell:
a box without one plane</p>
<p class="whs1">box = geompy.MakeBox(0.,
0., 0., 20., 20., 15.)</p>
<p class="whs1">FaceList = geompy.SubShapeAll(box,
geompy.ShapeType[&quot;FACE&quot;])</p>
<p class="whs1">FaceList.remove(FaceList[5])</p>
<p class="whs1">box = geompy.MakeShell(FaceList)</p>
<p class="whs1">idbox = geompy.addToStudy(box,
&quot;box&quot;)</p>
<p class="whs1">&nbsp;</p>
<p class="whs3"># create a mesh</p>
<p class="whs1"><span style="font-family: 'Lucida Console', monospace;">mesh
= smesh.Mesh(box, &quot;Mesh_borders_at_multi-connections&quot;)</span></p>
<p class="whs1">algo = mesh.Segment()</p>
<p class="whs1">algo.NumberOfSegments(5)</p>
<p class="whs1">algo = mesh.Triangle()</p>
<p class="whs1">algo.MaxElementArea(20.)</p>
<p class="whs1">mesh.Compute() </p>
<p class="whs1">&nbsp;</p>
<p class="whs3"># Criterion : Borders
at multi-connection</p>
<p class="whs1">nb_conn = 2</p>
<p class="whs1">&nbsp;</p>
<p class="whs1"><span style="font-family: 'Lucida Console', monospace;">aFilter
= smesh.GetFilter(smesh.EDGE, smesh.FT_MultiConnection, smesh.FT_EqualTo,
nb_conn)</span></p>
<p class="whs1">anIds = mesh.GetIdsFromFilter(aFilter)</p>
<p class="whs1">&nbsp;</p>
<p class="whs1">&nbsp;</p>
<p class="whs3"># print the result</p>
<p class="whs1">print &quot;Criterion:
Borders at multi-connections Nb = &quot;, len(anIds)</p>
<p class="whs1">j = 1</p>
<p class="whs1">for i in range(len(anIds)):</p>
<p class="whs1">&nbsp;&nbsp;if
j &gt; 20: j = 1; print &quot;&quot;</p>
<p class="whs1">&nbsp;&nbsp;print
anIds[i],</p>
<p class="whs1">&nbsp;&nbsp;j
= j + 1</p>
<p class="whs1">&nbsp;&nbsp;pass</p>
<p class="whs1">print &quot;&quot;</p>
<p class="whs1">&nbsp;</p>
<p class="whs3"># create a group</p>
<p class="whs1">aGroup = mesh.CreateGroup(SMESH.EDGE,
&quot;Borders at multi-connections&quot;)</p>
<p class="whs1">aGroup.Add(anIds)</p>
<p class="whs1">salome.sg.updateObjBrowser(1)
</p>
<h3><a name=bookmark2>Length 1D</a></h3>
<p class="whs1">import salome</p>
<p class="whs1">import geompy</p>
<p class="whs1">&nbsp;</p>
<p class="whs1">import smesh</p>
<p class="whs2">&nbsp;</p>
<p class="whs2"># create open shell: a
box without one plane</p>
<p class="whs1">box = geompy.MakeBox(0.,
0., 0., 20., 20., 15.)</p>
<p class="whs1">FaceList = geompy.SubShapeAll(box,
geompy.ShapeType[&quot;FACE&quot;])</p>
<p class="whs1">FaceList.remove(FaceList[5])</p>
<p class="whs1">box = geompy.MakeShell(FaceList)</p>
<p class="whs1">idbox = geompy.addToStudy(box,
&quot;box&quot;)</p>
<p class="whs2">&nbsp;</p>
<p class="whs2"># create a mesh</p>
<p class="whs1"><span style="font-family: 'Lucida Console', monospace;">mesh
= smesh.Mesh(box, &quot;Mesh_Length_1D&quot;)</span></p>
<p class="whs1">algo = mesh.Segment()</p>
<p class="whs1">algo.NumberOfSegments(5)</p>
<p class="whs1">algo = mesh.Triangle()</p>
<p class="whs1">algo.MaxElementArea(20.)</p>
<p class="whs1">mesh.Compute() </p>
<p class="whs2">&nbsp;</p>
<p class="whs2"># Criterion : Length &gt;
3.</p>
<p class="whs1">length_margin =
3.</p>
<p class="whs1">&nbsp;</p>
<p class="whs1"><span style="font-family: 'Lucida Console', monospace;">aFilter
= smesh.GetFilter(smesh.EDGE, smesh.FT_Length, smesh.FT_MoreThan, length_margin)</span></p>
<p class="whs1">anIds = mesh.GetIdsFromFilter(aFilter)
</p>
<p class="whs2">&nbsp;</p>
<p class="whs2"># print the result</p>
<p class="whs1">print &quot;Criterion:
Edges length &gt; &quot;, length_margin, &quot; Nb = &quot;, len(anIds)</p>
<p class="whs1">j = 1</p>
<p class="whs1">for i in range(len(anIds)):</p>
<p class="whs1">&nbsp;&nbsp;if
j &gt; 20: j = 1; print &quot;&quot;</p>
<p class="whs1">&nbsp;&nbsp;print
anIds[i],</p>
<p class="whs1">&nbsp;&nbsp;j
= j + 1</p>
<p class="whs1">&nbsp;&nbsp;pass</p>
<p class="whs1">print &quot;&quot;</p>
<p class="whs2">&nbsp;</p>
<p class="whs2"># create a group</p>
<p class="whs1">aGroup = mesh.CreateGroup(SMESH.EDGE,
&quot;Edges with length &gt; &quot; + `length_margin`)</p>
<p class="whs1">aGroup.Add(anIds)</p>
<p class="whs1">&nbsp;</p>
<p class="whs2"><span style="font-family: 'Lucida Console', monospace;">salome.sg.updateObjBrowser(1)</span>
</p>
<h3><a name=bookmark3>Free Edges</a></h3>
<p class="whs1">import SMESH_mechanic</p>
<p class="whs1">&nbsp;</p>
<p class="whs1">smesh &nbsp;=
SMESH_mechanic.smesh</p>
<p class="whs1">mesh &nbsp;&nbsp;=
SMESH_mechanic.mesh</p>
<p class="whs1">salome = SMESH_mechanic.salome</p>
<p class="whs1">&nbsp;</p>
<p class="whs1">aFilterMgr = smesh.CreateFilterManager()</p>
<p class="whs1">&nbsp;</p>
<p class="whs3"># Remove some elements
to obtain free edges</p>
<p class="whs3"># Criterion : AREA
&gt; 95.</p>
<p class="whs1">area_margin = 95.</p>
<p class="whs1">&nbsp;</p>
<p class="whs1"><span style="font-family: 'Lucida Console', monospace;">aFilter
= smesh.GetFilter(smesh.FACE, smesh.FT_Area, smesh.FT_MoreThan, area_margin)</span></p>
<p class="whs1">&nbsp;</p>
<p class="whs1">anIds = mesh.GetIdsFromFilter(aFilter)</p>
<p class="whs1">&nbsp;</p>
<p class="whs1">mesh.RemoveElements(anIds)</p>
<p class="whs1">&nbsp;</p>
<p class="whs3"># Criterion : Free
Edges</p>
<p class="whs1">aBorders = mesh.GetFreeBorders()
</p>
<p class="whs1">&nbsp;</p>
<p class="whs3"># create groups</p>
<p class="whs1">aGroupF = mesh.CreateGroup(SMESH.FACE,
&quot;Faces with free edges&quot;)</p>
<p class="whs1">aGroupN = mesh.CreateGroup(SMESH.NODE,
&quot;Nodes on free edges&quot;)</p>
<p class="whs1">&nbsp;</p>
<p class="whs3"># fill groups with
elements, corresponding to the criterion</p>
<p class="whs1">print &quot;&quot;</p>
<p class="whs1">print &quot;Criterion:
Free edges Nb = &quot;, len(aBorders)</p>
<p class="whs1">for i in range(len(aBorders)):</p>
<p class="whs1">&nbsp;&nbsp;aBorder
= aBorders[i]</p>
<p class="whs1">&nbsp;&nbsp;print
&quot;Face # &quot;, aBorder.myElemId, &quot; : Edge between nodes (&quot;,</p>
<p class="whs1">&nbsp;&nbsp;print
aBorder.myPnt1, &quot;, &quot;, aBorder.myPnt2, &quot;)&quot;</p>
<p class="whs1">&nbsp;</p>
<p class="whs1">&nbsp;&nbsp;<span
style="margin-top: 0pt;
margin-bottom: 0pt;
font-family: 'Lucida Console', monospace;">aGroupF.Add([aBorder.myElemId])</span></p>
<p class="whs1">&nbsp;&nbsp;aGroupN.Add([aBorder.myPnt1,
aBorder.myPnt2])</p>
<p class="whs1">&nbsp;</p>
<p class="whs1">salome.sg.updateObjBrowser(1)
</p>
<p class="whs1">&nbsp;</p>
<h3><a name=bookmark4>Length 2D</a></h3>
<p class="whs1">import salome</p>
<p class="whs1">import geompy</p>
<p class="whs1">&nbsp;</p>
<p class="whs1">import smesh</p>
<p class="whs1">&nbsp;</p>
<p class="whs3"># create open shell:
a box without one plane</p>
<p class="whs1">box = geompy.MakeBox(0.,
0., 0., 20., 20., 15.)</p>
<p class="whs1">FaceList = geompy.SubShapeAll(box,
geompy.ShapeType[&quot;FACE&quot;])</p>
<p class="whs1">FaceList.remove(FaceList[5])</p>
<p class="whs1">box = geompy.MakeShell(FaceList)</p>
<p class="whs1">idbox = geompy.addToStudy(box,
&quot;box&quot;)</p>
<p class="whs1">&nbsp;</p>
<p class="whs3"># create a mesh</p>
<p class="whs1"><span style="font-family: 'Lucida Console', monospace;">mesh
= smesh.Mesh(box, &quot;Mesh_Length_2D&quot;)</span></p>
<p class="whs1">algo = mesh.Segment()</p>
<p class="whs1">algo.NumberOfSegments(5)</p>
<p class="whs1">algo = mesh.Triangle()</p>
<p class="whs1">algo.MaxElementArea(20.)</p>
<p class="whs1">mesh.Compute()</p>
<p class="whs1">&nbsp;</p>
<p class="whs3"># Criterion : Length
2D &gt; 5.7</p>
<p class="whs1">length_margin =
5.7</p>
<p class="whs1">&nbsp;</p>
<p class="whs1"><span style="font-family: 'Lucida Console', monospace;">aFilter
= smesh.GetFilter(smesh.FACE, smesh.FT_Length2D, smesh.FT_MoreThan, length_margin)</span></p>
<p class="whs1">&nbsp;</p>
<p class="whs1">anIds = mesh.GetIdsFromFilter(aFilter)</p>
<p class="whs1">&nbsp;</p>
<p class="whs3"># print the result</p>
<p class="whs1">print &quot;Criterion:
Edges length 2D &gt; &quot;, length_margin, &quot; Nb = &quot;, len(anIds)</p>
<p class="whs1">j = 1</p>
<p class="whs1">for i in range(len(anIds)):</p>
<p class="whs1">&nbsp;&nbsp;if
j &gt; 20: j = 1; print &quot;&quot;</p>
<p class="whs1">&nbsp;&nbsp;print
anIds[i],</p>
<p class="whs1">&nbsp;&nbsp;j
= j + 1</p>
<p class="whs1">&nbsp;&nbsp;pass</p>
<p class="whs1">print &quot;&quot;</p>
<p class="whs1">&nbsp;</p>
<p class="whs3"># create a group</p>
<p class="whs1"><span style="font-family: 'Lucida Console', monospace;">aGroup
= mesh.CreateEmptyGroup(smesh.FACE, &quot;Faces with length 2D &gt; &quot;
+ `length_margin`)</span></p>
<p class="whs1">aGroup.Add(anIds)</p>
<p class="whs1">&nbsp;</p>
<p class="whs1">salome.sg.updateObjBrowser(1)
</p>
<p class="whs2">&nbsp;</p>
<h3><a name=bookmark5>Borders at Multiconnection 2D</a></h3>
<p class="whs1">import salome</p>
<p class="whs1">import geompy</p>
<p class="whs1">&nbsp;</p>
<p class="whs1">import smesh</p>
<p class="whs3">&nbsp;</p>
<p class="whs3"># create a compound
of two glued boxes</p>
<p class="whs1">box1 = geompy.MakeBox(0.,
0., 0., 20., 20., 15.)</p>
<p class="whs1">box2 = geompy.MakeTranslation(box1,
0., 20., 0)</p>
<p class="whs1">comp = geompy.MakeCompound([box1,
box2])</p>
<p class="whs1">box = geompy.MakeGlueFaces(comp,
0.000001)</p>
<p class="whs1">idbox = geompy.addToStudy(box,
&quot;box&quot;)</p>
<p class="whs1">&nbsp;</p>
<p class="whs3"># create a mesh</p>
<p class="whs1"><span style="font-family: 'Lucida Console', monospace;">mesh
= smesh.Mesh(box, &quot;Box compound : 2D triangle mesh&quot;)</span></p>
<p class="whs1">algo = mesh.Segment()</p>
<p class="whs1">algo.NumberOfSegments(5)</p>
<p class="whs1">algo = mesh.Triangle()</p>
<p class="whs1">algo.MaxElementArea(20.)</p>
<p class="whs1">mesh.Compute() </p>
<p class="whs1">&nbsp;</p>
<p class="whs3"># Criterion : MULTI-CONNECTION
2D = 3</p>
<p class="whs1">nb_conn = 3</p>
<p class="whs1">&nbsp;</p>
<p class="whs1"><span style="font-family: 'Lucida Console', monospace;">aFilter
= smesh.GetFilter(smesh.FACE, smesh.FT_MultiConnection2D, smesh.FT_EqualTo,
nb_conn)</span></p>
<p class="whs1">&nbsp;</p>
<p class="whs1">anIds = mesh.GetIdsFromFilter(aFilter)
</p>
<p class="whs1">&nbsp;</p>
<p class="whs3"># print the result</p>
<p class="whs1">print &quot;Criterion:
Borders at multi-connection 2D = &quot;, nb_conn, &quot; Nb = &quot;,
len(anIds)</p>
<p class="whs1">j = 1</p>
<p class="whs1">for i in range(len(anIds)):</p>
<p class="whs1">&nbsp;&nbsp;if
j &gt; 20: j = 1; print &quot;&quot;</p>
<p class="whs1">&nbsp;&nbsp;print
anIds[i],</p>
<p class="whs1">&nbsp;&nbsp;j
= j + 1</p>
<p class="whs1">&nbsp;&nbsp;pass</p>
<p class="whs1">print &quot;&quot;</p>
<p class="whs1">&nbsp;</p>
<p class="whs3"># create a group</p>
<p class="whs1"><span style="font-family: 'Lucida Console', monospace;">aGroup
= mesh.CreateEmptyGroup(smesh.FACE, &quot;Borders at multi-connection
2D = &quot; + `nb_conn`)</span></p>
<p class="whs1">aGroup.Add(anIds)</p>
<p class="whs1">&nbsp;</p>
<p class="whs1">salome.sg.updateObjBrowser(1)
</p>
<p class="whs1">&nbsp;</p>
<h3><a name=bookmark6>Area</a></h3>
<p class="whs1">import SMESH_mechanic</p>
<p class="whs1">&nbsp;</p>
<p class="whs1">smesh &nbsp;=
SMESH_mechanic.smesh</p>
<p class="whs1">mesh &nbsp;&nbsp;=
SMESH_mechanic.mesh</p>
<p class="whs1">salome = SMESH_mechanic.salome</p>
<p class="whs2">&nbsp;</p>
<p class="whs2"># Criterion : AREA &gt;
100.</p>
<p class="whs1">area_margin = 100.</p>
<p class="whs1">&nbsp;</p>
<p class="whs1">aFilter = smesh.GetFilter(smesh.FACE,
smesh.FT_Area, smesh.FT_MoreThan, area_margin)</p>
<p class="whs1">&nbsp;</p>
<p class="whs1">anIds = mesh.GetIdsFromFilter(aFilter)
</p>
<p class="whs2">&nbsp;</p>
<p class="whs2"># print the result</p>
<p class="whs1">print &quot;Criterion:
Area &gt; &quot;, area_margin, &quot; Nb = &quot;, len(anIds)</p>
<p class="whs1">j = 1</p>
<p class="whs1">for i in range(len(anIds)):</p>
<p class="whs1">&nbsp;&nbsp;if
j &gt; 20: j = 1; print &quot;&quot;</p>
<p class="whs1">&nbsp;&nbsp;print
anIds[i],</p>
<p class="whs1">&nbsp;&nbsp;j
= j + 1</p>
<p class="whs1">&nbsp;&nbsp;pass</p>
<p class="whs1">print &quot;&quot;</p>
<p class="whs1">&nbsp;</p>
<p class="whs2"># create a group</p>
<p class="whs1">aGroup = mesh.CreateEmptyGroup(smesh.FACE,
&quot;Area &gt; &quot; + `area_margin`)</p>
<p class="whs1">aGroup.Add(anIds)</p>
<p class="whs1">&nbsp;</p>
<p class="whs2"><span style="font-family: 'Lucida Console', monospace;">salome.sg.updateObjBrowser(1)</span>
&nbsp;</p>
<h3><a name=bookmark7>Taper</a></h3>
<p class="whs1">import SMESH_mechanic</p>
<p class="whs1">&nbsp;</p>
<p class="whs1">smesh &nbsp;=
SMESH_mechanic.smesh</p>
<p class="whs1">mesh &nbsp;&nbsp;=
SMESH_mechanic.mesh</p>
<p class="whs1">salome = SMESH_mechanic.salome</p>
<p class="whs1">&nbsp;</p>
<p class="whs3"># Criterion : Taper
&gt; 3e-20</p>
<p class="whs1">taper_margin = 3e-20</p>
<p class="whs1">&nbsp;</p>
<p class="whs1">aFilter = smesh.GetFilter(smesh.FACE,
smesh.FT_Taper, smesh.FT_MoreThan, taper_margin)</p>
<p class="whs1">&nbsp;</p>
<p class="whs1">anIds = mesh.GetIdsFromFilter(aFilter)
</p>
<p class="whs1">&nbsp;</p>
<p class="whs3"># print the result</p>
<p class="whs1">print &quot;Criterion:
Taper &gt; &quot;, taper_margin, &quot; Nb = &quot;, len(anIds)</p>
<p class="whs1">j = 1</p>
<p class="whs1">for i in range(len(anIds)):</p>
<p class="whs1">&nbsp;&nbsp;if
j &gt; 20: j = 1; print &quot;&quot;</p>
<p class="whs1">&nbsp;&nbsp;print
anIds[i],</p>
<p class="whs1">&nbsp;&nbsp;j
= j + 1</p>
<p class="whs1">&nbsp;&nbsp;pass</p>
<p class="whs1">print &quot;&quot;</p>
<p class="whs1">&nbsp;</p>
<p class="whs3"># create a group</p>
<p class="whs1"><span style="font-family: 'Lucida Console', monospace;">aGroup
= mesh.CreateEmptyGroup(smesh.FACE, &quot;Taper &gt; &quot; + `taper_margin`)</span></p>
<p class="whs1">aGroup.Add(anIds)</p>
<p class="whs1">&nbsp;</p>
<p class="whs1">salome.sg.updateObjBrowser(1)
&nbsp;</p>
<h3><a name=bookmark8>Aspect Ratio</a></h3>
<p class="whs1">import SMESH_mechanic</p>
<p class="whs1">&nbsp;</p>
<p class="whs1">smesh &nbsp;=
SMESH_mechanic.smesh</p>
<p class="whs1">mesh &nbsp;&nbsp;=
SMESH_mechanic.mesh</p>
<p class="whs1">salome = SMESH_mechanic.salome</p>
<p class="whs1">&nbsp;</p>
<p class="whs3"># Criterion : ASPECT
RATIO &gt; 1.8</p>
<p class="whs1">ar_margin = 1.8</p>
<p class="whs1">&nbsp;</p>
<p class="whs1"><span style="font-family: 'Lucida Console', monospace;">aFilter
= smesh.GetFilter(smesh.FACE, smesh.FT_AspectRatio, smesh.FT_MoreThan,
ar_margin)</span></p>
<p class="whs1">&nbsp;</p>
<p class="whs1">anIds = mesh.GetIdsFromFilter(aFilter)
</p>
<p class="whs1">&nbsp;</p>
<p class="whs3"># print the result</p>
<p class="whs1">print &quot;Criterion:
Aspect Ratio &gt; &quot;, ar_margin, &quot; Nb = &quot;, len(anIds)</p>
<p class="whs1">j = 1</p>
<p class="whs1">for i in range(len(anIds)):</p>
<p class="whs1">&nbsp;&nbsp;if
j &gt; 20: j = 1; print &quot;&quot;</p>
<p class="whs1">&nbsp;&nbsp;print
anIds[i],</p>
<p class="whs1">&nbsp;&nbsp;j
= j + 1</p>
<p class="whs1">&nbsp;&nbsp;pass</p>
<p class="whs1">print &quot;&quot;</p>
<p class="whs1">&nbsp;</p>
<p class="whs3"># create a group</p>
<p class="whs1"><span style="font-family: 'Lucida Console', monospace;">aGroup
= mesh.CreateEmptyGroup(smesh.FACE, &quot;Aspect Ratio &gt; &quot; + `ar_margin`)</span></p>
<p class="whs1">aGroup.Add(anIds)</p>
<p class="whs1">&nbsp;</p>
<p class="whs1">salome.sg.updateObjBrowser(1)
</p>
<p class="whs1">&nbsp;</p>
<h3><a name=bookmark9>Minimum Angle</a></h3>
<p class="whs1">import SMESH_mechanic</p>
<p class="whs1">&nbsp;</p>
<p class="whs1">smesh &nbsp;=
SMESH_mechanic.smesh</p>
<p class="whs1">mesh &nbsp;&nbsp;=
SMESH_mechanic.mesh</p>
<p class="whs1">salome = SMESH_mechanic.salome</p>
<p class="whs1">&nbsp;</p>
<p class="whs3"># Criterion : MINIMUM
ANGLE &lt; 35.</p>
<p class="whs1">min_angle = 35.</p>
<p class="whs1">&nbsp;</p>
<p class="whs1">aFilter = smesh.GetFilter(smesh.FACE,
smesh.FT_MinimumAngle, smesh.FT_LessThan, min_angle)</p>
<p class="whs1">&nbsp;</p>
<p class="whs1">anIds = mesh.GetIdsFromFilter(aFilter)
</p>
<p class="whs1">&nbsp;</p>
<p class="whs3"># print the result</p>
<p class="whs1">print &quot;Criterion:
Minimum Angle &lt; &quot;, min_angle, &quot; Nb = &quot;, len(anIds)</p>
<p class="whs1">j = 1</p>
<p class="whs1">for i in range(len(anIds)):</p>
<p class="whs1">&nbsp;&nbsp;if
j &gt; 20: j = 1; print &quot;&quot;</p>
<p class="whs1">&nbsp;&nbsp;print
anIds[i],</p>
<p class="whs1">&nbsp;&nbsp;j
= j + 1</p>
<p class="whs1">&nbsp;&nbsp;pass</p>
<p class="whs1">print &quot;&quot;</p>
<p class="whs1">&nbsp;</p>
<p class="whs3"># create a group</p>
<p class="whs1"><span style="font-family: 'Lucida Console', monospace;">aGroup
= mesh.CreateEmptyGroup(smesh.FACE, &quot;Minimum Angle &lt; &quot; +
`min_angle`)</span></p>
<p class="whs1">&nbsp;</p>
<p class="whs1">aGroup.Add(anIds)</p>
<p class="whs1">&nbsp;</p>
<p class="whs1">salome.sg.updateObjBrowser(1)
</p>
<p class="whs1">&nbsp;</p>
<h3><a name=bookmark10>Warping</a></h3>
<p class="whs1">import SMESH_mechanic</p>
<p class="whs1">&nbsp;</p>
<p class="whs1">smesh &nbsp;=
SMESH_mechanic.smesh</p>
<p class="whs1">mesh &nbsp;&nbsp;=
SMESH_mechanic.mesh</p>
<p class="whs1">salome = SMESH_mechanic.salome</p>
<p class="whs1">&nbsp;</p>
<p class="whs3"># Criterion : WARP
ANGLE &gt; 1e-15</p>
<p class="whs1">wa_margin = 1e-15</p>
<p class="whs1">&nbsp;</p>
<p class="whs1">aFilter = smesh.GetFilter(smesh.FACE,
smesh.FT_Warping, smesh.FT_MoreThan, wa_margin)</p>
<p class="whs1">&nbsp;</p>
<p class="whs1">anIds = mesh.GetIdsFromFilter(aFilter)
</p>
<p class="whs1">&nbsp;</p>
<p class="whs3"># print the result</p>
<p class="whs1">print &quot;Criterion:
Warp &gt; &quot;, wa_margin, &quot; Nb = &quot;, len(anIds)</p>
<p class="whs1">j = 1</p>
<p class="whs1">for i in range(len(anIds)):</p>
<p class="whs1">&nbsp;&nbsp;if
j &gt; 20: j = 1; print &quot;&quot;</p>
<p class="whs1">&nbsp;&nbsp;print
anIds[i],</p>
<p class="whs1">&nbsp;&nbsp;j
= j + 1</p>
<p class="whs1">&nbsp;&nbsp;pass</p>
<p class="whs1">print &quot;&quot;</p>
<p class="whs1">&nbsp;</p>
<p class="whs3"># create a group</p>
<p class="whs1">aGroup = mesh.CreateEmptyGroup(smesh.FACE,
&quot;Warp &gt; &quot; + `wa_margin`)</p>
<p class="whs1">&nbsp;</p>
<p class="whs1">aGroup.Add(anIds)</p>
<p class="whs1">&nbsp;</p>
<p class="whs1">salome.sg.updateObjBrowser(1)
</p>
<p class="whs1">&nbsp;</p>
<h3><a name=bookmark12>Skew</a></h3>
<p class="whs1">import SMESH_mechanic</p>
<p class="whs1">&nbsp;</p>
<p class="whs1">smesh &nbsp;=
SMESH_mechanic.smesh</p>
<p class="whs1">mesh &nbsp;&nbsp;=
SMESH_mechanic.mesh</p>
<p class="whs1">salome = SMESH_mechanic.salome</p>
<p class="whs1">&nbsp;</p>
<p class="whs3"># Criterion : Skew
&gt; 38.</p>
<p class="whs1">skew_margin = 38.</p>
<p class="whs1">&nbsp;</p>
<p class="whs1">aFilter = smesh.GetFilter(smesh.FACE,
smesh.FT_Skew, smesh.FT_MoreThan, skew_margin)</p>
<p class="whs1">&nbsp;</p>
<p class="whs1">anIds = mesh.GetIdsFromFilter(aFilter)</p>
<p class="whs1">&nbsp;</p>
<p class="whs3"># print the result</p>
<p class="whs1">print &quot;Criterion:
Skew &gt; &quot;, skew_margin, &quot; Nb = &quot;, len(anIds)</p>
<p class="whs1">j = 1</p>
<p class="whs1">for i in range(len(anIds)):</p>
<p class="whs1">&nbsp;&nbsp;if
j &gt; 20: j = 1; print &quot;&quot;</p>
<p class="whs1">&nbsp;&nbsp;print
anIds[i],</p>
<p class="whs1">&nbsp;&nbsp;j
= j + 1</p>
<p class="whs1">&nbsp;&nbsp;pass</p>
<p class="whs1">print &quot;&quot;</p>
<p class="whs1">&nbsp;</p>
<p class="whs3"># create a group</p>
<p class="whs1"><span style="font-family: 'Lucida Console', monospace;">aGroup
= mesh.CreateEmptyGroup(smesh.FACE, &quot;Skew &gt; &quot; + `skew_margin`)</span></p>
<p class="whs1">aGroup.Add(anIds)</p>
<p class="whs1">&nbsp;</p>
<p class="whs1">salome.sg.updateObjBrowser(1)
</p>
<p class="whs1">&nbsp;</p>
<h3><a name=bookmark11>Aspect Ratio 3D</a></h3>
<p class="whs1">import SMESH_mechanic_tetra
</p>
<p class="whs1">&nbsp;</p>
<p class="whs1">smesh &nbsp;=
SMESH_mechanic_tetra.smesh</p>
<p class="whs1">mesh &nbsp;&nbsp;=
SMESH_mechanic_tetra.mesh</p>
<p class="whs1">salome = SMESH_mechanic_tetra.salome</p>
<p class="whs1">&nbsp;</p>
<p class="whs3"># Criterion : ASPECT
RATIO 3D &gt; 4.5</p>
<p class="whs1">ar_margin = 4.5</p>
<p class="whs1">&nbsp;</p>
<p class="whs1">aFilter = smesh.GetFilter(smesh.VOLUME,
smesh.FT_AspectRatio3D, smesh.FT_MoreThan, ar_margin)</p>
<p class="whs1">&nbsp;</p>
<p class="whs1">anIds = mesh.GetIdsFromFilter(aFilter)
</p>
<p class="whs1">&nbsp;</p>
<p class="whs3"># print the result</p>
<p class="whs1">print &quot;Criterion:
Aspect Ratio 3D &gt; &quot;, ar_margin, &quot; Nb = &quot;, len(anIds)</p>
<p class="whs1">j = 1</p>
<p class="whs1">for i in range(len(anIds)):</p>
<p class="whs1">&nbsp;&nbsp;if
j &gt; 20: j = 1; print &quot;&quot;</p>
<p class="whs1">&nbsp;&nbsp;print
anIds[i],</p>
<p class="whs1">&nbsp;&nbsp;j
= j + 1</p>
<p class="whs1">&nbsp;&nbsp;pass</p>
<p class="whs1">print &quot;&quot;</p>
<p class="whs1">&nbsp;</p>
<p class="whs3"># create a group</p>
<p class="whs1">aGroup = mesh.CreateEmptyGroup(smesh.VOLUME,
&quot;Aspect Ratio 3D &gt; &quot; + `ar_margin`)</p>
<p class="whs1">&nbsp;</p>
<p class="whs1">aGroup.Add(anIds)</p>
<p class="whs1">&nbsp;</p>
<p class="whs1">salome.sg.updateObjBrowser(1)
</p>
<h3><a name=Volume>Volume</a></h3>
<p class="whs1">import SMESH_mechanic_tetra</p>
<p class="whs1">&nbsp;</p>
<p class="whs1">smesh &nbsp;=
SMESH_mechanic_tetra.smesh</p>
<p class="whs1">mesh &nbsp;&nbsp;=
SMESH_mechanic_tetra.mesh</p>
<p class="whs1">salome = SMESH_mechanic_tetra.salome</p>
<p class="whs2">&nbsp;</p>
<p class="whs2"># Criterion : VOLUME &lt;
7.</p>
<p class="whs1">volume_margin =
7.</p>
<p class="whs1">&nbsp;</p>
<p class="whs1">aFilter = smesh.GetFilter(smesh.VOLUME,
smesh.FT_Volume3D, smesh.FT_LessThan, volume_margin)</p>
<p class="whs1">&nbsp;</p>
<p class="whs1">anIds = mesh.GetIdsFromFilter(aFilter)
</p>
<p class="whs2">&nbsp;</p>
<p class="whs2"># print the result</p>
<p class="whs1">print &quot;&quot;</p>
<p class="whs1">print &quot;Criterion:
Volume &lt; &quot;, volume_margin, &quot; Nb = &quot;, len(anIds)</p>
<p class="whs1">j = 1</p>
<p class="whs1">for i in range(len(anIds)):</p>
<p class="whs1">&nbsp;&nbsp;if
j &gt; 20: j = 1; print &quot;&quot;</p>
<p class="whs1">&nbsp;&nbsp;print
anIds[i],</p>
<p class="whs1">&nbsp;&nbsp;j
= j + 1</p>
<p class="whs1">&nbsp;&nbsp;pass</p>
<p class="whs1">print &quot;&quot;</p>
<p class="whs2">&nbsp;</p>
<p class="whs2"># create a group</p>
<p class="whs1">aGroup = mesh.CreateEmptyGroup(smesh.VOLUME,
&quot;Volume &lt; &quot; + `volume_margin`)</p>
<p class="whs1">&nbsp;</p>
<p class="whs1">aGroup.Add(anIds)</p>
<p class="whs2">&nbsp;</p>
<p class="whs2"><span style="font-family: 'Lucida Console', monospace;">salome.sg.updateObjBrowser(1)
</span>&nbsp;</p>
<script type="text/javascript" language="javascript1.2">
<!--
if (window.writeIntopicBar)
writeIntopicBar(0);
//-->
</script>
</body>
</html>