]> SALOME platform Git repositories - modules/shaper.git/blob - src/FeaturesPlugin/doc/translationFeature.rst
Salome HOME
Copyright update 2022
[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 .. figure:: images/translation_vector_32x32.png    
18    :align: left
19    :height: 24px
20
21 by by axis and distance
22
23 .. figure:: images/translation_dxyz_32x32.png      
24    :align: left
25    :height: 24px
26
27 by vector 
28
29 .. figure:: 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 .. figure:: images/Translation2.png
41    :align: center
42
43    Translation by axis and distance property panel
44
45 Input fields:
46
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**.
50
51 **TUI Command**:
52
53 .. py:function:: model.addTranslation(Part_doc, [shape], axis, dist)
54
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.
60
61 Result
62 """"""
63
64 The result of operation is a shifted initial shape.
65
66 .. figure:: images/translation_XYZ.png
67    :align: center
68
69    Translation by axis and distance
70
71 **See Also** a sample TUI Script of a :ref:`tui_translation_vector` operation.
72
73 Translation by vector
74 ---------------------
75
76 .. figure:: images/Translation1.png
77    :align: center
78
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; :ref:`transformation_subshapes`
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 .. figure:: images/translation_vector.png
103    :align: center
104
105    Translation by vector
106
107 **See Also** a sample TUI Script of :ref:`tui_translation_DXDYDZ` operation.
108
109
110 Translation by two points
111 -------------------------
112
113 .. figure:: images/Translation3.png
114    :align: center
115
116    Translation by two points property panel
117
118 Input fields:
119
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;
123   
124 **TUI Command**:
125
126 .. py:function:: model.addTranslation(Part_doc, [shape], point1, point2)
127
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.
133
134 Result
135 """"""
136
137 The result of operation is a shifted initial shape.
138
139 .. figure:: images/translation_2points.png
140    :align: center
141
142    Translation by two points
143
144 **See Also** a sample TUI Script of :ref:`tui_translation_2points` operation.
145
146
147   .. _transformation_subshapes:
148
149 Transformation of COMPSOLID subshapes is prohibited.
150 ===========
151
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.
154
155 Transformation of COMPSOLID subshapes is prohibited, because we cannot guarantee the result still be a COMPSOLID after moving/duplicating some parts of it.