From: jfa Date: Tue, 30 Jun 2020 14:00:28 +0000 (+0300) Subject: Task #3231: Sketcher Offset of a curve. Documentation. X-Git-Tag: V9_6_0a1~60^2~11 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=10e21eabd9a3cb4c30d71a3808fa66217ad83203;p=modules%2Fshaper.git Task #3231: Sketcher Offset of a curve. Documentation. --- diff --git a/src/SketchPlugin/doc/SketchPlugin.rst b/src/SketchPlugin/doc/SketchPlugin.rst index e405acaa0..0f66b82bf 100644 --- a/src/SketchPlugin/doc/SketchPlugin.rst +++ b/src/SketchPlugin/doc/SketchPlugin.rst @@ -180,5 +180,6 @@ The plug-in includes the following operations: mirrorFeature.rst translationFeature.rst rotationFeature.rst + offsetFeature.rst sketchDrawer.rst sketchCopy.rst diff --git a/src/SketchPlugin/doc/TUI_offset.rst b/src/SketchPlugin/doc/TUI_offset.rst new file mode 100644 index 000000000..6175182e1 --- /dev/null +++ b/src/SketchPlugin/doc/TUI_offset.rst @@ -0,0 +1,11 @@ + + .. _tui_create_offset: + +Create Offset +============= + +.. literalinclude:: examples/offset.py + :linenos: + :language: python + +:download:`Download this script ` diff --git a/src/SketchPlugin/doc/examples/offset.py b/src/SketchPlugin/doc/examples/offset.py new file mode 100644 index 000000000..881db9a40 --- /dev/null +++ b/src/SketchPlugin/doc/examples/offset.py @@ -0,0 +1,22 @@ +from salome.shaper import model + +model.begin() +partSet = model.moduleDocument() + +Sketch_1 = model.addSketch(partSet, model.defaultPlane("XOY")) + +SketchLine_1 = Sketch_1.addLine(0, 0, 0, 100) +SketchLine_2 = Sketch_1.addLine(0, 100, 100, 100) +SketchLine_3 = Sketch_1.addLine(100, 100, 100, 0) +SketchLine_4 = Sketch_1.addLine(0, 0, 100, 0) + +Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint()) +Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint()) +Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.endPoint()) +Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchLine_4.startPoint()) + +SketchOffset_1_objects = [SketchLine_1.result(), SketchLine_2.result(), SketchLine_3.result(), SketchLine_4.result()] +SketchOffset_1 = Sketch_1.addOffset(SketchOffset_1_objects, 10.0, False) + +model.do() +model.end() diff --git a/src/SketchPlugin/doc/images/Offset_panel.png b/src/SketchPlugin/doc/images/Offset_panel.png new file mode 100644 index 000000000..d34ad6c3c Binary files /dev/null and b/src/SketchPlugin/doc/images/Offset_panel.png differ diff --git a/src/SketchPlugin/doc/images/Offset_res.png b/src/SketchPlugin/doc/images/Offset_res.png new file mode 100644 index 000000000..701faf072 Binary files /dev/null and b/src/SketchPlugin/doc/images/Offset_res.png differ diff --git a/src/SketchPlugin/doc/images/offset.png b/src/SketchPlugin/doc/images/offset.png new file mode 100644 index 000000000..8ce6065d0 Binary files /dev/null and b/src/SketchPlugin/doc/images/offset.png differ diff --git a/src/SketchPlugin/doc/offsetFeature.rst b/src/SketchPlugin/doc/offsetFeature.rst new file mode 100644 index 000000000..ce42254df --- /dev/null +++ b/src/SketchPlugin/doc/offsetFeature.rst @@ -0,0 +1,59 @@ +.. |offset.icon| image:: images/offset.png + +Offset +====== + +Offset operation offsets sketch entities on a given distance. +Gaps are filled by arcs. +Offset is performed outside a closed contour or to the right +of an open one, unless the **Reversed** flag is not set. + +To create an Offset in the active Sketch: + +#. select in the Main Menu *Sketch - > Offset* item or +#. click |offset.icon| **Offset** button in Sketch toolbar: + +Property panel: + +.. image:: images/Offset_panel.png + :align: center + +.. centered:: + Offset + +Input fields: + +- **Edges** is the list of segments (lines, circles, arcs) selected in the view. +- **Offset value** is the offset distance. +- **Reversed** sets the reversed offset side (inside a closed contour or to the left of an open one). + +Button: + +- **Select wire** button adds edges connected by coincident boundary constraint + and composing a wire with the already selected segments. + Not more than 2 edges can be connected with one coincident point. + +**TUI Command**: + +.. py:function:: Sketch_1.addOffset(Objects, Distance, isReversed) + + :param list: A list of objects. + :param real: An offset distance. + :param boolean: Reversed flag. + :return: Result object. + +Result +"""""" + +Created Offset appears in the view. + +| The original and the offset objects are marked with a special sign. +| Offset object is drawn with a thinner line. + +.. image:: images/Offset_res.png + :align: center + +.. centered:: + Offset created + +**See Also** a sample TUI Script of :ref:`tui_create_offset` operation.