]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Task #3016: 3.2 To add a mode «through all» for features RevolutionCut and RevolutionFuse
authorjfa <jfa@opencascade.com>
Thu, 17 Oct 2019 10:19:33 +0000 (13:19 +0300)
committerjfa <jfa@opencascade.com>
Thu, 17 Oct 2019 10:19:33 +0000 (13:19 +0300)
20 files changed:
src/FeaturesAPI/FeaturesAPI_RevolutionBoolean.cpp
src/FeaturesAPI/FeaturesAPI_RevolutionBoolean.h
src/FeaturesPlugin/CMakeLists.txt
src/FeaturesPlugin/FeaturesPlugin_Revolution.cpp
src/FeaturesPlugin/FeaturesPlugin_Revolution.h
src/FeaturesPlugin/Test/TestRevolutionCut_ThroughAll.py [new file with mode: 0644]
src/FeaturesPlugin/Test/TestRevolutionFuse_ThroughAll.py [new file with mode: 0644]
src/FeaturesPlugin/doc/TUI_revolutionCutThroughAll.rst [new file with mode: 0644]
src/FeaturesPlugin/doc/TUI_revolutionFuseThroughAll.rst [new file with mode: 0644]
src/FeaturesPlugin/doc/examples/revolution_cut_through_all.py [new file with mode: 0644]
src/FeaturesPlugin/doc/examples/revolution_fuse_through_all.py [new file with mode: 0644]
src/FeaturesPlugin/doc/images/revolution_cut_through_all_result.png [new file with mode: 0644]
src/FeaturesPlugin/doc/images/revolution_through_all.png [new file with mode: 0644]
src/FeaturesPlugin/doc/revolutionCutFeature.rst
src/FeaturesPlugin/doc/revolutionFuseFeature.rst
src/FeaturesPlugin/icons/extrusion_throughall_32x32.png [new file with mode: 0644]
src/FeaturesPlugin/icons/revol_throughall_32x32.png [new file with mode: 0644]
src/FeaturesPlugin/revolutioncut_widget.xml
src/FeaturesPlugin/revolutionfuse_widget.xml
src/GeomValidators/GeomValidators_ZeroOffset.cpp

index 385244275779ff6a8c4b0d2adf9dcc13dac69b18..3f595c2e933fffad62bf84828cee4dfcd6433aab 100644 (file)
@@ -94,7 +94,7 @@ void FeaturesAPI_RevolutionBoolean::setAngle(const ModelHighAPI_Double& theAngle
 //==================================================================================================
 void FeaturesAPI_RevolutionBoolean::setPlanesAndOffsets(const ModelHighAPI_Selection& theToObject,
                                                         const ModelHighAPI_Double& theToOffset,
-                                                      const ModelHighAPI_Selection& theFromObject,
+                                                        const ModelHighAPI_Selection& theFromObject,
                                                         const ModelHighAPI_Double& theFromOffset)
 {
   fillAttribute(FeaturesPlugin_Revolution::CREATION_METHOD_BY_PLANES(), mycreationMethod);
@@ -158,6 +158,8 @@ void FeaturesAPI_RevolutionBoolean::dump(ModelHighAPI_Dumper& theDumper) const
 
     theDumper << ", " << anAttrToObject << ", " << anAttrToOffset <<
       ", " << anAttrFromObject << ", " << anAttrFromOffset;
+  } else {
+    // Through All
   }
 
   AttributeSelectionListPtr anAttrBoolObjects =
@@ -185,6 +187,22 @@ FeaturesAPI_RevolutionCut::FeaturesAPI_RevolutionCut(
   initialize();
 }
 
+//==================================================================================================
+FeaturesAPI_RevolutionCut::FeaturesAPI_RevolutionCut(
+  const std::shared_ptr<ModelAPI_Feature>& theFeature,
+  const std::list<ModelHighAPI_Selection>& theBaseObjects,
+  const ModelHighAPI_Selection& theAxis,
+  const std::list<ModelHighAPI_Selection>& theBooleanObjects)
+: FeaturesAPI_RevolutionBoolean(theFeature)
+{
+  if(initialize()) {
+    fillAttribute(theBaseObjects, mybaseObjects);
+    fillAttribute(theAxis, myaxis);
+    fillAttribute(FeaturesPlugin_Revolution::CREATION_METHOD_THROUGH_ALL(), mycreationMethod);
+    setBooleanObjects(theBooleanObjects);
+  }
+}
+
 //==================================================================================================
 FeaturesAPI_RevolutionCut::FeaturesAPI_RevolutionCut(
   const std::shared_ptr<ModelAPI_Feature>& theFeature,
@@ -246,6 +264,18 @@ FeaturesAPI_RevolutionCut::FeaturesAPI_RevolutionCut(
   }
 }
 
+//==================================================================================================
+RevolutionCutPtr addRevolutionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
+                                  const std::list<ModelHighAPI_Selection>& theBaseObjects,
+                                  const ModelHighAPI_Selection& theAxis,
+                                  const std::list<ModelHighAPI_Selection>& theBooleanObjects)
+{
+  std::shared_ptr<ModelAPI_Feature> aFeature =
+    thePart->addFeature(FeaturesPlugin_RevolutionCut::ID());
+  return RevolutionCutPtr(new FeaturesAPI_RevolutionCut(aFeature, theBaseObjects,
+                                                        theAxis, theBooleanObjects));
+}
+
 //==================================================================================================
 RevolutionCutPtr addRevolutionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
                                   const std::list<ModelHighAPI_Selection>& theBaseObjects,
