mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2024-11-15 18:18:35 +05:00
354 lines
7.5 KiB
HTML
Executable File
354 lines
7.5 KiB
HTML
Executable File
<!doctype HTML public "-//W3C//DTD HTML 4.0 Frameset//EN">
|
|
|
|
<html>
|
|
|
|
<head>
|
|
<title>Boolean 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\nBoolean 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>Boolean Operations</h1>
|
|
|
|
<h3><a name=bookmark>Fuse</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">p1 = geompy.MakeVertex(25,
|
|
55, 0)</p>
|
|
|
|
<p class="whs1">p2 = geompy.MakeVertex(
|
|
0, 0, 0)</p>
|
|
|
|
<p class="whs1">v = geompy.MakeVector(p1,
|
|
p2)</p>
|
|
|
|
<p> </p>
|
|
|
|
<p># create a cylinder</p>
|
|
|
|
<p class="whs1">height = 35</p>
|
|
|
|
<p class="whs1">radius1 = 20</p>
|
|
|
|
<p class="whs1">cylinder = geompy.MakeCylinder(p1,
|
|
v, radius1, height)</p>
|
|
|
|
<p> </p>
|
|
|
|
<p># create a sphere</p>
|
|
|
|
<p class="whs1">sphere = geompy.MakeSphereR(40)</p>
|
|
|
|
<p> </p>
|
|
|
|
<p># fuse</p>
|
|
|
|
<p class="whs1">fuse = geompy.MakeFuse(cylinder,
|
|
sphere)</p>
|
|
|
|
<p> </p>
|
|
|
|
<p># add objects in the study</p>
|
|
|
|
<p class="whs1">id_cylinder = geompy.addToStudy(cylinder,
|
|
"Cylinder")</p>
|
|
|
|
<p class="whs1">id_sphere = geompy.addToStudy(sphere,
|
|
"Sphere")</p>
|
|
|
|
<p class="whs1">id_fuse = geompy.addToStudy(fuse,
|
|
"Fuse")</p>
|
|
|
|
<p> </p>
|
|
|
|
<p># display results</p>
|
|
|
|
<p class="whs1">gg.createAndDisplayGO(id_cylinder)</p>
|
|
|
|
<p class="whs1">gg.setDisplayMode(id_cylinder,1)</p>
|
|
|
|
<p class="whs1">gg.createAndDisplayGO(id_sphere)</p>
|
|
|
|
<p class="whs1">gg.setDisplayMode(id_sphere,1)</p>
|
|
|
|
<p class="whs1">gg.createAndDisplayGO(id_fuse)</p>
|
|
|
|
<p><span style="font-family: 'Lucida Console', monospace;">gg.setDisplayMode(id_fuse,1)</span>
|
|
</p>
|
|
|
|
<p> </p>
|
|
|
|
<h3><a name=bookmark1>Common</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">p1 = geompy.MakeVertex(25,
|
|
55, 0)</p>
|
|
|
|
<p class="whs1">p2 = geompy.MakeVertex(
|
|
0, 0, 0)</p>
|
|
|
|
<p class="whs1">v = geompy.MakeVector(p1,
|
|
p2)</p>
|
|
|
|
<p> </p>
|
|
|
|
<p># create a cylinder</p>
|
|
|
|
<p class="whs1">height = 35</p>
|
|
|
|
<p class="whs1">radius1 = 20</p>
|
|
|
|
<p class="whs1">cylinder = geompy.MakeCylinder(p1,
|
|
v, radius1, height)</p>
|
|
|
|
<p> </p>
|
|
|
|
<p># create a sphere</p>
|
|
|
|
<p class="whs1">sphere = geompy.MakeSphereR(40)</p>
|
|
|
|
<p> </p>
|
|
|
|
<p># make common</p>
|
|
|
|
<p class="whs1">common = geompy.MakeCommon(cylinder,
|
|
sphere)</p>
|
|
|
|
<p> </p>
|
|
|
|
<p># add objects in the study</p>
|
|
|
|
<p class="whs1">id_common = geompy.addToStudy(common,
|
|
"Common")</p>
|
|
|
|
<p> </p>
|
|
|
|
<p># display the results</p>
|
|
|
|
<p class="whs1">gg.createAndDisplayGO(id_common)</p>
|
|
|
|
<p class="whs1">gg.setDisplayMode(id_common,1)
|
|
</p>
|
|
|
|
<p class="whs1"> </p>
|
|
|
|
<h3><a name=bookmark2>Cut </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">p1 = geompy.MakeVertex(25,
|
|
55, 0)</p>
|
|
|
|
<p class="whs1">p2 = geompy.MakeVertex(
|
|
0, 0, 0)</p>
|
|
|
|
<p class="whs1">v = geompy.MakeVector(p1,
|
|
p2)</p>
|
|
|
|
<p> </p>
|
|
|
|
<p># create a cylinder</p>
|
|
|
|
<p class="whs1">height = 35</p>
|
|
|
|
<p class="whs1">radius1 = 20</p>
|
|
|
|
<p class="whs1">cylinder = geompy.MakeCylinder(p1,
|
|
v, radius1, height)</p>
|
|
|
|
<p> </p>
|
|
|
|
<p># create a sphere</p>
|
|
|
|
<p class="whs1">sphere = geompy.MakeSphereR(40)</p>
|
|
|
|
<p> </p>
|
|
|
|
<p>#cut</p>
|
|
|
|
<p class="whs1">cut = geompy.MakeCut(cylinder,
|
|
sphere)</p>
|
|
|
|
<p> </p>
|
|
|
|
<p># add objects in the study</p>
|
|
|
|
<p class="whs1">id_cut = geompy.addToStudy(cut,
|
|
"Cut")</p>
|
|
|
|
<p> </p>
|
|
|
|
<p># display the results</p>
|
|
|
|
<p class="whs1">gg.createAndDisplayGO(id_cut)</p>
|
|
|
|
<p><span style="font-family: 'Lucida Console', monospace;">gg.setDisplayMode(id_cut,1)</span>
|
|
</p>
|
|
|
|
<p> </p>
|
|
|
|
<h3><a name=bookmark3>Section</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">p1 = geompy.MakeVertex(25,
|
|
55, 0)</p>
|
|
|
|
<p class="whs1">p2 = geompy.MakeVertex(
|
|
0, 0, 0)</p>
|
|
|
|
<p class="whs1">v = geompy.MakeVector(p1,
|
|
p2)</p>
|
|
|
|
<p> </p>
|
|
|
|
<p># create a cylinder</p>
|
|
|
|
<p class="whs1">height = 35</p>
|
|
|
|
<p class="whs1">radius1 = 20</p>
|
|
|
|
<p class="whs1">cylinder = geompy.MakeCylinder(p1,
|
|
v, radius1, height)</p>
|
|
|
|
<p> </p>
|
|
|
|
<p># create a sphere</p>
|
|
|
|
<p class="whs1">sphere = geompy.MakeSphereR(40)</p>
|
|
|
|
<p> </p>
|
|
|
|
<p># make a section</p>
|
|
|
|
<p class="whs1">section = geompy.MakeSection(cylinder,
|
|
sphere)</p>
|
|
|
|
<p> </p>
|
|
|
|
<p># add objects in the study</p>
|
|
|
|
<p class="whs1">id_section = geompy.addToStudy(section,
|
|
"Section")</p>
|
|
|
|
<p> </p>
|
|
|
|
<p># display the results</p>
|
|
|
|
<p class="whs1">gg.createAndDisplayGO(id_section)</p>
|
|
|
|
<p class="whs1">gg.setDisplayMode(id_section,1)
|
|
</p>
|
|
|
|
<p class="whs1"> </p>
|
|
|
|
<script type="text/javascript" language="javascript1.2">
|
|
<!--
|
|
if (window.writeIntopicBar)
|
|
writeIntopicBar(0);
|
|
//-->
|
|
</script>
|
|
</body>
|
|
</html>
|