From: skv Date: Wed, 8 Oct 2014 13:52:13 +0000 (+0400) Subject: Polyline documentation X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=aa5e39eeff89705e4e5173ffbdb2d6a09c092120;p=modules%2Fgeom.git Polyline documentation --- diff --git a/doc/salome/examples/polyline.py b/doc/salome/examples/polyline.py new file mode 100644 index 000000000..8b7925607 --- /dev/null +++ b/doc/salome/examples/polyline.py @@ -0,0 +1,48 @@ +# 2D polyline + +import salome +salome.salome_init() +import GEOM +from salome.geom import geomBuilder +geompy = geomBuilder.New(salome.myStudy) +gg = salome.ImportComponentGUI("GEOM") + +# create vertices +p1 = geompy.MakeVertex(70., 0., 0.) +p2 = geompy.MakeVertex(70., 70., 80.) +p3 = geompy.MakeVertex( 0., 70., 0.) + +#create a vector from two points +vector_arc = geompy.MakeVector(p1, p3) + +# create an arc from three points +arc = geompy.MakeArc(p1, p2, p3) + +# create a wire +wire = geompy.MakeWire([vector_arc, arc]) + +# create a planar face +isPlanarWanted = 1 +face = geompy.MakeFace(wire, isPlanarWanted) + +# Create a 2D polyline with Polyline2D interface +pl = geompy.Polyline2D() +pl.addSection("section 1", GEOM.Polyline, True, [0, 0, 10, 0, 10, 10]) +polyline1 = pl.result([100, 0, 0, 1, 1, 1, -1, 1, 0]) + +pl = geompy.Polyline2D() +pl.addSection("section 2", GEOM.Interpolation, False) +pl.addPoints([20, 0, 30, 0, 30, 10]) +polyline2 = pl.result(face) + +# add objects in the study +id_face = geompy.addToStudy(face,"Face") +id_polyline1 = geompy.addToStudy(polyline1, "Polyline1") +id_polyline2 = geompy.addToStudy(polyline2, "Polyline2") + +# display the first polyline and the second polyline with its planar face +gg.createAndDisplayGO(id_face) +gg.setDisplayMode(id_face,1) +gg.setTransparency(id_face,0.5) +gg.createAndDisplayGO(id_polyline1) +gg.createAndDisplayGO(id_polyline2) diff --git a/doc/salome/gui/GEOM/images/polyline_dlg.png b/doc/salome/gui/GEOM/images/polyline_dlg.png new file mode 100644 index 000000000..532817c40 Binary files /dev/null and b/doc/salome/gui/GEOM/images/polyline_dlg.png differ diff --git a/doc/salome/gui/GEOM/images/polyline_dlg_add_section.png b/doc/salome/gui/GEOM/images/polyline_dlg_add_section.png new file mode 100644 index 000000000..9a6c1b9e5 Binary files /dev/null and b/doc/salome/gui/GEOM/images/polyline_dlg_add_section.png differ diff --git a/doc/salome/gui/GEOM/images/polyline_dlg_edit_section.png b/doc/salome/gui/GEOM/images/polyline_dlg_edit_section.png new file mode 100644 index 000000000..69df41e8f Binary files /dev/null and b/doc/salome/gui/GEOM/images/polyline_dlg_edit_section.png differ diff --git a/doc/salome/gui/GEOM/input/creating_basic_go.doc b/doc/salome/gui/GEOM/input/creating_basic_go.doc index 6693b469d..efdff9511 100644 --- a/doc/salome/gui/GEOM/input/creating_basic_go.doc +++ b/doc/salome/gui/GEOM/input/creating_basic_go.doc @@ -15,6 +15,7 @@ geometrical objects as:
  • \subpage create_isoline_page
  • \subpage create_sketcher_page
  • \subpage create_3dsketcher_page
  • +
  • \subpage create_polyline_page
  • \subpage create_vector_page
  • \subpage create_plane_page
  • \subpage create_lcs_page
  • diff --git a/doc/salome/gui/GEOM/input/creating_polyline.doc b/doc/salome/gui/GEOM/input/creating_polyline.doc new file mode 100644 index 000000000..7ec36434d --- /dev/null +++ b/doc/salome/gui/GEOM/input/creating_polyline.doc @@ -0,0 +1,107 @@ +/*! + +\page create_polyline_page 2D Polyline + +The 2D Polyline allows drawing arbitrary 2D shapes. + +To create a 2D Polyline select in the main menu New Entity -> Basic -> 2D Polyline. + +\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 +connected either by linear setgments or an interpolation curve. Every section has its own attributes: +- \b Name, +- \b Type (Polyline or Spline), +- \b Closed flag. + +A Polyline created represents a shape that lies on the XOY plane. It can have the following types: +- \b Vertex for a single section with only 1 point. +- \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 result wire is obtained for a Spline or Polyline with 2 points. +- \b Compound of Wires and/or Vertices if there are several sections. + +For the moment only one reference coordinate system for polyline creation is supported. The XOY plane of the Global coordinate system +is suggested. Implementation of another reference coordinate system is a subject of further development of this functionality. +Restore button orientates the viewer correspondingly to the chosen working plane and fits the scene to show all objects. +For the moment this button works with only one plane. + +It is possible to import a shape in this dialog using Import polyline selection button. To do it an imported object should satisfy conditions +for polyline shapes mentioned above. If a valid shape is selected, when dialog is opened, it is initialized by this shape. +Though the shape can be on any plane, an imported polyline will be defined on XOY plane only due to the limitation. + +The group \b Sections in this dialog represents the Polyline construction framework. Its toolbar has the following operations: +- \b Undo +- \b Redo +- Insert new section +- Addition mode +- Modification mode - not implemented +- Detection mode - not implemented +- \b Remove +- Join selected sections + +Undo/Redo buttons allows to undo/redo changes of the polyline. + +Insert new section button opens a dialog that allows to add a new section: + +\image html polyline_dlg_add_section.png + +In this dialog it is possible to choose: +- \b Name of section +- \b Type of section +- \b Closed flag + +To create a new section \b Add button should be clicked. \b Cancel button is used to cancel this operation. +After clicking \b Add button a new section is appeared on the list. Its name supplemented by its type and closedness +information (see icon) and the number of points (equal to 0 after creation). + +To modify section parameters it is possible to double-click on a section in the list. In this case the following dialog appears: + +\image html polyline_dlg_edit_section.png + +To apply modifications the button \b Ok should be clicked. + +Addition mode allows to add points to a section. It is necessary to select a particular section in a list of sections +and make some mouse clicks in the viewer. A section preview is recomputed after each click. + +Modification mode and Detection mode are not implemented for the moment. + +\b Remove button allows to remove a section. It is available if all modes are deactivated and one section is selected. + +Join selected sections button is available in modification mode if two or more sections are selected. It is used to +merge several sections into the first one from selection list. Joined section has parameters of the first selected one. Points of +the other sections are appended at the end of the list of the first section points. + +Some actions are available via popup menu by right mouse button click. + +If all modes are deactivated: +- Join all sections - join all defined sections into the first one. +- \b Join - join sections. Available if two or more sections are selected. + +In Addition mode: +- Join all sections - join all defined sections into the first one. + +In Modification mode: +- Join all sections - join all defined sections into the first one. +- \b Join - join sections. Available if two or more sections are selected. +- Clear all - remove all sections. Available if at least one section is selected. +- Set closed - set all selected section's Closed flag. Available if at least one section is selected. +- Set open - reset all selected section's Closed flag. Available if at least one section is selected. +- Set polyline - set all selected section's type to Polyline. Available if at least one section is selected. +- Set spline - set all selected section's type to Spline. Available if at least one section is selected. + +In Detection mode: +- Join all sections - join all defined sections into the first one. +- \b Join - join sections. Available if two or more sections are selected. + +

    TUI Commands

    + + +To create the 2D polyline in TUI Polyline2D interface is used. + +pl = geompy.Polyline2D() - returns an instance of Polyline2D interface pl. + +See the \ref gsketcher.Polyline2D "Polyline2D" interface documentation for more information. + +Our TUI Scripts provide you with useful examples of the use of +\ref tui_polyline_page "2D Polyline". +*/ diff --git a/doc/salome/gui/GEOM/input/tui_polyline.doc b/doc/salome/gui/GEOM/input/tui_polyline.doc new file mode 100644 index 000000000..ff83b9053 --- /dev/null +++ b/doc/salome/gui/GEOM/input/tui_polyline.doc @@ -0,0 +1,6 @@ +/*! + +\page tui_polyline_page 2D Polyline +\tui_script{polyline.py} + +*/