]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
translation and rotation
authorgzy <gzy@opencascade.com>
Fri, 21 Sep 2018 13:41:21 +0000 (16:41 +0300)
committergzy <gzy@opencascade.com>
Fri, 21 Sep 2018 13:41:21 +0000 (16:41 +0300)
18 files changed:
src/FeaturesPlugin/doc/TUI_rotation3pointsFeature.rst [new file with mode: 0644]
src/FeaturesPlugin/doc/TUI_rotationaxisFeature.rst [new file with mode: 0644]
src/FeaturesPlugin/doc/TUI_translation2pointsFeature.rst [new file with mode: 0644]
src/FeaturesPlugin/doc/TUI_translationdxdydzFeature.rst [new file with mode: 0644]
src/FeaturesPlugin/doc/TUI_translationvectorFeature.rst [new file with mode: 0644]
src/FeaturesPlugin/doc/examples/rotation1.py [new file with mode: 0644]
src/FeaturesPlugin/doc/examples/rotation2.py [new file with mode: 0644]
src/FeaturesPlugin/doc/examples/translation2points.py [new file with mode: 0644]
src/FeaturesPlugin/doc/examples/translationDXDYDZ.py [new file with mode: 0644]
src/FeaturesPlugin/doc/examples/translationvector.py [new file with mode: 0644]
src/FeaturesPlugin/doc/images/rotation.png [new file with mode: 0644]
src/FeaturesPlugin/doc/images/rotation_3pt_32x32.png [new file with mode: 0644]
src/FeaturesPlugin/doc/images/rotation_axis_32x32.png [new file with mode: 0644]
src/FeaturesPlugin/doc/images/translation_2pt_32x32.png [new file with mode: 0644]
src/FeaturesPlugin/doc/images/translation_dxyz_32x32.png [new file with mode: 0644]
src/FeaturesPlugin/doc/images/translation_vector_32x32.png [new file with mode: 0644]
src/FeaturesPlugin/doc/rotationFeature.rst
src/FeaturesPlugin/doc/translationFeature.rst

