1 .. _featureTranslation:
2 .. |translation_vector_32x32.icon| image:: images/translation_vector_32x32.png
7 **Translation** feature translates a selected shape.
9 To create a Translation in the active part:
11 #. select in the Main Menu *Part - > Translation* item or
12 #. click |translation_vector_32x32.icon| **Translation** button in the toolbar
14 .. image:: images/translation_vector_32x32.png
18 **Translation** button
20 The Vector of translation can be defined in three different ways:
22 .. image:: images/translation_vector_32x32.png
24 by by axis and distance
26 .. image:: images/translation_dxyz_32x32.png
30 .. image:: images/translation_2pt_32x32.png
34 Translation by axis and distance
35 --------------------------------
37 .. image:: images/Translation2.png
41 Translation by axis and distance property panel
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**.
51 .. py:function:: model.addTranslation(Part_doc, [shape], axis, dist)
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.
62 The result of operation is a shifted initial shape.
64 .. image:: images/translation_XYZ.png
68 Translation by axis and distance
70 **See Also** a sample TUI Script of a :ref:`tui_translation_vector` operation.
75 .. image:: images/Translation1.png
79 Translation by vector property panel
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.
88 .. py:function:: model.addTranslation(Part_1_doc, [shape], DX, DY, DZ)
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.
100 The result of operation is a shifted initial shape.
102 .. image:: images/translation_vector.png
106 Translation by vector
108 **See Also** a sample TUI Script of :ref:`tui_translation_DXDYDZ` operation.
111 Translation by two points
112 -------------------------
114 .. image:: images/Translation3.png
118 Translation by two points property panel
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;
128 .. py:function:: model.addTranslation(Part_doc, [shape], point1, point2)
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.
139 The result of operation is a shifted initial shape.
141 .. image:: images/translation_2points.png
145 Translation by two points
147 **See Also** a sample TUI Script of :ref:`tui_translation_2points` operation.