Salome HOME
Warn about direct SMESH idl usage: smesh python package have to be used where it...
[modules/smesh.git] / doc / salome / gui / SMESH / defining_hypotheses_tui.htm
index 0874e45078cc068dff489cf745d6d965814b7ea6..3fe7884bdff4f6e525a0f0d2e5550a7279c5e344 100755 (executable)
@@ -16,9 +16,8 @@ p.whs1 { font-weight:bold; }
 p.whs2 { font-family:'Lucida Console' , monospace; }\r
 p.whs3 { font-family:'Times New Roman' , serif; }\r
 p.whs4 { margin-top:0pt; margin-bottom:0pt; font-family:'Lucida Console' , monospace; }\r
-p.whs5 { margin-top:0pt; margin-bottom:0pt; }\r
-p.whs6 { margin-top:0pt; margin-bottom:0pt; font-family:Tahoma, sans-serif; }\r
-p.whs7 { margin-top:0pt; margin-bottom:0pt; font-family:'Times New Roman' , serif; }\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
@@ -28,7 +27,6 @@ if ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) == 4))
   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
@@ -51,43 +49,48 @@ onerror = null;
 <style type="text/css">\r
 <!--\r
 div.WebHelpPopupMenu { position:absolute; left:0px; top:0px; z-index:4; visibility:hidden; }\r
+p.WebHelpNavBar { text-align:right; }\r
 -->\r
 </style><script type="text/javascript" language="javascript1.2" src="whmsg.js"></script>\r
 <script type="text/javascript" language="javascript" src="whver.js"></script>\r
 <script type="text/javascript" language="javascript1.2" src="whproxy.js"></script>\r
 <script type="text/javascript" language="javascript1.2" src="whutils.js"></script>\r
 <script type="text/javascript" language="javascript1.2" src="whtopic.js"></script>\r
-</head>\r
-<body><script type="text/javascript" language="javascript1.2">\r
+<script type="text/javascript" language="javascript1.2">\r
 <!--\r
 if (window.gbWhTopic)\r
 {\r
-       if (window.addTocInfo)\r
+       if (window.setRelStartPage)\r
        {\r
        addTocInfo("MESH module\nTUI Scripts\nDefining Hypotheses");\r
-addButton("show",BTN_TEXT,"Show","","","","",0,0,"","","");\r
+addButton("show",BTN_IMG,"Show","","","","",0,0,"whd_show0.gif","whd_show2.gif","whd_show1.gif");\r
+addButton("hide",BTN_IMG,"Hide","","","","",0,0,"whd_hide0.gif","whd_hide2.gif","whd_hide1.gif");\r
 \r
        }\r
-       if (window.writeBtnStyle)\r
-               writeBtnStyle();\r
 \r
-       if (window.writeIntopicBar)\r
-               writeIntopicBar(1);\r
 \r
        if (window.setRelStartPage)\r
        {\r
-       setRelStartPage("smesh.htm");\r
+       setRelStartPage("index.htm");\r
 \r
                autoSync(1);\r
                sendSyncInfo();\r
                sendAveInfoOut();\r
        }\r
+\r
 }\r
 else\r
        if (window.gbIE4)\r
                document.location.reload();\r
 //-->\r
 </script>\r
+</head>\r
+<body><script type="text/javascript" language="javascript1.2">\r
+<!--\r
+if (window.writeIntopicBar)\r
+       writeIntopicBar(4);\r
+//-->\r
+</script>\r
 <h1>Defining Hypotheses and Algorithms</h1>\r
 \r
 <h3>Defining 1D Hypotheses</h3>\r
@@ -284,53 +287,67 @@ else
 \r
 <p class="whs3"># create vertices</p>\r
 \r
-<p class="whs2">px &nbsp;&nbsp;=geompy.MakeVertex(100., 0. &nbsp;,0. &nbsp;)</p>\r
+<p class="whs2">px &nbsp;&nbsp;= \r
+ geompy.MakeVertex(100., 0. &nbsp;, \r
+ 0. &nbsp;)</p>\r
 \r
-<p class="whs2">py &nbsp;&nbsp;=geompy.MakeVertex(0. &nbsp;,100., 0. &nbsp;)</p>\r
+<p class="whs2">py &nbsp;&nbsp;= \r
+ geompy.MakeVertex(0. &nbsp;, \r
+ 100., 0. &nbsp;)</p>\r
 \r
-<p class="whs2">pz &nbsp;&nbsp;=geompy.MakeVertex(0. &nbsp;,0. &nbsp;, 100.)</p>\r
+<p class="whs2">pz &nbsp;&nbsp;= \r
+ geompy.MakeVertex(0. &nbsp;, \r
+ 0. &nbsp;, 100.)</p>\r
 \r
 <p class="whs2">&nbsp;</p>\r
 \r
 <p class="whs3"># create a vector from \r
  two points</p>\r
 \r
