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