]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
symmetry and scale
authorgzy <gzy@opencascade.com>
Sun, 23 Sep 2018 07:43:26 +0000 (10:43 +0300)
committergzy <gzy@opencascade.com>
Sun, 23 Sep 2018 07:43:26 +0000 (10:43 +0300)
20 files changed:
src/FeaturesPlugin/doc/TUI_scaleXYZFeature.rst [new file with mode: 0644]
src/FeaturesPlugin/doc/TUI_scalefactorFeature.rst [new file with mode: 0644]
src/FeaturesPlugin/doc/TUI_symmetryaxisFeature.rst [new file with mode: 0644]
src/FeaturesPlugin/doc/TUI_symmetryplaneFeature.rst [new file with mode: 0644]
src/FeaturesPlugin/doc/TUI_symmetrypointFeature.rst [new file with mode: 0644]
src/FeaturesPlugin/doc/examples/scaleXYZ.py [new file with mode: 0644]
src/FeaturesPlugin/doc/examples/scalefactor.py [new file with mode: 0644]
src/FeaturesPlugin/doc/examples/symmetryaxis.py [new file with mode: 0644]
src/FeaturesPlugin/doc/examples/symmetryplane.py [new file with mode: 0644]
src/FeaturesPlugin/doc/examples/symmetrypoint.py [new file with mode: 0644]
src/FeaturesPlugin/doc/images/Symmetry.png
src/FeaturesPlugin/doc/images/scale.png [new file with mode: 0644]
src/FeaturesPlugin/doc/images/scale_dimensions_32x32.png [new file with mode: 0644]
src/FeaturesPlugin/doc/images/scale_factor_32x32.png [new file with mode: 0644]
src/FeaturesPlugin/doc/images/symmetry.png [new file with mode: 0644]
src/FeaturesPlugin/doc/images/symmetry_axis_32x32.png [new file with mode: 0644]
src/FeaturesPlugin/doc/images/symmetry_plane_32x32.png [new file with mode: 0644]
src/FeaturesPlugin/doc/images/symmetry_point_32x32.png [new file with mode: 0644]
src/FeaturesPlugin/doc/symmetryFeature.rst
src/FeaturesPlugin/doc/transformationFeature.rst

