2014-09-08 18:07:16 +06:00
/*!
\page create_polyline_page 2D Polyline
The 2D Polyline allows drawing arbitrary 2D shapes.
To create a <b>2D Polyline</b> select in the main menu <b>New Entity -> Basic -> 2D Polyline</b>.
\image html polyline_dlg.png
A polyline represents a section or a set of sections. Each section is constructed from a sequence of 2D points
2014-10-27 15:05:11 +05:00
connected by either linear segments or an interpolation curve. Every section has its own attributes:
2014-09-08 18:07:16 +06:00
- \b Name,
- \b Type (Polyline or Spline),
- \b Closed flag.
2014-10-27 15:05:11 +05:00
A created Polyline represents a shape that lies on the XOY plane. Its type can be one of the following:
2014-09-08 18:07:16 +06:00
- \b Vertex for a single section with only 1 point.
2014-10-27 15:05:11 +05:00
- \b Wire for a single section with 2 or more points. A Wire can have multiple edges for more then 2 points if the section type is Polyline. A single edge in the resulting wire is obtained for a Spline or Polyline with 2 points.
2014-09-08 18:07:16 +06:00
- \b Compound of Wires and/or Vertices if there are several sections.
2014-10-27 15:05:11 +05:00
For the moment only one reference coordinate system for polyline creation is supported, which is the XOY plane of the <b>Global coordinate system</b>.
\b Restore button orientates the viewer correspondingly to the chosen working plane and fits the scene to show all objects.
2014-09-08 18:07:16 +06:00
For the moment this button works with only one plane.
2014-10-27 15:05:11 +05:00
It is possible to import a shape in this dialog using <b>Import polyline</b> selection button. An imported object should meet the conditions for polyline shapes mentioned above. If a valid shape is selected, when the dialog is opened, it is initialized by this shape.
Though the shape can be on any plane, the imported polyline will be defined on XOY plane only due to the limitation.
2014-09-08 18:07:16 +06:00
2014-10-27 15:05:11 +05:00
The group \b Sections in this dialog represents the Polyline construction framework.
2014-09-08 18:07:16 +06:00
2014-11-10 13:25:00 +05:00
The buttons <b>Undo</b> and <b>Redo</b> allow to undo or redo the changes of the polyline.
2014-09-08 18:07:16 +06:00
2014-10-27 15:05:11 +05:00
<b>Insert new section</b> button opens the corresponding dialog:
2014-09-08 18:07:16 +06:00
\image html polyline_dlg_add_section.png
In this dialog it is possible to choose:
2014-10-27 15:05:11 +05:00
- \b Name of section;
- \b Type of section;
- Set \b Closed flag.
2014-09-08 18:07:16 +06:00
2014-10-27 15:05:11 +05:00
To create a new section, click \b Add button. \b Cancel button is used to cancel this operation.
After clicking \b Add button a new section appears in the list. Its name is generated automatically depending on its type, closed or opened state and the number of points (equal to 0 after creation).
2014-09-08 18:07:16 +06:00
2014-10-27 15:05:11 +05:00
To modify section parameters, double-click on a section in the list. In this case the following dialog appears:
2014-09-08 18:07:16 +06:00
\image html polyline_dlg_edit_section.png
2014-10-27 15:05:11 +05:00
To apply the modifications, click \b Ok button.
2014-09-08 18:07:16 +06:00
2014-10-27 15:05:11 +05:00
<b>Addition mode</b> allows adding points to a section. Select a particular section in the list of sections
and left-click in the viewer to add new nodes to the section. A section preview is recomputed after each click.
2014-09-08 18:07:16 +06:00
<b>Modification mode</b> and <b>Detection mode</b> are not implemented for the moment.
2014-10-27 15:05:11 +05:00
\b Remove button allows removing a section. It is available if all modes are deactivated and one section is selected.
2014-09-08 18:07:16 +06:00
<b>Join selected sections</b> button is available in modification mode if two or more sections are selected. It is used to
2014-10-27 15:05:11 +05:00
merge several sections into the first one from the selection list. The points of the merged sections are appended at the end of the list of points of the first section.
2014-09-08 18:07:16 +06:00
2014-10-27 15:05:11 +05:00
Some actions are available via the context menu activated by right mouse button click.
- <b>Join all sections</b> - joins all defined sections into the first one.
- \b Join - joins two or more selected sections.
- <b>Clear all</b> - removes all selected sections.
- <b>Set closed</b> - sets \b Closed flag for all selected section.
- <b>Set open</b> - unset \b Closed flag for all selected sections.
- <b>Set polyline</b> - sets the type of all selected sections to Polyline.
2014-11-10 13:25:00 +05:00
- <b>Set spline</b> - set the type of all selected sections to Spline.
2014-09-08 18:07:16 +06:00
2014-10-27 15:05:11 +05:00
Different actions are available depending on the mode and selection.
2014-09-08 18:07:16 +06:00
<h2>TUI Commands</h2>
To create the 2D polyline in TUI Polyline2D interface is used.
<em>pl = geompy.Polyline2D()</em> - returns an instance of Polyline2D interface <i>pl</i>.
See the \ref gsketcher.Polyline2D "Polyline2D" interface documentation for more information.
Our <b>TUI Scripts</b> provide you with useful examples of the use of
2014-11-10 13:25:00 +05:00
\ref tui_creation_polyline "2D Polyline".
2014-09-08 18:07:16 +06:00
*/