-<p class="whs2">vxy = geompy.MakeVector(px,py)</p>\r
+<p class="whs2">vxy = geompy.MakeVector(px, \r
+ py)</p>\r
 \r
 <p class="whs2">&nbsp;</p>\r
 \r
 <p class="whs3"># create an arc from \r
  three points</p>\r
 \r
-<p class="whs2">arc = geompy.MakeArc(py, pz, px)</p>\r
+<p class="whs2">arc = geompy.MakeArc(py, \r
+ pz, px)</p>\r
 \r
 <p class="whs2">&nbsp;</p>\r
 \r
 <p class="whs3"># create a wire</p>\r
 \r
-<p class="whs2">wire = geompy.MakeWire([vxy,arc])</p>\r
+<p class="whs2">wire = geompy.MakeWire([vxy, \r
+ arc])</p>\r
 \r
 <p class="whs2">isPlanarFace = 1</p>\r
 \r
 <p class="whs2">&nbsp;</p>\r
 \r
-<p class="whs3"># create a face from the wire</p>\r
+<p class="whs3"># create a face from \r
+ the wire</p>\r
 \r
-<p class="whs2">face1 = geompy.MakeFace(wire,isPlanarFace)</p>\r
+<p class="whs2">face1 = geompy.MakeFace(wire, \r
+ isPlanarFace)</p>\r
 \r
 <p class="whs2">&nbsp;</p>\r
 \r
-<p class="whs3"># get edges from the face</p>\r
+<p class="whs3"><span style="font-family: 'Times New Roman', serif;"># \r
+ get edges from the face</span></p>\r
 \r
-<p class="whs2">vxy, arc = geompy.SubShapeAll(face1, geompy.ShapeType["EDGE"])</p>\r
+<p class="whs2">vxy,arc = geompy.SubShapeAll(face1,geompy.ShapeType[&quot;EDGE&quot;])</p>\r
 \r
-<p class="whs2">&nbsp;</p>\r
+<p class="whs3">&nbsp;</p>\r
 \r
-<p class="whs3"># add objects in the study</p>\r
+<p class="whs3"># add objects in the \r
+ study</p>\r
 \r
 <p class="whs2">id_face1 = geompy.addToStudy(face1,&quot;Face1&quot;)</p>\r
 \r
-<p class="whs2">id_arc = geompy.addToStudyInFather(face1,arc,&quot;Arc Edge&quot;)</p>\r
+<p class="whs2">id_arc = geompy.addToStudyInFather(face1,arc,&quot;Arc \r
+ Edge&quot;)</p>\r
 \r
 <p class="whs2">&nbsp;</p>\r
 \r
@@ -346,38 +363,45 @@ else
 \r
 <p class="whs3"># create hexahedral mesh</p>\r
 \r
-<p class="whs2">hexa = smesh.Mesh(face1,&quot;Face compound : hexahedrical mesh&quot;)</p>\r
+<p class="whs2">hexa = smesh.Mesh(face1, \r
+ &quot;Face compound : hexahedrical mesh&quot;)</p>\r
 \r
 <p class="whs2">algo = hexa.Triangle()</p>\r
 \r
 <p class="whs2">&nbsp;</p>\r
 \r
-<p class="whs3"># define &quot;MaxElementArea&quot;hypothesis</p>\r
+<p class="whs3"># define &quot;MaxElementArea&quot; \r
+ hypothesis</p>\r
 \r
 <p class="whs2">algo.MaxElementArea(30)</p>\r
 \r
 <p class="whs2">&nbsp;</p>\r
 \r
-<p class="whs3"># create a local hypothesis on the wire</p>\r
+<p class="whs3"># create a local hypothesis \r
+ on the wire</p>\r
 \r
 <p class="whs2">algo = hexa.Segment(wire)</p>\r
 \r
 <p class="whs2">&nbsp;</p>\r
 \r
-<p class="whs3"># define &quot;NumberOfSegments&quot;hypothesis to cut\r
-a straight edge in a fixed number of segments</p>\r
+<p class="whs3"># define &quot;NumberOfSegments&quot; \r
+ hypothesis to cut a straight edge in a fixed number of segments</p>\r
 \r
 <p class="whs2">algo.NumberOfSegments(6)</p>\r
 \r
 <p class="whs2">&nbsp;</p>\r
 \r
-<p class="whs3"># define a local &quot;Deflection1D&quot;hypothesis on the arc</p>\r
+<p class="whs3"># define a local &quot;Deflection1D&quot; \r
+ hypothesis on the arc</p>\r
 \r
 <p class="whs2">algo = hexa.Segment(arc)</p>\r