diff --git a/src/FeaturesPlugin/doc/TUI_scaleXYZFeature.rst b/src/FeaturesPlugin/doc/TUI_scaleXYZFeature.rst
new file mode 100644 (file)
index 0000000..9b9f360
--- /dev/null
@@ -0,0 +1,11 @@
+
+  .. _tui_Scale_XYZ:
+
+Scale by different factors along axes
+=====================================
+
+.. literalinclude:: examples/scaleXYZ.py    
+    :linenos:
+    :language: python
+
+:download:`Download this script <examples/scaleXYZ.py >` 
\ No newline at end of file
diff --git a/src/FeaturesPlugin/doc/TUI_scalefactorFeature.rst b/src/FeaturesPlugin/doc/TUI_scalefactorFeature.rst
new file mode 100644 (file)
index 0000000..af4e71d
--- /dev/null
@@ -0,0 +1,11 @@
+
+  .. _tui_Scale_common_factor:
+
+Scale by one common factor
+==========================
+
+.. literalinclude:: examples/scalefactor.py   
+    :linenos:
+    :language: python
+
+:download:`Download this script <examples/scalefactor.py  >` 
\ No newline at end of file
diff --git a/src/FeaturesPlugin/doc/TUI_symmetryaxisFeature.rst b/src/FeaturesPlugin/doc/TUI_symmetryaxisFeature.rst
new file mode 100644 (file)
index 0000000..4309634
--- /dev/null
@@ -0,0 +1,11 @@
+
+  .. _tui_symmetry_axis:
+
+Symmetry through an Axis of symmetry
+====================================
+
+.. literalinclude:: examples/symmetryaxis.py     
+    :linenos:
+    :language: python
+
+:download:`Download this script <examples/symmetryaxis.py >` 
\ No newline at end of file
diff --git a/src/FeaturesPlugin/doc/TUI_symmetryplaneFeature.rst b/src/FeaturesPlugin/doc/TUI_symmetryplaneFeature.rst
new file mode 100644 (file)
index 0000000..cfafee3
--- /dev/null
@@ -0,0 +1,11 @@
+
+  .. _tui_symmetry_plane:
+
+Symmetry through a Plane of symmetry
+====================================
+
+.. literalinclude:: examples/symmetryplane.py     
+    :linenos:
+    :language: python
+
+:download:`Download this script <examples/symmetryplane.py >` 
\ No newline at end of file
diff --git a/src/FeaturesPlugin/doc/TUI_symmetrypointFeature.rst b/src/FeaturesPlugin/doc/TUI_symmetrypointFeature.rst
new file mode 100644 (file)
index 0000000..9a12164
--- /dev/null
@@ -0,0 +1,11 @@
+
+  .. _tui_symmetry_point:
+
+Symmetry through a Point of symmetry
+====================================
+
+.. literalinclude:: examples/symmetrypoint.py     
+    :linenos:
+    :language: python
+
+:download:`Download this script <examples/symmetrypoint.py >` 
\ No newline at end of file
diff --git a/src/FeaturesPlugin/doc/examples/scaleXYZ.py b/src/FeaturesPlugin/doc/examples/scaleXYZ.py
new file mode 100644 (file)
index 0000000..0a1a6fe
--- /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()
+Sphere_1 = model.addSphere(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), 10)
+Scale_1 = model.addScale(Part_1_doc, [model.selection("SOLID", "Sphere_1_1")] , model.selection("VERTEX", "PartSet/Origin"), 2 , 3, 4)
+model.do()
+model.end()
diff --git a/src/FeaturesPlugin/doc/examples/scalefactor.py b/src/FeaturesPlugin/doc/examples/scalefactor.py
new file mode 100644 (file)
index 0000000..9794ad4
--- /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()
+Cylinder_1 = model.addCylinder(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 5, 10)
+Scale_1 = model.addScale(Part_1_doc, [model.selection("SOLID", "Cylinder_1_1")] , model.selection("VERTEX", "PartSet/Origin"), 2)
+model.do()
+model.end()
diff --git a/src/FeaturesPlugin/doc/examples/symmetryaxis.py b/src/FeaturesPlugin/doc/examples/symmetryaxis.py
new file mode 100644 (file)
index 0000000..3ceb146
--- /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()
+Cylinder_1 = model.addCylinder(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 5, 10)
+Symmetry_1 = model.addSymmetry(Part_1_doc, [model.selection("SOLID", "Cylinder_1_1")], model.selection("EDGE", "Cylinder_1_1/Face_1"), False)
+model.do()
+model.end()
diff --git a/src/FeaturesPlugin/doc/examples/symmetryplane.py b/src/FeaturesPlugin/doc/examples/symmetryplane.py
new file mode 100644 (file)
index 0000000..549c89b
--- /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()
+Cylinder_1 = model.addCylinder(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 5, 10)
+Symmetry_1 = model.addSymmetry(Part_1_doc, [model.selection("SOLID", "Cylinder_1_1")], model.selection("FACE", "Cylinder_1_1/Face_2"), True)
+model.do()
+model.end()
diff --git a/src/FeaturesPlugin/doc/examples/symmetrypoint.py b/src/FeaturesPlugin/doc/examples/symmetrypoint.py
new file mode 100644 (file)
index 0000000..e71d7c6
--- /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()
+Cylinder_1 = model.addCylinder(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 5, 10)
+Symmetry_1 = model.addSymmetry(Part_1_doc, [model.selection("SOLID", "Cylinder_1_1")], model.selection("VERTEX", "PartSet/Origin"), True)
+model.do()
+model.end()
index a369a0f8111716eeb1aea10b74e749961f05d091..fdc73b21c6ba777e2d34bf1ca02e7faa26641739 100644 (file)
Binary files a/src/FeaturesPlugin/doc/images/Symmetry.png and b/src/FeaturesPlugin/doc/images/Symmetry.png differ
diff --git a/src/FeaturesPlugin/doc/images/scale.png b/src/FeaturesPlugin/doc/images/scale.png
new file mode 100644 (file)
index 0000000..156659c
Binary files /dev/null and b/src/FeaturesPlugin/doc/images/scale.png differ
diff --git a/src/FeaturesPlugin/doc/images/scale_dimensions_32x32.png b/src/FeaturesPlugin/doc/images/scale_dimensions_32x32.png
new file mode 100644 (file)
index 0000000..b5204f9
Binary files /dev/null and b/src/FeaturesPlugin/doc/images/scale_dimensions_32x32.png differ
diff --git a/src/FeaturesPlugin/doc/images/scale_factor_32x32.png b/src/FeaturesPlugin/doc/images/scale_factor_32x32.png
new file mode 100644 (file)
index 0000000..b82b643
Binary files /dev/null and b/src/FeaturesPlugin/doc/images/scale_factor_32x32.png differ
diff --git a/src/FeaturesPlugin/doc/images/symmetry.png b/src/FeaturesPlugin/doc/images/symmetry.png
new file mode 100644 (file)
index 0000000..fdc73b2
Binary files /dev/null and b/src/FeaturesPlugin/doc/images/symmetry.png differ
diff --git a/src/FeaturesPlugin/doc/images/symmetry_axis_32x32.png b/src/FeaturesPlugin/doc/images/symmetry_axis_32x32.png
new file mode 100644 (file)
index 0000000..3873378
Binary files /dev/null and b/src/FeaturesPlugin/doc/images/symmetry_axis_32x32.png differ
diff --git a/src/FeaturesPlugin/doc/images/symmetry_plane_32x32.png b/src/FeaturesPlugin/doc/images/symmetry_plane_32x32.png
new file mode 100644 (file)
index 0000000..ddecb82
Binary files /dev/null and b/src/FeaturesPlugin/doc/images/symmetry_plane_32x32.png differ
diff --git a/src/FeaturesPlugin/doc/images/symmetry_point_32x32.png b/src/FeaturesPlugin/doc/images/symmetry_point_32x32.png
new file mode 100644 (file)
index 0000000..2cda225
Binary files /dev/null and b/src/FeaturesPlugin/doc/images/symmetry_point_32x32.png differ
index dc8150c74bcac50d49bad84b3b380144cd2fd1bf..bd2d5eb1ba7e8a7d9be3d439db9fbe8349aa62c8 100644 (file)
@@ -2,9 +2,125 @@
 Symmetry
 ========
 