@@ -308,6 +338,22 @@ FeaturesAPI_RevolutionFuse::FeaturesAPI_RevolutionFuse(
   initialize();
 }
 
+//==================================================================================================
+FeaturesAPI_RevolutionFuse::FeaturesAPI_RevolutionFuse(
+  const std::shared_ptr<ModelAPI_Feature>& theFeature,
+  const std::list<ModelHighAPI_Selection>& theBaseObjects,
+  const ModelHighAPI_Selection& theAxis,
+  const std::list<ModelHighAPI_Selection>& theBooleanObjects)
+: FeaturesAPI_RevolutionBoolean(theFeature)
+{
+  if(initialize()) {
+    fillAttribute(theBaseObjects, mybaseObjects);
+    fillAttribute(theAxis, myaxis);
+    fillAttribute(FeaturesPlugin_Revolution::CREATION_METHOD_THROUGH_ALL(), mycreationMethod);
+    setBooleanObjects(theBooleanObjects);
+  }
+}
+
 //==================================================================================================
 FeaturesAPI_RevolutionFuse::FeaturesAPI_RevolutionFuse(
   const std::shared_ptr<ModelAPI_Feature>& theFeature,
@@ -371,6 +417,18 @@ FeaturesAPI_RevolutionFuse::FeaturesAPI_RevolutionFuse(
   }
 }
 
+//==================================================================================================
+RevolutionFusePtr addRevolutionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
+                                    const std::list<ModelHighAPI_Selection>& theBaseObjects,
+                                    const ModelHighAPI_Selection& theAxis,
+                                    const std::list<ModelHighAPI_Selection>& theBooleanObjects)
+{
+  std::shared_ptr<ModelAPI_Feature> aFeature =
+    thePart->addFeature(FeaturesPlugin_RevolutionFuse::ID());
+  return RevolutionFusePtr(new FeaturesAPI_RevolutionFuse(aFeature, theBaseObjects,
+                                                          theAxis, theBooleanObjects));
+}
+
 //==================================================================================================
 RevolutionFusePtr addRevolutionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
                                     const std::list<ModelHighAPI_Selection>& theBaseObjects,
index cd7809176800c9941d44decdb3551cd953d0a469..5f636c0811c9ef21289a006d077d2b819e19d935 100644 (file)
@@ -127,6 +127,13 @@ public:
   FEATURESAPI_EXPORT
   explicit FeaturesAPI_RevolutionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature);
 
