mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-12-31 03:40:34 +05:00
759 lines
18 KiB
HTML
Executable File
759 lines
18 KiB
HTML
Executable File
<!doctype HTML public "-//W3C//DTD HTML 4.0 Frameset//EN">
|
|
|
|
<html>
|
|
|
|
<head>
|
|
<title>Transforming Meshes</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">
|
|
<!--
|
|
h3.whs1 { margin-top:0pt; margin-bottom:0pt; }
|
|
h4.whs2 { margin-top:0pt; margin-bottom:0pt; }
|
|
p.whs3 { font-family:'Lucida Console' , monospace; margin-top:0pt; margin-bottom:0pt; }
|
|
p.whs4 { margin-top:0pt; margin-bottom:0pt; font-family:'Lucida Console' , monospace; }
|
|
p.whs5 { margin-top:0pt; margin-bottom:0pt; font-family:'Times New Roman' , serif; }
|
|
p.whs6 { margin-top:0pt; margin-bottom:0pt; }
|
|
-->
|
|
</style><script type="text/javascript" language="JavaScript">
|
|
<!--
|
|
if ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) == 4))
|
|
{
|
|
var strNSS = "<style type='text/css'>";
|
|
strNSS += "h3.whs1 {margin-top:1pt;margin-bottom:1pt; }";
|
|
strNSS += "h4.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 += "p.whs6 {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\nTransforming Meshes");
|
|
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>Transforming Meshes</h1>
|
|
|
|
<h3 class="whs1">Transforming Meshes</h3>
|
|
|
|
<h4 class="whs2"> </h4>
|
|
|
|
<h4 class="whs2"><a name=bookmark>Translation</a></h4>
|
|
|
|
<p class="whs3"> </p>
|
|
|
|
<p class="whs4">import SMESH_mechanic</p>
|
|
|
|
<p class="whs4"> </p>
|
|
|
|
<p class="whs4"><span style="font-family: 'Lucida Console', monospace;">smesh
|
|
= SMESH_mechanic.smesh </span></p>
|
|
|
|
<p class="whs4">mesh = SMESH_mechanic.mesh
|
|
</p>
|
|
|
|
<p class="whs4"> </p>
|
|
|
|
<p class="whs5"># define translation
|
|
vector</p>
|
|
|
|
<p class="whs4"><span style="font-family: 'Lucida Console', monospace;">point
|
|
= smesh.PointStruct(-150., -150., 0.)</span></p>
|
|
|
|
<p class="whs4">vector =smesh.DirStruct(point)
|
|
</p>
|
|
|
|
<p class="whs4"> </p>
|
|
|
|
<p class="whs5"># translate a mesh</p>
|
|
|
|
<p class="whs4">doCopy = 1</p>
|
|
|
|
<p class="whs4"> </p>
|
|
|
|
<p class="whs4">mesh.Translate([],
|
|
vector, doCopy) </p>
|
|
|
|
<p class="whs6"> </p>
|
|
|
|
<h4 class="whs2"><a name=bookmark1>Rotation</a></h4>
|
|
|
|
<p class="whs3"> </p>
|
|
|
|
<p class="whs3">import math</p>
|
|
|
|
<p class="whs3">import SMESH_mechanic</p>
|
|
|
|
<p class="whs3"> </p>
|
|
|
|
<p class="whs3"><span style="font-family: 'Lucida Console', monospace;">smesh
|
|
= SMESH_mechanic.smesh</span></p>
|
|
|
|
<p class="whs3">mesh = SMESH_mechanic.mesh </p>
|
|
|
|
<p class="whs3"> </p>
|
|
|
|
<p class="whs5"># define rotation axis
|
|
and angle</p>
|
|
|
|
<p class="whs3">axisXYZ = smesh.AxisStruct(0., 0., 0.,
|
|
5., 5., 20.)</p>
|
|
|
|
<p class="whs3">angle270 = 1.5 * math.pi</p>
|
|
|
|
<p class="whs3"> </p>
|
|
|
|
<p class="whs5"># rotate a mesh</p>
|
|
|
|
<p class="whs4">mesh.Rotate([],
|
|
axisXYZ, angle270, 1) </p>
|
|
|
|
<p class="whs6"> </p>
|
|
|
|
<h4 class="whs2"><a name=bookmark2>Symmetry</a></h4>
|
|
|
|
<p class="whs3"> </p>
|
|
|
|
<p class="whs3">import math</p>
|
|
|
|
<p class="whs3"> </p>
|
|
|
|
<p class="whs3">import SMESH_mechanic</p>
|
|
|
|
<p class="whs3"> </p>
|
|
|
|
<p class="whs3"><span style="font-family: 'Lucida Console', monospace;">smesh
|
|
= SMESH_mechanic.smesh</span></p>
|
|
|
|
<p class="whs3">mesh = SMESH_mechanic.mesh </p>
|
|
|
|
<p class="whs3"> </p>
|
|
|
|
<p class="whs5"># create a symmetrical
|
|
copy of the mesh mirrored through a point</p>
|
|
|
|
<p class="whs3">axis = SMESH.AxisStruct(0, 0, 0, 0, 0,
|
|
0)</p>
|
|
|
|
<p class="whs3"> </p>
|
|
|
|
<p class="whs3">mesh.Mirror([], axis, smesh.POINT, 1)
|
|
</p>
|
|
|
|
<p class="whs6"> </p>
|
|
|
|
<h4 class="whs2"><a name=bookmark3>Merging
|
|
Nodes</a></h4>
|
|
|
|
<p class="whs3"> </p>
|
|
|
|
<p class="whs4">import SMESH_mechanic</p>
|
|
|
|
<p class="whs4">mesh = SMESH_mechanic.mesh</p>
|
|
|
|
<p class="whs4"> </p>
|
|
|
|
<p class="whs5"># merge nodes</p>
|
|
|
|
<p class="whs4">Tolerance = 25.0</p>
|
|
|
|
<p class="whs4"> </p>
|
|
|
|
<p class="whs4">GroupsOfNodes =
|
|
mesh.FindCoincidentNodes(Tolerance)</p>
|
|
|
|
<p class="whs4">mesh.MergeNodes(GroupsOfNodes)
|
|
</p>
|
|
|
|
<p class="whs6"> </p>
|
|
|
|
<h4><a name=bookmark8>Merging Elements</a></h4>
|
|
|
|
<p class="whs4">import salome</p>
|
|
|
|
<p class="whs4">import geompy</p>
|
|
|
|
<p class="whs4">import smesh</p>
|
|
|
|
<p class="whs4"> </p>
|
|
|
|
<p class="whs5"># create a face to
|
|
be meshed</p>
|
|
|
|
<p class="whs4">px = geompy.MakeVertex(100.,
|
|
0. , 0.
|
|
)</p>
|
|
|
|
<p class="whs4">py = geompy.MakeVertex(0.
|
|
, 100.,
|
|
0. )</p>
|
|
|
|
<p class="whs4">pz = geompy.MakeVertex(0.
|
|
, 0. ,
|
|
100.)</p>
|
|
|
|
<p class="whs4"> </p>
|
|
|
|
<p class="whs4">vxy = geompy.MakeVector(px,
|
|
py)</p>
|
|
|
|
<p class="whs4">arc = geompy.MakeArc(py,
|
|
pz, px)</p>
|
|
|
|
<p class="whs4"> </p>
|
|
|
|
<p class="whs4">wire = geompy.MakeWire([vxy,
|
|
arc])</p>
|
|
|
|
<p class="whs4">isPlanarFace = 1</p>
|
|
|
|
<p class="whs4"> </p>
|
|
|
|
<p class="whs4">face1 = geompy.MakeFace(wire,
|
|
isPlanarFace)</p>
|
|
|
|
<p class="whs4">id_face1 = geompy.addToStudy(face1,
|
|
"Face1")</p>
|
|
|
|
<p class="whs4"> </p>
|
|
|
|
<p class="whs5"># create a circle to
|
|
be an extrusion path</p>
|
|
|
|
<p class="whs4">px1 = geompy.MakeVertex(
|
|
100., 100.,
|
|
0.)</p>
|
|
|
|
<p class="whs4">py1 = geompy.MakeVertex(-100.,
|
|
-100., 0.)</p>
|
|
|
|
<p class="whs4">pz1 = geompy.MakeVertex(
|
|
0.,
|
|
0.,
|
|
50.)</p>
|
|
|
|
<p class="whs4"> </p>
|
|
|
|
<p class="whs4">circle = geompy.MakeCircleThreePnt(py1,
|
|
pz1, px1)</p>
|
|
|
|
<p class="whs4">id_circle = geompy.addToStudy(circle,
|
|
"Path")</p>
|
|
|
|
<p class="whs4"> </p>
|
|
|
|
<p class="whs5"># create a 2D mesh
|
|
on the face</p>
|
|
|
|
<p class="whs4">trias = smesh.Mesh(face1,
|
|
"Face : 2D mesh")</p>
|
|
|
|
<p class="whs4"> </p>
|
|
|
|
<p class="whs4">algo1D = trias.Segment()</p>
|
|
|
|
<p class="whs4">algo1D.NumberOfSegments(6)</p>
|
|
|
|
<p class="whs4">algo2D = trias.Triangle()</p>
|
|
|
|
<p class="whs4">algo2D.LengthFromEdges()</p>
|
|
|
|
<p class="whs4"> </p>
|
|
|
|
<p class="whs4">trias.Compute()</p>
|
|
|
|
<p class="whs5"> </p>
|
|
|
|
<p class="whs5"># create a path mesh</p>
|
|
|
|
<p class="whs4">circlemesh = smesh.Mesh(circle,
|
|
"Path mesh")</p>
|
|
|
|
<p class="whs4">algo = circlemesh.Segment()</p>
|
|
|
|
<p class="whs4">algo.NumberOfSegments(10)</p>
|
|
|
|
<p class="whs4">circlemesh.Compute()</p>
|
|
|
|
<p class="whs5"> </p>
|
|
|
|
<p class="whs5"># extrusion of the
|
|
mesh</p>
|
|
|
|
<p class="whs4"><span style="font-family: 'Lucida Console', monospace;">trias.ExtrusionAlongPath([],
|
|
circlemesh, circle,</span></p>
|
|
|
|
<p class="whs4"> 1,
|
|
0, [], 0, smesh.PointStruct(0, 0, 0))</p>
|
|
|
|
<p class="whs4"> </p>
|
|
|
|
<p class="whs5"># merge nodes</p>
|
|
|
|
<p class="whs4">print "Number
|
|
of nodes before MergeNodes:", </p>
|
|
|
|
<p class="whs4">trias.NbNodes()</p>
|
|
|
|
<p class="whs4">tolerance = 0.001</p>
|
|
|
|
<p class="whs4">array_of_nodes_groups
|
|
= trias.FindCoincidentNodes(tolerance)</p>
|
|
|
|
<p class="whs4"> </p>
|
|
|
|
<p class="whs4">trias.MergeNodes(array_of_nodes_groups)</p>
|
|
|
|
<p class="whs4"> </p>
|
|
|
|
<p class="whs4">print "Number
|
|
of nodes after MergeNodes:", trias.NbNodes()</p>
|
|
|
|
<p class="whs4">print ""</p>
|
|
|
|
<p class="whs4">print "Number
|
|
of elements before MergeEqualElements:"</p>
|
|
|
|
<p class="whs4">print "Edges
|
|
:
|
|
", trias.NbEdges()</p>
|
|
|
|
<p class="whs4">print "Triangles
|
|
: ",
|
|
trias.NbTriangles()</p>
|
|
|
|
<p class="whs4">print "Quadrangles:
|
|
", trias.NbQuadrangles()</p>
|
|
|
|
<p class="whs4">print "Volumes
|
|
:
|
|
", trias.NbVolumes()</p>
|
|
|
|
<p class="whs4"> </p>
|
|
|
|
<p class="whs5"># merge elements</p>
|
|
|
|
<p class="whs4">trias.MergeEqualElements()</p>
|
|
|
|
<p class="whs4">print "Number
|
|
of elements after MergeEqualElements:"</p>
|
|
|
|
<p class="whs4">print "Edges
|
|
:
|
|
", trias.NbEdges()</p>
|
|
|
|
<p class="whs4">print "Triangles
|
|
: ",
|
|
trias.NbTriangles()</p>
|
|
|
|
<p class="whs4">print "Quadrangles:
|
|
", trias.NbQuadrangles()</p>
|
|
|
|
<p class="whs4">print "Volumes
|
|
:
|
|
", trias.NbVolumes()</p>
|
|
|
|
<p class="whs4"> </p>
|
|
|
|
<p class="whs4">salome.sg.updateObjBrowser(1)
|
|
</p>
|
|
|
|
<p class="whs4"> </p>
|
|
|
|
<h3>Sewing Meshes</h3>
|
|
|
|
<h4><a name=bookmark4>Sew Meshes Border to Border</a></h4>
|
|
|
|
<p class="whs4">import geompy</p>
|
|
|
|
<p class="whs4">import smesh</p>
|
|
|
|
<p class="whs4"> </p>
|
|
|
|
<p class="whs5"># create two faces
|
|
of a box</p>
|
|
|
|
<p class="whs4">box1 = geompy.MakeBox(0.,
|
|
0., -10., 30., 20., 25.)</p>
|
|
|
|
<p class="whs4">facesList1 = geompy.SubShapeAll(box1,
|
|
geompy.ShapeType["FACE"])</p>
|
|
|
|
<p class="whs4">face1 = facesList1[2]</p>
|
|
|
|
<p class="whs4"> </p>
|
|
|
|
<p class="whs4">box2 = geompy.MakeBox(0.,
|
|
5., 0., 20., 20., 15.)</p>
|
|
|
|
<p class="whs4">facesList2 = geompy.SubShapeAll(box2,
|
|
geompy.ShapeType["FACE"])</p>
|
|
|
|
<p class="whs4">face2 = facesList2[1]</p>
|
|
|
|
<p class="whs4"> </p>
|
|
|
|
<p class="whs4">edgesList = geompy.SubShapeAll(face2,
|
|
geompy.ShapeType["EDGE"])</p>
|
|
|
|
<p class="whs4">edge1 = edgesList[2]</p>
|
|
|
|
<p class="whs4"> </p>
|
|
|
|
<p class="whs4">aComp = geompy.MakeCompound([face1,
|
|
face2])</p>
|
|
|
|
<p class="whs4">geompy.addToStudy(aComp,
|
|
"Two faces")</p>
|
|
|
|
<p class="whs4"> </p>
|
|
|
|
<p class="whs5"># create a mesh on
|
|
two faces</p>
|
|
|
|
<p class="whs4">mesh = smesh.Mesh(aComp,
|
|
"Two faces : quadrangle mesh")</p>
|
|
|
|
<p class="whs4"> </p>
|
|
|
|
<p class="whs4">algo1D = mesh.Segment()</p>
|
|
|
|
<p class="whs4">algo1D.NumberOfSegments(9)</p>
|
|
|
|
<p class="whs4">algo2D = mesh.Quadrangle()</p>
|
|
|
|
<p class="whs4"> </p>
|
|
|
|
<p class="whs4">algo_local = mesh.Segment(edge1)</p>
|
|
|
|
<p class="whs4">algo_local.Arithmetic1D(1,
|
|
4)</p>
|
|
|
|
<p class="whs4">algo_local.Propagation()</p>
|
|
|
|
<p class="whs4"> </p>
|
|
|
|
<p class="whs4">mesh.Compute()</p>
|
|
|
|
<p class="whs4"> </p>
|
|
|
|
<p class="whs5"># sew border to side</p>
|
|
|
|
<p class="whs5"># FirstNodeIDOnFreeBorder,
|
|
SecondNodeIDOnFreeBorder, LastNodeIDOnFreeBorder,</p>
|
|
|
|
<p class="whs5"># FirstNodeIDOnSide,
|
|
LastNodeIDOnSide,</p>
|
|
|
|
<p class="whs5"># CreatePolygons, CreatePolyedrs</p>
|
|
|
|
<p class="whs4">mesh.SewBorderToSide(5,
|
|
45, 6, 113, 109, 0, 0) </p>
|
|
|
|
<h4><a name=bookmark5>Sew Conform Free Borders</a></h4>
|
|
|
|
<p class="whs4">import geompy</p>
|
|
|
|
<p class="whs4">import smesh</p>
|
|
|
|
<p class="whs4"> </p>
|
|
|
|
<p class="whs5"># create two faces
|
|
of the box</p>
|
|
|
|
<p class="whs4">box1 = geompy.MakeBox(0.,
|
|
0., -10., 20., 20., 15.)</p>
|
|
|
|
<p class="whs4">facesList1 = geompy.SubShapeAll(box1,
|
|
geompy.ShapeType["FACE"])</p>
|
|
|
|
<p class="whs4">face1 = facesList1[2]</p>
|
|
|
|
<p class="whs4"> </p>
|
|
|
|
<p class="whs4">box2 = geompy.MakeBox(0.,
|
|
5., 0., 20., 20., 15.)</p>
|
|
|
|
<p class="whs4">facesList2 = geompy.SubShapeAll(box2,
|
|
geompy.ShapeType["FACE"])</p>
|
|
|
|
<p class="whs4">face2 = facesList2[1]</p>
|
|
|
|
<p class="whs4"> </p>
|
|
|
|
<p class="whs4">edgesList = geompy.SubShapeAll(face2,
|
|
geompy.ShapeType["EDGE"])</p>
|
|
|
|
<p class="whs4">edge1 = edgesList[2]</p>
|
|
|
|
<p class="whs4"> </p>
|
|
|
|
<p class="whs4">aComp = geompy.MakeCompound([face1,
|
|
face2])</p>
|
|
|
|
<p class="whs4">geompy.addToStudy(aComp,
|
|
"Two faces")</p>
|
|
|
|
<p class="whs4"> </p>
|
|
|
|
<p class="whs5"># create a mesh on
|
|
two faces</p>
|
|
|
|
<p class="whs4">mesh = smesh.Mesh(aComp,
|
|
"Two faces : quadrangle mesh")</p>
|
|
|
|
<p class="whs4"> </p>
|
|
|
|
<p class="whs4">algo1D = mesh.Segment()</p>
|
|
|
|
<p class="whs4">algo1D.NumberOfSegments(9)</p>
|
|
|
|
<p class="whs4">algo2D = mesh.Quadrangle()</p>
|
|
|
|
<p class="whs4"> </p>
|
|
|
|
<p class="whs4">algo_local = mesh.Segment(edge1)</p>
|
|
|
|
<p class="whs4">algo_local.Arithmetic1D(1,
|
|
4)</p>
|
|
|
|
<p class="whs4">algo_local.Propagation()</p>
|
|
|
|
<p class="whs4"> </p>
|
|
|
|
<p class="whs4">mesh.Compute()</p>
|
|
|
|
<p class="whs4"> </p>
|
|
|
|
<p class="whs5"># sew conform free
|
|
borders</p>
|
|
|
|
<p class="whs5"># FirstNodeID1, SecondNodeID1,
|
|
LastNodeID1, FirstNodeID2, SecondNodeID2</p>
|
|
|
|
<p class="whs4">mesh.SewConformFreeBorders(5,
|
|
45, 6, 3, 24) </p>
|
|
|
|
<h4><a name=bookmark6>Sew Free Borders</a></h4>
|
|
|
|
<p class="whs4">import geompy</p>
|
|
|
|
<p class="whs4">import smesh</p>
|
|
|
|
<p class="whs4"> </p>
|
|
|
|
<p class="whs5"># create two faces
|
|
of the box</p>
|
|
|
|
<p class="whs4">box1 = geompy.MakeBox(0.,
|
|
0., 0., 20., 20., 15.)</p>
|
|
|
|
<p class="whs4">facesList1 = geompy.SubShapeAll(box1,
|
|
geompy.ShapeType["FACE"])</p>
|
|
|
|
<p class="whs4">face1 = facesList1[2]</p>
|
|
|
|
<p class="whs4"> </p>
|
|
|
|
<p class="whs4">box2 = geompy.MakeBox(0.,
|
|
5., 0., 20., 20., 15.)</p>
|
|
|
|
<p class="whs4">facesList2 = geompy.SubShapeAll(box2,
|
|
geompy.ShapeType["FACE"])</p>
|
|
|
|
<p class="whs4">face2 = facesList2[1]</p>
|
|
|
|
<p class="whs4"> </p>
|
|
|
|
<p class="whs4">edgesList = geompy.SubShapeAll(face2,
|
|
geompy.ShapeType["EDGE"])</p>
|
|
|
|
<p class="whs4">edge1 = edgesList[2]</p>
|
|
|
|
<p class="whs4"> </p>
|
|
|
|
<p class="whs4">aComp = geompy.MakeCompound([face1,
|
|
face2])</p>
|
|
|
|
<p class="whs4">geompy.addToStudy(aComp,
|
|
"Two faces")</p>
|
|
|
|
<p class="whs4"> </p>
|
|
|
|
<p class="whs5"># create a mesh on
|
|
two faces</p>
|
|
|
|
<p class="whs4">mesh = smesh.Mesh(aComp,
|
|
"Two faces : quadrangle mesh")</p>
|
|
|
|
<p class="whs4"> </p>
|
|
|
|
<p class="whs4">algo1D = mesh.Segment()</p>
|
|
|
|
<p class="whs4">algo1D.NumberOfSegments(4)</p>
|
|
|
|
<p class="whs4">algo2D = mesh.Quadrangle()</p>
|
|
|
|
<p class="whs4"> </p>
|
|
|
|
<p class="whs4">algo_local = mesh.Segment(edge1)</p>
|
|
|
|
<p class="whs4">algo_local.Arithmetic1D(1,
|
|
4)</p>
|
|
|
|
<p class="whs4">algo_local.Propagation()</p>
|
|
|
|
<p class="whs4"> </p>
|
|
|
|
<p class="whs4">mesh.Compute()</p>
|
|
|
|
<p class="whs4"> </p>
|
|
|
|
<p class="whs5"># sew free borders</p>
|
|
|
|
<p class="whs5"># FirstNodeID1, SecondNodeID1,
|
|
LastNodeID1,</p>
|
|
|
|
<p class="whs5"># FirstNodeID2, SecondNodeID2,
|
|
LastNodeID2, CreatePolygons, CreatePolyedrs</p>
|
|
|
|
<p class="whs6">mesh.SewFreeBorders(6,
|
|
21, 5, 1, 12, 3, 0, 0) </p>
|
|
|
|
<h4><a name=bookmark7>Sew Side Elements</a></h4>
|
|
|
|
<p class="whs4">import geompy</p>
|
|
|
|
<p class="whs4">import smesh</p>
|
|
|
|
<p class="whs4"> </p>
|
|
|
|
<p class="whs5"># create two boxes</p>
|
|
|
|
<p class="whs4">box1 = geompy.MakeBox(0.,
|
|
0., 0.,
|
|
10., 10., 10.)</p>
|
|
|
|
<p class="whs4">box2 = geompy.MakeBox(0.,
|
|
15., 0., 20., 25., 10.)</p>
|
|
|
|
<p class="whs4"> </p>
|
|
|
|
<p class="whs4">EdgesList = geompy.SubShapeAll(box2,
|
|
geompy.ShapeType["EDGE"])</p>
|
|
|
|
<p class="whs4"> </p>
|
|
|
|
<p class="whs4">aComp = geompy.MakeCompound([box1,
|
|
box2])</p>
|
|
|
|
<p class="whs4">geompy.addToStudy(aComp,
|
|
"Two boxes")</p>
|
|
|
|
<p class="whs4"> </p>
|
|
|
|
<p class="whs5"># create a mesh on
|
|
two boxes</p>
|
|
|
|
<p class="whs4">mesh = smesh.Mesh(aComp,
|
|
"Two faces : quadrangle mesh")</p>
|
|
|
|
<p class="whs4"> </p>
|
|
|
|
<p class="whs4">algo1D = mesh.Segment()</p>
|
|
|
|
<p class="whs4">algo1D.NumberOfSegments(2)</p>
|
|
|
|
<p class="whs4">algo2D = mesh.Quadrangle()</p>
|
|
|
|
<p class="whs4"> </p>
|
|
|
|
<p class="whs4">algo_local = mesh.Segment(EdgesList[8])</p>
|
|
|
|
<p class="whs4">algo_local.NumberOfSegments(4)</p>
|
|
|
|
<p class="whs4">algo_local.Propagation()</p>
|
|
|
|
<p class="whs4"> </p>
|
|
|
|
<p class="whs4">mesh.Compute()</p>
|
|
|
|
<p class="whs4"> </p>
|
|
|
|
<p class="whs5"># sew side elements</p>
|
|
|
|
<p class="whs5"># IDsOfSide1Elements,
|
|
IDsOfSide2Elements,</p>
|
|
|
|
<p class="whs5"># NodeID1OfSide1ToMerge,
|
|
NodeID1OfSide2ToMerge, NodeID2OfSide1ToMerge, NodeID2OfSide2ToMerge</p>
|
|
|
|
<p class="whs4">mesh.SewSideElements([69,
|
|
70, 71, 72], [91, 92, 89, 90], 8, 38, 23, 58) </p>
|
|
|
|
<script type="text/javascript" language="javascript1.2">
|
|
<!--
|
|
if (window.writeIntopicBar)
|
|
writeIntopicBar(0);
|
|
//-->
|
|
</script>
|
|
</body>
|
|
</html>
|