Salome HOME
Documentation: use 'figure' instead of 'image'; improve caption layout; fix warnings.
[modules/shaper.git] / src / SketchPlugin / doc / distanceFeature.rst
1 .. |distance.icon|    image:: images/Distance.png
2
3 Distance constraint
4 ===================
5
6 Distance constraint fixes the distance between two objects.
7
8 The constraint can be defined between such objects as point, line, line or arc end point, center of circle or arc.
9
10 To create a Distance constraint in the active Sketch:
11
12 #. select in the Main Menu *Sketch - > Distance* item  or
13 #. click |distance.icon| **Distance** button in Sketch toolbar:
14
15 Property panel:
16
17 .. figure:: images/Distance_panel.png
18    :align: center
19
20 .. |location_left| image:: images/location_left.png
21 .. |location_auto| image:: images/location_automatic.png
22 .. |location_right| image:: images/location_right.png
23
24 Input fields:
25
26 - **First object** is the first object selected in the view;
27 - **Second object** is the second object selected in the view;
28 - **Value** is a distance between the objects, can be modified to set the desirable value;
29 - **Text location** is a position of the distance value label relating to extension line (in the view):
30    | |location_left| **Left** inserts text to the left of the distance extension line;
31    | |location_auto| **Automatic** inserts text in the middle of the distance extension line if it has enough length, otherwise - to the left;
32    | |location_right| **Right** inserts text to the right of the distance extension line;
33 - **Keep orientation** fixes the relative position between selected objects.
34
35 When both objects are selected, the distance value is displayed in the property panel and in the view.
36
37 When creating a constraint after selection of two objects for the first time:
38
39 - drag the distance presentation in the view to the desired position and click once;
40 - set the desirable distance value in the input field and press **Enter** or just press **Enter** to keep the current distance.
41
42 .. figure:: images/Distance_field_view.png
43    :align: center
44
45    Distance input in the view
46
47 **TUI Command**:
48
49 .. py:function:: Sketch_1.setDistance(FirstObject, SecondObject, Value, KeepOrientation)
50
51     :param object: First object.
52     :param object: Second object.
53     :param real: Value.
54     :param boolean: Keep orientation flag.
55     :return: Result object.
56
57 Result
58 """"""
59
60 Created Distance appears in the view.
61
62 .. figure:: images/Distance_res.png
63    :align: center
64
65    Distance created
66
67 **See Also** a sample TUI Script of :ref:`tui_create_distance` operation.