+\r
 <p class="whs2">algo.Deflection1D(1)</p>\r
 \r
 <p class="whs2">&nbsp;</p>\r
 \r
+<p class="whs2">&nbsp;</p>\r
+\r
 <p class="whs3"># compute the mesh</p>\r
 \r
 <p class="whs2">hexa.Compute() </p>\r
@@ -741,17 +765,16 @@ a straight edge in a fixed number of segments</p>
 \r
 <h4><a name=bookmark4>Maximum Element Area</a></h4>\r
 \r
-<p class="whs4">import smesh</p>\r
+<p class="whs4"><span style="font-family: 'Lucida Console', monospace;">import \r
+ smesh</span></p>\r
 \r
 <p class="whs4">import geompy</p>\r
 \r
 <p class="whs4">import salome</p>\r
 \r
-<p class="whs4">gg = salome.ImportComponentGUI(&quot;GEOM&quot;)</p>\r
-\r
-<p class="whs5">&nbsp;</p>\r
+<p class="whs4">&nbsp;</p>\r
 \r
-<p class="whs5"># create vertices</p>\r
+<p class="whs5"># create a face</p>\r
 \r
 <p class="whs4">px &nbsp;&nbsp;= \r
  geompy.MakeVertex(100., 0. &nbsp;, \r
@@ -765,101 +788,79 @@ a straight edge in a fixed number of segments</p>
  geompy.MakeVertex(0. &nbsp;, \r
  0. &nbsp;, 100.)</p>\r
 \r
-<p class="whs5">&nbsp;</p>\r
-\r
-<p class="whs5"># create a vector from \r
- two points</p>\r
+<p class="whs4">&nbsp;</p>\r
 \r
 <p class="whs4">vxy = geompy.MakeVector(px, \r
  py)</p>\r
 \r
-<p class="whs5">&nbsp;</p>\r
-\r
-<p class="whs5"># create an arc from three \r
- points</p>\r
-\r
 <p class="whs4">arc = geompy.MakeArc(py, \r
  pz, px)</p>\r
 \r
-<p class="whs5">&nbsp;</p>\r
-\r
-<p class="whs5"># create a wire</p>\r
-\r
 <p class="whs4">wire = geompy.MakeWire([vxy, \r
  arc])</p>\r
 \r
-<p class="whs4">isPlanarFace = 1</p>\r
-\r
-<p class="whs5">&nbsp;</p>\r
+<p class="whs4">&nbsp;</p>\r
 \r
-<p class="whs5"># create a face from the \r
- wire</p>\r
+<p class="whs4">isPlanarFace = 1</p>\r
 \r
-<p class="whs4">face1 = geompy.MakeFace(wire, \r
+<p class="whs4">face = geompy.MakeFace(wire, \r
  isPlanarFace)</p>\r
 \r
-<p class="whs5">&nbsp;</p>\r
-\r
-<p class="whs5"># add objects in the study</p>\r
-\r
-<p class="whs4">id_face1 = geompy.addToStudy(face1,&quot;Face1&quot;)</p>\r
-\r
-<p class="whs5">&nbsp;</p>\r
-\r
-<p class="whs5"># display faces</p>\r
-\r
-<p class="whs4">gg.createAndDisplayGO(id_face1)</p>\r
-\r
-<p class="whs4">gg.setDisplayMode(id_face1,1)</p>\r
+<p class="whs4">&nbsp;</p>\r
 \r
-<p class="whs4">gg.setTransparency(id_face1,0.2)</p>\r
+<p class="whs5"># add the face in the \r
+ study</p>\r
 \r
-<p class="whs5">&nbsp;</p>\r
+<p class="whs4">id_face = geompy.addToStudy(face, \r
+ &quot;Face to be meshed&quot;)</p>\r
 \r
-<p class="whs5"># create a hexahedral mesh</p>\r
+<p class="whs4">&nbsp;</p>\r
 \r
-<p class="whs4">hexa = smesh.Mesh(face1, \r
- &quot;Face compound : hexahedrical mesh&quot;)</p>\r
+<p class="whs5"># create a mesh</p>\r
 \r
-<p class="whs4">algo = hexa.Triangle()</p>\r
+<p class="whs4">tria_mesh = smesh.Mesh(face, \r
+ &quot;Face : triangulation&quot;)</p>\r
 \r
-<p class="whs5">&nbsp;</p>\r
+<p class="whs4">&nbsp;</p>\r
 \r
-<p class="whs5"># define &quot;MaxElementArea&quot; \r
- hypothesis to be applied to each triangle</p>\r
+<p class="whs5"># define 1D meshing:</p>\r
 \r
-<p class="whs4">algo.MaxElementArea(7)</p>\r
+<p class="whs4">algo = tria_mesh.Segment()</p>\r
 \r
-<p class="whs5">&nbsp;</p>\r
+<p class="whs4">algo.NumberOfSegments(20)</p>\r
 \r
-<p class="whs5"># create a quadrangle 2D \r
- algorithm for faces</p>\r
+<p class="whs4">&nbsp;</p>\r
 \r
-<p class="whs4">hexa.Quadrangle()</p>\r
+<p class="whs5"># define 2D meshing:</p>\r
 \r
 <p class="whs5">&nbsp;</p>\r
 \r
-<p class="whs5"># create a local hypothesis</p>\r
+<p class="whs5"># assign triangulation \r
+ algorithm</p>\r
 \r
-<p class="whs6">algo = hexa.Segment(wire)</p>\r
+<p class="whs4">algo = tria_mesh.Triangle()</p>\r
 \r
-<p class="whs5">&nbsp;</p>\r
+<p class="whs4">&nbsp;</p>\r
 \r
-<p class="whs5"># define &quot;NumberOfSegments&quot; \r
hypothesis to cut an edge in a fixed number of segments</p>\r
+<p class="whs5"># apply &quot;Max Element \r
Area&quot; hypothesis to each triangle</p>\r
 \r
-<p class="whs4">algo.NumberOfSegments(10)</p>\r
+<p class="whs4">algo.MaxElementArea(100)</p>\r
 \r
-<p class="whs5">&nbsp;</p>\r
+<p class="whs4">&nbsp;</p>\r
 \r
 <p class="whs5"># compute the mesh</p>\r
 \r
-<p class="whs4">hexa.Compute() </p>\r
+<p class="whs4">tria_mesh.Compute() \r
+ &nbsp;</p>\r
 \r
 <p class="whs4">&nbsp;</p>\r
 \r
 <h4><a name=bookmark5>Maximum Element Volume</a></h4>\r
 \r
+<p>Attention! This script was written using old approach, based on direct usage of SMESH idl interface. To be updated for version 3.2.1 to use <b>smesh</b> package.\r
+<br>&nbsp;\r
+\r
 <p class="whs4"><span style="font-family: 'Lucida Console', monospace;">import \r
  salome</span></p>\r
 \r
@@ -867,6 +868,10 @@ a straight edge in a fixed number of segments</p>
 \r
 <p class="whs4">import StdMeshers</p>\r
 \r
+<p class="whs4">import NETGENPlugin</p>\r
+\r
+<p class="whs4">&nbsp;</p>\r
+\r
 <p class="whs4">smesh = salome.lcc.FindOrLoadComponent(&quot;FactoryServer&quot;, \r
  &quot;SMESH&quot;)</p>\r
 \r
@@ -876,14 +881,16 @@ a straight edge in a fixed number of segments</p>
 \r
 <p class="whs4">&nbsp;</p>\r
 \r
-<p class="whs7"># create a box</p>\r
+<p class="whs5"># create a box</p>\r
 \r
 <p class="whs4">box = geompy.MakeCylinderRH(30, \r
- 50) #MakeBox(0., 0., 0., 100., 200., 300.)</p>\r
+ 50) #MakeBox(0., 0., 0., </p>\r
+\r
+<p class="whs4">100., 200., 300.)</p>\r
 \r
 <p class="whs4">&nbsp;</p>\r
 \r