+  /// Constructor with values.
+  FEATURESAPI_EXPORT
+  explicit FeaturesAPI_RevolutionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
+                                     const std::list<ModelHighAPI_Selection>& theBaseObjects,
+                                     const ModelHighAPI_Selection& theAxis,
+                                     const std::list<ModelHighAPI_Selection>& theBooleanObjects);
+
   /// Constructor with values.
   FEATURESAPI_EXPORT
   explicit FeaturesAPI_RevolutionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
@@ -159,6 +166,14 @@ public:
 /// Pointer on RevolutionCut object.
 typedef std::shared_ptr<FeaturesAPI_RevolutionCut> RevolutionCutPtr;
 
+/// \ingroup CPPHighAPI
+/// \brief Create RevolutionCut feature.
+FEATURESAPI_EXPORT
+RevolutionCutPtr addRevolutionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
+                                  const std::list<ModelHighAPI_Selection>& theBaseObjects,
+                                  const ModelHighAPI_Selection& theAxis,
+                                  const std::list<ModelHighAPI_Selection>& theBooleanObjects);
+
 /// \ingroup CPPHighAPI
 /// \brief Create RevolutionCut feature.
 FEATURESAPI_EXPORT
@@ -204,6 +219,13 @@ public:
   FEATURESAPI_EXPORT
   explicit FeaturesAPI_RevolutionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature);
 
+  /// Constructor with values.
+  FEATURESAPI_EXPORT
+  explicit FeaturesAPI_RevolutionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
+                                      const std::list<ModelHighAPI_Selection>& theBaseObjects,
+                                      const ModelHighAPI_Selection& theAxis,
+                                      const std::list<ModelHighAPI_Selection>& theBooleanObjects);
+
   /// Constructor with values.
   FEATURESAPI_EXPORT
   explicit FeaturesAPI_RevolutionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
@@ -236,6 +258,14 @@ public:
 /// Pointer on RevolutionFuse object.
 typedef std::shared_ptr<FeaturesAPI_RevolutionFuse> RevolutionFusePtr;
 
+/// \ingroup CPPHighAPI
+/// \brief Create RevolutionFuse feature.
+FEATURESAPI_EXPORT
+RevolutionFusePtr addRevolutionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
+                                    const std::list<ModelHighAPI_Selection>& theBaseObjects,
+                                    const ModelHighAPI_Selection& theAxis,
+                                    const std::list<ModelHighAPI_Selection>& theBooleanObjects);
+
 /// \ingroup CPPHighAPI
 /// \brief Create RevolutionFuse feature.
 FEATURESAPI_EXPORT
