Salome HOME
Merge branch 'master' into gni/evolution
[modules/shaper.git] / src / SketchPlugin / doc / offsetFeature.rst
1 .. |offset.icon|    image:: images/offset.png
2
3 Offset
4 ======
5
6 Offset operation offsets sketch entities on a given distance.
7 Offset is performed outside a closed contour or to the right
8 of an open one, unless the **Reversed** flag is not set.
9
10 Edges junctions are filled in accordance with selected offset mode.
11 The following modes are implemented:
12   - **Keep distance** mode, enabled by default. It keeps the distance from initial
13     contour to the resulting one, creating additional arcs where it is needed.
14   - **Arcs mode**, where on connection of straight segments, tangent arcs are created.
15     Only connection of straight lines is supported; with other types of curves,
16     offset will work as in **Keep distance** mode. Radius of arcs equals to the offset value.
17     These arcs cut off the initially connected lines, so, if in result at least one
18     such line becomes invalid (removed from the result), the arc is not created
19     in this connection, the line is created in this point as in the **Lines** mode.
20   - **Lines** mode, where no arcs is created on the connection of the resulting lines.
21     Adjacent lines are prolonged to the point of their intersection. If the offset
22     arguments are not straigh lines (arcs, bspline, etc), the offset will work
23     as in the **Keep distance** mode in these locations.
24
25 To create an Offset in the active Sketch:
26
27 #. select in the Main Menu *Sketch - > Offset* item  or
28 #. click |offset.icon| **Offset** button in Sketch toolbar:
29
30 Property panel:
31
32 .. image:: images/Offset_panel.png
33   :align: center
34
35 .. centered::
36    Offset
37
38 Input fields:
39
40 - Offset mode can be **Keep distance**, **Arcs** or **Lines**
41 - **Approx by segments and arcs** converts the input geometry of the offset algorithm to segments and arcs.
42 - **Edges** is the list of segments (lines, circles, arcs) selected in the view.
43 - **Offset value** is the offset distance.
44 - **Reversed** sets the reversed offset side (inside a closed contour or to the left of an open one).
45
46 Button:
47
48 - **Select wire** button adds edges connected by coincident boundary constraint
49                   and composing a wire with the already selected segments.
50                   Not more than 2 edges can be connected with one coincident point.
51
52 **TUI Command**:
53
54 .. py:function:: Sketch_1.addOffset(Objects, Distance, isReversed, Mode)
55
56     :param list: A list of objects.
57     :param real: An offset distance.
58     :param boolean: Reversed flag.
59     :param string: Offset mode. Can be "KeepDistance", "Arcs" or "Lines".
60     :return: Result object.
61
62 Result
63 """"""
64
65 Created Offset appears in the view.
66
67 | The original and the offset objects are marked with a special sign.
68 | Offset object is drawn with a thinner line.
69
70 .. image:: images/Offset_res.png
71            :align: center
72
73 .. centered::
74    Offset created
75
76 **See Also** a sample TUI Script of :ref:`tui_create_offset` operation.