-<p class="whs7"># add the box to the \r
+<p class="whs5"># add the box in the \r
  study</p>\r
 \r
 <p class="whs4">idbox = geompy.addToStudy(box, \r
@@ -891,83 +898,11 @@ a straight edge in a fixed number of segments</p>
 \r
 <p class="whs4">&nbsp;</p>\r
 \r
-<p class="whs7"># create vertices</p>\r
-\r
-<p class="whs4">px &nbsp;&nbsp;= \r
- geompy.MakeVertex(100., 0. &nbsp;, \r
- 0. &nbsp;)</p>\r
-\r
-<p class="whs4">py &nbsp;&nbsp;= \r
- geompy.MakeVertex(0. &nbsp;, \r
- 100., 0. &nbsp;)</p>\r
-\r
-<p class="whs4">pz &nbsp;&nbsp;= \r
- geompy.MakeVertex(0. &nbsp;, \r
- 0. &nbsp;, 100.)</p>\r
-\r
-<p class="whs4">&nbsp;</p>\r
-\r
-<p class="whs7"># create a vector from \r
- two points</p>\r
-\r
-<p class="whs4">vxy = geompy.MakeVector(px, \r
- py)</p>\r
-\r
-<p class="whs4">&nbsp;</p>\r
-\r
-<p class="whs7"># create an arc from \r
- three points</p>\r
-\r
-<p class="whs4">arc = geompy.MakeArc(py, \r
- pz, px)</p>\r
-\r
-<p class="whs4">&nbsp;</p>\r
-\r
-<p class="whs7"># create a wire</p>\r
-\r
-<p class="whs4">wire = geompy.MakeWire([vxy, \r
- arc])</p>\r
-\r
-<p class="whs4">isPlanarFace = 1</p>\r
-\r
-<p class="whs4">&nbsp;</p>\r
-\r
-<p class="whs7"># create a face from \r
- the wire</p>\r
-\r
-<p class="whs4">#face1</p>\r
-\r
-<p class="whs4">box = geompy.MakeFace(wire, \r
- isPlanarFace)</p>\r
-\r
-<p class="whs4">&nbsp;</p>\r
-\r
-<p class="whs7"># add objects in the \r
- study</p>\r
-\r
-<p class="whs4">id_face1 = geompy.addToStudy(box,&quot;Face1&quot;)</p>\r
-\r
-<p class="whs4">#geompy.addToStudy(face1,&quot;Face1&quot;)</p>\r
-\r
-<p class="whs4">&nbsp;</p>\r
-\r
-<p class="whs7"># display faces</p>\r
-\r
-<p class="whs4">gg.createAndDisplayGO(id_face1)</p>\r
-\r
-<p class="whs4">gg.setDisplayMode(id_face1,1)</p>\r
-\r
-<p class="whs4">gg.setTransparency(id_face1,0.2)</p>\r
-\r
-<p class="whs4">&nbsp;</p>\r
-\r
-<p class="whs7"># create a hypothesis</p>\r
+<p class="whs5"># create a set of hypotheses</p>\r
 \r
-<p class="whs4">print &quot;-------------------------- \r
- create Hypothesis&quot;</p>\r
+<p class="whs5">&nbsp;</p>\r
 \r
-<p class="whs4">print &quot;-------------------------- \r
- NumberOfSegments&quot;</p>\r
+<p class="whs5"># Number of Segments</p>\r
 \r
 <p class="whs4">numberOfSegments \r
  = 7</p>\r
@@ -979,15 +914,14 @@ a straight edge in a fixed number of segments</p>
 \r
 <p class="whs4">print hypNbSeg.GetName()</p>\r
 \r
-<p class="whs4">print hypNbSeg.GetId()</p>\r
-\r
 <p class="whs4">print hypNbSeg.GetNumberOfSegments()</p>\r
 \r
 <p class="whs4">smeshgui.SetName(salome.ObjectToID(hypNbSeg), \r
- &quot;NumberOfSegments_10&quot;)</p>\r
+ &quot;NumberOfSegments_7&quot;)</p>\r
 \r
