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