index 7640e539aea9caa8e33620dc08b0c9e542ad577a..5316c8c07fac08f0201e56c69896e943a6c91307 100644 (file)
@@ -210,9 +210,11 @@ ADD_UNIT_TESTS(TestExtrusion.py
                TestRevolutionCut.py
                TestRevolutionCut_ByAngle.py
                TestRevolutionCut_ByPlanesAndOffsets.py
+               TestRevolutionCut_ThroughAll.py
                TestRevolutionFuse.py
                TestRevolutionFuse_ByAngle.py
                TestRevolutionFuse_ByPlanesAndOffsets.py
+               TestRevolutionFuse_ThroughAll.py
                TestCompositeFeaturesOnCompSolids.py
                TestPartition.py
                TestPartition_ErrorMsg.py
index 9994cd900268067bdf4f7ed728600b7306da9945..1789039f5595192f14ed0b5caa5eb04e62553fcd 100644 (file)
@@ -139,12 +139,16 @@ bool FeaturesPlugin_Revolution::makeRevolutions(ListOfShape& theBaseShapes,
   double aToAngle = 0.0;
   double aFromAngle = 0.0;
 
-  if(string(CREATION_METHOD())->value() == CREATION_METHOD_BY_ANGLES()) {
+  if (string(CREATION_METHOD())->value() == CREATION_METHOD_BY_ANGLES()) {
     aToAngle = real(TO_ANGLE_ID())->value();
     aFromAngle = real(FROM_ANGLE_ID())->value();
-  } else {
+  } else if (string(CREATION_METHOD())->value() == CREATION_METHOD_BY_PLANES()) {
     aToAngle = real(TO_OFFSET_ID())->value();
     aFromAngle = real(FROM_OFFSET_ID())->value();
+  } else if (string(CREATION_METHOD())->value() == CREATION_METHOD_THROUGH_ALL()) {
+    aToAngle = 360.0;
+    aFromAngle = 0.0;
+  } else {
   }
 
   // Getting bounding planes.
index cd0b929fc777eefe1984a6e9a68b6703c5ec6367..820ae3471fcf9acfb924ff983202a4f73038a113 100644 (file)
@@ -48,6 +48,13 @@ public:
     return MY_CREATION_METHOD_ID;
   }
 
+  /// Attribute name for creation method.
+  inline static const std::string& CREATION_METHOD_THROUGH_ALL()
+  {
+    static const std::string MY_CREATION_METHOD_ID("ThroughAll");
+    return MY_CREATION_METHOD_ID;
+  }
+
   /// Attribute name for creation method.
   inline static const std::string& CREATION_METHOD_BY_ANGLES()
   {
diff --git a/src/FeaturesPlugin/Test/TestRevolutionCut_ThroughAll.py b/src/FeaturesPlugin/Test/TestRevolutionCut_ThroughAll.py
new file mode 100644 (file)
index 0000000..837f0a4
--- /dev/null
@@ -0,0 +1,60 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+from salome.shaper import model
+
+import math
+
+def checkMiddlePoint(shape, x, y, z, tolerance = 1.e-7):
+    assert(shape is not None)
+    middlePoint = shape.middlePoint()
+    assert(math.fabs(middlePoint.x() - x) < tolerance), "{} != {}".format(middlePoint.x(), x)
+    assert(math.fabs(middlePoint.y() - y) < tolerance), "{} != {}".format(middlePoint.y(), y)
+    assert(math.fabs(middlePoint.z() - z) < tolerance), "{} != {}".format(middlePoint.z(), z)
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+Cylinder_1 = model.addCylinder(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 2, 10)
+Translation_1 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Cylinder_1_1")], 5, 5, 0)
+
+RevolutionCut_1 = model.addRevolutionCut(Part_1_doc, [], model.selection("EDGE", "[Box_1_1/Front][Box_1_1/Top]"), [model.selection("SOLID", "Box_1_1")])
+
+Sketch_1 = model.addSketch(Part_1_doc, model.selection("FACE", "Translation_1_1/MF:Translated&Cylinder_1_1/Face_2"))
+SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "[Translation_1_1/MF:Translated&Cylinder_1_1/Face_1][Translation_1_1/MF:Translated&Cylinder_1_1/Face_2]__cc"), False)
+SketchPoint_1 = SketchProjection_1.createdFeature()
+SketchProjection_2 = Sketch_1.addProjection(model.selection("EDGE", "[Translation_1_1/MF:Translated&Cylinder_1_1/Face_1][Translation_1_1/MF:Translated&Cylinder_1_1/Face_2]"), False)
+SketchCircle_1 = SketchProjection_2.createdFeature()
+SketchCircle_2 = Sketch_1.addCircle(5, 5, 2)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchPoint_1.result(), SketchCircle_2.center())
+SketchConstraintTangent_1 = Sketch_1.setTangent(SketchCircle_1.results()[1], SketchCircle_2.results()[1])
+
+RevolutionCut_1.setNestedSketch(Sketch_1)
+
+model.do()
+
+Shape = RevolutionCut_1.results()[0].resultSubShapePair()[0].shape()
+checkMiddlePoint(Shape, 5.13562827, 5.0, 5.13562827)
+
+model.end()
+
+assert(model.checkPythonDump())
diff --git a/src/FeaturesPlugin/Test/TestRevolutionFuse_ThroughAll.py b/src/FeaturesPlugin/Test/TestRevolutionFuse_ThroughAll.py
new file mode 100644 (file)
index 0000000..2f1d342
--- /dev/null
@@ -0,0 +1,60 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+from salome.shaper import model
+
+import math
+
+def checkMiddlePoint(shape, x, y, z, tolerance = 1.e-7):
+    assert(shape is not None)
+    middlePoint = shape.middlePoint()
+    assert(math.fabs(middlePoint.x() - x) < tolerance), "{} != {}".format(middlePoint.x(), x)
+    assert(math.fabs(middlePoint.y() - y) < tolerance), "{} != {}".format(middlePoint.y(), y)
+    assert(math.fabs(middlePoint.z() - z) < tolerance), "{} != {}".format(middlePoint.z(), z)
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+Cylinder_1 = model.addCylinder(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 2, 10)
+Translation_1 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Cylinder_1_1")], 5, 5, 0)
+
+RevolutionFuse_1 = model.addRevolutionFuse(Part_1_doc, [], model.selection("EDGE", "[Box_1_1/Front][Box_1_1/Top]"), [model.selection("SOLID", "Box_1_1")])
+
+Sketch_1 = model.addSketch(Part_1_doc, model.selection("FACE", "Translation_1_1/MF:Translated&Cylinder_1_1/Face_2"))
+SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "[Translation_1_1/MF:Translated&Cylinder_1_1/Face_1][Translation_1_1/MF:Translated&Cylinder_1_1/Face_2]__cc"), False)
+SketchPoint_1 = SketchProjection_1.createdFeature()
+SketchProjection_2 = Sketch_1.addProjection(model.selection("EDGE", "[Translation_1_1/MF:Translated&Cylinder_1_1/Face_1][Translation_1_1/MF:Translated&Cylinder_1_1/Face_2]"), False)
+SketchCircle_1 = SketchProjection_2.createdFeature()
+SketchCircle_2 = Sketch_1.addCircle(5, 5, 2)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchPoint_1.result(), SketchCircle_2.center())
+SketchConstraintTangent_1 = Sketch_1.setTangent(SketchCircle_1.results()[1], SketchCircle_2.results()[1])
+
+RevolutionFuse_1.setNestedSketch(Sketch_1)
+
+model.do()
+
+Shape = RevolutionFuse_1.results()[0].resultSubShapePair()[0].shape()
+checkMiddlePoint(Shape, 7.01705635, 5.0, 7.01705635)
+
+model.end()
+
+assert(model.checkPythonDump())
diff --git a/src/FeaturesPlugin/doc/TUI_revolutionCutThroughAll.rst b/src/FeaturesPlugin/doc/TUI_revolutionCutThroughAll.rst
new file mode 100644 (file)
index 0000000..b7e158e
--- /dev/null
@@ -0,0 +1,12 @@
+
+  .. _tui_create_revolution_cut_through_all:
+
+Create Revolution Cut by 360 degrees
+====================================
+
+.. literalinclude:: examples/revolution_cut_through_all.py 
+    :linenos:
+    :language: python
+
+:download:`Download this script <examples/revolution_cut_through_all.py>`
+   
diff --git a/src/FeaturesPlugin/doc/TUI_revolutionFuseThroughAll.rst b/src/FeaturesPlugin/doc/TUI_revolutionFuseThroughAll.rst
new file mode 100644 (file)
index 0000000..047d25d
--- /dev/null
@@ -0,0 +1,12 @@
+
+  .. _tui_create_revolution_fuse_through_all:
+
+Create Revolution Fuse by 360 degrees
+=====================================
+
+.. literalinclude:: examples/revolution_fuse_through_all.py 
+    :linenos:
+    :language: python
+
+:download:`Download this script <examples/revolution_fuse_through_all.py>`
+   
diff --git a/src/FeaturesPlugin/doc/examples/revolution_cut_through_all.py b/src/FeaturesPlugin/doc/examples/revolution_cut_through_all.py
new file mode 100644 (file)
index 0000000..508147e
--- /dev/null
@@ -0,0 +1,13 @@
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+Sketch_1 = model.addSketch(Part_1_doc, model.selection("FACE", "Box_1_1/Top"))
+SketchCircle_1 = Sketch_1.addCircle(5, 5, 2.5)
+model.do()
+RevolutionCut_1 = model.addRevolutionCut(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection("EDGE", "[Box_1_1/Front][Box_1_1/Top]"), [model.selection("SOLID", "Box_1_1")])
+model.do()
+model.end()
diff --git a/src/FeaturesPlugin/doc/examples/revolution_fuse_through_all.py b/src/FeaturesPlugin/doc/examples/revolution_fuse_through_all.py
new file mode 100644 (file)
index 0000000..fad51a6
--- /dev/null
@@ -0,0 +1,13 @@
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+Sketch_1 = model.addSketch(Part_1_doc, model.selection("FACE", "Box_1_1/Top"))
+SketchCircle_1 = Sketch_1.addCircle(5, 5, 2.5)
+model.do()
+RevolutionFuse_1 = model.addRevolutionFuse(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection("EDGE", "[Box_1_1/Front][Box_1_1/Top]"), [model.selection("SOLID", "Box_1_1")])
+model.do()
+model.end()
diff --git a/src/FeaturesPlugin/doc/images/revolution_cut_through_all_result.png b/src/FeaturesPlugin/doc/images/revolution_cut_through_all_result.png
new file mode 100644 (file)
index 0000000..6905721
Binary files /dev/null and b/src/FeaturesPlugin/doc/images/revolution_cut_through_all_result.png differ
diff --git a/src/FeaturesPlugin/doc/images/revolution_through_all.png b/src/FeaturesPlugin/doc/images/revolution_through_all.png
new file mode 100644 (file)
index 0000000..2c1a4b2
Binary files /dev/null and b/src/FeaturesPlugin/doc/images/revolution_through_all.png differ
index b2f5d47049c71a3a9992e50010785e1608d8692e..da86d155e6db03adfa7c873c61f2e51c2764aadd 100644 (file)
@@ -18,7 +18,7 @@ The following property panel will be opened:
 .. centered::
   Start sketch
 