-<p class="whs4">print &quot;-------------------------- \r
- MaxElementArea&quot;</p>\r
+<p class="whs4">&nbsp;</p>\r
+\r
+<p class="whs5"># Max Element Area</p>\r
 \r
 <p class="whs4">maxElementArea = \r
  800</p>\r
@@ -999,15 +933,14 @@ a straight edge in a fixed number of segments</p>
 \r
 <p class="whs4">print hypArea.GetName()</p>\r
 \r
-<p class="whs4">print hypArea.GetId()</p>\r
-\r
 <p class="whs4">print hypArea.GetMaxElementArea()</p>\r
 \r
 <p class="whs4">smeshgui.SetName(salome.ObjectToID(hypArea), \r
  &quot;MaxElementArea_800&quot;)</p>\r
 \r
-<p class="whs4">print &quot;-------------------------- \r
- MaxElementVolume&quot;</p>\r
+<p class="whs4">&nbsp;</p>\r
+\r
+<p class="whs5"># Max Element Volume</p>\r
 \r
 <p class="whs4">maxElementVolume \r
  = 900</p>\r
@@ -1019,8 +952,6 @@ a straight edge in a fixed number of segments</p>
 \r
 <p class="whs4">print hypVolume.GetName()</p>\r
 \r
-<p class="whs4">print hypVolume.GetId()</p>\r
-\r
 <p class="whs4">print hypVolume.GetMaxElementVolume()</p>\r
 \r
 <p class="whs4">smeshgui.SetName(salome.ObjectToID(hypVolume), \r
@@ -1028,13 +959,11 @@ a straight edge in a fixed number of segments</p>
 \r
 <p class="whs4">&nbsp;</p>\r
 \r
-<p class="whs7"># create algorithms</p>\r
+<p class="whs5"># create a set of algorithms</p>\r
 \r
-<p class="whs4">print &quot;-------------------------- \r
- create Algorithms&quot;</p>\r
+<p class="whs5">&nbsp;</p>\r
 \r
-<p class="whs4">print &quot;-------------------------- \r
- Regular_1D&quot;</p>\r
+<p class="whs5"># Regular_1D</p>\r
 \r
 <p class="whs4">regular1D = smesh.CreateHypothesis(&quot;Regular_1D&quot;, \r
  &quot;libStdMeshersEngine.so&quot;)</p>\r
@@ -1042,8 +971,9 @@ a straight edge in a fixed number of segments</p>
 <p class="whs4">smeshgui.SetName(salome.ObjectToID(regular1D), \r
  &quot;Wire Discretisation&quot;)</p>\r
 \r
-<p class="whs4">print &quot;-------------------------- \r
- MEFISTO_2D&quot;</p>\r
+<p class="whs4">&nbsp;</p>\r
+\r
+<p class="whs5"># MEFISTO_2D</p>\r
 \r
 <p class="whs4">mefisto2D = smesh.CreateHypothesis(&quot;MEFISTO_2D&quot;, \r
  &quot;libStdMeshersEngine.so&quot;)</p>\r
@@ -1051,18 +981,20 @@ a straight edge in a fixed number of segments</p>
 <p class="whs4">smeshgui.SetName(salome.ObjectToID(mefisto2D), \r
  &quot;MEFISTO_2D&quot;)</p>\r
 \r
-<p class="whs4">#print &quot;-------------------------- \r
- Hexa_3D (Hexahedron meshing algorithm)&quot;</p>\r
+<p class="whs4">&nbsp;</p>\r
 \r
-<p class="whs4">hexa3D = smesh.CreateHypothesis(&quot;Hexa_3D&quot;, \r
&quot;libStdMeshersEngine.so&quot;)</p>\r
+<p class="whs5"># NETGEN_3D (Tetrahedron \r
meshing algorithm)</p>\r
 \r
