From: jfa Date: Thu, 17 Oct 2019 10:19:33 +0000 (+0300) Subject: Task #3016: 3.2 To add a mode «through all» for features RevolutionCut and RevolutionFuse X-Git-Tag: V9_5_0a1~167^2~81 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=7eb4c88d46d8fa7d664bc5f505952f4677fd4628;p=modules%2Fshaper.git Task #3016: 3.2 To add a mode «through all» for features RevolutionCut and RevolutionFuse --- diff --git a/src/FeaturesAPI/FeaturesAPI_RevolutionBoolean.cpp b/src/FeaturesAPI/FeaturesAPI_RevolutionBoolean.cpp index 385244275..3f595c2e9 100644 --- a/src/FeaturesAPI/FeaturesAPI_RevolutionBoolean.cpp +++ b/src/FeaturesAPI/FeaturesAPI_RevolutionBoolean.cpp @@ -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& theFeature, + const std::list& theBaseObjects, + const ModelHighAPI_Selection& theAxis, + const std::list& 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& theFeature, @@ -246,6 +264,18 @@ FeaturesAPI_RevolutionCut::FeaturesAPI_RevolutionCut( } } +//================================================================================================== +RevolutionCutPtr addRevolutionCut(const std::shared_ptr& thePart, + const std::list& theBaseObjects, + const ModelHighAPI_Selection& theAxis, + const std::list& theBooleanObjects) +{ + std::shared_ptr aFeature = + thePart->addFeature(FeaturesPlugin_RevolutionCut::ID()); + return RevolutionCutPtr(new FeaturesAPI_RevolutionCut(aFeature, theBaseObjects, + theAxis, theBooleanObjects)); +} + //================================================================================================== RevolutionCutPtr addRevolutionCut(const std::shared_ptr& thePart, const std::list& theBaseObjects, @@ -308,6 +338,22 @@ FeaturesAPI_RevolutionFuse::FeaturesAPI_RevolutionFuse( initialize(); } +//================================================================================================== +FeaturesAPI_RevolutionFuse::FeaturesAPI_RevolutionFuse( + const std::shared_ptr& theFeature, + const std::list& theBaseObjects, + const ModelHighAPI_Selection& theAxis, + const std::list& 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& theFeature, @@ -371,6 +417,18 @@ FeaturesAPI_RevolutionFuse::FeaturesAPI_RevolutionFuse( } } +//================================================================================================== +RevolutionFusePtr addRevolutionFuse(const std::shared_ptr& thePart, + const std::list& theBaseObjects, + const ModelHighAPI_Selection& theAxis, + const std::list& theBooleanObjects) +{ + std::shared_ptr aFeature = + thePart->addFeature(FeaturesPlugin_RevolutionFuse::ID()); + return RevolutionFusePtr(new FeaturesAPI_RevolutionFuse(aFeature, theBaseObjects, + theAxis, theBooleanObjects)); +} + //================================================================================================== RevolutionFusePtr addRevolutionFuse(const std::shared_ptr& thePart, const std::list& theBaseObjects, diff --git a/src/FeaturesAPI/FeaturesAPI_RevolutionBoolean.h b/src/FeaturesAPI/FeaturesAPI_RevolutionBoolean.h index cd7809176..5f636c081 100644 --- a/src/FeaturesAPI/FeaturesAPI_RevolutionBoolean.h +++ b/src/FeaturesAPI/FeaturesAPI_RevolutionBoolean.h @@ -127,6 +127,13 @@ public: FEATURESAPI_EXPORT explicit FeaturesAPI_RevolutionCut(const std::shared_ptr& theFeature); + /// Constructor with values. + FEATURESAPI_EXPORT + explicit FeaturesAPI_RevolutionCut(const std::shared_ptr& theFeature, + const std::list& theBaseObjects, + const ModelHighAPI_Selection& theAxis, + const std::list& theBooleanObjects); + /// Constructor with values. FEATURESAPI_EXPORT explicit FeaturesAPI_RevolutionCut(const std::shared_ptr& theFeature, @@ -159,6 +166,14 @@ public: /// Pointer on RevolutionCut object. typedef std::shared_ptr RevolutionCutPtr; +/// \ingroup CPPHighAPI +/// \brief Create RevolutionCut feature. +FEATURESAPI_EXPORT +RevolutionCutPtr addRevolutionCut(const std::shared_ptr& thePart, + const std::list& theBaseObjects, + const ModelHighAPI_Selection& theAxis, + const std::list& theBooleanObjects); + /// \ingroup CPPHighAPI /// \brief Create RevolutionCut feature. FEATURESAPI_EXPORT @@ -204,6 +219,13 @@ public: FEATURESAPI_EXPORT explicit FeaturesAPI_RevolutionFuse(const std::shared_ptr& theFeature); + /// Constructor with values. + FEATURESAPI_EXPORT + explicit FeaturesAPI_RevolutionFuse(const std::shared_ptr& theFeature, + const std::list& theBaseObjects, + const ModelHighAPI_Selection& theAxis, + const std::list& theBooleanObjects); + /// Constructor with values. FEATURESAPI_EXPORT explicit FeaturesAPI_RevolutionFuse(const std::shared_ptr& theFeature, @@ -236,6 +258,14 @@ public: /// Pointer on RevolutionFuse object. typedef std::shared_ptr RevolutionFusePtr; +/// \ingroup CPPHighAPI +/// \brief Create RevolutionFuse feature. +FEATURESAPI_EXPORT +RevolutionFusePtr addRevolutionFuse(const std::shared_ptr& thePart, + const std::list& theBaseObjects, + const ModelHighAPI_Selection& theAxis, + const std::list& theBooleanObjects); + /// \ingroup CPPHighAPI /// \brief Create RevolutionFuse feature. FEATURESAPI_EXPORT diff --git a/src/FeaturesPlugin/CMakeLists.txt b/src/FeaturesPlugin/CMakeLists.txt index 7640e539a..5316c8c07 100644 --- a/src/FeaturesPlugin/CMakeLists.txt +++ b/src/FeaturesPlugin/CMakeLists.txt @@ -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 diff --git a/src/FeaturesPlugin/FeaturesPlugin_Revolution.cpp b/src/FeaturesPlugin/FeaturesPlugin_Revolution.cpp index 9994cd900..1789039f5 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Revolution.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Revolution.cpp @@ -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. diff --git a/src/FeaturesPlugin/FeaturesPlugin_Revolution.h b/src/FeaturesPlugin/FeaturesPlugin_Revolution.h index cd0b929fc..820ae3471 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Revolution.h +++ b/src/FeaturesPlugin/FeaturesPlugin_Revolution.h @@ -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 index 000000000..837f0a4ac --- /dev/null +++ b/src/FeaturesPlugin/Test/TestRevolutionCut_ThroughAll.py @@ -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 index 000000000..2f1d34213 --- /dev/null +++ b/src/FeaturesPlugin/Test/TestRevolutionFuse_ThroughAll.py @@ -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 index 000000000..b7e158ed4 --- /dev/null +++ b/src/FeaturesPlugin/doc/TUI_revolutionCutThroughAll.rst @@ -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 ` + diff --git a/src/FeaturesPlugin/doc/TUI_revolutionFuseThroughAll.rst b/src/FeaturesPlugin/doc/TUI_revolutionFuseThroughAll.rst new file mode 100644 index 000000000..047d25d4c --- /dev/null +++ b/src/FeaturesPlugin/doc/TUI_revolutionFuseThroughAll.rst @@ -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 ` + 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 index 000000000..508147e62 --- /dev/null +++ b/src/FeaturesPlugin/doc/examples/revolution_cut_through_all.py @@ -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 index 000000000..fad51a66c --- /dev/null +++ b/src/FeaturesPlugin/doc/examples/revolution_fuse_through_all.py @@ -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 index 000000000..690572198 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 index 000000000..2c1a4b2b7 Binary files /dev/null and b/src/FeaturesPlugin/doc/images/revolution_through_all.png differ diff --git a/src/FeaturesPlugin/doc/revolutionCutFeature.rst b/src/FeaturesPlugin/doc/revolutionCutFeature.rst index b2f5d4704..da86d155e 100644 --- a/src/FeaturesPlugin/doc/revolutionCutFeature.rst +++ b/src/FeaturesPlugin/doc/revolutionCutFeature.rst @@ -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. diff --git a/src/FeaturesPlugin/doc/revolutionFuseFeature.rst b/src/FeaturesPlugin/doc/revolutionFuseFeature.rst index 3ef022a8a..a608a03d9 100644 --- a/src/FeaturesPlugin/doc/revolutionFuseFeature.rst +++ b/src/FeaturesPlugin/doc/revolutionFuseFeature.rst @@ -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 index 000000000..2c1a4b2b7 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 index 000000000..2c1a4b2b7 Binary files /dev/null and b/src/FeaturesPlugin/icons/revol_throughall_32x32.png differ diff --git a/src/FeaturesPlugin/revolutioncut_widget.xml b/src/FeaturesPlugin/revolutioncut_widget.xml index a8edd4a49..c3b19383e 100644 --- a/src/FeaturesPlugin/revolutioncut_widget.xml +++ b/src/FeaturesPlugin/revolutioncut_widget.xml @@ -83,6 +83,8 @@ + + + + & if(theFeature->string(*anIt)) { aSelectedMethod = theFeature->string(*anIt)->value(); } + if (aSelectedMethod == "ThroughAll") return true; anIt++; std::string aCreationMethod = *anIt; anIt++;