-There are two variants of the property panel for Revolution Cut depending on the chosen option:
+There are three variants of the property panel for Revolution Cut depending on the chosen option:
 
 .. image:: images/revolution_by_angles.png
    :align: left
@@ -28,6 +28,10 @@ There are two variants of the property panel for Revolution Cut depending on the
    :align: left
 **By Bounding Planes** revolves objects by specifying bounding planes and angles.
 
+.. image:: images/revolution_through_all.png
+   :align: left
+**Through All** revolves objects by 360 degrees.
+
 
 By angles
 --------
@@ -120,4 +124,40 @@ The Result of the operation will be a revolved shape:
 .. centered::
    **Revolution Cut created**
 
-**See Also** a sample TUI Script of :ref:`tui_create_revolution_cut_by_bounding_planes` operation.
\ No newline at end of file
+**See Also** a sample TUI Script of :ref:`tui_create_revolution_cut_by_bounding_planes` operation.
+
+Through all
+--------
+
+.. image:: images/RevolutionCut3.png
+  :align: center
+
+.. centered::
+  Revolution Cut: revolving through all the space
+
+- **Base objects** - contains a list of objects selected in the Object Browser or in the Viewer, which will be revolved.
+- **Axis** - axis of revolution.
+- **Cut from** - contains a list of objects which will but cut with the result of revolution.
+
+**TUI Commands**:
+
+.. py:function:: model.addRevolutionCut(part, objectsToRevolve, axis, objectToCut)
+
+    :param part: The current part object.
+    :param list: A list of objects for revolution.
+    :param object: An axis.
+    :param list: A list of objects to cut from.
+    :return: Created object.
+
+Result
+""""""
+
+The Result of the operation will be a revolved shape:
+
+.. image:: images/revolution_cut_through_all_result.png
+          :align: center
+
+.. centered::
+   **Revolution Cut created**
+
+**See Also** a sample TUI Script of :ref:`tui_create_revolution_cut_through_all` operation.
index 3ef022a8affefe51ddbc04687c35ff20d73e6160..a608a03d9c735a0686f84bcfbeba86c5e274c4a7 100644 (file)
@@ -18,7 +18,7 @@ The following property panel will be opened:
 .. centered::
   Start sketch
   