+The feature **Symmetry** makes symmetrical copy of a selected shape.
 
-.. image:: images/Symmetry.png
+To create Symmetry in the active part:
+
+#. select in the Main Menu *Part - > Symmetry* item  or
+#. click **Symmetry** button in the toolbar
+
+.. image:: images/symmetry.png    
+   :align: center
+
+.. centered::
+   **Symmetry** button 
+
+Symmetrical copy of an Object can be mirrored in three different ways:
+
+  .. image:: images/symmetry_point_32x32.png    
+    :align: left
+  through a Point of symmetry 
+
+  .. image:: images/symmetry_axis_32x32.png      
+    :align: left
+  through an Axis of symmetry  
+
+  .. image:: images/symmetry_plane_32x32.png    
+    :align: left
+  through a Plane of symmetry 
+
+Symmetry through a Point of symmetry
+------------------------------------
+
+.. image:: images/symmetryPoint.png
+  :align: center
+
+.. centered::
+  Symmetry through a Point of symmetry property panel
+
+Input fields:
+
+- **Main objects** panel contains shapes to be translated. Shapes are selected in 3D OCC viewer or object browser;
+- **Point**  defines point of symmetry selected in 3D OCC viewer or object browser;
+- **Create a copy** checkbox turns on/off preservation of the initial object.
+
+**TUI Command**:  *model.addSymmetry(Part_doc, [shape], point, copy)*
+
+**Arguments**: part + list of shapes in format *model.selection(TYPE, shape)* + point in format *model.selection(TYPE, shape)*+ boolean (Create a copy key).
+
+Result
+""""""
+
+Result of operation is mirrored initial shape with **Create a copy** = *True*.
+
+.. image:: images/symmetryPointres.png
+   :align: center
+
+.. centered::
+   Symmetry through a Point of symmetry
+
+**See Also** a sample TUI Script of a :ref:`tui_symmetry_point` operation.
+
+Symmetry through an Axis of symmetry
+------------------------------------
+
+.. image:: images/symmetryAxis.png
   :align: center
 
 .. centered::
