PAL12557: Documentation for scripts is not up to date.

This commit is contained in:
jfa 2006-07-14 06:16:22 +00:00
parent 50d053afee
commit c6a0df686b
6 changed files with 278 additions and 208 deletions

View File

@ -15,6 +15,7 @@ if (navigator.appName !="Netscape")
<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">
<!--
@ -79,15 +80,18 @@ if (window.writeIntopicBar)
<h3><a name=bookmark4>Multi Transformation</a></h3>
<p class="whs1">import geompy</p>
<p class="whs1"><span style="font-family: 'Lucida Console', monospace;">import
geompy</span></p>
<p class="whs1">import salome</p>
<p class="whs1">&nbsp;</p>
<p class="whs1">gg = salome.ImportComponentGUI(&quot;GEOM&quot;)</p>
<p>&nbsp;</p>
<p class="whs1">&nbsp;</p>
<p># create vertices</p>
<p class="whs2"># create vertices</p>
<p class="whs1">p_25_25_50 = geompy.MakeVertex(25.,
25., 50.)</p>
@ -98,9 +102,13 @@ if (window.writeIntopicBar)
<p class="whs1">p_25_50_25 = geompy.MakeVertex(25.,
50., 25.)</p>
<p class="whs1">&nbsp;</p>
<p class="whs1">box = geompy.MakeBoxDXDYDZ(50,
50, 50)</p>
<p class="whs1">&nbsp;</p>
<p class="whs1">top_face = geompy.GetFaceNearPoint(box,
p_25_25_50)</p>
@ -110,18 +118,21 @@ if (window.writeIntopicBar)
<p class="whs1">xz_face = geompy.GetFaceNearPoint(box,
p_25_50_25)</p>
<p class="whs1">top_face_ind = geompy.LocalOp.GetSubShapeIndex(box,
<p class="whs1">&nbsp;</p>
<p class="whs1">top_face_ind = geompy.GetSubShapeID(box,
top_face)</p>
<p class="whs1">yz_face_ind = geompy.LocalOp.GetSubShapeIndex(box,
<p class="whs1">yz_face_ind = geompy.GetSubShapeID(box,
yz_face)</p>
<p class="whs1">xz_face_ind = geompy.LocalOp.GetSubShapeIndex(box,
<p class="whs1">xz_face_ind = geompy.GetSubShapeID(box,
xz_face)</p>
<p>&nbsp;</p>
<p class="whs1">&nbsp;</p>
<p># Multi-transformate block and glue the result</p>
<p class="whs2"># Multi-transformate
block and glue the result</p>
<p class="whs1">box_tr1 = geompy.MakeMultiTransformation1D(box,
yz_face_ind, top_face_ind, 3)</p>
@ -129,9 +140,10 @@ if (window.writeIntopicBar)
<p class="whs1">box_tr2 = geompy.MakeMultiTransformation2D(box,
xz_face_ind, yz_face_ind, 3, top_face_ind, 0, 2)</p>
<p>&nbsp;</p>
<p class="whs1">&nbsp;</p>
<p># add objects in the study</p>
<p class="whs2"># add objects in the
study</p>
<p class="whs1">id_box = geompy.addToStudy(box,
&quot;Box&quot;)</p>
@ -142,9 +154,9 @@ if (window.writeIntopicBar)
<p class="whs1">id_box_tr2 = geompy.addToStudy(box_tr2,
&quot;Multi-transformed Block 2D&quot;)</p>
<p>&nbsp;</p>
<p class="whs1">&nbsp;</p>
<p># display the results</p>
<p class="whs2"># display the results</p>
<p class="whs1">gg.createAndDisplayGO(id_box)</p>
@ -152,10 +164,10 @@ if (window.writeIntopicBar)
<p class="whs1">gg.createAndDisplayGO(id_box_tr1)</p>
<p><span style="font-family: 'Lucida Console', monospace;">gg.createAndDisplayGO(id_box_tr2)</span>
<p class="whs1">gg.createAndDisplayGO(id_box_tr2)
</p>
<p>&nbsp;</p>
<p class="whs1">&nbsp;</p>
<h3><a name=bookmark5>Explode on Blocks</a></h3>
@ -163,11 +175,14 @@ if (window.writeIntopicBar)
<p class="whs1">import salome</p>
<p class="whs1">&nbsp;</p>
<p class="whs1">gg = salome.ImportComponentGUI(&quot;GEOM&quot;)</p>
<p>&nbsp;</p>
<p class="whs1">&nbsp;</p>
<p># create a box and a sphere</p>
<p class="whs2"># create a box and a
sphere</p>
<p class="whs1">box = geompy.MakeBoxDXDYDZ(200,
200, 200)</p>
@ -176,31 +191,38 @@ if (window.writeIntopicBar)
<p class="whs1">&nbsp;</p>
<p># make a compound</p>
<p class="whs2"># make a compound</p>
<p class="whs1">compound = geompy.MakeCompound([box,
sphere])</p>
<p>&nbsp;</p>
<p class="whs2">&nbsp;</p>
<p># get all the blocks, contained in the given compound</p>
<p class="whs2"># get all the blocks
of the given compound, by criteria: min_nb_faces &lt;= nb. of faces &lt;=
max_nb_faces</p>
<p class="whs1">min_nb_faces = 6</p>
<p class="whs1">max_nb_faces = 6</p>
<p class="whs1">make_block_explode
= geompy.MakeBlockExplode(compound, 1, 1)</p>
= geompy.MakeBlockExplode(compound, min_nb_faces, max_nb_faces)</p>
<p>&nbsp;</p>
<p class="whs1">&nbsp;</p>
<p># add objects in the study</p>
<p class="whs2"># add objects in the
study</p>
<p class="whs1">id_compound = geompy.addToStudy(compound,
&quot;Compound&quot;)</p>
<p class="whs1">id_make_block_explode
= geompy.addToStudy(make_block_explode[0], &quot;MakeBlockExplode&quot;)</p>
= geompy.addToStudyInFather(compound, make_block_explode[0], &quot;MakeBlockExplode&quot;)</p>
<p>&nbsp;</p>
<p class="whs1">&nbsp;</p>
<p># display the results</p>
<p class="whs2"># display the results</p>
<p class="whs1">gg.createAndDisplayGO(id_compound)</p>
@ -217,42 +239,45 @@ if (window.writeIntopicBar)
<p class="whs1">import salome</p>
<p>&nbsp;</p>
<p class="whs1">&nbsp;</p>
<p># create a box and a sphere</p>
<p class="whs2"># create a box</p>
<p class="whs1">box = geompy.MakeBoxDXDYDZ(200,
200, 200)</p>
<p>&nbsp;</p>
<p class="whs1">&nbsp;</p>
<p># check and improve</p>
<p class="whs1">check_box = geompy.CheckAndImprove(box)</p>
<p>&nbsp;&nbsp;</p>
<p># build all possible propagation groups</p>
<p class="whs2"># build all possible
propagation groups</p>
<p class="whs1">listChains = geompy.Propagate(check_box)</p>
<p>&nbsp;</p>
<p class="whs1">&nbsp;</p>
<p># add objects in the study</p>
<p class="whs2"># add objects in the
study</p>
<p class="whs1">geompy.addToStudy(check_box,
&quot;Box&quot;)</p>
<p class="whs1">ii = 1</p>
<p class="whs1">for chain in listChains:</p>
<p class="whs1">&nbsp;&nbsp;&nbsp;&nbsp;geompy.addToStudyInFather(check_box,
chain, &quot;propagation chain&quot;)</p>
chain, &quot;propagation chain &quot; + `ii`)</p>
<p class="whs1">&nbsp;&nbsp;&nbsp;&nbsp;ii
= ii + 1</p>
<p class="whs1">&nbsp;&nbsp;&nbsp;&nbsp;pass</p>
<p>&nbsp;</p>
<p><span style="font-family: 'Lucida Console', monospace;">salome.sg.updateObjBrowser(1)</span>
</p>
<p>&nbsp;</p>
<script type="text/javascript" language="javascript1.2">
<!--
if (window.writeIntopicBar)

View File

@ -15,6 +15,7 @@ if (navigator.appName !="Netscape")
<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">
<!--
@ -200,8 +201,6 @@ if (window.writeIntopicBar)
<p><span style="font-family: 'Lucida Console', monospace;">gg.setDisplayMode(id_qface3,1)</span>
</p>
<p>&nbsp;</p>
<h3>Hexagonal Solid</h3>
<p class="whs1">import geompy</p>
@ -210,120 +209,141 @@ if (window.writeIntopicBar)
<p class="whs1">gg = salome.ImportComponentGUI(&quot;GEOM&quot;)</p>
<p>&nbsp;</p>
<p class="whs1">&nbsp;</p>
<p># create vertices</p>
<p class="whs2"># create vertices</p>
<p class="whs1">p1 = geompy.MakeVertex(
&nbsp;0., &nbsp;&nbsp;0.,
<p class="whs1">p0 &nbsp;=
geompy.MakeVertex( &nbsp;0.,
&nbsp;&nbsp;0.,
&nbsp;&nbsp;0.)</p>
<p class="whs1">p2 = geompy.MakeVertex(150.,
&nbsp;30., &nbsp;&nbsp;0.)</p>
<p class="whs1">p1 &nbsp;=
geompy.MakeVertex( &nbsp;0.,
&nbsp;&nbsp;0.,
&nbsp;40.)</p>
<p class="whs1">p3 = geompy.MakeVertex(
&nbsp;0., 120.,
&nbsp;50.)</p>
<p class="whs1">p2 &nbsp;=
geompy.MakeVertex( 70., -15., &nbsp;&nbsp;0.)</p>
<p class="whs1">p4 = geompy.MakeVertex(
&nbsp;0., &nbsp;40.,
<p class="whs1">p3 &nbsp;=
geompy.MakeVertex( 70., -15., &nbsp;70.)</p>
<p class="whs1">&nbsp;</p>
<p class="whs1">p4 &nbsp;=
geompy.MakeVertex( &nbsp;0.,
&nbsp;70., &nbsp;&nbsp;0.)</p>
<p class="whs1">p5 &nbsp;=
geompy.MakeVertex( &nbsp;0.,
&nbsp;70., &nbsp;40.)</p>
<p class="whs1">p6 &nbsp;=
geompy.MakeVertex( 70., &nbsp;70.,
&nbsp;&nbsp;0.)</p>
<p class="whs1">p7 &nbsp;=
geompy.MakeVertex( 70., &nbsp;70.,
&nbsp;70.)</p>
<p class="whs1">p5 = geompy.MakeVertex(100.,
&nbsp;20., &nbsp;45.)</p>
<p class="whs1">&nbsp;</p>
<p class="whs1">p6 = geompy.MakeVertex(
&nbsp;0., 70.,
&nbsp;40.)</p>
<p class="whs1">p8 &nbsp;=
geompy.MakeVertex( &nbsp;0.,
-50., &nbsp;&nbsp;0.)</p>
<p class="whs1">p7 = geompy.MakeVertex(
70., 70., &nbsp;70.)</p>
<p class="whs1">p8 = geompy.MakeVertex(
70.,-15., &nbsp;70.)</p>
<p class="whs1">p9 = geompy.MakeVertex(
&nbsp;0., &nbsp;0.,
&nbsp;40.)</p>
<p class="whs1">p9 &nbsp;=
geompy.MakeVertex( &nbsp;0.,
-50., &nbsp;40.)</p>
<p class="whs1">p10 = geompy.MakeVertex(
&nbsp;0., 70.,
&nbsp;&nbsp;0.)</p>
70., -35., &nbsp;&nbsp;0.)</p>
<p class="whs1">p11 = geompy.MakeVertex(
70., 70., &nbsp;&nbsp;0.)</p>
70., -35., &nbsp;70.)</p>
<p class="whs1">p12 = geompy.MakeVertex(
70., -15., &nbsp;&nbsp;0.)</p>
<p class="whs1">&nbsp;</p>
<p class="whs1">p13 = geompy.MakeVertex(
&nbsp;0., &nbsp;0.,
&nbsp;&nbsp;0.)</p>
<p class="whs2"># create faces</p>
<p>&nbsp;</p>
<p class="whs1">qface1 = geompy.MakeQuad4Vertices(p0,
p1, p2, p3)</p>
<p># create faces</p>
<p class="whs1">qface2 = geompy.MakeQuad4Vertices(p4,
p5, p6, p7)</p>
<p class="whs1">qface1 = geompy.MakeQuad4Vertices(p1,
p2, p3, p4)</p>
<p class="whs1">qface3 = geompy.MakeQuad4Vertices(p0,
p1, p4, p5)</p>
<p class="whs1">qface2 = geompy.MakeQuad4Vertices(p1,
p2, p5, p4)</p>
<p class="whs1">qface4 = geompy.MakeQuad4Vertices(p2,
p3, p6, p7)</p>
<p class="whs1">qface3 = geompy.MakeQuad4Vertices(p13,
p12, p11, p10)</p>
<p class="whs1">qface5 = geompy.MakeQuad4Vertices(p0,
p2, p4, p6)</p>
<p class="whs1">qface4 = geompy.MakeQuad4Vertices(p9,
p8, p7, p6)</p>
<p class="whs1">qface6 = geompy.MakeQuad4Vertices(p1,
p3, p5, p7)</p>
<p class="whs1">qface5 = geompy.MakeQuad4Vertices(p13,
p9, p6, p10)</p>
<p class="whs1">&nbsp;</p>
<p class="whs1">qface6 = geompy.MakeQuad4Vertices(p13,
p9, p8, p12)</p>
<p class="whs1">qface7 = geompy.MakeQuad4Vertices(p8,
p9, p10, p11)</p>
<p class="whs1">qface7 = geompy.MakeQuad4Vertices(p12,
p8, p7, p11)</p>
<p class="whs1">&nbsp;</p>
<p class="whs1">qface8 = geompy.MakeQuad4Vertices(p11,
p7, p6, p10)</p>
<p>&nbsp;</p>
<p># create a hexahedral solid between two given faces</p>
<p class="whs2"># create a hexahedral
solid between two given faces</p>
<p class="whs1">solid1 = geompy.MakeHexa2Faces(qface1,
qface2)</p>
qface7)</p>
<p>&nbsp;</p>
<p class="whs1">&nbsp;</p>
<p># create a hexahedral solids, bounded by six given faces</p>
<p class="whs2"># create a hexahedral
solid, bounded by six given faces</p>
<p class="whs1">solid2 = geompy.MakeHexa(qface3,
qface4, qface5, qface6, qface7, qface8)</p>
<p class="whs1">solid2 = geompy.MakeHexa(qface1,
qface2, qface3, qface4, qface5, qface6)</p>
<p>&nbsp;</p>
<p class="whs1">&nbsp;</p>
<p># add objects in the study</p>
<p class="whs2"># add objects in the
study</p>
<p class="whs1">geompy.addToStudy(qface1,&quot;qface1&quot;)</p>
<p class="whs1">geompy.addToStudy(qface2,&quot;qface2&quot;)</p>
<p class="whs1">geompy.addToStudy(qface3,&quot;qface3&quot;)</p>
<p class="whs1">geompy.addToStudy(qface4,&quot;qface4&quot;)</p>
<p class="whs1">geompy.addToStudy(qface5,&quot;qface5&quot;)</p>
<p class="whs1">geompy.addToStudy(qface6,&quot;qface6&quot;)</p>
<p class="whs1">geompy.addToStudy(qface7,&quot;qface7&quot;)</p>
<p class="whs1">&nbsp;</p>
<p class="whs1">id_solid1 = geompy.addToStudy(solid1,&quot;Solid1&quot;)</p>
<p class="whs1">id_solid2 = geompy.addToStudy(solid2,&quot;Solid2&quot;)</p>
<p>&nbsp;</p>
<p class="whs1">&nbsp;</p>
<p># display solids</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.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>&nbsp;</p>
<p><span style="font-family: 'Lucida Console', monospace;">gg.setDisplayMode(id_solid2,
1)</span> </p>
<script type="text/javascript" language="javascript1.2">
<!--

View File

@ -491,88 +491,73 @@ if (window.writeIntopicBar)
<h3><a name=bookmark4>Creation of a Compound</a></h3>
<p class="whs1">import geompy</p>
<p class="whs1"><span style="font-family: 'Lucida Console', monospace;">import
geompy</span></p>
<p class="whs1">import salome</p>
<p class="whs1">&nbsp;</p>
<p class="whs1">gg = salome.ImportComponentGUI(&quot;GEOM&quot;)</p>
<p class="whs1">&nbsp;</p>
<p class="whs2">#create vertices</p>
<p class="whs2"># create a vertex and
a vector</p>
<p class="whs1">p0 = geompy.MakeVertex(
0., &nbsp;0.,
&nbsp;0.)</p>
<p class="whs1">p1 = geompy.MakeVertex(
&nbsp;-30., &nbsp;-30.,
&nbsp;50.)</p>
<p class="whs1">pz = geompy.MakeVertex(
0., &nbsp;0.,
40.)</p>
<p class="whs1">p2 = geompy.MakeVertex(
&nbsp;-60., &nbsp;-60.,
&nbsp;30.)</p>
<p class="whs1">p3 = geompy.MakeVertex(
&nbsp;-30., &nbsp;-30.,
&nbsp;10.)</p>
<p class="whs1">&nbsp;</p>
<p class="whs2"># create sketchers</p>
<p class="whs2"># create an arc from
three points</p>
<p class="whs1">sketcher = geompy.MakeSketcher(&quot;Sketcher:F
-50 -50:TT 100 -50:R 0:C 50 70:R 0:L 100:WW&quot;)</p>
<p class="whs1">arc = geompy.MakeArc(p1,
p2, p3)</p>
<p class="whs1">ShapeListCompound
= []</p>
<p class="whs1">i = 0</p>
<p class="whs1">while i &lt;= 3 :</p>
<p class="whs1">&nbsp;&nbsp;&nbsp;&nbsp;S
= geompy.MakeTranslation(arc, i * 50., 0., 0.)</p>
<p class="whs1">&nbsp;&nbsp;&nbsp;&nbsp;ShapeListCompound.append(S)</p>
<p class="whs1">&nbsp;&nbsp;&nbsp;&nbsp;i
= i + 1</p>
<p class="whs1">&nbsp;</p>
<p class="whs2"># create faces from two
wires</p>
<p class="whs2"># create a compund of
the given shapes</p>
<p class="whs1">face = geompy.MakeFace(sketcher,1)</p>
<p class="whs1">compound = geompy.MakeCompound(ShapeListCompound)</p>
<p class="whs1">&nbsp;</p>
<p class="whs2"># create a prism</p>
<p class="whs2"># add object in the study</p>
<p class="whs1">prism = geompy.MakePrism(face,
p0, pz)</p>
<p class="whs1">id_compound = geompy.addToStudy(compound,&quot;Compound&quot;)</p>
<p class="whs1">&nbsp;</p>
<p class="whs2"># explode the prism into
faces</p>
<p class="whs2"># display the compound</p>
<p class="whs1">prism_faces = geompy.SubShapeAllSorted(prism,
geompy.ShapeType[&quot;FACE&quot;])</p>
<p class="whs1">&nbsp;</p>
<p class="whs2"># create a shell from
a set of faces</p>
<p class="whs1">shell = geompy.MakeShell([prism_faces[0],
prism_faces[1],</p>
<p class="whs1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;prism_faces[3],
prism_faces[4],</p>
<p class="whs1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;prism_faces[5],
prism_faces[2]])</p>
<p class="whs1">&nbsp;</p>
<p class="whs2"># create a solid, bounded
by the given shells</p>
<p class="whs1">solid = geompy.MakeSolid([shell])</p>
<p class="whs1">&nbsp;</p>
<p class="whs2"># add objects in the
study</p>
<p class="whs1">id_solid = geompy.addToStudy(solid,&quot;Solid&quot;)</p>
<p class="whs1">&nbsp;</p>
<p class="whs2"># display the solid</p>
<p class="whs1">gg.createAndDisplayGO(id_solid)</p>
<p class="whs1">gg.setDisplayMode(id_solid,1)
<p class="whs1">gg.createAndDisplayGO(id_compound)
</p>
<script type="text/javascript" language="javascript1.2">

View File

@ -80,32 +80,52 @@ if (window.writeIntopicBar)
<h3>Point Coordinates</h3>
<p class="whs1">import math</p>
<p class="whs1">import geompy</p>
<p>&nbsp;</p>
<p class="whs1">&nbsp;</p>
<p># create a point</p>
<p class="whs2"># create a point</p>
<p class="whs1">point = geompy.MakeVertex(15,
23, 80)</p>
<p class="whs1">point = geompy.MakeVertex(15.,
23., 80.)</p>
<p>&nbsp;</p>
<p class="whs1">&nbsp;</p>
<p># get the coordinates of the point and check its values</p>
<p class="whs2"># get the coordinates
of the point and check its values</p>
<p class="whs1">coords = geompy.PointCoordinates(point)</p>
<p class="whs1">if coords[0] != 15
or coords[1] != 23 or coords[2] != 80 :</p>
<p class="whs1">&nbsp;</p>
<p class="whs2"># check the obtained
coordinate values </p>
<p class="whs1">tolerance = 1.e-07</p>
<p class="whs1">def IsEqual(val1,
val2): return (math.fabs(val1 - val2) &lt; tolerance)</p>
<p class="whs1">&nbsp;</p>
<p class="whs1">if IsEqual(coords[0],
15.) and IsEqual(coords[1], 23.) and IsEqual(coords[2], 80.):</p>
<p class="whs1">&nbsp;&nbsp;&nbsp;&nbsp;print
&quot;Coordinates of point must be (15, 23, 80), but returned (&quot;,
coords[0], &quot;, &quot;, coords[1], &quot;, &quot;, coords[2], &quot;)&quot;</p>
&quot;All values are OK.&quot;</p>
<p class="whs1">else :</p>
<p><span style="font-family: 'Lucida Console', monospace;">&nbsp;&nbsp;&nbsp;&nbsp;print
&quot;All values are OK.&quot;</span> </p>
<p class="whs1">&nbsp;&nbsp;&nbsp;&nbsp;print
&quot;Coordinates of point must be (15, 23, 80), but returned (&quot;,</p>
<p class="whs1">&nbsp;&nbsp;&nbsp;&nbsp;print
coords[0], &quot;, &quot;, coords[1], &quot;, &quot;, coords[2], &quot;)&quot;</p>
<p><span style="font-family: 'Lucida Console', monospace;">&nbsp;&nbsp;&nbsp;&nbsp;pass</span>
</p>
<h3>Basic Properties</h3>

View File

@ -143,50 +143,62 @@ if (window.writeIntopicBar)
<p class="whs1">import salome</p>
<p class="whs1">&nbsp;</p>
<p class="whs1">gg = salome.ImportComponentGUI(&quot;GEOM&quot;)</p>
<p>&nbsp;</p>
<p class="whs1">&nbsp;</p>
<p># create a vertex and a vector</p>
<p class="whs1">p1 = geompy.MakeVertex(35,
35, 0)</p>
<p class="whs1">p1 = geompy.MakeVertex(25,
35, 45)</p>
<p class="whs1">p2 = geompy.MakeVertex(35,
35, 70)</p>
<p class="whs1">p2 = geompy.MakeVertex(70,
70, 70)</p>
<p class="whs1">v = geompy.MakeVector(p1,
p2)</p>
<p>&nbsp;</p>
<p># create cones</p>
<p># create cylinders</p>
<p class="whs1">cone1 = geompy.MakeCone(p1,
v, 17, 1, 20)</p>
<p class="whs1">height = 40</p>
<p class="whs1">cone2 = geompy.MakeConeR1R2H(30,
10, 30)</p>
<p class="whs1">&nbsp;</p>
<p class="whs1">radius1 = 15</p>
<p class="whs1">cylinder1 = geompy.MakeCylinder(p1,
v, radius1, height)</p>
<p class="whs1">&nbsp;</p>
<p class="whs1">radius2 = 30</p>
<p class="whs1">cylinder2 = geompy.MakeCylinderRH(radius2,
height)</p>
<p class="whs1">&nbsp;</p>
<p># add objects in the study</p>
<p class="whs1">id_cone1 = geompy.addToStudy(cone1,&quot;Cone1&quot;)</p>
<p class="whs1">id_cylinder1 = geompy.addToStudy(cylinder1,&quot;Cylinder1&quot;)</p>
<p class="whs1">id_cone2 = geompy.addToStudy(cone2,&quot;Cone2&quot;)</p>
<p class="whs1">id_cylinder2 = geompy.addToStudy(cylinder2,&quot;Cylinder2&quot;)</p>
<p>&nbsp;</p>
<p># display cones</p>
<p># display the cylinders</p>
<p class="whs1">gg.createAndDisplayGO(id_cone1)</p>
<p class="whs1">gg.createAndDisplayGO(id_cylinder1)</p>
<p class="whs1">gg.setDisplayMode(id_cone1,1)</p>
<p class="whs1">gg.setDisplayMode(id_cylinder1,1)</p>
<p class="whs1">gg.createAndDisplayGO(id_cone2)</p>
<p class="whs1">gg.createAndDisplayGO(id_cylinder2)</p>
<p><span style="font-family: 'Lucida Console', monospace;">gg.setDisplayMode(id_cone2,1)</span>
<p><span style="font-family: 'Lucida Console', monospace;">gg.setDisplayMode(id_cylinder2,1)</span>
</p>
<p>&nbsp;</p>

View File

@ -15,6 +15,7 @@ if (navigator.appName !="Netscape")
<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">
<!--
@ -347,7 +348,7 @@ if (window.writeIntopicBar)
<p>&nbsp;</p>
<p># create an object, symmetrical to the given one relatively the given
<p># create an object, symmetrical to another object through the given
plane</p>
<p class="whs1">p1 = geompy.MakeVertex(
@ -367,7 +368,7 @@ if (window.writeIntopicBar)
<p>&nbsp;</p>
<p># create an object, symmetrical to the given one relatively the given
<p># create an object, symmetrical to another object through the given
axis</p>
<p class="whs1">p4 = geompy.MakeVertex(
@ -384,7 +385,7 @@ if (window.writeIntopicBar)
<p>&nbsp;</p>
<p># create an object, symmetrical to the given one relatively the given
<p># create an object, symmetrical to another object through the given
point</p>
<p class="whs1">mirror3 = geompy.MakeMirrorByPoint(box,
@ -450,18 +451,22 @@ if (window.writeIntopicBar)
<p class="whs1">import salome</p>
<p class="whs1">&nbsp;</p>
<p class="whs1">gg = salome.ImportComponentGUI(&quot;GEOM&quot;)</p>
<p>&nbsp;</p>
<p class="whs1">&nbsp;</p>
<p># create a box and a sphere</p>
<p class="whs2"># create a box and a
sphere</p>
<p class="whs1">box = geompy.MakeBoxDXDYDZ(200,
200, 200)</p>
<p>&nbsp;</p>
<p class="whs1">&nbsp;</p>
<p># scale the given object by the factor</p>
<p class="whs2"># scale the given object
by the factor</p>
<p class="whs1">p0 = geompy.MakeVertex(100,
100, 100)</p>
@ -471,9 +476,10 @@ if (window.writeIntopicBar)
<p class="whs1">scale = geompy.MakeScaleTransform(box,
p0, factor)</p>
<p>&nbsp;</p>
<p class="whs1">&nbsp;</p>
<p># add objects in the study</p>
<p class="whs2"># add objects in the
study</p>
<p class="whs1">id_box = geompy.addToStudy(box,
&quot;Box&quot;)</p>
@ -481,14 +487,16 @@ if (window.writeIntopicBar)
<p class="whs1">id_scale = geompy.addToStudy(scale,
&quot;Scale&quot;)</p>
<p>&nbsp;</p>
<p class="whs1">&nbsp;</p>
<p># display the results</p>
<p class="whs2"># display the results</p>
<p class="whs1">gg.createAndDisplayGO(id_box)</p>
<p class="whs1">gg.setDisplayMode(id_box,1)</p>
<p class="whs1">gg.setTransparency(id_box,0.5)</p>
<p class="whs1">gg.createAndDisplayGO(id_scale)</p>
<p><span style="font-family: 'Lucida Console', monospace;">gg.setDisplayMode(id_scale,1)</span>