-<p class="whs4">smeshgui.SetName(salome.ObjectToID(hexa3D), \r
- &quot;HEXA_3D&quot;)</p>\r
+<p class="whs4">tetra3D = smesh.CreateHypothesis(&quot;NETGEN_3D&quot;, \r
+ &quot;libNETGENEngine.so&quot;)</p>\r
+\r
+<p class="whs4">smeshgui.SetName(salome.ObjectToID(tetra3D), \r
+ &quot;NETGEN_3D&quot;)</p>\r
 \r
 <p class="whs4">&nbsp;</p>\r
 \r
-<p class="whs7"># initialize a mesh \r
+<p class="whs5"># initialize a mesh \r
  with the box</p>\r
 \r
 <p class="whs4">mesh = smesh.CreateMesh(box)</p>\r
@@ -1072,11 +1004,8 @@ a straight edge in a fixed number of segments</p>
 \r
 <p class="whs4">&nbsp;</p>\r
 \r
-<p class="whs7"># add a hypothesis \r
- to the box</p>\r
-\r
-<p class="whs4">print &quot;-------------------------- \r
- add hypothesis to the box&quot;</p>\r
+<p class="whs5"># add hypotheses and \r
+ algorithms to the box</p>\r
 \r
 <p class="whs4">mesh.AddHypothesis(box,hypNbSeg)</p>\r
 \r
@@ -1088,43 +1017,41 @@ a straight edge in a fixed number of segments</p>
 \r
 <p class="whs4">mesh.AddHypothesis(box,mefisto2D)</p>\r
 \r
-<p class="whs4">mesh.AddHypothesis(box,hexa3D)</p>\r
+<p class="whs4">mesh.AddHypothesis(box,tetra3D)</p>\r
 \r
 <p class="whs4">&nbsp;</p>\r
 \r
-<p class="whs7"># compute the mesh</p>\r
-\r
-<p class="whs4">print &quot;-------------------------- \r
- compute the mesh of the box&quot;</p>\r
+<p class="whs5"># compute the mesh</p>\r
 \r
 <p class="whs4">ret = smesh.Compute(mesh,box)</p>\r
 \r
-<p class="whs4">print ret</p>\r
-\r
 <p class="whs4">if ret == 0:</p>\r
 \r
 <p class="whs4">&nbsp;&nbsp;&nbsp;&nbsp;print \r
  &quot;probleme when computing the mesh&quot;</p>\r
 \r
-<p class="whs4">salome.sg.updateObjBrowser(1)</p>\r
+<p class="whs4">else:</p>\r
 \r
-<p class="whs4">&nbsp;</p>\r
+<p class="whs4">&nbsp;&nbsp;&nbsp;&nbsp;print \r
+ &quot;Computation succeded&quot;</p>\r
 \r
-<h3>Defining Additional Hypotheses</h3>\r
+<p class="whs4">salome.sg.updateObjBrowser(1) \r
+ </p>\r
+\r
+<p class="whs4">&nbsp;</p>\r
 \r
 <h4><a name=bookmark6>Length from Edges</a></h4>\r
 \r
-<p class="whs2">import smesh</p>\r
+<p class="whs2"><span style="font-family: 'Lucida Console', monospace;">import \r
+ salome</span></p>\r
 \r
 <p class="whs2">import geompy</p>\r
 \r
