mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2024-11-16 02:28:35 +05:00
249 lines
6.1 KiB
HTML
Executable File
249 lines
6.1 KiB
HTML
Executable File
<!doctype HTML public "-//W3C//DTD HTML 4.0 Frameset//EN">
|
|
|
|
<html>
|
|
|
|
<head>
|
|
<title>Basic Operations</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; }
|
|
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\nTransformation\nBasic Operations");
|
|
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>Basic Operations</h1>
|
|
|
|
<h3><a name=bookmark>Partition</a></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 a vertex and a vector</p>
|
|
|
|
<p class="whs1">p0 =
|
|
geompy.MakeVertex( 0.,
|
|
0.,
|
|
0.)</p>
|
|
|
|
<p class="whs1">p200 = geompy.MakeVertex(200.,
|
|
200., 200.)</p>
|
|
|
|
<p class="whs1">pz =
|
|
geompy.MakeVertex( 0.,
|
|
0.,
|
|
100.)</p>
|
|
|
|
<p> </p>
|
|
|
|
<p># create a vector</p>
|
|
|
|
<p class="whs1">vxyz = geompy.MakeVectorDXDYDZ(100.,
|
|
100., 100.)</p>
|
|
|
|
<p> </p>
|
|
|
|
<p># create a box from two points</p>
|
|
|
|
<p class="whs1">box = geompy.MakeBoxTwoPnt(p0,
|
|
p200)</p>
|
|
|
|
<p> </p>
|
|
|
|
<p># create a plane</p>
|
|
|
|
<p class="whs1">trimsize =
|
|
500.</p>
|
|
|
|
<p class="whs1">plane = geompy.MakePlane(pz,
|
|
vxyz, trimsize)</p>
|
|
|
|
<p> </p>
|
|
|
|
<p># create partition objects</p>
|
|
|
|
<p class="whs1">partition1 = geompy.MakePartition([box],
|
|
[plane])</p>
|
|
|
|
<p class="whs1">partition2 = geompy.Partition([box],
|
|
[plane])</p>
|
|
|
|
<p class="whs1">partition3 = geompy.MakeHalfPartition(box,
|
|
plane)</p>
|
|
|
|
<p class="whs1"> </p>
|
|
|
|
<p># add objects in the study</p>
|
|
|
|
<p class="whs1">id_box = geompy.addToStudy(box,"Box")</p>
|
|
|
|
<p class="whs1">id_plane = geompy.addToStudy(plane,"Plane")</p>
|
|
|
|
<p class="whs1">id_partition1 = geompy.addToStudy(partition1,"MakePartition")</p>
|
|
|
|
<p class="whs1">id_partition2 = geompy.addToStudy(partition2,"Partition")</p>
|
|
|
|
<p class="whs1">id_partition3 = geompy.addToStudy(partition3,"MakeHalfPartition")</p>
|
|
|
|
<p> </p>
|
|
|
|
<p># display the partition objects and the plane</p>
|
|
|
|
<p class="whs1">gg.createAndDisplayGO(id_box)</p>
|
|
|
|
<p class="whs1">gg.setDisplayMode(id_box,1)</p>
|
|
|
|
<p class="whs1">gg.createAndDisplayGO(id_plane)</p>
|
|
|
|
<p class="whs1">gg.setDisplayMode(id_plane,1)</p>
|
|
|
|
<p class="whs1">gg.createAndDisplayGO(id_partition1)</p>
|
|
|
|
<p class="whs1">gg.createAndDisplayGO(id_partition2)</p>
|
|
|
|
<p><span style="font-family: 'Lucida Console', monospace;">gg.createAndDisplayGO(id_partition3)</span>
|
|
</p>
|
|
|
|
<h3><a name=bookmark1>Archimede</a></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 a vertex and a vector</p>
|
|
|
|
<p class="whs1">p0 =
|
|
geompy.MakeVertex( 0.,
|
|
0.,
|
|
0.)</p>
|
|
|
|
<p class="whs1">p200 = geompy.MakeVertex(200.,
|
|
200., 200.)</p>
|
|
|
|
<p> </p>
|
|
|
|
<p># create a box from two points</p>
|
|
|
|
<p class="whs1">box = geompy.MakeBoxTwoPnt(p0,
|
|
p200)</p>
|
|
|
|
<p> </p>
|
|
|
|
<p># perform an Archimede operation on the selected shape with selected
|
|
parameters</p>
|
|
|
|
<p class="whs1">weight =
|
|
1000000.</p>
|
|
|
|
<p class="whs1">waterdensity = 1.</p>
|
|
|
|
<p class="whs1">meshingdeflection
|
|
= 0.01</p>
|
|
|
|
<p class="whs1">archimede =
|
|
geompy.Archimede(box, weight, waterdensity, meshingdeflection)</p>
|
|
|
|
<p class="whs1"> </p>
|
|
|
|
<p># add objects in the study</p>
|
|
|
|
<p class="whs1">id_box = geompy.addToStudy(box,"Box")</p>
|
|
|
|
<p class="whs1">id_archimede = geompy.addToStudy(archimede,"Archimede")</p>
|
|
|
|
<p> </p>
|
|
|
|
<p># display the box and the result of Archimede operation</p>
|
|
|
|
<p class="whs1">gg.createAndDisplayGO(id_box)</p>
|
|
|
|
<p class="whs1">gg.setDisplayMode(id_box,1)</p>
|
|
|
|
<p class="whs1">gg.createAndDisplayGO(id_archimede)</p>
|
|
|
|
<p><span style="font-family: 'Lucida Console', monospace;">gg.setDisplayMode(id_archimede,1)</span>
|
|
</p>
|
|
|
|
<p> </p>
|
|
|
|
<script type="text/javascript" language="javascript1.2">
|
|
<!--
|
|
if (window.writeIntopicBar)
|
|
writeIntopicBar(0);
|
|
//-->
|
|
</script>
|
|
</body>
|
|
</html>
|