-There are two variants of the property panel for Revolution Fuse depending on the chosen option:
+There are three variants of the property panel for Revolution Fuse depending on the chosen option:
 
 .. image:: images/revolution_by_angles.png
    :align: left
@@ -28,6 +28,10 @@ There are two variants of the property panel for Revolution Fuse depending on th
    :align: left
 **By Bounding Planes** revolves objects by specifying bounding planes and angles.
 
+.. image:: images/revolution_through_all.png
+   :align: left
+**Through All** revolves objects by 360 degrees.
+
 
 By angles
 --------
@@ -120,4 +124,40 @@ The Result of the operation will be a revolved shape:
 .. centered::
    **Revolution Fuse created**
 
-**See Also** a sample TUI Script of :ref:`tui_create_revolution_fuse_by_bounding_planes` operation.
\ No newline at end of file
+**See Also** a sample TUI Script of :ref:`tui_create_revolution_fuse_by_bounding_planes` operation.
+
+Through All
+-----------
+
+.. image:: images/RevolutionFuse3.png
+  :align: center
+
+.. centered::
+  Revolution Fuse: definition by bounding planes
+
+- **Base objects** - contains a list of objects selected in the Object Browser or in the Viewer, which will be revolved.
+- **Axis** - axis of revolution.
+- **Fuse with** - contains a list of objects which will be fused with the result of revolution.
+
+**TUI Command**:
+
+.. py:function:: model.addRevolutionFuse(part, objectsToRevolve, axis, objectToFuse)
+
+    :param part: The current part object.
+    :param list: A list of objects for revolution.
+    :param object: An axis.
+    :param list: A list of objects to fuse with.
+    :return: Created object.
+
+Result
+""""""
+
+The Result of the operation will be a revolved shape:
+
+.. image:: images/revolution_fuse_through_all_result.png
+          :align: center
+
+.. centered::
+   **Revolution Fuse created**
+
+**See Also** a sample TUI Script of :ref:`tui_create_revolution_fuse_through_all` operation.
diff --git a/src/FeaturesPlugin/icons/extrusion_throughall_32x32.png b/src/FeaturesPlugin/icons/extrusion_throughall_32x32.png
new file mode 100644 (file)
index 0000000..2c1a4b2
Binary files /dev/null and b/src/FeaturesPlugin/icons/extrusion_throughall_32x32.png differ
diff --git a/src/FeaturesPlugin/icons/revol_throughall_32x32.png b/src/FeaturesPlugin/icons/revol_throughall_32x32.png
new file mode 100644 (file)
index 0000000..2c1a4b2
Binary files /dev/null and b/src/FeaturesPlugin/icons/revol_throughall_32x32.png differ
index a8edd4a49206d282d77dc588b79e750d28886f82..c3b19383ebd73881dece0904956dd2bf9836b6dc 100644 (file)
@@ -83,6 +83,8 @@
           </doublevalue>
         </groupbox>
       </box>
+      <box id="ThroughAll" title="Through all" icon="icons/Features/revol_throughall_32x32.png">
+      </box>
     </toolbox>
   </groupbox>
   <multi_selector id="main_objects"
index 7981db76c305aa9751236ff148d9d11e0d4c5e66..4f571406e089f1fac9229e8c0348802124fa2443 100644 (file)
@@ -83,6 +83,8 @@
           </doublevalue>
         </groupbox>
       </box>
+      <box id="ThroughAll" title="Through all" icon="icons/Features/revol_throughall_32x32.png">
+      </box>
     </toolbox>
   </groupbox>
   <multi_selector id="main_objects"
index 411a1a21ef59acb0b5a9dd70aa43e1778fda1887..3a52d2d515d992becc252e778487441bd5346a41 100644 (file)
@@ -52,6 +52,7 @@ bool GeomValidators_ZeroOffset::isValid(const std::shared_ptr<ModelAPI_Feature>&
   if(theFeature->string(*anIt)) {
     aSelectedMethod = theFeature->string(*anIt)->value();
   }
+  if (aSelectedMethod == "ThroughAll") return true;
   anIt++;
   std::string aCreationMethod = *anIt;
   anIt++;