1 .. _featureTranslation:
2 .. |translation_vector_32x32.icon| image:: images/translation_vector_32x32.png
8 **Translation** feature translates a selected shape.
10 To create a Translation in the active part:
12 #. select in the Main Menu *Part - > Translation* item or
13 #. click |translation_vector_32x32.icon| **Translation** button in the toolbar
15 The Vector of translation can be defined in three different ways:
17 .. figure:: images/translation_vector_32x32.png
21 by by axis and distance
23 .. figure:: images/translation_dxyz_32x32.png
29 .. figure:: images/translation_2pt_32x32.png
35 --------------------------------------------------------------------------------
37 Translation by axis and distance
38 --------------------------------
40 .. figure:: images/Translation2.png
43 Translation by axis and distance property panel
47 - **Main objects** panel contains shapes to be translated. The shapes are selected in 3D OCC viewer or object browser; :ref:`transformation_subshapes`
48 - **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;
49 - **Distance** defines the distance along the **Vector of translation**.
53 .. py:function:: model.addTranslation(Part_doc, [shape], axis, dist)
55 :param part: The current part object.
56 :param list: A list of shapes in format *model.selection(TYPE, shape)*.
57 :param object: axis in format *model.selection(TYPE, shape)*.
58 :param real: Distance value.
59 :return: Result object.
64 The result of operation is a shifted initial shape.
66 .. figure:: images/translation_XYZ.png
69 Translation by axis and distance
71 **See Also** a sample TUI Script of a :ref:`tui_translation_vector` operation.
76 .. figure:: 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; :ref:`transformation_subshapes`
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 .. figure:: images/translation_vector.png
105 Translation by vector
107 **See Also** a sample TUI Script of :ref:`tui_translation_DXDYDZ` operation.
110 Translation by two points
111 -------------------------
113 .. figure:: images/Translation3.png
116 Translation by two points property panel
120 - **Main objects** panel contains shapes to be translated. Shapes are selected in 3D OCC viewer or object browser; :ref:`transformation_subshapes`
121 - **Start point** defines start vector point as point or vertex selected in 3D OCC viewer or object browser;
122 - **End point** defines end vector point as point or vertex selected in 3D OCC viewer or object browser;
126 .. py:function:: model.addTranslation(Part_doc, [shape], point1, point2)
128 :param part: The current part object.
129 :param list: A list of shapes in format *model.selection(TYPE, shape)*.
130 :param object: A point in format *model.selection(TYPE, shape)*.
131 :param object: A point in format *model.selection(TYPE, shape)*.
132 :return: Result object.
137 The result of operation is a shifted initial shape.
139 .. figure:: images/translation_2points.png
142 Translation by two points
144 **See Also** a sample TUI Script of :ref:`tui_translation_2points` operation.
147 .. _transformation_subshapes:
149 Transformation of COMPSOLID subshapes is prohibited.
152 If you select one or more subshapes of COMPOUND as transformation (translation or other operation that changes the shape position or orientation) **Main objects**,
153 all other subshapes will be also included in result at their original locations.
155 Transformation of COMPSOLID subshapes is prohibited, because we cannot guarantee the result still be a COMPSOLID after moving/duplicating some parts of it.