-  Symmetry definition
+  Symmetry through an Axis of symmetry property panel
+
+Input fields:
+
+- **Main objects** panel contains shapes to be translated. Shapes are selected in 3D OCC viewer or object browser;
+- **Axis**  defines axis of symmetry selected in 3D OCC viewer or object browser;
+- **Create a copy** checkbox turns on/off preservation of the initial object.
+
+**TUI Command**:  *model.addSymmetry(Part_doc, [shape], axis, copy)*
+
+**Arguments**: part + list of shapes in format *model.selection(TYPE, shape)* + axis in format *model.selection(TYPE, shape)*+ boolean (Create a copy key).
+
+Result
+""""""
+
+Result of operation is mirrored initial shape with **Create a copy** = *False*.
+
+.. image:: images/symmetryAxisres.png
+   :align: center
+
+.. centered::
+   Symmetry through an Axis of symmetry
+
+**See Also** a sample TUI Script of a :ref:`tui_symmetry_axis` operation.  
+
+Symmetry through a Plane of symmetry
+------------------------------------
+
+.. image:: images/symmetryPlane.png
+  :align: center
+
+.. centered::
+  Symmetry through a Plane of symmetry property panel
+
+Input fields:
+
+- **Main objects** panel contains shapes to be translated. Shapes are selected in 3D OCC viewer or object browser;
+- **Plane**  defines plane of symmetry selected in 3D OCC viewer or object browser;
+- **Create a copy** checkbox turns on/off preservation of the initial object.
+
+**TUI Command**:  *model.addSymmetry(Part_doc, [shape], plane, copy)*
+
+**Arguments**: part + list of shapes in format *model.selection(TYPE, shape)* + plane in format *model.selection(TYPE, shape)*+ boolean (Create a copy key).
+
+Result
+""""""
+
+Result of operation is mirrored initial shape with **Create a copy** = *False*.
+
+.. image:: images/symmetryPlaneres.png
+   :align: center
+
+.. centered::
+   Symmetry through a Plane of symmetry
+
+**See Also** a sample TUI Script of a :ref:`tui_symmetry_plane` operation.   
\ No newline at end of file
index 5e8f204d7a60055e80ee89bc1ff932bfde119d50..8ca725554efc0aa774334ff20c152e3986cc142d 100644 (file)
@@ -2,16 +2,93 @@
 Scale
 =====
 
+The feature **Scale** makes a scaled shape basing on the initial shape.
+
+To create Scale in the active part:
+
+#. select in the Main Menu *Features - > Scale* item  or
+#. click **Scale** button in the toolbar
+
+.. image:: images/scale.png      
+   :align: center
+
+.. centered::
+   **Scale** button 
+
+Two Scale algorithms are:
+
+  .. image:: images/scale_factor_32x32.png    
+    :align: left
+  by one common factor 
+
+  .. image:: images/scale_dimensions_32x32.png    
+    :align: left
+  by different factors along axes
+
+Scale by one common factor
+--------------------------
+
+Scale by one common factor scales the entire object without modification the geometry of the shape: dimensions change evenly in all three orthogonal directions.
 
 .. image:: images/Scale1.png
   :align: center
 
 .. centered::
-  Scale: define by a one common factor
+  Scale by one common factor property panel
+
+Input fields:
+
+- **Main objects** panel contains shapes to be scaled. Shapes are selected in 3D OCC viewer or object browser;
+- **Center point** defines the point relatively to which the object is scaled. Point is selected in 3D OCC viewer or object browser;
+- **Scale factor** defines the multiplier of axial dimensions. If Scale Factor is negative, the object is mirrored through the Central Point. 
+
+**TUI Command**:  *model.addScale(Part_doc, [shape], center, factor)*
+**Arguments**: part + list of shapes in format *model.selection(TYPE, shape)* + center point in format *model.selection(TYPE, shape)*+ real (scale factor value).
+
+Result
+""""""
+
+Result of operation is transformed initial shape.
 
+.. image:: images/Scale_common_factor.png
+   :align: center
+
+.. centered::
+   Scale by one common factor
+
+**See Also** a sample TUI Script of a :ref:`tui_Scale_common_factor` operation.  
+
+Scale by different factors along axes
+-------------------------------------
+
+Scale by different factors along axes is a general transformation, which can modify the geometry, for example, a sphere can be transformed into an ellipsoid.
 
 .. image:: images/Scale2.png
   :align: center
 
 .. centered::
-  Scale: define by different factors
+  Scale: define by different factors property panel
+
+Input fields:
+
+- **Main objects** panel contains shapes to be scaled. Shapes are selected in 3D OCC viewer or object browser;
+- **Center point** defines the point relatively to which the object is scaled. Point is selected in 3D OCC viewer or object browser;
+- **Scale factor in X**, **Scale factor in Y**, **Scale factor in Z** define the the multipliers of axial dimensions.  If Scale Factor is negative, the object is mirrored through the Central Point. 
+
+**TUI Command**:  *model.addScale(Part_doc, [shape], center, factors)*
+**Arguments**: part + list of shapes in format *model.selection(TYPE, shape)* + center point in format *model.selection(TYPE, shape)*+ 3 reals (scale factor values along X. Y, Z axes).
+
+Result
+""""""
+
+Result of operation is transformed initial shape.
+
+.. image:: images/Scale_common_factor.png
+   :align: center
+
+.. centered::
+   Scale by different factors
+
+**See Also** a sample TUI Script of a :ref:`tui_Scale_XYZ` operation.
\ No newline at end of file