diff --git a/src/FeaturesPlugin/doc/TUI_rotation3pointsFeature.rst b/src/FeaturesPlugin/doc/TUI_rotation3pointsFeature.rst
new file mode 100644 (file)
index 0000000..b6af697
--- /dev/null
@@ -0,0 +1,11 @@
+
+  .. _tui_rotation_3points:
+
+Rotation by center and points
+=============================
+
+.. literalinclude:: examples/rotation2.py  
+    :linenos:
+    :language: python
+
+:download:`Download this script <examples/rotation2.py >` 
\ No newline at end of file
diff --git a/src/FeaturesPlugin/doc/TUI_rotationaxisFeature.rst b/src/FeaturesPlugin/doc/TUI_rotationaxisFeature.rst
new file mode 100644 (file)
index 0000000..de089c1
--- /dev/null
@@ -0,0 +1,11 @@
+
+  .. _tui_rotation_axis:
+
+Rotation by axis and angle
+==========================
+
+.. literalinclude:: examples/rotation1.py  
+    :linenos:
+    :language: python
+
+:download:`Download this script <examples/rotation1.py >` 
\ No newline at end of file
diff --git a/src/FeaturesPlugin/doc/TUI_translation2pointsFeature.rst b/src/FeaturesPlugin/doc/TUI_translation2pointsFeature.rst
new file mode 100644 (file)
index 0000000..b26f8e7
--- /dev/null
@@ -0,0 +1,11 @@
+
+  .. _tui_translation_2points:
+
+Translation by 2 points
+=======================
+
+.. literalinclude:: examples/translation2points.py  
+    :linenos:
+    :language: python
+
+:download:`Download this script <examples/translation2points.py >` 
\ No newline at end of file
diff --git a/src/FeaturesPlugin/doc/TUI_translationdxdydzFeature.rst b/src/FeaturesPlugin/doc/TUI_translationdxdydzFeature.rst
new file mode 100644 (file)
index 0000000..e3e273c
--- /dev/null
@@ -0,0 +1,11 @@
+
+  .. _tui_translation_DXDYDZ:
+
+Translation by vector
+=====================
+
+.. literalinclude:: examples/translationDXDYDZ.py  
+    :linenos:
+    :language: python
+
+:download:`Download this script <examples/translationDXDYDZ.py  >` 
\ No newline at end of file
diff --git a/src/FeaturesPlugin/doc/TUI_translationvectorFeature.rst b/src/FeaturesPlugin/doc/TUI_translationvectorFeature.rst
new file mode 100644 (file)
index 0000000..70278fa
--- /dev/null
@@ -0,0 +1,12 @@
+
+  .. _tui_translation_vector:
+
+Translation by axis and distance
+================================
+
+.. literalinclude:: examples/translationvector.py  
+    :linenos:
+    :language: python
+
+:download:`Download this script <examples/translationvector.py  >` 
+   
diff --git a/src/FeaturesPlugin/doc/examples/rotation1.py b/src/FeaturesPlugin/doc/examples/rotation1.py
new file mode 100644 (file)
index 0000000..a82d443
--- /dev/null
@@ -0,0 +1,12 @@
+# -*- coding: utf-8 -*-
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Cone_1 = model.addCone(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 10, 5, 10)
+Rotation_1 = model.addRotation(Part_1_doc, [model.selection("COMPOUND", "all-in-Cone_1")], model.selection("EDGE", "PartSet/OX"), 120)
+model.do()
+model.end()
diff --git a/src/FeaturesPlugin/doc/examples/rotation2.py b/src/FeaturesPlugin/doc/examples/rotation2.py
new file mode 100644 (file)
index 0000000..489541f
--- /dev/null
@@ -0,0 +1,12 @@
+# -*- coding: utf-8 -*-
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Cone_1 = model.addCone(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 10, 5, 10)
+Rotation_1 = model.addRotation(Part_1_doc, [model.selection("SOLID", "Cone_1_1")], model.selection("VERTEX", "PartSet/Origin"), model.selection("VERTEX", "Cone_1_1/Face_1&Cone_1_1/Face_3"), model.selection("VERTEX", "Cone_1_1/Face_1&Cone_1_1/Face_2"))
+model.do()
+model.end()
diff --git a/src/FeaturesPlugin/doc/examples/translation2points.py b/src/FeaturesPlugin/doc/examples/translation2points.py
new file mode 100644 (file)
index 0000000..d06a7ec
--- /dev/null
@@ -0,0 +1,12 @@
+# -*- coding: utf-8 -*-
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Cone_1 = model.addCone(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 10, 5, 10)
+Translation_1 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Cone_1_1")], model.selection("VERTEX", "PartSet/Origin"), model.selection("VERTEX", "Cone_1_1/Face_1&Cone_1_1/Face_2"))
+model.do()
+model.end()
diff --git a/src/FeaturesPlugin/doc/examples/translationDXDYDZ.py b/src/FeaturesPlugin/doc/examples/translationDXDYDZ.py
new file mode 100644 (file)
index 0000000..d06cf3b
--- /dev/null
@@ -0,0 +1,12 @@
+# -*- coding: utf-8 -*-
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Cone_1 = model.addCone(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 10, 5, 10)
+Translation_1 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Cone_1_1")], 10, 20, 50)
+model.do()
+model.end()
diff --git a/src/FeaturesPlugin/doc/examples/translationvector.py b/src/FeaturesPlugin/doc/examples/translationvector.py
new file mode 100644 (file)
index 0000000..5ebee45
--- /dev/null
@@ -0,0 +1,12 @@
+# -*- coding: utf-8 -*-
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Cone_1 = model.addCone(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 10, 5, 10)
+Translation_1 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Cone_1_1")], model.selection("EDGE", "Cone_1_1/Face_1"), 40)
+model.do()
+model.end()
diff --git a/src/FeaturesPlugin/doc/images/rotation.png b/src/FeaturesPlugin/doc/images/rotation.png
new file mode 100644 (file)
index 0000000..cfc31b4
Binary files /dev/null and b/src/FeaturesPlugin/doc/images/rotation.png differ
diff --git a/src/FeaturesPlugin/doc/images/rotation_3pt_32x32.png b/src/FeaturesPlugin/doc/images/rotation_3pt_32x32.png
new file mode 100644 (file)
index 0000000..e2493da
Binary files /dev/null and b/src/FeaturesPlugin/doc/images/rotation_3pt_32x32.png differ
diff --git a/src/FeaturesPlugin/doc/images/rotation_axis_32x32.png b/src/FeaturesPlugin/doc/images/rotation_axis_32x32.png
new file mode 100644 (file)
index 0000000..cf443b3
Binary files /dev/null and b/src/FeaturesPlugin/doc/images/rotation_axis_32x32.png differ
diff --git a/src/FeaturesPlugin/doc/images/translation_2pt_32x32.png b/src/FeaturesPlugin/doc/images/translation_2pt_32x32.png
new file mode 100644 (file)
index 0000000..5e68607
Binary files /dev/null and b/src/FeaturesPlugin/doc/images/translation_2pt_32x32.png differ
diff --git a/src/FeaturesPlugin/doc/images/translation_dxyz_32x32.png b/src/FeaturesPlugin/doc/images/translation_dxyz_32x32.png
new file mode 100644 (file)
index 0000000..a11f680
Binary files /dev/null and b/src/FeaturesPlugin/doc/images/translation_dxyz_32x32.png differ
diff --git a/src/FeaturesPlugin/doc/images/translation_vector_32x32.png b/src/FeaturesPlugin/doc/images/translation_vector_32x32.png
new file mode 100644 (file)
index 0000000..2c1a4b2
Binary files /dev/null and b/src/FeaturesPlugin/doc/images/translation_vector_32x32.png differ
index ff0380d0c23e36acaf11f7e89830a04900ae5fba..38bef70b99389a4170cbba9fb4378b469d261530 100644 (file)
@@ -2,16 +2,88 @@
 Rotation
 ========
 