-<p class="whs2">import salome</p>\r
-\r
-<p class="whs2">gg = salome.ImportComponentGUI(&quot;GEOM&quot;)</p>\r
+<p class="whs2">import smesh</p>\r
 \r
-<p>&nbsp;</p>\r
+<p class="whs2">&nbsp;</p>\r
 \r
-<p># create sketchers</p>\r
+<p class="whs3"># create sketchers</p>\r
 \r
 <p class="whs2">sketcher1 = geompy.MakeSketcher(&quot;Sketcher:F \r
  0 0:TT 70 0:TT 70 70:TT 0 70:WW&quot;)</p>\r
@@ -1134,77 +1061,66 @@ a straight edge in a fixed number of segments</p>
 \r
 <p class="whs2">isPlanarFace = 1</p>\r
 \r
-<p>&nbsp;</p>\r
+<p class="whs2">&nbsp;</p>\r
 \r
-<p># create faces from two wires</p>\r
+<p class="whs3"># create a face from \r
+ two wires</p>\r
 \r
 <p class="whs2">face1 = geompy.MakeFaces([sketcher1, \r
  sketcher2],isPlanarFace)</p>\r
 \r
-<p>&nbsp;</p>\r
+<p class="whs2">&nbsp;</p>\r
 \r
-<p># add objects in the study</p>\r
+<p class="whs3"># add object in the study</p>\r
 \r
 <p class="whs2">id_face1 = geompy.addToStudy(face1,&quot;Face1&quot;)</p>\r
 \r
-<p>&nbsp;</p>\r
-\r
-<p># display faces</p>\r
-\r
-<p class="whs2">gg.createAndDisplayGO(id_face1)</p>\r
-\r
-<p class="whs2">gg.setDisplayMode(id_face1,1)</p>\r
-\r
-<p class="whs2">gg.setTransparency(id_face1,0.2)</p>\r
-\r
-<p>&nbsp;</p>\r
+<p class="whs2">&nbsp;</p>\r
 \r
-<p># create a mesh</p>\r
+<p class="whs3"># create a mesh</p>\r
 \r
-<p class="whs2">hexa = smesh.Mesh(face1, \r
+<p class="whs2">tria = smesh.Mesh(face1, \r
  &quot;Face : triangle 2D mesh&quot;)</p>\r
 \r
-<p class="whs2">algo = hexa.Triangle()</p>\r
-\r
-<p>&nbsp;</p>\r
+<p class="whs2">&nbsp;</p>\r
 \r
-<p># define &quot;MaxElementArea&quot; hypothesis to be applied to each \r
- triangle</p>\r
+<p class="whs3"># Define 1D meshing</p>\r
 \r
-<p class="whs2">algo.MaxElementArea(30)</p>\r
+<p class="whs2">algo = tria.Segment()</p>\r
 \r
-<p>&nbsp;</p>\r
+<p class="whs2">algo.NumberOfSegments(2)</p>\r
 \r
-<p># define &quot;LengthFromEdges&quot; hypothesis to build triangles based \r
- on the length of the edges taken from the wire</p>\r
+<p class="whs2">&nbsp;</p>\r
 \r
-<p class="whs2">algo.LengthFromEdges()</p>\r
+<p class="whs3"># create and assign the \r
+ algorithm for 2D meshing with triangles</p>\r
 \r
-<p>&nbsp;</p>\r
+<p class="whs2">algo = tria.Triangle()</p>\r
 \r
-<p># create local hypothesis</p>\r
+<p class="whs2">&nbsp;</p>\r
 \r
-<p class="whs2">algo = hexa.Segment()</p>\r
+<p class="whs3"># create and assign &quot;LengthFromEdges&quot; \r
+ hypothesis to build triangles </p>\r
 \r
-<p>&nbsp;</p>\r
+<p class="whs3"># based on the length \r
+ of the edges taken from the wire</p>\r
 \r
-<p># define &quot;NumberOfSegments&quot; hypothesis to cut an edge in a \r
- fixed number of segments</p>\r
-\r
-<p class="whs2">algo.NumberOfSegments(2)</p>\r
+<p class="whs2">algo.LengthFromEdges()</p>\r
 \r
-<p>&nbsp;</p>\r
+<p class="whs2">&nbsp;</p>\r
 \r
-<p># compute the mesh</p>\r
+<p class="whs3"># compute the mesh</p>\r
 \r
-<p class="whs2">hexa.Compute() </p>\r
+<p class="whs2">tria.Compute() </p>\r
 \r
 <p class="whs2">&nbsp;</p>\r
 \r
+<h3>Defining Additional Hypotheses</h3>\r
+\r
 <h4><a name=bookmark7>Propagation</a></h4>\r
 \r
-<p class="whs2">from geompy import \r
*</p>\r
+<p class="whs2"><span style="font-family: 'Lucida Console', monospace;">from \r
geompy import *</span></p>\r
 \r
 <p class="whs2">import smesh</p>\r
 \r
@@ -1302,21 +1218,15 @@ a straight edge in a fixed number of segments</p>
 \r
 <p class="whs3"># create a solid</p>\r
 \r
-<p class="whs2">Block = MakeHexa(FaceX11, \r
+<p class="whs2">box = MakeHexa(FaceX11, \r
  FaceX21, FaceY111, FaceY121, FaceZ11, FaceZ12)</p>\r
 \r
 <p class="whs2">&nbsp;</p>\r
 \r
-<p class="whs3"># create a compound</p>\r
-\r
-<p class="whs2">box = MakeCompound([Block])</p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
 <p class="whs3"># add in the study</p>\r
 \r
 <p class="whs2">box_id = addToStudy(box, \r
- &quot;Box compound&quot;)</p>\r
+ &quot;Box&quot;)</p>\r
 \r
 <p class="whs2">&nbsp;</p>\r
 \r
@@ -1324,7 +1234,12 @@ a straight edge in a fixed number of segments</p>
  mesh on the box</p>\r
 \r
 <p class="whs2">hexa = smesh.Mesh(box, \r
- &quot;Box compound : hexahedrical mesh&quot;)</p>\r
+ &quot;Box : hexahedrical mesh&quot;)</p>\r
+\r
+<p class="whs2">&nbsp;</p>\r
+\r
+<p class="whs3"># create an 1D algorithm \r
+ for edges</p>\r
 \r
 <p class="whs2">algo = hexa.Segment()</p>\r
 \r
