mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2024-11-15 18:18:35 +05:00
356 lines
8.6 KiB
HTML
Executable File
356 lines
8.6 KiB
HTML
Executable File
<!doctype HTML public "-//W3C//DTD HTML 4.0 Frameset//EN">
|
|
|
|
<html>
|
|
|
|
<head>
|
|
<title>Building by Blocks</title>
|
|
<meta http-equiv="content-type" content="text/html; charset=windows-1252">
|
|
<meta name="generator" content="RoboHelp by eHelp Corporation www.ehelp.com">
|
|
<link rel="stylesheet" href="default_ns.css"><script type="text/javascript" language="JavaScript" title="WebHelpSplitCss">
|
|
<!--
|
|
if (navigator.appName !="Netscape")
|
|
{ document.write("<link rel='stylesheet' href='default.css'>");}
|
|
//-->
|
|
</script>
|
|
<style type="text/css">
|
|
<!--
|
|
p.whs1 { font-family:'Lucida Console' , monospace; }
|
|
p.whs2 { font-family:'Times New Roman' , serif; }
|
|
-->
|
|
</style><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("Geometry module\nTUI Scripts\nCreating Geometric Objects\nBuilding by Blocks");
|
|
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>Building by Blocks</h1>
|
|
|
|
<h3>Quadrangle Face</h3>
|
|
|
|
<p class="whs1">import geompy</p>
|
|
|
|
<p class="whs1">import salome</p>
|
|
|
|
<p class="whs1">gg = salome.ImportComponentGUI("GEOM")</p>
|
|
|
|
<p> </p>
|
|
|
|
<p># create vertices</p>
|
|
|
|
<p class="whs1">p1 = geompy.MakeVertex(
|
|
0., 0.,
|
|
0.)</p>
|
|
|
|
<p class="whs1">p2 = geompy.MakeVertex(150.,
|
|
30., 0.)</p>
|
|
|
|
<p class="whs1">p3 = geompy.MakeVertex(
|
|
0., 120.,
|
|
50.)</p>
|
|
|
|
<p class="whs1">p4 = geompy.MakeVertex(
|
|
0., 40.,
|
|
70.)</p>
|
|
|
|
<p> </p>
|
|
|
|
<p># create edges</p>
|
|
|
|
<p class="whs1">edge1 = geompy.MakeEdge(p1,
|
|
p2)</p>
|
|
|
|
<p class="whs1">edge2 = geompy.MakeEdge(p2,
|
|
p3)</p>
|
|
|
|
<p class="whs1">edge3 = geompy.MakeEdge(p3,
|
|
p4)</p>
|
|
|
|
<p class="whs1">edge4 = geompy.MakeEdge(p4,
|
|
p1)</p>
|
|
|
|
<p> </p>
|
|
|
|
<p># create a quadrangle face from four edges</p>
|
|
|
|
<p class="whs1">qface1 = geompy.MakeQuad(edge1,
|
|
edge2, edge3, edge4)</p>
|
|
|
|
<p> </p>
|
|
|
|
<p># create a quadrangle face from two edges</p>
|
|
|
|
<p class="whs1">qface2 = geompy.MakeQuad2Edges(edge1,
|
|
edge3)</p>
|
|
|
|
<p> </p>
|
|
|
|
<p># create a quadrangle from four points in its corners</p>
|
|
|
|
<p class="whs1">qface3 = geompy.MakeQuad4Vertices(p1,
|
|
p2, p3, p4)</p>
|
|
|
|
<p> </p>
|
|
|
|
<p># add objects in the study</p>
|
|
|
|
<p class="whs1">id_p1 = geompy.addToStudy(p1,"Point1")</p>
|
|
|
|
<p class="whs1">id_p2 = geompy.addToStudy(p2,"Point2")</p>
|
|
|
|
<p class="whs1">id_p3 = geompy.addToStudy(p3,"Point3")</p>
|
|
|
|
<p class="whs1">id_p4 = geompy.addToStudy(p4,"Point4")</p>
|
|
|
|
<p class="whs1">id_edge1 = geompy.addToStudy(edge1,"Edge1")</p>
|
|
|
|
<p class="whs1">id_edge2 = geompy.addToStudy(edge2,"Edge2")</p>
|
|
|
|
<p class="whs1">id_edge3 = geompy.addToStudy(edge3,"Edge3")</p>
|
|
|
|
<p class="whs1">id_edge4 = geompy.addToStudy(edge4,"Edge4")</p>
|
|
|
|
<p class="whs1">id_qface1 = geompy.addToStudy(qface1,"Qface1")</p>
|
|
|
|
<p class="whs1">id_qface2 = geompy.addToStudy(qface2,"Qface2")</p>
|
|
|
|
<p class="whs1">id_qface3 = geompy.addToStudy(qface3,"Qface3")</p>
|
|
|
|
<p> </p>
|
|
|
|
<p># display the vertices, the edges and the quadrangle faces</p>
|
|
|
|
<p class="whs1">gg.createAndDisplayGO(id_p1)</p>
|
|
|
|
<p class="whs1">gg.createAndDisplayGO(id_p2)</p>
|
|
|
|
<p class="whs1">gg.createAndDisplayGO(id_p3)</p>
|
|
|
|
<p class="whs1">gg.createAndDisplayGO(id_p4)</p>
|
|
|
|
<p class="whs1">gg.createAndDisplayGO(id_edge1)</p>
|
|
|
|
<p class="whs1">gg.createAndDisplayGO(id_edge2)</p>
|
|
|
|
<p class="whs1">gg.createAndDisplayGO(id_edge3)</p>
|
|
|
|
<p class="whs1">gg.createAndDisplayGO(id_edge4)</p>
|
|
|
|
<p class="whs1">gg.createAndDisplayGO(id_qface1)</p>
|
|
|
|
<p class="whs1">gg.setDisplayMode(id_qface1,1)</p>
|
|
|
|
<p class="whs1">gg.createAndDisplayGO(id_qface2)</p>
|
|
|
|
<p class="whs1">gg.setDisplayMode(id_qface2,1)</p>
|
|
|
|
<p class="whs1">gg.createAndDisplayGO(id_qface3)</p>
|
|
|
|
<p><span style="font-family: 'Lucida Console', monospace;">gg.setDisplayMode(id_qface3,1)</span>
|
|
</p>
|
|
|
|
<h3>Hexagonal Solid</h3>
|
|
|
|
<p class="whs1">import geompy</p>
|
|
|
|
<p class="whs1">import salome</p>
|
|
|
|
<p class="whs1">gg = salome.ImportComponentGUI("GEOM")</p>
|
|
|
|
<p class="whs1"> </p>
|
|
|
|
<p class="whs2"># create vertices</p>
|
|
|
|
<p class="whs1">p0 =
|
|
geompy.MakeVertex( 0.,
|
|
0.,
|
|
0.)</p>
|
|
|
|
<p class="whs1">p1 =
|
|
geompy.MakeVertex( 0.,
|
|
0.,
|
|
40.)</p>
|
|
|
|
<p class="whs1">p2 =
|
|
geompy.MakeVertex( 70., -15., 0.)</p>
|
|
|
|
<p class="whs1">p3 =
|
|
geompy.MakeVertex( 70., -15., 70.)</p>
|
|
|
|
<p class="whs1"> </p>
|
|
|
|
<p class="whs1">p4 =
|
|
geompy.MakeVertex( 0.,
|
|
70., 0.)</p>
|
|
|
|
<p class="whs1">p5 =
|
|
geompy.MakeVertex( 0.,
|
|
70., 40.)</p>
|
|
|
|
<p class="whs1">p6 =
|
|
geompy.MakeVertex( 70., 70.,
|
|
0.)</p>
|
|
|
|
<p class="whs1">p7 =
|
|
geompy.MakeVertex( 70., 70.,
|
|
70.)</p>
|
|
|
|
<p class="whs1"> </p>
|
|
|
|
<p class="whs1">p8 =
|
|
geompy.MakeVertex( 0.,
|
|
-50., 0.)</p>
|
|
|
|
<p class="whs1">p9 =
|
|
geompy.MakeVertex( 0.,
|
|
-50., 40.)</p>
|
|
|
|
<p class="whs1">p10 = geompy.MakeVertex(
|
|
70., -35., 0.)</p>
|
|
|
|
<p class="whs1">p11 = geompy.MakeVertex(
|
|
70., -35., 70.)</p>
|
|
|
|
<p class="whs1"> </p>
|
|
|
|
<p class="whs2"># create faces</p>
|
|
|
|
<p class="whs1">qface1 = geompy.MakeQuad4Vertices(p0,
|
|
p1, p2, p3)</p>
|
|
|
|
<p class="whs1">qface2 = geompy.MakeQuad4Vertices(p4,
|
|
p5, p6, p7)</p>
|
|
|
|
<p class="whs1">qface3 = geompy.MakeQuad4Vertices(p0,
|
|
p1, p4, p5)</p>
|
|
|
|
<p class="whs1">qface4 = geompy.MakeQuad4Vertices(p2,
|
|
p3, p6, p7)</p>
|
|
|
|
<p class="whs1">qface5 = geompy.MakeQuad4Vertices(p0,
|
|
p2, p4, p6)</p>
|
|
|
|
<p class="whs1">qface6 = geompy.MakeQuad4Vertices(p1,
|
|
p3, p5, p7)</p>
|
|
|
|
<p class="whs1"> </p>
|
|
|
|
<p class="whs1">qface7 = geompy.MakeQuad4Vertices(p8,
|
|
p9, p10, p11)</p>
|
|
|
|
<p class="whs1"> </p>
|
|
|
|
<p class="whs2"># create a hexahedral
|
|
solid between two given faces</p>
|
|
|
|
<p class="whs1">solid1 = geompy.MakeHexa2Faces(qface1,
|
|
qface7)</p>
|
|
|
|
<p class="whs1"> </p>
|
|
|
|
<p class="whs2"># create a hexahedral
|
|
solid, bounded by six given faces</p>
|
|
|
|
<p class="whs1">solid2 = geompy.MakeHexa(qface1,
|
|
qface2, qface3, qface4, qface5, qface6)</p>
|
|
|
|
<p class="whs1"> </p>
|
|
|
|
<p class="whs2"># add objects in the
|
|
study</p>
|
|
|
|
<p class="whs1">geompy.addToStudy(qface1,"qface1")</p>
|
|
|
|
<p class="whs1">geompy.addToStudy(qface2,"qface2")</p>
|
|
|
|
<p class="whs1">geompy.addToStudy(qface3,"qface3")</p>
|
|
|
|
<p class="whs1">geompy.addToStudy(qface4,"qface4")</p>
|
|
|
|
<p class="whs1">geompy.addToStudy(qface5,"qface5")</p>
|
|
|
|
<p class="whs1">geompy.addToStudy(qface6,"qface6")</p>
|
|
|
|
<p class="whs1">geompy.addToStudy(qface7,"qface7")</p>
|
|
|
|
<p class="whs1"> </p>
|
|
|
|
<p class="whs1">id_solid1 = geompy.addToStudy(solid1,"Solid1")</p>
|
|
|
|
<p class="whs1">id_solid2 = geompy.addToStudy(solid2,"Solid2")</p>
|
|
|
|
<p class="whs1"> </p>
|
|
|
|
<p class="whs2"># display solids</p>
|
|
|
|
<p class="whs1">gg.createAndDisplayGO(id_solid1)</p>
|
|
|
|
<p class="whs1">gg.setDisplayMode(id_solid1,
|
|
1)</p>
|
|
|
|
<p class="whs1">gg.createAndDisplayGO(id_solid2)</p>
|
|
|
|
<p><span style="font-family: 'Lucida Console', monospace;">gg.setDisplayMode(id_solid2,
|
|
1)</span> </p>
|
|
|
|
<script type="text/javascript" language="javascript1.2">
|
|
<!--
|
|
if (window.writeIntopicBar)
|
|
writeIntopicBar(0);
|
|
//-->
|
|
</script>
|
|
</body>
|
|
</html>
|