From a9503c2f68f344b35d952ff91d6b77db32004d65 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me?= Date: Tue, 10 Nov 2020 15:28:29 +0100 Subject: [PATCH] Fix issues #20294 --- .../Test/TestFillet_MultiRadius.py | 133 ++++++++++++++++++ src/ConnectorAPI/Test/tests.set | 1 + src/FeaturesAPI/FeaturesAPI.i | 3 +- src/FeaturesAPI/FeaturesAPI_Fillet.cpp | 40 +++--- src/FeaturesAPI/FeaturesAPI_Fillet.h | 18 ++- src/FeaturesPlugin/CMakeLists.txt | 1 + ...aturesPlugin_WidgetFilletMultiRadiuses.cpp | 9 +- src/FeaturesPlugin/Test/TestFillet.py | 2 + .../Test/TestFillet_MultiRadius.py | 92 ++---------- .../doc/examples/filletMultiRadiusByPoints.py | 4 +- .../examples/filletMultiRadiusBycurvAbs.py | 4 +- src/FeaturesPlugin/doc/filletFeature.rst | 22 +-- src/PythonAPI/model/features/__init__.py | 2 +- 13 files changed, 198 insertions(+), 133 deletions(-) create mode 100644 src/ConnectorAPI/Test/TestFillet_MultiRadius.py diff --git a/src/ConnectorAPI/Test/TestFillet_MultiRadius.py b/src/ConnectorAPI/Test/TestFillet_MultiRadius.py new file mode 100644 index 000000000..3ebe363b3 --- /dev/null +++ b/src/ConnectorAPI/Test/TestFillet_MultiRadius.py @@ -0,0 +1,133 @@ +# Copyright (C) 2014-2020 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 +# + +""" + TestFillet_MultiRadius.py + Unit test of ... +""" +#========================================================================= +# Initialization of the test +#========================================================================= + +import salome + +import os +import math +from tempfile import TemporaryDirectory + +import GEOM +from ModelAPI import * +from salome.shaper import model +from salome.geom import geomBuilder +from GeomAPI import GeomAPI_Shape +from GeomAlgoAPI import * + +#import SALOMEDS + + +__updated__ = "2020-10-10" + +salome.salome_init(1) + +#========================================================================= +# Help functions +#========================================================================= +def removeFile(theFileName): + try: os.remove(theFileName) + except OSError: pass + assert not os.path.exists(theFileName), \ + "Can not remove file {0}".format(theFileName) + +#========================================================================= +# test Fillet on a solid with a constant radius +#========================================================================= +def testFillet_constant_radius_onsolids(): + + model.begin() + partSet = model.moduleDocument() + ### Create Part + Part_1 = model.addPart(partSet) + Part_1_doc = Part_1.document() + + ### Create Box + Box_1 = model.addBox(Part_1_doc, 20, 30, 10) + + ### Create Fillet + Fillet_1 = model.addFillet(Part_1_doc, [model.selection("SOLID", "Box_1_1")], 2) + + ### Create Export + Export_1 = model.exportToXAO(Part_1_doc, '/tmp/shaper_exp_cglb.xao', model.selection("SOLID", "Fillet_1_1"), 'XAO') + + model.end() + + # Check results + ### + ### GEOM component + ### + + geompy = geomBuilder.New() + + O = geompy.MakeVertex(0, 0, 0) + OX = geompy.MakeVectorDXDYDZ(1, 0, 0) + OY = geompy.MakeVectorDXDYDZ(0, 1, 0) + OZ = geompy.MakeVectorDXDYDZ(0, 0, 1) + + # where we import the fillet from SHAPER and get its basic properties + (imported, Fillet_1_1, [], [], []) = geompy.ImportXAO("/tmp/shaper_exp_cglb.xao") + geompy.addToStudy( O, 'O' ) + geompy.addToStudy( OX, 'OX' ) + geompy.addToStudy( OY, 'OY' ) + geompy.addToStudy( OZ, 'OZ' ) + geompy.addToStudy( Fillet_1_1, 'Fillet_1_1' ) + + myDelta = 1e-6 + Props_shaper = geompy.BasicProperties(Fillet_1_1) + print("\nBasic Properties:") + print(" Wires length: ", Props_shaper[0]) + print(" Surface area: ", Props_shaper[1]) + print(" Volume : ", Props_shaper[2]) + + # where we build the same fillet in GEOM for comparison + Box_1 = geompy.MakeBoxDXDYDZ(20, 30, 10) + Fillet_1 = geompy.MakeFilletAll(Box_1, 2) + geompy.addToStudy( Box_1, 'Box_1' ) + geompy.addToStudy( Fillet_1, 'Fillet_1' ) + + Props_geom = geompy.BasicProperties(Fillet_1) + print("\nBasic Properties:") + print(" Wires length: ", Props_geom[0]) + print(" Surface area: ", Props_geom[1]) + print(" Volume : ", Props_geom[2]) + + aRefSurface = Props_geom[1] + aResSurface = Props_shaper[1] + assert (math.fabs(aResSurface - aRefSurface) < myDelta), "The surface is wrong: expected = {0}, real = {1}".format(aRefSurface, aResSurface) + + aRefVolume = Props_geom[2] + aResVolume = Props_shaper[2] + assert (math.fabs(aResVolume - aRefVolume) < myDelta), "The volume is wrong: expected = {0}, real = {1}".format(aRefVolume, aResVolume) + + +if __name__ == '__main__': + with TemporaryDirectory() as tmp_dir: + + testFillet_constant_radius_onsolids() + #========================================================================= + # End of test + #========================================================================= diff --git a/src/ConnectorAPI/Test/tests.set b/src/ConnectorAPI/Test/tests.set index 60e932add..1b3c1995e 100644 --- a/src/ConnectorAPI/Test/tests.set +++ b/src/ConnectorAPI/Test/tests.set @@ -27,4 +27,5 @@ SET(TEST_NAMES Test17917 Test18887 Test3195 + TestFillet_MultiRadius ) diff --git a/src/FeaturesAPI/FeaturesAPI.i b/src/FeaturesAPI/FeaturesAPI.i index be460f967..a6593757f 100644 --- a/src/FeaturesAPI/FeaturesAPI.i +++ b/src/FeaturesAPI/FeaturesAPI.i @@ -42,8 +42,7 @@ %feature("kwargs") addCommon; %feature("kwargs") addCut; %feature("kwargs") addFillet; -%feature("kwargs") addFilletMultiRadiusBycurvAbs; -%feature("kwargs") addFilletMultiRadiusByPoints; +%feature("kwargs") addFilletMultiRadius; %feature("kwargs") addFuse; %feature("kwargs") addIntersection; %feature("kwargs") addMultiRotation; diff --git a/src/FeaturesAPI/FeaturesAPI_Fillet.cpp b/src/FeaturesAPI/FeaturesAPI_Fillet.cpp index 4863546aa..60a294693 100644 --- a/src/FeaturesAPI/FeaturesAPI_Fillet.cpp +++ b/src/FeaturesAPI/FeaturesAPI_Fillet.cpp @@ -126,9 +126,10 @@ FeaturesAPI_Fillet2D::FeaturesAPI_Fillet2D(const std::shared_ptr& theFeature, - const std::list& theBaseObjects, - const ModelHighAPI_Double& theRadius) +FeaturesAPI_Fillet2D::FeaturesAPI_Fillet2D( + const std::shared_ptr& theFeature, + const std::list& theBaseObjects, + const ModelHighAPI_Double& theRadius) : FeaturesAPI_Fillet(theFeature) { if (initialize()) { @@ -141,14 +142,14 @@ FeaturesAPI_Fillet2D::FeaturesAPI_Fillet2D(const std::shared_ptr& theFeature, - const std::list& theBaseObjects, + const std::list& theEdgesFaces, const ModelHighAPI_Double& theRadius1, const ModelHighAPI_Double& theRadius2) : FeaturesAPI_Fillet(theFeature) { if (initialize()) { fillAttribute(FeaturesPlugin_Fillet::CREATION_METHOD_VARYING_RADIUS(), mycreationMethod); - fillAttribute(theBaseObjects, mybaseObjects); + fillAttribute(theEdgesFaces, myedgesfacesselected); fillAttribute(theRadius1, mystartRadius); fillAttribute(theRadius2, myendRadius); @@ -300,7 +301,7 @@ void FeaturesAPI_Fillet2D::dump(ModelHighAPI_Dumper& theDumper) const aBase->selectionList(FeaturesPlugin_Fillet::ARRAY_POINT_RADIUS_BY_POINTS()); AttributeTablesPtr anAttrTable = aBase->tables(FeaturesPlugin_Fillet::VALUES_ID()); - theDumper << aBase << " = model.addFilletMultiRadiusByPoints(" + theDumper << aBase << " = model.addFilletMultiRadius(" << aDocName << ", " << anAttrEdgeSelec; theDumper << ", " << anAttrPoint ; theDumper<<", ["; @@ -316,7 +317,7 @@ void FeaturesAPI_Fillet2D::dump(ModelHighAPI_Dumper& theDumper) const AttributeSelectionListPtr anAttrEdgesFaces = aBase->selectionList(FeaturesPlugin_Fillet::EDGES_FACES_MULTI_LIST_ID()); AttributeTablesPtr anAttrTable = aBase->tables(FeaturesPlugin_Fillet::VALUES_CURV_ID()); - theDumper << aBase << " = model.addFilletMultiRadiusBycurvAbs(" + theDumper << aBase << " = model.addFilletMultiRadius(" << aDocName << ", " << anAttrEdgesFaces; theDumper << ", "; theDumper<<"["; @@ -352,11 +353,10 @@ void FeaturesAPI_Fillet2D::dump(ModelHighAPI_Dumper& theDumper) const AttributeDoublePtr anAttrRadius2 = aBase->real(FeaturesPlugin_Fillet::END_RADIUS_ID()); theDumper << ", " << anAttrRadius1 << ", " << anAttrRadius2; } + if (!aBase->data()->version().empty()) + theDumper << ", keepSubResults = True"; } - if (!aBase->data()->version().empty()) - theDumper << ", keepSubResults = True"; - theDumper << ")" << std::endl; } @@ -391,16 +391,14 @@ FilletPtr addFillet(const std::shared_ptr& thePart, return aFillet; } -FilletPtr addFilletMultiRadiusByPoints(const std::shared_ptr& thePart, - const ModelHighAPI_Selection & theEdgeSelected, - const std::list& thePoint, - const std::list& theRadius, - const bool keepSubResults) +FilletPtr addFilletMultiRadius(const std::shared_ptr& thePart, + const ModelHighAPI_Selection & theEdgeSelected, + const std::list& thePoint, + const std::list& theRadius) { FeaturePtr aFeature = thePart->addFeature(FeaturesAPI_Fillet2D::ID()); - if (!keepSubResults) - aFeature->data()->setVersion(""); + aFeature->data()->setVersion(""); FilletPtr aFillet; @@ -409,16 +407,14 @@ FilletPtr addFilletMultiRadiusByPoints(const std::shared_ptr& return aFillet; } -FilletPtr addFilletMultiRadiusBycurvAbs(const std::shared_ptr& thePart, +FilletPtr addFilletMultiRadius(const std::shared_ptr& thePart, const std::list& theBaseObjects, const std::list& thePointCurvCood, - const std::list& theRadius, - const bool keepSubResults) + const std::list& theRadius) { FeaturePtr aFeature = thePart->addFeature(FeaturesAPI_Fillet2D::ID()); - if (!keepSubResults) - aFeature->data()->setVersion(""); + aFeature->data()->setVersion(""); FilletPtr aFillet; diff --git a/src/FeaturesAPI/FeaturesAPI_Fillet.h b/src/FeaturesAPI/FeaturesAPI_Fillet.h index 413bb49f7..a23022ea3 100644 --- a/src/FeaturesAPI/FeaturesAPI_Fillet.h +++ b/src/FeaturesAPI/FeaturesAPI_Fillet.h @@ -127,7 +127,7 @@ public: /// Constructor with values. FEATURESAPI_EXPORT explicit FeaturesAPI_Fillet2D(const std::shared_ptr& theFeature, - const std::list& theBaseObjects, + const std::list& theEdgesFaces, const ModelHighAPI_Double& theRadius1, const ModelHighAPI_Double& theRadius2); @@ -141,7 +141,7 @@ public: /// Constructor with values. FEATURESAPI_EXPORT explicit FeaturesAPI_Fillet2D(const std::shared_ptr& theFeature, - const std::list& theBaseObjects, + const std::list& theEdgesFaces, const std::list& thepointCurvCood, const std::list& theRadius); /// Destructor. @@ -219,20 +219,18 @@ FilletPtr addFillet(const std::shared_ptr& thePart, /// \ingroup CPPHighAPI /// \brief Create Fillet feature. FEATURESAPI_EXPORT -FilletPtr addFilletMultiRadiusByPoints(const std::shared_ptr& thePart, - const ModelHighAPI_Selection & theEdgeSelected, - const std::list& thePoint, - const std::list& theRadius, - const bool keepSubResults= false); +FilletPtr addFilletMultiRadius(const std::shared_ptr& thePart, + const ModelHighAPI_Selection & theEdgeSelected, + const std::list& thePoint, + const std::list& theRadius); /// \ingroup CPPHighAPI /// \brief Create Fillet feature. FEATURESAPI_EXPORT -FilletPtr addFilletMultiRadiusBycurvAbs( const std::shared_ptr& thePart, +FilletPtr addFilletMultiRadius( const std::shared_ptr& thePart, const std::list& theBaseObjects, const std::list& thePointCurvCood, - const std::list& theRadius, - const bool keepSubResults= false); + const std::list& theRadius); #endif // FeaturesAPI_Fillet_H_ diff --git a/src/FeaturesPlugin/CMakeLists.txt b/src/FeaturesPlugin/CMakeLists.txt index 089805750..3b0992f92 100644 --- a/src/FeaturesPlugin/CMakeLists.txt +++ b/src/FeaturesPlugin/CMakeLists.txt @@ -203,6 +203,7 @@ SET(PROJECT_LIBRARIES GeomAlgoAPI GeomValidators Config + ModuleBase ${OpenCASCADE_Visualization_LIBRARIES} ) diff --git a/src/FeaturesPlugin/FeaturesPlugin_WidgetFilletMultiRadiuses.cpp b/src/FeaturesPlugin/FeaturesPlugin_WidgetFilletMultiRadiuses.cpp index 3c390fd16..79e14cfac 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_WidgetFilletMultiRadiuses.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_WidgetFilletMultiRadiuses.cpp @@ -197,6 +197,7 @@ ModuleBase_WidgetSelector(theParent, theWorkshop, theData), myHeaderEditor(0), aHeaders << "Radius"; myDataTbl->setHorizontalHeaderLabels(aHeaders); + myDataTbl->installEventFilter(this); QTableWidgetItem* anItem; for(int j =0; j<3;j++) @@ -278,6 +279,12 @@ void FeaturesPlugin_WidgetFilletMultiRadiuses::deactivate() //********************************************************************************** bool FeaturesPlugin_WidgetFilletMultiRadiuses::eventFilter(QObject* theObject, QEvent* theEvent) { + if (theEvent->type() == QEvent::KeyPress) { + QKeyEvent* akey = static_cast(theEvent); + if ( (akey->key()==Qt::Key_Enter) || (akey->key()==Qt::Key_Return) ) { + updateObject(myFeature); + } + } return ModuleBase_WidgetSelector::eventFilter(theObject, theEvent); } @@ -569,8 +576,8 @@ void FeaturesPlugin_WidgetFilletMultiRadiuses::onRemove() } myDataTbl->model()->removeRow(anIndex.row()); myDataTbl->blockSignals(false); - emit valuesChanged(); + updateObject(myFeature); } } diff --git a/src/FeaturesPlugin/Test/TestFillet.py b/src/FeaturesPlugin/Test/TestFillet.py index ed05f8be4..52c9f1aad 100644 --- a/src/FeaturesPlugin/Test/TestFillet.py +++ b/src/FeaturesPlugin/Test/TestFillet.py @@ -80,6 +80,8 @@ assert(aFillet1.error() == ""), "FAILED: Fillet reports error \"{}\"".format(aFi #========================================================================= aSession.startOperation() aFillet1.string("creation_method").setValue("variable_radius") +anObjects = aFillet1.selectionList("edges_faces_seleted") +anObjects.append("[Box_1_1/Left][Box_1_1/Top]", "edge") aFillet1.real("radius1").setValue(5) aFillet1.real("radius2").setValue(1) aSession.finishOperation() diff --git a/src/FeaturesPlugin/Test/TestFillet_MultiRadius.py b/src/FeaturesPlugin/Test/TestFillet_MultiRadius.py index e0e724c76..7fb3bcccd 100644 --- a/src/FeaturesPlugin/Test/TestFillet_MultiRadius.py +++ b/src/FeaturesPlugin/Test/TestFillet_MultiRadius.py @@ -31,21 +31,15 @@ import os import math from tempfile import TemporaryDirectory -import GEOM + from ModelAPI import * from salome.shaper import model -import SHAPERSTUDY -from salome.geom import geomBuilder + from GeomAPI import GeomAPI_Shape from GeomAlgoAPI import * -#import SALOMEDS - - __updated__ = "2020-10-10" -salome.salome_init(1) - #========================================================================= # Help functions #========================================================================= @@ -55,74 +49,6 @@ def removeFile(theFileName): assert not os.path.exists(theFileName), \ "Can not remove file {0}".format(theFileName) -#========================================================================= -# test Fillet on a solid with a constant radius -#========================================================================= -def testFillet_constant_radius_onsolids(): - - model.begin() - partSet = model.moduleDocument() - ### Create Part - Part_1 = model.addPart(partSet) - Part_1_doc = Part_1.document() - - ### Create Box - Box_1 = model.addBox(Part_1_doc, 20, 30, 10) - - ### Create Fillet - Fillet_1 = model.addFillet(Part_1_doc, [model.selection("SOLID", "Box_1_1")], 2, keepSubResults = True) - - ### Create Export - Export_1 = model.exportToXAO(Part_1_doc, '/tmp/shaper_exp_cglb.xao', model.selection("SOLID", "Fillet_1_1"), 'XAO') - - model.end() - - # Check results - ### - ### GEOM component - ### - - geompy = geomBuilder.New() - - O = geompy.MakeVertex(0, 0, 0) - OX = geompy.MakeVectorDXDYDZ(1, 0, 0) - OY = geompy.MakeVectorDXDYDZ(0, 1, 0) - OZ = geompy.MakeVectorDXDYDZ(0, 0, 1) - - # where we import the fillet from SHAPER and get its basic properties - (imported, Fillet_1_1, [], [], []) = geompy.ImportXAO("/tmp/shaper_exp_cglb.xao") - geompy.addToStudy( O, 'O' ) - geompy.addToStudy( OX, 'OX' ) - geompy.addToStudy( OY, 'OY' ) - geompy.addToStudy( OZ, 'OZ' ) - geompy.addToStudy( Fillet_1_1, 'Fillet_1_1' ) - - myDelta = 1e-6 - Props_shaper = geompy.BasicProperties(Fillet_1_1) - print("\nBasic Properties:") - print(" Wires length: ", Props_shaper[0]) - print(" Surface area: ", Props_shaper[1]) - print(" Volume : ", Props_shaper[2]) - - # where we build the same fillet in GEOM for comparison - Box_1 = geompy.MakeBoxDXDYDZ(20, 30, 10) - Fillet_1 = geompy.MakeFilletAll(Box_1, 2) - geompy.addToStudy( Box_1, 'Box_1' ) - geompy.addToStudy( Fillet_1, 'Fillet_1' ) - - Props_geom = geompy.BasicProperties(Fillet_1) - print("\nBasic Properties:") - print(" Wires length: ", Props_geom[0]) - print(" Surface area: ", Props_geom[1]) - print(" Volume : ", Props_geom[2]) - - aRefSurface = Props_geom[1] - aResSurface = Props_shaper[1] - assert (math.fabs(aResSurface - aRefSurface) < myDelta), "The surface is wrong: expected = {0}, real = {1}".format(aRefSurface, aResSurface) - - aRefVolume = Props_geom[2] - aResVolume = Props_shaper[2] - assert (math.fabs(aResVolume - aRefVolume) < myDelta), "The volume is wrong: expected = {0}, real = {1}".format(aRefVolume, aResVolume) #========================================================================= # test Fillet on an edge with multiple radii identified by points @@ -143,9 +69,11 @@ def testFillet_multiradii_bypoints(): Point_3 = model.addPoint(Part_1_doc, model.selection("EDGE", "[Box_1_1/Left][Box_1_1/Top]"), 0.8, True, False) ### Create Fillet on an edge with 4 radii identified by points - Fillet_1 = model.addFilletMultiRadiusByPoints(Part_1_doc, model.selection("EDGE", "[Box_1_1/Left][Box_1_1/Top]"), [model.selection("VERTEX", "Point_1"), model.selection("VERTEX", "Point_2")], [0.5, 2, 1, 2], keepSubResults = True) + Fillet_1 = model.addFilletMultiRadius(Part_1_doc, model.selection("EDGE", "[Box_1_1/Left][Box_1_1/Top]"), [model.selection("VERTEX", "Point_1"), model.selection("VERTEX", "Point_2")], [0.5, 2, 1, 2]) model.end() + model.testNbResults(Fillet_1, 1) + model.testResultsVolumes(Fillet_1, [995.3927]) #========================================================================= # test Fillet on an edge(s) or/and face(s) with multiple radii identified @@ -163,20 +91,20 @@ def testFillet_multiradii_bycurvabs(): Box_1 = model.addBox(Part_1_doc, 10, 10, 10) ### Create Fillet - Fillet_1 = model.addFilletMultiRadiusBycurvAbs(Part_1_doc, [model.selection("EDGE", "[Box_1_1/Left][Box_1_1/Top]")], [0, 0.4, 0.7, 1],[1, 2, 0.5, 2], keepSubResults = True) + Fillet_1 = model.addFilletMultiRadius(Part_1_doc, [model.selection("EDGE", "[Box_1_1/Left][Box_1_1/Top]")], [0, 0.4, 0.7, 1],[1, 2, 0.5, 2]) ### Create Fillet - Fillet_2 = model.addFilletMultiRadiusBycurvAbs(Part_1_doc, [model.selection("FACE", "Box_1_1/Right")], [0, 0.5, 1],[1, 0.5, 1], keepSubResults = True) - + Fillet_2 = model.addFilletMultiRadius(Part_1_doc, [model.selection("FACE", "Box_1_1/Right")], [0, 0.5, 1],[1, 0.5, 1]) model.end() + model.testNbResults(Fillet_2, 1) + model.testResultsVolumes(Fillet_2, [990.974897]) + if __name__ == '__main__': with TemporaryDirectory() as tmp_dir: - testFillet_constant_radius_onsolids() testFillet_multiradii_bypoints() testFillet_multiradii_bycurvabs() - #========================================================================= # End of test #========================================================================= diff --git a/src/FeaturesPlugin/doc/examples/filletMultiRadiusByPoints.py b/src/FeaturesPlugin/doc/examples/filletMultiRadiusByPoints.py index d3f3ca65c..4f8053711 100644 --- a/src/FeaturesPlugin/doc/examples/filletMultiRadiusByPoints.py +++ b/src/FeaturesPlugin/doc/examples/filletMultiRadiusByPoints.py @@ -8,10 +8,10 @@ Box_1 = model.addBox(Part_1_doc, 10, 10, 10) ### Create Point Point_1 = model.addPoint(Part_1_doc, model.selection("EDGE", "[Box_1_1/Left][Box_1_1/Top]"), 0.5, True, False) Point_2 = model.addPoint(Part_1_doc, model.selection("EDGE", "[Box_1_1/Left][Box_1_1/Top]"), 0.2, True, False) -Fillet_1 = model.addFilletMultiRadiusByPoints(Part_1_doc, +Fillet_1 = model.addFilletMultiRadius(Part_1_doc, model.selection("EDGE", "[Box_1_1/Left][Box_1_1/Top]"), [model.selection("VERTEX", "Point_1"), model.selection("VERTEX", "Point_2")], - [1, 0.5, 0.5, 2], keepSubResults = True) + [1, 0.5, 0.5, 2]) model.do() model.end() diff --git a/src/FeaturesPlugin/doc/examples/filletMultiRadiusBycurvAbs.py b/src/FeaturesPlugin/doc/examples/filletMultiRadiusBycurvAbs.py index 02456d833..1eb9f982a 100644 --- a/src/FeaturesPlugin/doc/examples/filletMultiRadiusBycurvAbs.py +++ b/src/FeaturesPlugin/doc/examples/filletMultiRadiusBycurvAbs.py @@ -5,8 +5,8 @@ partSet = model.moduleDocument() Part_1 = model.addPart(partSet) Part_1_doc = Part_1.document() Box_1 = model.addBox(Part_1_doc, 10, 10, 10) -Fillet_1 = model.model.addFilletMultiRadiusBycurvAbs +Fillet_1 = model.addFilletMultiRadius (Part_1_doc, [model.selection("EDGE", "[Box_1_1/Front][Box_1_1/Top]")], - [0, 0.5, 1],[1, 0.5, 1], keepSubResults = True) + [0, 0.5, 1],[1, 0.5, 1]) model.do() model.end() diff --git a/src/FeaturesPlugin/doc/filletFeature.rst b/src/FeaturesPlugin/doc/filletFeature.rst index c501ed4fe..19eddce91 100644 --- a/src/FeaturesPlugin/doc/filletFeature.rst +++ b/src/FeaturesPlugin/doc/filletFeature.rst @@ -88,12 +88,12 @@ Input fields: **TUI Command**: -.. py:function:: model.addFillet(Part_doc, shapes, R1, R2) +.. py:function:: model.addFillet(Part_doc,[face,edge], R1, R2) :param document Part_doc: The current part object. - :param list shapes: A list of faces and edges subject to fillet operation in format *model.selection(TYPE, shape)*. - :param double R1: Start radius value. - :param double R2: End radius value. + :param list: A list of faces and edges subject to fillet operation in format *model.selection(TYPE, shape)*. + :param number: Start radius value. + :param number: End radius value. :return: Created object. Result @@ -150,12 +150,12 @@ Input fields: **TUI Command**: -.. py:function:: model.addFilletMultiRadiusBycurvAbs(Part_doc, shapes, listAbsc, listRadius) +.. py:function:: model.addFilletMultiRadius(Part_doc, [face,edge], [absc1,absc2,...], [r1,r2,...]) :param document Part_doc: The current part object. - :param list shapes: A list of faces and edges subject to fillet operation in format *model.selection(TYPE, shape)*. - :param listAbsc: list of curvilinea abscissa. - :param listRadius: list of radius value. + :param list: A list of faces and edges subject to fillet operation in format *model.selection(TYPE, shape)*. + :param list number: list of curvilinea abscissa. + :param list number: list of radius value. :return: Created object. Result @@ -188,12 +188,12 @@ Input fields: **TUI Command**: -.. py:function:: model.addFilletMultiRadiusByPoints(Part_doc, edge, Points, ListRadius) +.. py:function:: model.addFilletMultiRadius(Part_doc, edge, [point],[r1,r2,...]) :param document Part_doc: The current part object. :param edge: An edge subject to fillet operation in format *model.selection(TYPE, shape)*. - :param Points: list of point in format *model.selection(TYPE, shape)*. - :param ListRadius: list of radius value. + :param list: list of point in format *model.selection(TYPE, shape)*. + :param list number: list of radius value. :return: Created object. Result diff --git a/src/PythonAPI/model/features/__init__.py b/src/PythonAPI/model/features/__init__.py index 035b5d31f..6cf724c41 100644 --- a/src/PythonAPI/model/features/__init__.py +++ b/src/PythonAPI/model/features/__init__.py @@ -27,7 +27,7 @@ from FeaturesAPI import addPipe from FeaturesAPI import addCut, addFuse, addCommon, addSmash, addSplit from FeaturesAPI import addIntersection, addPartition, addUnion, addRemoveSubShapes from FeaturesAPI import addRecover -from FeaturesAPI import addFillet,addFilletMultiRadiusBycurvAbs, addFilletMultiRadiusByPoints, addChamfer +from FeaturesAPI import addFillet, addFilletMultiRadius, addChamfer from FeaturesAPI import addFusionFaces from FeaturesAPI import measureLength, measureDistance, measureRadius, measureAngle from FeaturesAPI import addRemoveResults -- 2.39.2