From: mzn Date: Mon, 10 Sep 2018 12:42:46 +0000 (+0300) Subject: Sketch objects help pages (initial version). X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=6b350fda96a1fa7a73b4b69738bd1a6d7670d15f;p=modules%2Fshaper.git Sketch objects help pages (initial version). --- diff --git a/src/SketchPlugin/doc/SketchPlugin.rst b/src/SketchPlugin/doc/SketchPlugin.rst index 59a693866..82924f527 100644 --- a/src/SketchPlugin/doc/SketchPlugin.rst +++ b/src/SketchPlugin/doc/SketchPlugin.rst @@ -5,46 +5,96 @@ Sketch plug-in ================ +Sketch plug-in includes features for creation of 2D shapes. -.. image:: images/StartSketch.png - :align: center +The process of sketch creation is comprised of: +- definition of sketch plane +- creation of sketch objects from scratch +- generation of sketch objects via operations on the existing operations +- definition of constaints + +Sketch could be created both in active part and a part set (if there is no active part). + +To create a Sketch: + +#. select in the Main Menu *Sketch - > Sketch* item or +#. click **Sketch** button in Sketch toolbar: + +.. image:: images/SketchButton.png + :align: center .. centered:: - Start sketcher + **Sketch** button + +At first it is necessary to define a plane on which to create a sketch: + +.. image:: images/PlaneDefinition.png + :align: center + +- specify plane size (equal to 25 in the example above) +- then select the appropriate plane in the viewer + +Note that in case if there are no convenient objects for plane selection are +displayed in the viewer - coordinate planes will be suggested for selection: +.. image:: images/CoordinatePlanes.png + :align: center +After the plane for sketch is selected the following property panel will be opened: -.. image:: images/SketchProperties.png - :align: center +.. image:: images/SketchPanel.png + :align: center .. centered:: - Sketcher properies panel + Sketch general panel +- **Reversed** check box - allows reversing the sketch plane normal +- **Set plane view** button - switches the viewer to the top view for the sketch plane +- **Show geometrical constraints** check box - turns on/off geometrical constraints displaying +- **Show dimensional constraints** check box - turns on/off dimensional constraints displaying +- **Show existing expressions** check box - turns on/off expressions displaying + +Now it is possible to create sketch objects, make sketch operations and constraints. +To apply or cancel sketch creation it is possible to use apply and cancel buttons from the +Sketch panel as well as equivalent buttons from Sketch toolbar. + +The Result of operation will be a COMPOUND. Result node in the object tree is located in +**Constructions** folder. + +Name is assigned automatically: **Sketch_1**, **Sketch_2**, ... both for Feature and Result. + +**TUI Command**: *Sketch_1 = model.addSketch(PartOrPartSet, plane)* + +**Arguments**: Part or PartSet + plane. Sketch objects -------------- +The plug-in includes following features for creation of 2D objects: + .. toctree:: :maxdepth: 1 - arcFeature.rst - circleFeature.rst - ellipseFeature.rst - lineFeature.rst pointFeature.rst + lineFeature.rst + rectangleFeature.rst + circleFeature.rst + arcFeature.rst Constraints ----------- + + .. toctree:: :maxdepth: 1 + distanceFeature.rst + horizontalDistFeature.rst angleFeature.rst coincedenceFeature.rst collinearFeature.rst - distanceFeature.rst equalFeature.rst - horizontalDistFeature.rst horizontalFeature.rst lengthFeature.rst middleFeature.rst @@ -63,10 +113,10 @@ Operations :maxdepth: 1 filletFeature.rst + splitFeature.rst + trimFeature.rst intersectionFeature.rst mirrorFeature.rst projectionFeature.rst rotationFeature.rst - splitFeature.rst translationFeature.rst - trimFeature.rst diff --git a/src/SketchPlugin/doc/TUI_lineFeature.rst b/src/SketchPlugin/doc/TUI_lineFeature.rst new file mode 100644 index 000000000..f4c180999 --- /dev/null +++ b/src/SketchPlugin/doc/TUI_lineFeature.rst @@ -0,0 +1,11 @@ + + .. _tui_create_line: + +Create Skecth Line +================== + +.. literalinclude:: examples/line.py + :linenos: + :language: python + +:download:`Download this script ` diff --git a/src/SketchPlugin/doc/TUI_pointFeature.rst b/src/SketchPlugin/doc/TUI_pointFeature.rst new file mode 100644 index 000000000..37f66f7f9 --- /dev/null +++ b/src/SketchPlugin/doc/TUI_pointFeature.rst @@ -0,0 +1,11 @@ + + .. _tui_create_point: + +Create Skecth Point +=================== + +.. literalinclude:: examples/point.py + :linenos: + :language: python + +:download:`Download this script ` diff --git a/src/SketchPlugin/doc/TUI_rectangleFeature.rst b/src/SketchPlugin/doc/TUI_rectangleFeature.rst new file mode 100644 index 000000000..9298af6b9 --- /dev/null +++ b/src/SketchPlugin/doc/TUI_rectangleFeature.rst @@ -0,0 +1,11 @@ + + .. _tui_create_rectangle: + +Create Skecth Rectangle +======================= + +.. literalinclude:: examples/rectangle.py + :linenos: + :language: python + +:download:`Download this script ` diff --git a/src/SketchPlugin/doc/arcFeature.rst b/src/SketchPlugin/doc/arcFeature.rst index a830d1874..5f179c550 100644 --- a/src/SketchPlugin/doc/arcFeature.rst +++ b/src/SketchPlugin/doc/arcFeature.rst @@ -2,23 +2,61 @@ Arc === +The feature Arc creates an arc segment in the current Sketch. -.. image:: images/Arc1.png - :align: center +To add new Arc to the Sketch: + +#. select in the Main Menu *Sketch - > Arc* item or +#. click **Arc** button in Sketch toolbar: + +.. image:: images/arc.png + :align: center .. centered:: - Create arc by center and two points + **Arc** button +There are 3 algorithms for creation of an Arc: -.. image:: images/Arc2.png - :align: center +.. image:: images/arc_base_32x32.png + :align: left +**By center and two points** creates an arc segment with the given center passing from the start point to the end point on the circumference. -.. centered:: - Create arc by three points +.. image:: images/arc_3pt_32x32.png + :align: left +**By three points** creates an arc segment passing from the start point to end point through another point on the circumference. +.. image:: images/arc_tang_32x32.png + :align: left +**By tangent and point** creates an arc segment with the tangent point and the end point. -.. image:: images/Arc3.png - :align: center +By center and two points +"""""""""""""""""""""""" -.. centered:: - Create arc as tangent to an edge +.. image:: images/Arc_panel_base.png + :align: center + + + +**TUI Command**: *Sketch_1.addCircle(CenterX, CenterY, StartX, StartY, EndX, EndY, Inversed)* + +**Arguments**: 7 values (coordinates of the center, the start, the end, inversed flag (if true - build arc from end to start)). + +By three points +""""""""""""""" + +.. image:: images/Arc_panel_3pt.png + :align: center + +**TUI Command**: *Sketch_1.addCircle(StartX, StartY, EndX, EndY, PassedX, PassedY)* + +**Arguments**: 6 values (coordinates of the start, end and passed points). + +By tangent and point +"""""""""""""""""""" + +.. image:: images/Arc_panel_tang.png + :align: center + +**TUI Command**: *Sketch_1.addCircle(TangetPoint, EndX, EndY, Inversed)* + +**Arguments**: 4 values (reference to tangent point, coordinates of end point, inversed flag (if true - build arc from end to start)). \ No newline at end of file diff --git a/src/SketchPlugin/doc/circleFeature.rst b/src/SketchPlugin/doc/circleFeature.rst index d0dc3f9e5..ef62dc0b5 100644 --- a/src/SketchPlugin/doc/circleFeature.rst +++ b/src/SketchPlugin/doc/circleFeature.rst @@ -2,16 +2,50 @@ Circle ====== +The feature Circle creates a circle in the current Sketch. -.. image:: images/Circle1.png - :align: center +To add new Circle to the Sketch: + +#. select in the Main Menu *Sketch - > Circle* item or +#. click **Circle** button in Sketch toolbar: + +.. image:: images/circle.png + :align: center .. centered:: - Create circle by center and point + **Circle** button +There are 2 algorithms for creation of a Circle: -.. image:: images/Circle2.png - :align: center +.. image:: images/circle_pt_rad_32x32.png + :align: left +**By center and passed point** creates a circle with the given center passing through the given point. -.. centered:: - Create circle by tree points +.. image:: images/circle_3pt_32x32.png + :align: left +**By three points** creates a circle passing through the given three points. + +By center and passed point +"""""""""""""""""""""""""" + +.. image:: images/Circle_panel_pt_rad.png + :align: center + +Click in the view once to set the center point, then move the mouse and click a second time to set the passed point. + +**TUI Command**: *Sketch_1.addCircle(CenterX, CenterY, PassedX, PassedY)* + +**Arguments**: 4 values (coordinates of the center and the passed point). + +By three points +""""""""""""""" + +.. image:: images/Circle_panel_3pt.png + :align: center + +Click in the view once to set the first passed point, then move the mouse and click a second time to set the second passed point +and finally move the mouse and click a third time to set the last passed point. + +**TUI Command**: *Sketch_1.addCircle(X1, Y1, X2, Y2, X3, Y3)* + +**Arguments**: 6 values (coordinates of three points). diff --git a/src/SketchPlugin/doc/examples/line.py b/src/SketchPlugin/doc/examples/line.py new file mode 100644 index 000000000..2b41c800b --- /dev/null +++ b/src/SketchPlugin/doc/examples/line.py @@ -0,0 +1,12 @@ +# -*- coding: utf-8 -*- + +from salome.shaper import model + +model.begin() +partSet = model.moduleDocument() +Part_1 = model.addPart(partSet) +Part_1_doc = Part_1.document() +Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY")) +SketchLine_1 = Sketch_1.addLine(64.50309529234383, 87.92795791556755, -33.49721981216553, -42.5840914148601) +model.do() +model.end() diff --git a/src/SketchPlugin/doc/examples/point.py b/src/SketchPlugin/doc/examples/point.py new file mode 100644 index 000000000..9903355b4 --- /dev/null +++ b/src/SketchPlugin/doc/examples/point.py @@ -0,0 +1,12 @@ +# -*- coding: utf-8 -*- + +from salome.shaper import model + +model.begin() +partSet = model.moduleDocument() +Part_1 = model.addPart(partSet) +Part_1_doc = Part_1.document() +Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY")) +SketchPoint_1 = Sketch_1.addPoint(42.64092753227449, 19.02972704799864) +model.do() +model.end() \ No newline at end of file diff --git a/src/SketchPlugin/doc/examples/rectangle.py b/src/SketchPlugin/doc/examples/rectangle.py new file mode 100644 index 000000000..a126cf041 --- /dev/null +++ b/src/SketchPlugin/doc/examples/rectangle.py @@ -0,0 +1,12 @@ +# -*- coding: utf-8 -*- + +from salome.shaper import model + +model.begin() +partSet = model.moduleDocument() +Part_1 = model.addPart(partSet) +Part_1_doc = Part_1.document() +Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY")) +Rectangle_1 = Sketch_1.addRectangle(5.598878525298213, 8.556502484736781, 31.35634838639225, 78.97905438572354) +model.do() +model.end() diff --git a/src/SketchPlugin/doc/images/Arc_panel_3pt.png b/src/SketchPlugin/doc/images/Arc_panel_3pt.png new file mode 100644 index 000000000..ba9a7e024 Binary files /dev/null and b/src/SketchPlugin/doc/images/Arc_panel_3pt.png differ diff --git a/src/SketchPlugin/doc/images/Arc_panel_base.png b/src/SketchPlugin/doc/images/Arc_panel_base.png new file mode 100644 index 000000000..b7eced57c Binary files /dev/null and b/src/SketchPlugin/doc/images/Arc_panel_base.png differ diff --git a/src/SketchPlugin/doc/images/Arc_panel_tang.png b/src/SketchPlugin/doc/images/Arc_panel_tang.png new file mode 100644 index 000000000..7236df8f5 Binary files /dev/null and b/src/SketchPlugin/doc/images/Arc_panel_tang.png differ diff --git a/src/SketchPlugin/doc/images/Circle_panel_3pt.png b/src/SketchPlugin/doc/images/Circle_panel_3pt.png new file mode 100644 index 000000000..4a4df051b Binary files /dev/null and b/src/SketchPlugin/doc/images/Circle_panel_3pt.png differ diff --git a/src/SketchPlugin/doc/images/Circle_panel_pt_rad.png b/src/SketchPlugin/doc/images/Circle_panel_pt_rad.png new file mode 100644 index 000000000..e6d70a158 Binary files /dev/null and b/src/SketchPlugin/doc/images/Circle_panel_pt_rad.png differ diff --git a/src/SketchPlugin/doc/images/CoordinatePlanes.png b/src/SketchPlugin/doc/images/CoordinatePlanes.png new file mode 100644 index 000000000..c36a587fd Binary files /dev/null and b/src/SketchPlugin/doc/images/CoordinatePlanes.png differ diff --git a/src/SketchPlugin/doc/images/Line.png b/src/SketchPlugin/doc/images/Line.png index 2f48eee17..53dbb0820 100644 Binary files a/src/SketchPlugin/doc/images/Line.png and b/src/SketchPlugin/doc/images/Line.png differ diff --git a/src/SketchPlugin/doc/images/Line_panel.png b/src/SketchPlugin/doc/images/Line_panel.png new file mode 100644 index 000000000..e5381398e Binary files /dev/null and b/src/SketchPlugin/doc/images/Line_panel.png differ diff --git a/src/SketchPlugin/doc/images/Line_res.png b/src/SketchPlugin/doc/images/Line_res.png new file mode 100644 index 000000000..61de79e87 Binary files /dev/null and b/src/SketchPlugin/doc/images/Line_res.png differ diff --git a/src/SketchPlugin/doc/images/PlaneDefinition.png b/src/SketchPlugin/doc/images/PlaneDefinition.png new file mode 100644 index 000000000..02e0fb877 Binary files /dev/null and b/src/SketchPlugin/doc/images/PlaneDefinition.png differ diff --git a/src/SketchPlugin/doc/images/Point.png b/src/SketchPlugin/doc/images/Point.png index c4691b68e..96149ebf3 100644 Binary files a/src/SketchPlugin/doc/images/Point.png and b/src/SketchPlugin/doc/images/Point.png differ diff --git a/src/SketchPlugin/doc/images/Point_panel.png b/src/SketchPlugin/doc/images/Point_panel.png new file mode 100644 index 000000000..7017b16ce Binary files /dev/null and b/src/SketchPlugin/doc/images/Point_panel.png differ diff --git a/src/SketchPlugin/doc/images/Point_res.png b/src/SketchPlugin/doc/images/Point_res.png new file mode 100644 index 000000000..47b87c3bb Binary files /dev/null and b/src/SketchPlugin/doc/images/Point_res.png differ diff --git a/src/SketchPlugin/doc/images/Rectangle.png b/src/SketchPlugin/doc/images/Rectangle.png index 2bb9f9151..b98a99162 100644 Binary files a/src/SketchPlugin/doc/images/Rectangle.png and b/src/SketchPlugin/doc/images/Rectangle.png differ diff --git a/src/SketchPlugin/doc/images/Rectangle_panel.png b/src/SketchPlugin/doc/images/Rectangle_panel.png new file mode 100644 index 000000000..a2267a4ed Binary files /dev/null and b/src/SketchPlugin/doc/images/Rectangle_panel.png differ diff --git a/src/SketchPlugin/doc/images/Rectangle_res.png b/src/SketchPlugin/doc/images/Rectangle_res.png new file mode 100644 index 000000000..475c9a3c6 Binary files /dev/null and b/src/SketchPlugin/doc/images/Rectangle_res.png differ diff --git a/src/SketchPlugin/doc/images/SketchButton.png b/src/SketchPlugin/doc/images/SketchButton.png new file mode 100644 index 000000000..d97a8497b Binary files /dev/null and b/src/SketchPlugin/doc/images/SketchButton.png differ diff --git a/src/SketchPlugin/doc/images/SketchPanel.png b/src/SketchPlugin/doc/images/SketchPanel.png new file mode 100644 index 000000000..c22a957b9 Binary files /dev/null and b/src/SketchPlugin/doc/images/SketchPanel.png differ diff --git a/src/SketchPlugin/doc/images/arc.png b/src/SketchPlugin/doc/images/arc.png new file mode 100644 index 000000000..fef024583 Binary files /dev/null and b/src/SketchPlugin/doc/images/arc.png differ diff --git a/src/SketchPlugin/doc/images/arc_3pt_32x32.png b/src/SketchPlugin/doc/images/arc_3pt_32x32.png new file mode 100644 index 000000000..584fa594a Binary files /dev/null and b/src/SketchPlugin/doc/images/arc_3pt_32x32.png differ diff --git a/src/SketchPlugin/doc/images/arc_base_32x32.png b/src/SketchPlugin/doc/images/arc_base_32x32.png new file mode 100644 index 000000000..c36df3056 Binary files /dev/null and b/src/SketchPlugin/doc/images/arc_base_32x32.png differ diff --git a/src/SketchPlugin/doc/images/arc_tang_32x32.png b/src/SketchPlugin/doc/images/arc_tang_32x32.png new file mode 100644 index 000000000..cfec981e7 Binary files /dev/null and b/src/SketchPlugin/doc/images/arc_tang_32x32.png differ diff --git a/src/SketchPlugin/doc/images/circle.png b/src/SketchPlugin/doc/images/circle.png new file mode 100644 index 000000000..6f311635d Binary files /dev/null and b/src/SketchPlugin/doc/images/circle.png differ diff --git a/src/SketchPlugin/doc/images/circle_3pt_32x32.png b/src/SketchPlugin/doc/images/circle_3pt_32x32.png new file mode 100644 index 000000000..d7ed5b227 Binary files /dev/null and b/src/SketchPlugin/doc/images/circle_3pt_32x32.png differ diff --git a/src/SketchPlugin/doc/images/circle_pt_rad_32x32.png b/src/SketchPlugin/doc/images/circle_pt_rad_32x32.png new file mode 100644 index 000000000..6a8b7e7fa Binary files /dev/null and b/src/SketchPlugin/doc/images/circle_pt_rad_32x32.png differ diff --git a/src/SketchPlugin/doc/lineFeature.rst b/src/SketchPlugin/doc/lineFeature.rst index a18275976..020a1c3ee 100644 --- a/src/SketchPlugin/doc/lineFeature.rst +++ b/src/SketchPlugin/doc/lineFeature.rst @@ -2,9 +2,47 @@ Line ==== +The feature Line creates a line segment by two points in the current Sketch. -.. image:: images/Line.png +To add new Line to the Sketch: + +#. select in the Main Menu *Sketch - > Line* item or +#. click **Line** button in Sketch toolbar: + +.. image:: images/line.png + :align: center + +.. centered:: + **Line** button + +The following property panel appears. + +.. image:: images/Line_panel.png :align: center .. centered:: - Create a line + Line + +Pick 2 points (start and end) in the view to create a Line. In the case of click on an existing object constraint for +the point will be created automatically. + +Start and end points coordinates are displayed in the property panel. + +**TUI Command**: *Sketch_1.addLine(X1, Y1, X2, Y2)* + +**Arguments**: 4 values (coordinates of the start and end points). + +Result +"""""" + +Created line appears in the view. + +Example is shown below. + +.. image:: images/Line_res.png + :align: center + +.. centered:: + Line created + +**See Also** a sample TUI Script of a :ref:`tui_create_line` operation. diff --git a/src/SketchPlugin/doc/pointFeature.rst b/src/SketchPlugin/doc/pointFeature.rst index b344fcce0..bceedd1f3 100644 --- a/src/SketchPlugin/doc/pointFeature.rst +++ b/src/SketchPlugin/doc/pointFeature.rst @@ -2,9 +2,47 @@ Point ===== +The feature Point creates a point in the current Sketch. -.. image:: images/Point.png +To add new Point to the Sketch: + +#. select in the Main Menu *Sketch - > Point* item or +#. click **Point** button in Sketch toolbar: + +.. image:: images/point.png + :align: center + +.. centered:: + **Point** button + +The following property panel appears. + +.. image:: images/Point_panel.png :align: center .. centered:: - Create a point + Point + +Clicking in the view creates a point preview. In the case of click on an existing object constraint for +the point will be created automatically. + +The point coordinates are displayed in the property panel. + +**TUI Command**: *Sketch_1.addPoint(X, Y)* + +**Arguments**: 2 values (coordinates on the Sketch plane). + +Result +"""""" + +Created point appears in the view. + +Example is shown below. + +.. image:: images/Point_res.png + :align: center + +.. centered:: + Point created + +**See Also** a sample TUI Script of a :ref:`tui_create_point` operation. \ No newline at end of file diff --git a/src/SketchPlugin/doc/rectangleFeature.rst b/src/SketchPlugin/doc/rectangleFeature.rst index c2afc1802..f5712b71e 100644 --- a/src/SketchPlugin/doc/rectangleFeature.rst +++ b/src/SketchPlugin/doc/rectangleFeature.rst @@ -2,9 +2,50 @@ Rectangle ========= +The feature Rectangle creates a rectangle by two opposite points in the current Sketch. -.. image:: images/Rectangle.png +The result is represented in the form of four Lines which compose a rectangle. +Two of the lines have Vertical constraint and two others have Horizontal constraint. + +To add new Rectangle to the Sketch: + +#. select in the Main Menu *Sketch - > Rectangle* item or +#. click **Rectangle** button in Sketch toolbar: + +.. image:: images/rectangle.png + :align: center + +.. centered:: + **Rectangle** button + +The following property panel appears. + +.. image:: images/Rectangle_panel.png :align: center .. centered:: - Create a rectangle + Rectangle + +Click in the view once to set the first corner, then move the mouse and click a second time to set the opposite corner. +In the case of click on an existing object constraint for the point will be created automatically. + +Start and end points coordinates are displayed in the property panel. + +**TUI Command**: *Sketch_1.addRectangle(X1, Y1, X2, Y2)* + +**Arguments**: 4 values (coordinates of the start and end points). + +Result +"""""" + +Created rectangle appears in the view. + +Example is shown below. + +.. image:: images/Rectangle_res.png + :align: center + +.. centered:: + Rectangle created + +**See Also** a sample TUI Script of a :ref:`tui_create_rectangle` operation. \ No newline at end of file