mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2024-11-16 10:38:34 +05:00
183 lines
5.1 KiB
HTML
Executable File
183 lines
5.1 KiB
HTML
Executable File
<!doctype HTML public "-//W3C//DTD HTML 4.0 Frameset//EN">
|
|
|
|
<html>
|
|
|
|
<head>
|
|
<title>Sketcher</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:'MS Sans Serif' , sans-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\nSketcher");
|
|
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>Sketcher</h1>
|
|
|
|
<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(70.,
|
|
0., 0.)</p>
|
|
|
|
<p class="whs1">p2 = geompy.MakeVertex(70.,
|
|
70., 80.)</p>
|
|
|
|
<p class="whs1">p3 = geompy.MakeVertex(
|
|
0., 70., 0.)</p>
|
|
|
|
<p> </p>
|
|
|
|
<p>#create a vector from two points</p>
|
|
|
|
<p class="whs1">vector_arc = geompy.MakeVector(p1,
|
|
p3)</p>
|
|
|
|
<p> </p>
|
|
|
|
<p># create an arc from three points</p>
|
|
|
|
<p class="whs1">arc = geompy.MakeArc(p1,
|
|
p2, p3)</p>
|
|
|
|
<p> </p>
|
|
|
|
<p># create a wire</p>
|
|
|
|
<p class="whs1">wire = geompy.MakeWire([vector_arc,
|
|
arc])</p>
|
|
|
|
<p> </p>
|
|
|
|
<p># create a planar face</p>
|
|
|
|
<p class="whs1">isPlanarWanted = 1</p>
|
|
|
|
<p class="whs1">face = geompy.MakeFace(wire,
|
|
isPlanarWanted)</p>
|
|
|
|
<p> </p>
|
|
|
|
<p># create a sketcher (face), following the textual description</p>
|
|
|
|
<p class="whs1">sketcher1 = geompy.MakeSketcher("Sketcher:F
|
|
-100 -100:TT 250 -100:R 0:C 100 150:R 0:L 300:WF",</p>
|
|
|
|
<p class="whs1"> [100,0,0,
|
|
1,1,1, -1,1,0])</p>
|
|
|
|
<p> </p>
|
|
|
|
<p># create a sketcher (wire) on the given face</p>
|
|
|
|
<p class="whs1">sketcher2 = geompy.MakeSketcherOnPlane("Sketcher:F
|
|
10 -30:R 10:C 20 180:R 15:L 50:WW",</p>
|
|
|
|
<p class="whs1"> face)</p>
|
|
|
|
<p> </p>
|
|
|
|
<p># add objects in the study</p>
|
|
|
|
<p class="whs2">id_face = geompy.addToStudy(face,"Face")</p>
|
|
|
|
<p class="whs2">id_sketcher1 = geompy.addToStudy(sketcher1,"Sketcher1")</p>
|
|
|
|
<p class="whs2">id_sketcher2 = geompy.addToStudy(sketcher2,"Sketcher2")</p>
|
|
|
|
<p> </p>
|
|
|
|
<p># display the first sketcher and the second sketcher with its planar
|
|
face</p>
|
|
|
|
<p class="whs1">gg.createAndDisplayGO(id_face)</p>
|
|
|
|
<p class="whs1">gg.setDisplayMode(id_face,1)</p>
|
|
|
|
<p class="whs1">gg.setTransparency(id_face,0.5)</p>
|
|
|
|
<p class="whs1">gg.createAndDisplayGO(id_sketcher1)</p>
|
|
|
|
<p><span style="font-family: 'Lucida Console', monospace;">gg.createAndDisplayGO(id_sketcher2)</span>
|
|
</p>
|
|
|
|
<script type="text/javascript" language="javascript1.2">
|
|
<!--
|
|
if (window.writeIntopicBar)
|
|
writeIntopicBar(0);
|
|
//-->
|
|
</script>
|
|
</body>
|
|
</html>
|