From: mzn Date: Wed, 12 Sep 2018 16:17:11 +0000 (+0300) Subject: Sketch constraints help pages (distance, vertical and horizontal distance). X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=c34169fe922480fc2ff30893aad58c6f706e98a7;p=modules%2Fshaper.git Sketch constraints help pages (distance, vertical and horizontal distance). --- diff --git a/src/SketchPlugin/doc/SketchPlugin.rst b/src/SketchPlugin/doc/SketchPlugin.rst index 823667866..b0970fad3 100644 --- a/src/SketchPlugin/doc/SketchPlugin.rst +++ b/src/SketchPlugin/doc/SketchPlugin.rst @@ -78,7 +78,7 @@ Name is assigned automatically: **Sketch_1**, **Sketch_2**, ... both for Feature Sketch objects -------------- -The plug-in includes following features for creation of 2D objects: +The plug-in includes the following features for creation of 2D objects: .. toctree:: :maxdepth: 1 @@ -94,13 +94,34 @@ The plug-in includes following features for creation of 2D objects: Constraints ----------- +Constraints are available and viewable during sketch creation or editing. +The goal of constrains creation is to fix a sketch geometry, i.e. set degrees of freedom to zero. + +If all degrees of freedom are eliminated, the sketch is fixed and displayed with green color. + +.. image:: images/Sketch_fixed.png + :align: center + +.. centered:: + Fixed Sketch + +If any degrees of freedom remain unsolved, the sketch is under-constrained and displayed with red color. + +.. image:: images/Sketch_underconstrained.png + :align: center + +.. centered:: + Underconstrained Sketch + +The plug-in includes the following constraints: .. toctree:: :maxdepth: 1 distanceFeature.rst horizontalDistFeature.rst + verticalDistFeature.rst angleFeature.rst coincedenceFeature.rst collinearFeature.rst @@ -113,7 +134,6 @@ Constraints radiusFeature.rst rigidFeature.rst tangentFeature.rst - verticalDistFeature.rst verticalFeature.rst .. _sketch_operations: diff --git a/src/SketchPlugin/doc/TUI_distance.rst b/src/SketchPlugin/doc/TUI_distance.rst new file mode 100644 index 000000000..260369b42 --- /dev/null +++ b/src/SketchPlugin/doc/TUI_distance.rst @@ -0,0 +1,11 @@ + + .. _tui_create_distance: + +Create Distance constraint +========================== + +.. literalinclude:: examples/distance.py + :linenos: + :language: python + +:download:`Download this script ` diff --git a/src/SketchPlugin/doc/TUI_hdistance.rst b/src/SketchPlugin/doc/TUI_hdistance.rst new file mode 100644 index 000000000..fc300376c --- /dev/null +++ b/src/SketchPlugin/doc/TUI_hdistance.rst @@ -0,0 +1,11 @@ + + .. _tui_create_hdistance: + +Create Horizontal Distance constraint +===================================== + +.. literalinclude:: examples/hdistance.py + :linenos: + :language: python + +:download:`Download this script ` diff --git a/src/SketchPlugin/doc/TUI_vdistance.rst b/src/SketchPlugin/doc/TUI_vdistance.rst new file mode 100644 index 000000000..38b38f3ed --- /dev/null +++ b/src/SketchPlugin/doc/TUI_vdistance.rst @@ -0,0 +1,11 @@ + + .. _tui_create_vdistance: + +Create Vertical Distance constraint +===================================== + +.. literalinclude:: examples/vdistance.py + :linenos: + :language: python + +:download:`Download this script ` diff --git a/src/SketchPlugin/doc/distanceFeature.rst b/src/SketchPlugin/doc/distanceFeature.rst index dd52e8f63..325c61ce2 100644 --- a/src/SketchPlugin/doc/distanceFeature.rst +++ b/src/SketchPlugin/doc/distanceFeature.rst @@ -2,9 +2,69 @@ Distance constraint =================== +Distance can be defined between two objects such as point, line, line or arc end point, center of circle or arc. -.. image:: images/Distance.png - :align: center +To create Distance constraint in the active Sketch: + +#. select in the Main Menu *Sketch - > Distance* item or +#. click **Distance** button in Sketch toolbar: + +.. image:: images/distance.png + :align: center + +.. centered:: + **Distance** button + +Property panel: + +.. image:: images/Distance_panel.png + :align: center + +Input fields: + +- **First object** - the first object +- **Second object** - the second object +- **Value** - distance between the objects, could be modified to set the desirable value +- **Text location** - position of the distance value label relating to extension line (in the view) + .. image:: images/location_left.png + :align: left + **Left** inserts text at the left of the distance extension line. + + .. image:: images/location_automatic.png + :align: left + **Automatic** inserts text at the middle of the distance extension line if it has enough length, otherwise - to the left. + + .. image:: images/location_right.png + :align: left + **Right** inserts text to the right of the distance extension line. +- **Keep orientation** - fixes the relative position between selected objects + +When the both objects are selected distance value is displayed in the property panel and in the view. + +When creating the constraint and the both objects are selected the first time: + +- drag the distance presentation in the view to the desired position (by move mouse and click once) +- set desirable distance value in the input field in the view and press **Enter** or just press **Enter** to keep the current distance + +.. image:: images/Distance_field_view.png + :align: center .. centered:: - Create a distance constraint + Distance input in the view + +**TUI Command**: *Sketch_1.setDistance(FirstObject, SecondObject, Value, KeepOrientation)* + +**Arguments**: 2 objects + distance value + keep orientation flag + +Result +"""""" + +Created Distance appears in the view. + +.. image:: images/Distance_res.png + :align: center + +.. centered:: + Distance created + +**See Also** a sample TUI Script of a :ref:`tui_create_distance` operation. diff --git a/src/SketchPlugin/doc/examples/distance.py b/src/SketchPlugin/doc/examples/distance.py new file mode 100644 index 000000000..b0e79ebe1 --- /dev/null +++ b/src/SketchPlugin/doc/examples/distance.py @@ -0,0 +1,14 @@ +# -*- 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")) +SketchCircle_1 = Sketch_1.addCircle(24.1, 24.5, 18.2) +SketchLine_1 = Sketch_1.addLine(54.3, 93.4, 91.2, 56.4) +SketchConstraintDistance_1 = Sketch_1.setDistance(SketchCircle_1.center(), SketchLine_1.result(), 70.0, True) +model.do() +model.end() \ No newline at end of file diff --git a/src/SketchPlugin/doc/examples/hdistance.py b/src/SketchPlugin/doc/examples/hdistance.py new file mode 100644 index 000000000..dfdf7672c --- /dev/null +++ b/src/SketchPlugin/doc/examples/hdistance.py @@ -0,0 +1,14 @@ +# -*- 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")) +SketchCircle_1 = Sketch_1.addCircle(24.1, 24.5, 18.2) +SketchLine_1 = Sketch_1.addLine(54.3, 93.4, 91.2, 56.4) +SketchConstraintDistanceHorizontal_1 = Sketch_1.setHorizontalDistance(SketchCircle_1.center(), SketchLine_1.startPoint(), 30) +model.do() +model.end() \ No newline at end of file diff --git a/src/SketchPlugin/doc/examples/vdistance.py b/src/SketchPlugin/doc/examples/vdistance.py new file mode 100644 index 000000000..51d74e882 --- /dev/null +++ b/src/SketchPlugin/doc/examples/vdistance.py @@ -0,0 +1,14 @@ +# -*- 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")) +SketchCircle_1 = Sketch_1.addCircle(24.1, 24.5, 18.2) +SketchLine_1 = Sketch_1.addLine(62.3, 85.1, 91.2, 56.4) +SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(SketchCircle_1.center(), SketchLine_1.startPoint(), 75.5) +model.do() +model.end() \ No newline at end of file diff --git a/src/SketchPlugin/doc/horizontalDistFeature.rst b/src/SketchPlugin/doc/horizontalDistFeature.rst index 3150c0f6b..74b095414 100644 --- a/src/SketchPlugin/doc/horizontalDistFeature.rst +++ b/src/SketchPlugin/doc/horizontalDistFeature.rst @@ -2,9 +2,70 @@ Horizontal distance constraint ============================== +Horizontal Distance constraint fixes distance between two objects along the horizontal axis. -.. image:: images/HorizontalDist.png - :align: center +The constraint can be defined between two points such as point object, line or arc end point, center of circle or arc. + +To create Horizontal Distance constraint in the active Sketch: + +#. select in the Main Menu *Sketch - > Horizontal Distance* item or +#. click **Horizontal Distance** button in Sketch toolbar: + +.. image:: images/distance_h.png + :align: center .. centered:: - Create horizontal distance constraint + **Horizontal Distance** button + +Property panel: + +.. image:: images/HorizontalDistance_panel.png + :align: center + +Input fields: + +- **First object** - the first object +- **Second object** - the second object +- **Value** - distance between the objects, could be modified to set the desirable value +- **Text location** - position of the distance value label relating to extension line (in the view) + .. image:: images/location_left.png + :align: left + **Left** inserts text at the left of the distance extension line. + + .. image:: images/location_automatic.png + :align: left + **Automatic** inserts text at the middle of the distance extension line if it has enough length, otherwise - to the left. + + .. image:: images/location_right.png + :align: left + **Right** inserts text to the right of the distance extension line. + +When the both objects are selected horizontal distance value is displayed in the property panel and in the view. + +When creating the constraint and the both objects are selected the first time: + +- drag the horizontal distance presentation in the view to the desired position (by move mouse and click once) +- set desirable horizontal distance value in the input field in the view and press **Enter** or just press **Enter** to keep the current distance + +.. image:: images/HorizontalDistance_field_view.png + :align: center + +.. centered:: + Horizontal Distance input in the view + +**TUI Command**: *Sketch_1.setHorizontalDistance(FirstObject, SecondObject, Value)* + +**Arguments**: 2 objects + horizontal distance value + +Result +"""""" + +Created Horizontal Distance appears in the view. + +.. image:: images/HorizontalDistance_res.png + :align: center + +.. centered:: + Horizontal Distance created + +**See Also** a sample TUI Script of a :ref:`tui_create_hdistance` operation. \ No newline at end of file diff --git a/src/SketchPlugin/doc/images/Distance.png b/src/SketchPlugin/doc/images/Distance.png index 2ef362b39..7676548da 100644 Binary files a/src/SketchPlugin/doc/images/Distance.png and b/src/SketchPlugin/doc/images/Distance.png differ diff --git a/src/SketchPlugin/doc/images/Distance_field_view.png b/src/SketchPlugin/doc/images/Distance_field_view.png new file mode 100644 index 000000000..6290be94a Binary files /dev/null and b/src/SketchPlugin/doc/images/Distance_field_view.png differ diff --git a/src/SketchPlugin/doc/images/Distance_panel.png b/src/SketchPlugin/doc/images/Distance_panel.png new file mode 100644 index 000000000..27d66efc9 Binary files /dev/null and b/src/SketchPlugin/doc/images/Distance_panel.png differ diff --git a/src/SketchPlugin/doc/images/Distance_res.png b/src/SketchPlugin/doc/images/Distance_res.png new file mode 100644 index 000000000..e7273711b Binary files /dev/null and b/src/SketchPlugin/doc/images/Distance_res.png differ diff --git a/src/SketchPlugin/doc/images/HorizontalDist.png b/src/SketchPlugin/doc/images/HorizontalDist.png deleted file mode 100644 index 29789230b..000000000 Binary files a/src/SketchPlugin/doc/images/HorizontalDist.png and /dev/null differ diff --git a/src/SketchPlugin/doc/images/HorizontalDistance_field_view.png b/src/SketchPlugin/doc/images/HorizontalDistance_field_view.png new file mode 100644 index 000000000..b9bdc9aff Binary files /dev/null and b/src/SketchPlugin/doc/images/HorizontalDistance_field_view.png differ diff --git a/src/SketchPlugin/doc/images/HorizontalDistance_panel.png b/src/SketchPlugin/doc/images/HorizontalDistance_panel.png new file mode 100644 index 000000000..c204cdca6 Binary files /dev/null and b/src/SketchPlugin/doc/images/HorizontalDistance_panel.png differ diff --git a/src/SketchPlugin/doc/images/HorizontalDistance_res.png b/src/SketchPlugin/doc/images/HorizontalDistance_res.png new file mode 100644 index 000000000..f50453a00 Binary files /dev/null and b/src/SketchPlugin/doc/images/HorizontalDistance_res.png differ diff --git a/src/SketchPlugin/doc/images/Sketch_fixed.png b/src/SketchPlugin/doc/images/Sketch_fixed.png new file mode 100644 index 000000000..ce5577c84 Binary files /dev/null and b/src/SketchPlugin/doc/images/Sketch_fixed.png differ diff --git a/src/SketchPlugin/doc/images/Sketch_underconstrained - Copy.png b/src/SketchPlugin/doc/images/Sketch_underconstrained - Copy.png new file mode 100644 index 000000000..852396f87 Binary files /dev/null and b/src/SketchPlugin/doc/images/Sketch_underconstrained - Copy.png differ diff --git a/src/SketchPlugin/doc/images/Sketch_underconstrained.png b/src/SketchPlugin/doc/images/Sketch_underconstrained.png new file mode 100644 index 000000000..852396f87 Binary files /dev/null and b/src/SketchPlugin/doc/images/Sketch_underconstrained.png differ diff --git a/src/SketchPlugin/doc/images/VerticalDistance_field_view.png b/src/SketchPlugin/doc/images/VerticalDistance_field_view.png new file mode 100644 index 000000000..1c72a7148 Binary files /dev/null and b/src/SketchPlugin/doc/images/VerticalDistance_field_view.png differ diff --git a/src/SketchPlugin/doc/images/VerticalDistance_panel.png b/src/SketchPlugin/doc/images/VerticalDistance_panel.png new file mode 100644 index 000000000..9397c7ea0 Binary files /dev/null and b/src/SketchPlugin/doc/images/VerticalDistance_panel.png differ diff --git a/src/SketchPlugin/doc/images/VerticalDistance_res.png b/src/SketchPlugin/doc/images/VerticalDistance_res.png new file mode 100644 index 000000000..e911a08f7 Binary files /dev/null and b/src/SketchPlugin/doc/images/VerticalDistance_res.png differ diff --git a/src/SketchPlugin/doc/images/distance_h.png b/src/SketchPlugin/doc/images/distance_h.png new file mode 100644 index 000000000..b88db2102 Binary files /dev/null and b/src/SketchPlugin/doc/images/distance_h.png differ diff --git a/src/SketchPlugin/doc/images/distance_v.png b/src/SketchPlugin/doc/images/distance_v.png new file mode 100644 index 000000000..027a384d5 Binary files /dev/null and b/src/SketchPlugin/doc/images/distance_v.png differ diff --git a/src/SketchPlugin/doc/images/location_automatic.png b/src/SketchPlugin/doc/images/location_automatic.png new file mode 100644 index 000000000..88730b3b5 Binary files /dev/null and b/src/SketchPlugin/doc/images/location_automatic.png differ diff --git a/src/SketchPlugin/doc/images/location_left.png b/src/SketchPlugin/doc/images/location_left.png new file mode 100644 index 000000000..e963b8d92 Binary files /dev/null and b/src/SketchPlugin/doc/images/location_left.png differ diff --git a/src/SketchPlugin/doc/images/location_right.png b/src/SketchPlugin/doc/images/location_right.png new file mode 100644 index 000000000..cdb855141 Binary files /dev/null and b/src/SketchPlugin/doc/images/location_right.png differ diff --git a/src/SketchPlugin/doc/verticalDistFeature.rst b/src/SketchPlugin/doc/verticalDistFeature.rst index 9fb6991b9..47e718a99 100644 --- a/src/SketchPlugin/doc/verticalDistFeature.rst +++ b/src/SketchPlugin/doc/verticalDistFeature.rst @@ -2,9 +2,70 @@ Vertical distance constraint ============================ +Vertical Distance constraint fixes distance between two objects along the vertical axis. -.. image:: images/VerticalDist.png - :align: center +The constraint can be defined between two points such as point object, line or arc end point, center of circle or arc. + +To create Vertical Distance constraint in the active Sketch: + +#. select in the Main Menu *Sketch - > Vertical Distance* item or +#. click **Vertical Distance** button in Sketch toolbar: + +.. image:: images/distance_v.png + :align: center .. centered:: - Create a vertical distance constraint + **Vertical Distance** button + +Property panel: + +.. image:: images/VerticalDistance_panel.png + :align: center + +Input fields: + +- **First object** - the first object +- **Second object** - the second object +- **Value** - distance between the objects, could be modified to set the desirable value +- **Text location** - position of the distance value label relating to extension line (in the view) + .. image:: images/location_left.png + :align: left + **Left** inserts text at the left of the distance extension line. + + .. image:: images/location_automatic.png + :align: left + **Automatic** inserts text at the middle of the distance extension line if it has enough length, otherwise - to the left. + + .. image:: images/location_right.png + :align: left + **Right** inserts text to the right of the distance extension line. + +When the both objects are selected vertical distance value is displayed in the property panel and in the view. + +When creating the constraint and the both objects are selected the first time: + +- drag the Vertical distance presentation in the view to the desired position (by move mouse and click once) +- set desirable vertical distance value in the input field in the view and press **Enter** or just press **Enter** to keep the current distance + +.. image:: images/VerticalDistance_field_view.png + :align: center + +.. centered:: + Vertical Distance input in the view + +**TUI Command**: *Sketch_1.setVerticalDistance(FirstObject, SecondObject, Value)* + +**Arguments**: 2 objects + vertical distance value + +Result +"""""" + +Created Vertical Distance appears in the view. + +.. image:: images/VerticalDistance_res.png + :align: center + +.. centered:: + Vertical Distance created + +**See Also** a sample TUI Script of a :ref:`tui_create_vdistance` operation.