+The feature **Rotation** makes rotation of a selected shape.
+
+To create Rotation in the active part:
+
+#. select in the Main Menu *Part - > Rotation* item  or
+#. click **Rotation** button in the toolbar
+
+.. image:: images/rotation.png      
+   :align: center
+
+.. centered::
+   **Rotation** button 
+
+Two rotation algorithms are:
+
+  .. image:: images/rotation_axis_32x32.png      
+    :align: left
+  by axis and angle 
+
+  .. image:: images/rotation_3pt_32x32.png    
+    :align: left
+  by center and 2 points
+
+Rotation by axis and angle
+--------------------------
 
 .. image:: images/Rotation1.png
   :align: center
 
 .. centered::
-  Rotation by axis and angle
+  Rotation by axis and angle property panel
+
+Input fields:
+
+- **Main objects** panel contains shapes to be rotated. Shapes are selected in 3D OCC viewer or object browser;
+- **Axis** defines the axis of rotation. Vector is edge, axis selected in 3D OCC viewer or object browser;
+- **Angle** defines the angle by which the object is rotated. 
+
+**TUI Command**:  *model.addRotation(Part_doc, [shape], axis, angle)*
+
+**Arguments**: part + list of shapes in format *model.selection(TYPE, shape)* + axis in format *model.selection(TYPE, shape)*+ real (angle value).
+
+Result
+""""""
+
+Result of operation is rotated initial shape.
 
+.. image:: images/rotation_axis.png
+   :align: center
+
+.. centered::
+   Rotation by axis and angle
+
+**See Also** a sample TUI Script of a :ref:`tui_rotation_axis` operation.
+
+Rotation by center and points
+-----------------------------
 
 .. image:: images/Rotation2.png
   :align: center
 
 .. centered::
-  Rotation by center and points
+  Rotation by center and 2 points property panel
+
+Input fields:
+
+- **Main objects** panel contains shapes to be rotated. Shapes are selected in 3D OCC viewer or object browser;
+- **Center point**, **Start point**, **End point** define 3 points or vertices selected in 3D OCC viewer or object browser. Rotation axis will pass through the **Center point** and will be will be orthogonal to a plane defined by three points. Rotation Angle is the angle between two vectors directed from the **Center point** to **Start point** and **End point**.  
+
+**TUI Command**:  *model.addRotation(Part_doc, [shape], point1, point2, point3)*
+
+**Arguments**: part + list of shapes in format *model.selection(TYPE, shape)* + 3 points in format *model.selection(TYPE, shape)*.
+
+Result
+""""""
+
+Result of operation is rotated initial shape.
+
+.. image:: images/rotation_3points.png
+   :align: center
+
+.. centered::
+   Rotation by center and 2 points
+
+**See Also** a sample TUI Script of a :ref:`tui_rotation_3points` operation.
\ No newline at end of file
index 99ce5db7232fa6ed2c6474e21183452d94db93ea..b3bbd5edcd1796ff429e8db7565121ce183c96db 100644 (file)
 Translation
 ===========
 
