From 6eb856d08410d45e773963261f83fc12e5a56f5e Mon Sep 17 00:00:00 2001 From: gzy Date: Thu, 20 Sep 2018 17:27:33 +0300 Subject: [PATCH] polyline --- src/BuildPlugin/doc/TUI_polylineFeature.rst | 12 ++++++ src/BuildPlugin/doc/examples/polyline.py | 15 ++++++++ .../doc/images/feature_polyline.png | Bin 0 -> 569 bytes src/BuildPlugin/doc/polylineFeature.rst | 35 ++++++++++++++++++ 4 files changed, 62 insertions(+) create mode 100644 src/BuildPlugin/doc/TUI_polylineFeature.rst create mode 100644 src/BuildPlugin/doc/examples/polyline.py create mode 100644 src/BuildPlugin/doc/images/feature_polyline.png diff --git a/src/BuildPlugin/doc/TUI_polylineFeature.rst b/src/BuildPlugin/doc/TUI_polylineFeature.rst new file mode 100644 index 000000000..1099c4f5c --- /dev/null +++ b/src/BuildPlugin/doc/TUI_polylineFeature.rst @@ -0,0 +1,12 @@ + + .. _tui_create_polyline: + +Create Polyline +=============== + +.. literalinclude:: examples/polyline.py + :linenos: + :language: python + +:download:`Download this script ` + diff --git a/src/BuildPlugin/doc/examples/polyline.py b/src/BuildPlugin/doc/examples/polyline.py new file mode 100644 index 000000000..9596db811 --- /dev/null +++ b/src/BuildPlugin/doc/examples/polyline.py @@ -0,0 +1,15 @@ +# -*- coding: utf-8 -*- + +from salome.shaper import model + +model.begin() +partSet = model.moduleDocument() +Part_1 = model.addPart(partSet) +Part_1_doc = Part_1.document() +Box_1 = model.addBox(Part_1_doc, 10, 10, 10) +Point_2 = model.addPoint(Part_1_doc, -10, -5, -7) +Vertex_1 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Point_1")]) +Polyline_1_objects = [model.selection("VERTEX", "Point_1"), model.selection("VERTEX", "Box_1_1/Front&Box_1_1/Left&Box_1_1/Bottom"), model.selection("VERTEX", "Box_1_1/Front&Box_1_1/Right&Box_1_1/Top"), model.selection("VERTEX", "Box_1_1/Back&Box_1_1/Left&Box_1_1/Top"), model.selection("VERTEX", "Box_1_1/Back&Box_1_1/Right&Box_1_1/Bottom")] +Polyline_1 = model.addPolyline3D(Part_1_doc, Polyline_1_objects, False) +model.do() +model.end() diff --git a/src/BuildPlugin/doc/images/feature_polyline.png b/src/BuildPlugin/doc/images/feature_polyline.png new file mode 100644 index 0000000000000000000000000000000000000000..8ed9356e716da9301db9463787b8aed48660b3ca GIT binary patch literal 569 zcmV-90>=G`P)Q0-;}8t>V@|8&vN4*J?T z%?!iG$8VgD)0eL%x{f|>Ig~!UURi$5f0hxeMMVxGa&3OH{h?oW&S{C}=m3W|0LjFL zJ+}Yn1yr8}Vrsr8PyDho_N&B!-2l=#Jlt~U(sHS<>$~Z8*LwVBGNL9ATm;gacT2!i zFf*=SpOZnt)Y-zmFVl~z0uXrSmcqEJwq3HUZqb7>$5E44k@Ki#fmo>W?abYrU8%OF zRJd;dLhMVxY~T!R*K;#0x&5}-lnDpiy6q5^k@uh5W>>1MDF9JM1wa>x2fxiK@Sv&R zUf(sfTrSq>w7pW1EW*U!z3<7iUo!9Zj2)m*aFRp$o#6(ax#4@puDvD|39?ycs}W;o z0f}2D*AO87k+;APwK~|C!3ZJf0zzW|02|8O;-}=1o3~G#j0%wLL*JEC_bRo-n26R9 z)ARMk)Sh42VNj_hx&c%rW>tHm7{vbZDWZ}F{ZQBVR20A;Y$=+gb6jaE00000NkvXX Hu0mjfa9RUN literal 0 HcmV?d00001 diff --git a/src/BuildPlugin/doc/polylineFeature.rst b/src/BuildPlugin/doc/polylineFeature.rst index 9d4a9e6c9..f6f19416d 100644 --- a/src/BuildPlugin/doc/polylineFeature.rst +++ b/src/BuildPlugin/doc/polylineFeature.rst @@ -2,9 +2,44 @@ Polyline ======== +The feature **Polyline** creates a wire. + +To create a Polyline in the active part: + +#. select in the Main Menu *Build - > Polyline* item or +#. click **Polyline** button in the toolbar + +.. image:: images/feature_polyline.png + :align: center + +.. centered:: + **Polyline** button + +The following property panel appears. .. image:: images/Polyline.png :align: center .. centered:: Create a polyline + +Input fields: + +- **Points and vertices** panel contains list of points and vertices selected in 3D OCC viewer. Polyline consequently connects points; +- **Closed** check-box turns on/off connection of the start and end points to make polyline closed. + +**TUI Commands**: *model.addPolyline3D(Part_1_doc, Polyline_objects, Key)* + +**Arguments**: 1 part+ list of vertices selected in format *model.selection("VERTEX", "Point")* + boolean key defining presence of connection between the start and end points. + +Result +"""""" +Result of operation is closed or open Polyline. + +.. image:: images/polyline.png + :align: center + +.. centered:: + Polyline + +**See Also** a sample TUI Script of a :ref:`tui_create_polyline` operation. \ No newline at end of file -- 2.39.2