Salome HOME
Correct documentation bugs, adapt for 'Read The Docs' theme (bos #18858)
[modules/shaper.git] / src / FeaturesPlugin / doc / translationFeature.rst
1 .. _featureTranslation:
2 .. |translation_vector_32x32.icon|    image:: images/translation_vector_32x32.png
3    :height: 16px
4
5 Translation
6 ===========
7
8 **Translation** feature translates a selected shape.
9
10 To create a Translation in the active part:
11
12 #. select in the Main Menu *Part - > Translation* item  or
13 #. click |translation_vector_32x32.icon| **Translation** button in the toolbar
14
15 The Vector of translation can be defined in three different ways:
16
17 .. image:: images/translation_vector_32x32.png    
18    :align: left
19    :height: 24px
20
21 by by axis and distance
22
23 .. image:: images/translation_dxyz_32x32.png      
24    :align: left
25    :height: 24px
26
27 by vector 
28
29 .. image:: images/translation_2pt_32x32.png    
30    :align: left
31    :height: 24px
32
33 by two points
34
35 --------------------------------------------------------------------------------
36
37 Translation by axis and distance
38 --------------------------------
39
40 .. image:: images/Translation2.png
41   :align: center
42
43 .. centered::
44   Translation by axis and distance property panel
45
46 Input fields:
47
48 - **Main objects** panel contains shapes to be translated. The shapes are selected in 3D OCC viewer or object browser;
49 - **Axis**  defines a vector along which the object will be translated. The vector is an edge or axis selected in 3D OCC viewer or object browser;
50 - **Distance** defines the distance along the **Vector of translation**.
51
52 **TUI Command**:
53
54 .. py:function:: model.addTranslation(Part_doc, [shape], axis, dist)
55
56     :param part: The current part object.
57     :param list: A list of shapes in format *model.selection(TYPE, shape)*.
58     :param object: axis in format *model.selection(TYPE, shape)*.
59     :param real: Distance value.
60     :return: Result object.
61
62 Result
63 """"""
64
65 The result of operation is a shifted initial shape.
66
67 .. image:: images/translation_XYZ.png
68    :align: center
69
70 .. centered::
71    Translation by axis and distance
72
73 **See Also** a sample TUI Script of a :ref:`tui_translation_vector` operation.
74
75 Translation by vector
76 ---------------------
77
78 .. image:: images/Translation1.png
79   :align: center
80
81 .. centered::
82   Translation by vector property panel
83
84 Input fields:
85
86 - **Main objects** panel contains shapes to be translated. The shapes are selected in 3D OCC viewer or object browser;
87 - **DX**, **DY**, **DZ**  define vector using coordinates along the axis.
88
89 **TUI Command**:
90
91 .. py:function:: model.addTranslation(Part_1_doc, [shape], DX, DY, DZ)
92
93     :param part: The current part object.
94     :param list: A list of shapes in format *model.selection(TYPE, shape)*.
95     :param real: dX value.
96     :param real: dY value.
97     :param real: dZ value.
98     :return: Result object.
99
100 Result
101 """"""
102
103 The result of operation is a shifted initial shape.
104
105 .. image:: images/translation_vector.png
106    :align: center
107
108 .. centered::
109    Translation by vector
110
111 **See Also** a sample TUI Script of :ref:`tui_translation_DXDYDZ` operation.
112
113
114 Translation by two points
115 -------------------------
116
117 .. image:: images/Translation3.png
118   :align: center
119
120 .. centered::
121   Translation by two points property panel
122
123 Input fields:
124
125 - **Main objects** panel contains shapes to be translated. Shapes are selected in 3D OCC viewer or object browser;
126 - **Start point**  defines start vector point as point or vertex selected in 3D OCC viewer or object browser;
127 - **End point**  defines end vector point as point or vertex selected in 3D OCC viewer or object browser;
128   
129 **TUI Command**:
130
131 .. py:function:: model.addTranslation(Part_doc, [shape], point1, point2)
132
133     :param part: The current part object.
134     :param list: A list of shapes in format *model.selection(TYPE, shape)*.
135     :param object: A point in format *model.selection(TYPE, shape)*.
136     :param object: A point in format *model.selection(TYPE, shape)*.
137     :return: Result object.
138
139 Result
140 """"""
141
142 The result of operation is a shifted initial shape.
143
144 .. image:: images/translation_2points.png
145    :align: center
146
147 .. centered::
148    Translation by two points
149
150 **See Also** a sample TUI Script of :ref:`tui_translation_2points` operation.
151