mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2024-11-15 18:18:35 +05:00
331 lines
8.0 KiB
HTML
Executable File
331 lines
8.0 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; }
|
|
-->
|
|
</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; }
|
|
-->
|
|
</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>
|
|
</head>
|
|
<body><script type="text/javascript" language="javascript1.2">
|
|
<!--
|
|
if (window.gbWhTopic)
|
|
{
|
|
if (window.addTocInfo)
|
|
{
|
|
addTocInfo("GEOM module\nTUI Scripts\nCreation of Geometric Objects\nBuilding by Blocks");
|
|
addButton("show",BTN_TEXT,"Show","","","","",0,0,"","","");
|
|
|
|
}
|
|
if (window.writeBtnStyle)
|
|
writeBtnStyle();
|
|
|
|
if (window.writeIntopicBar)
|
|
writeIntopicBar(1);
|
|
|
|
if (window.setRelStartPage)
|
|
{
|
|
setRelStartPage("geom.htm");
|
|
|
|
autoSync(1);
|
|
sendSyncInfo();
|
|
sendAveInfoOut();
|
|
}
|
|
}
|
|
else
|
|
if (window.gbIE4)
|
|
document.location.reload();
|
|
//-->
|
|
</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 quadrangle face from four edges</p>
|
|
|
|
<p class="whs1">qface1 = geompy.MakeQuad(edge1,
|
|
edge2, edge3, edge4)</p>
|
|
|
|
<p> </p>
|
|
|
|
<p># create quadrangle face on two edges</p>
|
|
|
|
<p class="whs1">qface2 = geompy.MakeQuad2Edges(edge1,
|
|
edge3)</p>
|
|
|
|
<p> </p>
|
|
|
|
<p># create quadrangle with specified corners</p>
|
|
|
|
<p class="whs1">qface3 = geompy.MakeQuad4Vertices(p1,
|
|
p2, p3, p4)</p>
|
|
|
|
<p> </p>
|
|
|
|
<p># add objects in 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 vertices, edges and 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> </h3>
|
|
|
|
<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> </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 class="whs1">p5 = geompy.MakeVertex(100.,
|
|
20., 45.)</p>
|
|
|
|
<p class="whs1">p6 = geompy.MakeVertex(
|
|
0., 70.,
|
|
40.)</p>
|
|
|
|
<p class="whs1">p7 = geompy.MakeVertex(
|
|
70., 70., 70.)</p>
|
|
|
|
<p class="whs1">p8 = geompy.MakeVertex(
|
|
70.,-15., 70.)</p>
|
|
|
|
<p class="whs1">p9 = geompy.MakeVertex(
|
|
0., 0.,
|
|
40.)</p>
|
|
|
|
<p class="whs1">p10 = geompy.MakeVertex(
|
|
0., 70.,
|
|
0.)</p>
|
|
|
|
<p class="whs1">p11 = geompy.MakeVertex(
|
|
70., 70., 0.)</p>
|
|
|
|
<p class="whs1">p12 = geompy.MakeVertex(
|
|
70., -15., 0.)</p>
|
|
|
|
<p class="whs1">p13 = geompy.MakeVertex(
|
|
0., 0.,
|
|
0.)</p>
|
|
|
|
<p> </p>
|
|
|
|
<p># create faces</p>
|
|
|
|
<p class="whs1">qface1 = geompy.MakeQuad4Vertices(p1,
|
|
p2, p3, p4)</p>
|
|
|
|
<p class="whs1">qface2 = geompy.MakeQuad4Vertices(p1,
|
|
p2, p5, p4)</p>
|
|
|
|
<p class="whs1">qface3 = geompy.MakeQuad4Vertices(p13,
|
|
p12, p11, p10)</p>
|
|
|
|
<p class="whs1">qface4 = geompy.MakeQuad4Vertices(p9,
|
|
p8, p7, p6)</p>
|
|
|
|
<p class="whs1">qface5 = geompy.MakeQuad4Vertices(p13,
|
|
p9, p6, p10)</p>
|
|
|
|
<p class="whs1">qface6 = geompy.MakeQuad4Vertices(p13,
|
|
p9, p8, p12)</p>
|
|
|
|
<p class="whs1">qface7 = geompy.MakeQuad4Vertices(p12,
|
|
p8, p7, p11)</p>
|
|
|
|
<p class="whs1">qface8 = geompy.MakeQuad4Vertices(p11,
|
|
p7, p6, p10)</p>
|
|
|
|
<p> </p>
|
|
|
|
<p># create hexahedral solid between two given faces</p>
|
|
|
|
<p class="whs1">solid1 = geompy.MakeHexa2Faces(qface1,
|
|
qface2)</p>
|
|
|
|
<p> </p>
|
|
|
|
<p># create hexahedral solids, bounded by the six given faces</p>
|
|
|
|
<p class="whs1">solid2 = geompy.MakeHexa(qface3,
|
|
qface4, qface5, qface6, qface7, qface8)</p>
|
|
|
|
<p> </p>
|
|
|
|
<p># add objects in study</p>
|
|
|
|
<p class="whs1">id_solid1 = geompy.addToStudy(solid1,"Solid1")</p>
|
|
|
|
<p class="whs1">id_solid2 = geompy.addToStudy(solid2,"Solid2")</p>
|
|
|
|
<p> </p>
|
|
|
|
<p># 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>
|
|
|
|
<p> </p>
|
|
|
|
<script type="text/javascript" language="javascript1.2">
|
|
<!--
|
|
if (window.writeIntopicBar)
|
|
writeIntopicBar(0);
|
|
//-->
|
|
</script>
|
|
</body>
|
|
</html>
|