]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Task #3231: Sketcher Offset of a curve. Documentation.
authorjfa <jfa@opencascade.com>
Tue, 30 Jun 2020 14:00:28 +0000 (17:00 +0300)
committerjfa <jfa@opencascade.com>
Tue, 30 Jun 2020 14:00:28 +0000 (17:00 +0300)
src/SketchPlugin/doc/SketchPlugin.rst
src/SketchPlugin/doc/TUI_offset.rst [new file with mode: 0644]
src/SketchPlugin/doc/examples/offset.py [new file with mode: 0644]
src/SketchPlugin/doc/images/Offset_panel.png [new file with mode: 0644]
src/SketchPlugin/doc/images/Offset_res.png [new file with mode: 0644]
src/SketchPlugin/doc/images/offset.png [new file with mode: 0644]
src/SketchPlugin/doc/offsetFeature.rst [new file with mode: 0644]

index e405acaa0f297ce13a568e43a3508411ba66451d..0f66b82bf2e92910b4f195347d5eaf5e76daaf5a 100644 (file)
@@ -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 (file)
index 0000000..6175182
--- /dev/null
@@ -0,0 +1,11 @@
+
+  .. _tui_create_offset:
+
+Create Offset
+=============
+
+.. literalinclude:: examples/offset.py
+    :linenos:
+    :language: python
+
+:download:`Download this script <examples/offset.py>`
diff --git a/src/SketchPlugin/doc/examples/offset.py b/src/SketchPlugin/doc/examples/offset.py
new file mode 100644 (file)
index 0000000..881db9a
--- /dev/null
@@ -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 (file)
index 0000000..d34ad6c
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 (file)
index 0000000..701faf0
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 (file)
index 0000000..8ce6065
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 (file)
index 0000000..ce42254
--- /dev/null
@@ -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.