Salome HOME
Change icons for chamfer
[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 .. image:: images/Distance_panel.png
18    :align: center
19
20 Input fields:
21
22 - **First object** is the first object selected in the view;
23 - **Second object** is the second object selected in the view;
24 - **Value** is a distance between the objects, can be modified to set the desirable value;
25 - **Text location** is a position of the distance value label relating to extension line (in the view):
26    .. image:: images/location_left.png
27       :align: left
28    **Left** inserts text to the left of the distance extension line;
29
30    .. image:: images/location_automatic.png
31       :align: left
32    **Automatic** inserts text in the middle of the distance extension line if it has enough length, otherwise - to the left;
33
34    .. image:: images/location_right.png
35       :align: left
36    **Right** inserts text to the right of the distance extension line;
37 - **Keep orientation** fixes the relative position between selected objects.
38
39 When both objects are selected, the distance value is displayed in the property panel and in the view.
40
41 When creating a constraint after selection of two objects for the first time:
42
43 - drag the distance presentation in the view to the desired position and click once;
44 - set the desirable distance value in the input field and press **Enter** or just press **Enter** to keep the current distance.
45
46 .. image:: images/Distance_field_view.png
47    :align: center
48
49 .. centered::
50    Distance input in the view
51
52 **TUI Command**:
53
54 .. py:function:: Sketch_1.setDistance(FirstObject, SecondObject, Value, KeepOrientation)
55
56     :param object: First object.
57     :param object: Second object.
58     :param real: Value.
59     :param boolean: Keep orientation flag.
60     :return: Result object.
61
62 Result
63 """"""
64
65 Created Distance appears in the view.
66
67 .. image:: images/Distance_res.png
68            :align: center
69
70 .. centered::
71    Distance created
72
73 **See Also** a sample TUI Script of :ref:`tui_create_distance` operation.