+The feature **Translation** makes translation of a selected shape.
+
+To create Translation in the active part:
+
+#. select in the Main Menu *Part - > Translation* item  or
+#. click **Translation** button in the toolbar
+
+.. image:: images/translation_vector_32x32.png   
+   :align: center
+
+.. centered::
+   **Translation** button 
+
+The Vector of translation can be defined in three different ways:
+
+  .. image:: images/translation_vector_32x32.png    
+    :align: left
+  by by axis and distance
+
+  .. image:: images/translation_dxyz_32x32.png      
+    :align: left
+  by vector 
+
+  .. image:: images/translation_2pt_32x32.png    
+    :align: left
+  by two points
+
+Translation by axis and distance
+--------------------------------
 
 .. image:: images/Translation1.png
   :align: center
 
 .. centered::
-  Translation by axis and distance
+  Translation by axis and distance property panel
+
+Input fields:
+
+- **Main objects** panel contains shapes to be translated. Shapes are selected in 3D OCC viewer or object browser;
+- **Axis**  defines vector along which the object will be translated. Vector is edge, axis selected in 3D OCC viewer or object browser;
+- **Distance** defines the distance along the **Vector of translation**.
+
+**TUI Command**:  *model.addTranslation(Part_doc, [shape], axis, dist)*
+
+**Arguments**: part + list of shapes in format *model.selection(TYPE, shape)* + axis in format *model.selection(TYPE, shape)*+ real (distance value).
+
+Result
+""""""
+
+Result of operation is shifted initial shape.
+
+.. image:: images/translation_vector.png
+   :align: center
+
+.. centered::
+   Translation by axis and distance
+
+**See Also** a sample TUI Script of a :ref:`tui_translation_vector` operation.
 
+Translation by vector
+---------------------
 
 .. image:: images/Translation2.png
   :align: center
 
 .. centered::
-  By vector
+  Translation by vector property panel
 
+Input fields:
+
+- **Main objects** panel contains shapes to be translated. Shapes are selected in 3D OCC viewer or object browser;
+- **DX**, **DY**, **DZ**  define vector using coordinates along the axis.
+
+**TUI Command**:  *model.addTranslation(Part_1_doc, [shape], DX, DY, DZ)*
+
+**Arguments**: part + list of shapes in format *model.selection(TYPE, shape)* + 3 real (coordinate values).
+
+Result
+""""""
+
+Result of operation is shifted initial shape.
+
+.. image:: images/translation_vector.png
+   :align: center
+
+.. centered::
+   Translation by vector
+
+**See Also** a sample TUI Script of a :ref:`tui_translation_DXDYDZ` operation.
+
+
+Translation by two points
+-------------------------
 
 .. image:: images/Translation3.png
   :align: center
 
 .. centered::
-  By two points
+  Translation by two points property panel
+
+Input fields:
+
+- **Main objects** panel contains shapes to be translated. Shapes are selected in 3D OCC viewer or object browser;
+- **Start point**  defines start vector point as point or vertex selected in 3D OCC viewer or object browser;
+- **End point**  defines end vector point as point or vertex selected in 3D OCC viewer or object browser;
+  
+**TUI Command**:  *model.addTranslation(Part_doc, [shape], point1, point2)*
+
+**Arguments**: part + list of shapes in format *model.selection(TYPE, shape)* + 2 points in format *model.selection(TYPE, shape)*.
+
+Result
+""""""
+
+Result of operation is shifted initial shape.
+
+.. image:: images/translation_vector.png
+   :align: center
+
+.. centered::
+   Translation by two points
+
+**See Also** a sample TUI Script of a :ref:`tui_translation_2points` operation.
+