mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-12 01:30:34 +05:00
Warn about direct SMESH idl usage: smesh python package have to be used where it is possible.
This commit is contained in:
parent
fb9855e033
commit
c46bd4f9bb
@ -89,8 +89,14 @@ if (window.writeIntopicBar)
|
||||
</script>
|
||||
<h1>Creating Meshes</h1>
|
||||
|
||||
<p>At first see <a href="smesh_py_introduction.htm">Example of 3d mesh generation</a>, using <b>smesh</b> package.
|
||||
<p>Other examples of python scripts will be also updated soon to use <b>smesh</b> package instead of direct usage of idl interface.
|
||||
|
||||
<h3><a name=bookmark>Construction of a Mesh</a></h3>
|
||||
|
||||
<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.
|
||||
<br>
|
||||
|
||||
<p class="whs1">import salome</p>
|
||||
|
||||
<p class="whs1">import geompy</p>
|
||||
@ -417,6 +423,9 @@ if (window.writeIntopicBar)
|
||||
|
||||
<h3><a name=bookmark2>Editing of a mesh</a></h3>
|
||||
|
||||
<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.
|
||||
<br>
|
||||
|
||||
<p class="whs3"> </p>
|
||||
|
||||
<p class="whs3"><span style="font-family: 'Lucida Console', monospace;">import
|
||||
@ -548,6 +557,9 @@ if (window.writeIntopicBar)
|
||||
|
||||
<h3><a name=bookmark3>Export of a Mesh</a></h3>
|
||||
|
||||
<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.
|
||||
<br>
|
||||
|
||||
<p class="whs4"> </p>
|
||||
|
||||
<p class="whs1"><span style="font-family: 'Lucida Console', monospace;">import
|
||||
|
@ -858,6 +858,9 @@ if (window.writeIntopicBar)
|
||||
|
||||
<h4><a name=bookmark5>Maximum Element Volume</a></h4>
|
||||
|
||||
<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.
|
||||
<br>
|
||||
|
||||
<p class="whs4"><span style="font-family: 'Lucida Console', monospace;">import
|
||||
salome</span></p>
|
||||
|
||||
@ -1294,6 +1297,9 @@ if (window.writeIntopicBar)
|
||||
|
||||
<h3><a name=bookmark8>Defining Meshing Algorithms</a></h3>
|
||||
|
||||
<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.
|
||||
<br>
|
||||
|
||||
<p class="whs4"><span style="font-family: 'Lucida Console', monospace;">import
|
||||
salome</span></p>
|
||||
|
||||
|
@ -181,6 +181,9 @@ if (window.writeIntopicBar)
|
||||
|
||||
<h3><a name=bookmark5>Create a Group on Geometry</a></h3>
|
||||
|
||||
<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.
|
||||
<br>
|
||||
|
||||
<p class="whs1">import salome</p>
|
||||
|
||||
<p class="whs1">import geompy</p>
|
||||
|
@ -1443,6 +1443,9 @@ if (window.writeIntopicBar)
|
||||
|
||||
<h3><a name=bookmark13>Pattern Mapping</a></h3>
|
||||
|
||||
<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.
|
||||
<br>
|
||||
|
||||
<p class="whs7">import salome</p>
|
||||
|
||||
<p class="whs7">import geompy</p>
|
||||
|
@ -87,6 +87,9 @@ if (window.writeIntopicBar)
|
||||
|
||||
<h3><a name=bookmark>Free Borders</a></h3>
|
||||
|
||||
<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.
|
||||
<br>
|
||||
|
||||
<p class="whs1">import salome</p>
|
||||
|
||||
<p class="whs1">import geompy</p>
|
||||
@ -233,6 +236,9 @@ if (window.writeIntopicBar)
|
||||
|
||||
<h3><a name=bookmark1>Borders at Multiconnection</a></h3>
|
||||
|
||||
<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.
|
||||
<br>
|
||||
|
||||
<p class="whs1">import salome</p>
|
||||
|
||||
<p class="whs1">import geompy</p>
|
||||
@ -399,6 +405,9 @@ if (window.writeIntopicBar)
|
||||
|
||||
<h3><a name=bookmark2>Length 1D</a></h3>
|
||||
|
||||
<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.
|
||||
<br>
|
||||
|
||||
<p class="whs2"> </p>
|
||||
|
||||
<p class="whs1">import salome</p>
|
||||
@ -561,6 +570,9 @@ if (window.writeIntopicBar)
|
||||
|
||||
<h3><a name=bookmark3>Free Edges</a></h3>
|
||||
|
||||
<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.
|
||||
<br>
|
||||
|
||||
<p class="whs1">import SMESH</p>
|
||||
|
||||
<p class="whs1">import SMESH_mechanic</p>
|
||||
@ -672,6 +684,9 @@ if (window.writeIntopicBar)
|
||||
|
||||
<h3><a name=bookmark4>Length 2D</a></h3>
|
||||
|
||||
<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.
|
||||
<br>
|
||||
|
||||
<p class="whs1">import salome</p>
|
||||
|
||||
<p class="whs1">import geompy</p>
|
||||
@ -837,6 +852,9 @@ if (window.writeIntopicBar)
|
||||
|
||||
<h3><a name=bookmark5>Borders at Multiconnection 2D</a></h3>
|
||||
|
||||
<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.
|
||||
<br>
|
||||
|
||||
<p class="whs1">import salome</p>
|
||||
|
||||
<p class="whs1">import geompy</p>
|
||||
@ -994,6 +1012,9 @@ if (window.writeIntopicBar)
|
||||
|
||||
<h3><a name=bookmark6>Area</a></h3>
|
||||
|
||||
<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.
|
||||
<br>
|
||||
|
||||
<p class="whs1">import SMESH</p>
|
||||
|
||||
<p class="whs1">import SMESH_mechanic</p>
|
||||
@ -1073,6 +1094,9 @@ if (window.writeIntopicBar)
|
||||
|
||||
<h3><a name=bookmark7>Taper</a></h3>
|
||||
|
||||
<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.
|
||||
<br>
|
||||
|
||||
<p class="whs1">import SMESH</p>
|
||||
|
||||
<p class="whs1">import SMESH_mechanic</p>
|
||||
@ -1152,6 +1176,9 @@ if (window.writeIntopicBar)
|
||||
|
||||
<h3><a name=bookmark8>Aspect Ratio</a></h3>
|
||||
|
||||
<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.
|
||||
<br>
|
||||
|
||||
<p class="whs1">import SMESH</p>
|
||||
|
||||
<p class="whs1">import SMESH_mechanic</p>
|
||||
@ -1231,6 +1258,9 @@ if (window.writeIntopicBar)
|
||||
|
||||
<h3><a name=bookmark9>Minimum Angle</a></h3>
|
||||
|
||||
<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.
|
||||
<br>
|
||||
|
||||
<p class="whs1"> </p>
|
||||
|
||||
<p class="whs1">import SMESH</p>
|
||||
@ -1312,6 +1342,9 @@ if (window.writeIntopicBar)
|
||||
|
||||
<h3><a name=bookmark10>Warping</a></h3>
|
||||
|
||||
<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.
|
||||
<br>
|
||||
|
||||
<p class="whs1">import SMESH</p>
|
||||
|
||||
<p class="whs1">import SMESH_mechanic</p>
|
||||
@ -1389,6 +1422,9 @@ if (window.writeIntopicBar)
|
||||
|
||||
<h3><a name=bookmark12>Skew</a></h3>
|
||||
|
||||
<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.
|
||||
<br>
|
||||
|
||||
<p class="whs1">import SMESH</p>
|
||||
|
||||
<p class="whs1">import SMESH_mechanic</p>
|
||||
@ -1468,6 +1504,9 @@ if (window.writeIntopicBar)
|
||||
|
||||
<h3><a name=bookmark11>Aspect Ratio 3D</a></h3>
|
||||
|
||||
<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.
|
||||
<br>
|
||||
|
||||
<p class="whs1">import SMESH</p>
|
||||
|
||||
<p class="whs1">import SMESH_mechanic_tetra</p>
|
||||
|
208
doc/salome/gui/SMESH/smesh_py_introduction.htm
Executable file
208
doc/salome/gui/SMESH/smesh_py_introduction.htm
Executable file
@ -0,0 +1,208 @@
|
||||
<!doctype HTML public "-//W3C//DTD HTML 4.0 Frameset//EN">
|
||||
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>Introduction to MESH module python interface</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 { font-family:'Lucida Console' , monospace; margin-top:0px; margin-bottom:0px; }
|
||||
p.whs4 { margin-top:0px; margin-bottom:0px; }
|
||||
p.whs5 { margin-top:0px; margin-bottom:0px; 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 += "p.whs4 {margin-top:1pt;margin-bottom:1pt; }";
|
||||
strNSS += "p.whs5 {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\nIntroduction to MESH module python interface");
|
||||
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>Introduction to MESH module python interface</h1>
|
||||
|
||||
<p><a href="smeshpy_doc/namespacesmesh.html">Package smesh</a> provides a standard API for meshes creation and edition.
|
||||
<p>Below you can see an example of package <b>smesh</b> usage for 3d mesh generation.
|
||||
<p>
|
||||
<h3><a name=bookmark>Example of 3d mesh generation with NETGEN</a></h3>
|
||||
|
||||
<br>from geompy import *
|
||||
<br>
|
||||
<br>import smesh
|
||||
<br>
|
||||
<br># Geometry
|
||||
<br># ========
|
||||
<br>
|
||||
<br># an assembly of a box, a cylinder and a truncated cone meshed with tetrahedral.
|
||||
<br>
|
||||
<br># Define values
|
||||
<br># -------------
|
||||
<br>
|
||||
<br>name = "ex21_lamp"
|
||||
<br>
|
||||
<br>cote = 60
|
||||
<br>
|
||||
<br>section = 20
|
||||
<br>size = 200
|
||||
<br>
|
||||
<br>radius_1 = 80
|
||||
<br>radius_2 = 40
|
||||
<br>height = 100
|
||||
<br>
|
||||
<br># Build a box
|
||||
<br># -----------
|
||||
<br>
|
||||
<br>box = MakeBox(-cote, -cote, -cote, +cote, +cote, +cote)
|
||||
<br>
|
||||
<br># Build a cylinder
|
||||
<br># ----------------
|
||||
<br>
|
||||
<br>pt1 = MakeVertex(0, 0, cote/3)
|
||||
<br>di1 = MakeVectorDXDYDZ(0, 0, 1)
|
||||
<br>cyl = MakeCylinder(pt1, di1, section, size)
|
||||
<br>
|
||||
<br># Build a truncated cone
|
||||
<br># ----------------------
|
||||
<br>
|
||||
<br>pt2 = MakeVertex(0, 0, size)
|
||||
<br>cone = MakeCone(pt2, di1, radius_1, radius_2, height)
|
||||
<br>
|
||||
<br># Fuse
|
||||
<br># ----
|
||||
<br>
|
||||
<br>box_cyl = MakeFuse(box, cyl)
|
||||
<br>piece = MakeFuse(box_cyl, cone)
|
||||
<br>
|
||||
<br># Add in study
|
||||
<br># ------------
|
||||
<br>
|
||||
<br>addToStudy(piece, name)
|
||||
<br>
|
||||
<br># Create a group of faces
|
||||
<br># -----------------------
|
||||
<br>
|
||||
<br>group = CreateGroup(piece, ShapeType["FACE"])
|
||||
<br>
|
||||
<br>group_name = name + "_grp"
|
||||
<br>addToStudy(group, group_name)
|
||||
<br>group.SetName(group_name)
|
||||
<br>
|
||||
<br># Add faces in the group
|
||||
<br># ----------------------
|
||||
<br>
|
||||
<br>faces = SubShapeAllIDs(piece, ShapeType["FACE"])
|
||||
<br>
|
||||
<br>UnionIDs(group, faces)
|
||||
<br>
|
||||
<br># Create a mesh
|
||||
<br># =============
|
||||
<br>
|
||||
<br># Define a mesh on a geometry
|
||||
<br># ---------------------------
|
||||
<br>
|
||||
<br>tetra = smesh.Mesh(piece, name)
|
||||
<br>
|
||||
<br># Define 1D hypothesis
|
||||
<br># --------------------
|
||||
<br>
|
||||
<br>algo1d = tetra.Segment()
|
||||
<br>algo1d.LocalLength(10)
|
||||
<br>
|
||||
<br># Define 2D hypothesis
|
||||
<br># --------------------
|
||||
<br>
|
||||
<br>algo2d = tetra.Triangle()
|
||||
<br>algo2d.LengthFromEdges()
|
||||
<br>
|
||||
<br># Define 3D hypothesis
|
||||
<br># --------------------
|
||||
<br>
|
||||
<br>algo3d = tetra.Tetrahedron(smesh.NETGEN)
|
||||
<br>algo3d.MaxElementVolume(100)
|
||||
<br>
|
||||
<br># Compute the mesh
|
||||
<br># ----------------
|
||||
<br>
|
||||
<br>tetra.Compute()
|
||||
<br>
|
||||
<br># Create a groupe of faces
|
||||
<br># ------------------------
|
||||
<br>
|
||||
<br>tetra.Group(group)
|
||||
|
||||
<script type="text/javascript" language="javascript1.2">
|
||||
<!--
|
||||
if (window.writeIntopicBar)
|
||||
writeIntopicBar(0);
|
||||
//-->
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -7,6 +7,9 @@
|
||||
<!-- Generated by Doxygen 1.4.6 -->
|
||||
<h1>Package smesh</h1>
|
||||
<p>
|
||||
Python package smesh defines several classes, destined for easy and clear mesh creation and edition.
|
||||
<p class="whs2"><a href="../smesh_py_introduction.htm">Example.</a></p>
|
||||
<p>
|
||||
<table border="0" cellpadding="0" cellspacing="0">
|
||||
<tr><td></td></tr>
|
||||
<tr><td colspan="2"><br><h2>Data Structures</h2></td></tr>
|
||||
|
@ -85,6 +85,9 @@ if (window.writeIntopicBar)
|
||||
|
||||
<h3>Viewing Mesh Infos</h3>
|
||||
|
||||
<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.
|
||||
<br>
|
||||
|
||||
<p class="whs1">import salome</p>
|
||||
|
||||
<p class="whs1">import geompy</p>
|
||||
|
@ -81,6 +81,7 @@
|
||||
aTE(2,0,"Pattern mapping","pattern_mapping.htm");
|
||||
aTE(2,0,"Access to Mesh module functionality from Python (using smesh.py)","smeshpy_doc/namespacesmesh.html");
|
||||
aTE(1,7,"TUI Scripts");
|
||||
aTE(2,0,"Introduction to MESH module python interface","smesh_py_introduction.htm");
|
||||
aTE(2,0,"Creating Meshes","constructing_meshes.htm");
|
||||
aTE(2,0,"Defining Hypotheses","defining_hypotheses_tui.htm");
|
||||
aTE(2,0,"Viewing Meshes","viewing_meshes.htm");
|
||||
|
@ -46,6 +46,7 @@ img {vertial-align:middle;}
|
||||
<nobr><a name="6"></a><a href="whlstt6.htm#6" target="_self" title="closed book"><img src="../whd_toc1.gif" border="0" align="absmiddle"> Grouping elements</a></nobr><br>
|
||||
<nobr><a name="7"></a><a href="whlstt7.htm#7" target="_self" title="closed book"><img src="../whd_toc1.gif" border="0" align="absmiddle"> Modifying meshes</a></nobr><br>
|
||||
<nobr><a name="9"></a><a href="whlstt1.htm#9" target="_self"><img src="../whd_toc2.gif" border="0" align="absmiddle"> TUI Scripts</a></nobr><br>
|
||||
<nobr><a href="../smesh_py_introduction.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Introduction to MESH module python interface</a></nobr><br>
|
||||
<nobr><a href="../constructing_meshes.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Creating Meshes</a></nobr><br>
|
||||
<nobr><a href="../defining_hypotheses_tui.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Defining Hypotheses</a></nobr><br>
|
||||
<nobr><a href="../viewing_meshes.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Viewing Meshes</a></nobr><br>
|
||||
|
@ -80,6 +80,7 @@
|
||||
</book>
|
||||
<item name="Access to Mesh module functionality from Python (using smesh.py)" url="smeshpy_doc/namespacesmesh.html" />
|
||||
<book name="TUI Scripts" >
|
||||
<item name="Introduction to MESH module python interface" url="smesh_py_introduction.htm" />
|
||||
<item name="Creating Meshes" url="constructing_meshes.htm" />
|
||||
<item name="Defining Hypotheses" url="defining_hypotheses_tui.htm" />
|
||||
<item name="Viewing Meshes" url="viewing_meshes.htm" />
|
||||
|
Loading…
Reference in New Issue
Block a user