@@ -1357,11 +1272,9 @@ a straight edge in a fixed number of segments</p>
 \r
 <p class="whs2">&nbsp;</p>\r
 \r
-<p class="whs2"><span style="font-family: 'Times New Roman', serif;"># \r
- define &quot;Arithmetic1D&quot; hypothesis to cut an edge in several segments \r
- with arithmetic length</span> </p>\r
-\r
-<p class="whs2">increasing</p>\r
+<p class="whs3"># define &quot;Arithmetic1D&quot; \r
+ hypothesis to cut an edge<span style="font-family: 'Times New Roman', serif;"> \r
+ in several segments with increasing length</span></p>\r
 \r
 <p class="whs2">algo.Arithmetic1D(1, \r
  4)</p>\r
@@ -1369,8 +1282,10 @@ a straight edge in a fixed number of segments</p>
 <p class="whs2">&nbsp;</p>\r
 \r
 <p class="whs3"># define &quot;Propagation&quot; \r
- hypothesis that propagatea all other hypothesis on all edges on the opposite \r
- side in case of quadrangular faces</p>\r
+ hypothesis that propagates all other 1D hypotheses</p>\r
+\r
+<p class="whs3"># from all edges on the \r
+ opposite side of a face in case of quadrangular faces</p>\r
 \r
 <p class="whs2">algo.Propagation()</p>\r
 \r
@@ -1378,12 +1293,13 @@ a straight edge in a fixed number of segments</p>
 \r
 <p class="whs3"># compute the mesh</p>\r
 \r
-<p class="whs2">hexa.Compute() </p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
+<p class="whs2">hexa.Compute() &nbsp;</p>\r
 \r
 <h3><a name=bookmark8>Defining Meshing Algorithms</a></h3>\r
 \r
+<p>Attention! This script was written using old approach, based on direct usage of SMESH idl interface. To be updated for version 3.2.1 to use <b>smesh</b> package.\r
+<br>&nbsp;\r
+\r
 <p class="whs4"><span style="font-family: 'Lucida Console', monospace;">import \r
  salome</span></p>\r
 \r
@@ -1400,9 +1316,9 @@ a straight edge in a fixed number of segments</p>
 \r
 <p class="whs4">smeshgui.Init(salome.myStudyId);</p>\r
 \r
-<p class="whs5">&nbsp;</p>\r
+<p class="whs6">&nbsp;</p>\r
 \r
-<p class="whs5"># create algorithms</p>\r
+<p class="whs6"># create algorithms</p>\r
 \r
 <p class="whs4">print &quot;-------------------------- \r
  create Algorithms&quot;</p>\r
@@ -1462,7 +1378,7 @@ a straight edge in a fixed number of segments</p>
 \r
 <p class="whs4">salome.sg.updateObjBrowser(1)</p>\r
 \r
-<p class="whs5">&nbsp;</p>\r
+<p class="whs6">&nbsp;</p>\r
 \r
 <script type="text/javascript" language="javascript1.2">\r
 <!--\r