From d448f72525a9f49a2837dc22f5951ca39888d219 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me?= Date: Thu, 26 Nov 2020 16:00:52 +0100 Subject: [PATCH] Add documentation and test unit --- src/FeaturesAPI/FeaturesAPI_NormalToFace.cpp | 16 +-- src/FeaturesAPI/FeaturesAPI_NormalToFace.h | 4 +- src/FeaturesPlugin/CMakeLists.txt | 1 + .../CreateNormalToFace_widget.xml | 5 +- .../FeaturesPlugin_CreateNormalToFace.cpp | 65 ++++++------ .../FeaturesPlugin_CreateNormalToFace.h | 9 +- .../FeaturesPlugin_NormalToFace.cpp | 93 +++++++++--------- .../FeaturesPlugin_NormalToFace.h | 11 +-- src/FeaturesPlugin/NormalToFace_widget.xml | 5 +- src/FeaturesPlugin/Test/TestNormalToFace.py | 66 +++++++++++++ src/FeaturesPlugin/doc/FeaturesPlugin.rst | 1 + .../doc/TUI_NormalToFaceFeature.rst | 22 +++++ .../doc/examples/createNormalToFace.py | 15 +++ .../examples/createNormalToFaceAtVertex.py | 17 ++++ src/FeaturesPlugin/doc/images/normal.png | Bin 0 -> 655 bytes .../doc/images/normalToFacePropertyPanel.png | Bin 0 -> 10808 bytes .../doc/images/normalToFaceResult.png | Bin 0 -> 2777 bytes .../images/normalToFaceResultwithVertex.png | Bin 0 -> 2685 bytes .../doc/normalToFaceFeature.rst | 71 +++++++++++++ src/FeaturesPlugin/plugin-Features.xml | 4 +- 20 files changed, 295 insertions(+), 110 deletions(-) create mode 100644 src/FeaturesPlugin/Test/TestNormalToFace.py create mode 100644 src/FeaturesPlugin/doc/TUI_NormalToFaceFeature.rst create mode 100644 src/FeaturesPlugin/doc/examples/createNormalToFace.py create mode 100644 src/FeaturesPlugin/doc/examples/createNormalToFaceAtVertex.py create mode 100644 src/FeaturesPlugin/doc/images/normal.png create mode 100644 src/FeaturesPlugin/doc/images/normalToFacePropertyPanel.png create mode 100644 src/FeaturesPlugin/doc/images/normalToFaceResult.png create mode 100644 src/FeaturesPlugin/doc/images/normalToFaceResultwithVertex.png create mode 100644 src/FeaturesPlugin/doc/normalToFaceFeature.rst diff --git a/src/FeaturesAPI/FeaturesAPI_NormalToFace.cpp b/src/FeaturesAPI/FeaturesAPI_NormalToFace.cpp index 2875a9f97..fbc7bd650 100644 --- a/src/FeaturesAPI/FeaturesAPI_NormalToFace.cpp +++ b/src/FeaturesAPI/FeaturesAPI_NormalToFace.cpp @@ -25,7 +25,7 @@ #include #include - +//================================================================================================= FeaturesAPI_NormalToFace:: FeaturesAPI_NormalToFace(const std::shared_ptr& theFeature) : ModelHighAPI_Interface(theFeature) @@ -33,6 +33,7 @@ FeaturesAPI_NormalToFace:: initialize(); } +//================================================================================================= FeaturesAPI_NormalToFace::FeaturesAPI_NormalToFace( const std::shared_ptr& theFeature, const ModelHighAPI_Selection& theBaseFace, @@ -47,6 +48,7 @@ FeaturesAPI_NormalToFace::FeaturesAPI_NormalToFace( } } +//================================================================================================= FeaturesAPI_NormalToFace::FeaturesAPI_NormalToFace( const std::shared_ptr& theFeature, const ModelHighAPI_Selection& theBaseFace) @@ -59,21 +61,23 @@ FeaturesAPI_NormalToFace::FeaturesAPI_NormalToFace( } } +//================================================================================================= FeaturesAPI_NormalToFace::~FeaturesAPI_NormalToFace() { } +//================================================================================================= void FeaturesAPI_NormalToFace::dump(ModelHighAPI_Dumper& theDumper) const { FeaturePtr aBase = feature(); const std::string& aDocName = theDumper.name(aBase->document()); AttributeSelectionPtr anAttrObject; - anAttrObject = aBase->selection(FeaturesPlugin_CreateNormalToFace::OBJECTS_LIST_ID()); + anAttrObject = aBase->selection(FeaturesPlugin_CreateNormalToFace::FACE_SELECTED_ID()); theDumper << aBase << " = model.getNormal(" << aDocName << ", " << anAttrObject; - if ( !aBase->string(FeaturesPlugin_CreateNormalToFace::VERTEX_OPTION_ID())->value().empty()){ + if (!aBase->string(FeaturesPlugin_CreateNormalToFace::VERTEX_OPTION_ID())->value().empty()){ AttributeSelectionPtr anAttrVertex = aBase->selection(FeaturesPlugin_CreateNormalToFace::VERTEX_SELECTED_ID()); @@ -85,10 +89,9 @@ void FeaturesAPI_NormalToFace::dump(ModelHighAPI_Dumper& theDumper) const } //================================================================================================== - NormalPtr getNormal(const std::shared_ptr& thePart, - const ModelHighAPI_Selection& theBaseFace, - const ModelHighAPI_Selection& theOptionnelPoint) + const ModelHighAPI_Selection& theBaseFace, + const ModelHighAPI_Selection& theOptionnelPoint) { FeaturePtr aFeature = @@ -101,6 +104,7 @@ NormalPtr getNormal(const std::shared_ptr& thePart, return aNormalToface; } +//================================================================================================= NormalPtr getNormal(const std::shared_ptr& thePart, const ModelHighAPI_Selection& theBaseFace) { diff --git a/src/FeaturesAPI/FeaturesAPI_NormalToFace.h b/src/FeaturesAPI/FeaturesAPI_NormalToFace.h index a1ad49159..f7c1facc0 100644 --- a/src/FeaturesAPI/FeaturesAPI_NormalToFace.h +++ b/src/FeaturesAPI/FeaturesAPI_NormalToFace.h @@ -52,8 +52,8 @@ public: FEATURESAPI_EXPORT virtual ~FeaturesAPI_NormalToFace(); - INTERFACE_3(FeaturesPlugin_CreateNormalToFace::ID(), - faceSelected, FeaturesPlugin_CreateNormalToFace::OBJECTS_LIST_ID(), + INTERFACE_3(FeaturesPlugin_CreateNormalToFace::ID(), + faceSelected, FeaturesPlugin_CreateNormalToFace::FACE_SELECTED_ID(), ModelAPI_AttributeSelection, /** base face */, vertexSelected, FeaturesPlugin_CreateNormalToFace::VERTEX_SELECTED_ID(), diff --git a/src/FeaturesPlugin/CMakeLists.txt b/src/FeaturesPlugin/CMakeLists.txt index 4777f6aea..0375dd1d0 100644 --- a/src/FeaturesPlugin/CMakeLists.txt +++ b/src/FeaturesPlugin/CMakeLists.txt @@ -704,4 +704,5 @@ ADD_UNIT_TESTS(TestExtrusion.py TestFillet1D_Wire_3.py TestFillet1D_Wire_4.py TestFillet1D_Wire_5.py + TestNormalToFace.py ) diff --git a/src/FeaturesPlugin/CreateNormalToFace_widget.xml b/src/FeaturesPlugin/CreateNormalToFace_widget.xml index c2b4bece0..f7fc96d17 100644 --- a/src/FeaturesPlugin/CreateNormalToFace_widget.xml +++ b/src/FeaturesPlugin/CreateNormalToFace_widget.xml @@ -1,5 +1,5 @@ - - - diff --git a/src/FeaturesPlugin/FeaturesPlugin_CreateNormalToFace.cpp b/src/FeaturesPlugin/FeaturesPlugin_CreateNormalToFace.cpp index 4e9f7df11..14c8848ca 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_CreateNormalToFace.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_CreateNormalToFace.cpp @@ -20,21 +20,14 @@ #include "FeaturesPlugin_CreateNormalToFace.h" #include -#include -#include #include #include #include #include -#include -#include #include #include #include -#include #include -#include -#include #include #include #include @@ -42,16 +35,17 @@ #include #include -#include +//================================================================================================= FeaturesPlugin_CreateNormalToFace::FeaturesPlugin_CreateNormalToFace() { } +//================================================================================================= void FeaturesPlugin_CreateNormalToFace::initAttributes() { // attribute for object selected - data()->addAttribute(OBJECTS_LIST_ID(), ModelAPI_AttributeSelection::typeId()); + data()->addAttribute(FACE_SELECTED_ID(), ModelAPI_AttributeSelection::typeId()); data()->addAttribute(VERTEX_SELECTED_ID(), ModelAPI_AttributeSelection::typeId()); // attributes for result message and values data()->addAttribute(VERTEX_OPTION_ID(), ModelAPI_AttributeString::typeId()); @@ -60,35 +54,37 @@ void FeaturesPlugin_CreateNormalToFace::initAttributes() } +//================================================================================================= void FeaturesPlugin_CreateNormalToFace::execute() { -AttributeSelectionPtr aSelectionFace = selection(OBJECTS_LIST_ID()); -AttributeSelectionPtr aSelectionPoint = selection(VERTEX_SELECTED_ID()); -GeomShapePtr aShape; -GeomShapePtr aShapePoint; + AttributeSelectionPtr aSelectionFace = selection(FACE_SELECTED_ID()); + AttributeSelectionPtr aSelectionPoint = selection(VERTEX_SELECTED_ID()); + + GeomShapePtr aShape; + GeomShapePtr aShapePoint; if(!string(VERTEX_OPTION_ID())->value().empty()) -{ - if (aSelectionPoint && aSelectionPoint->isInitialized()) { - aShapePoint = aSelectionPoint->value(); - if (!aShapePoint && aSelectionPoint->context()) - aShapePoint = aSelectionPoint->context()->shape(); - } -} + { + if (aSelectionPoint && aSelectionPoint->isInitialized()) { + aShapePoint = aSelectionPoint->value(); + if (!aShapePoint && aSelectionPoint->context()) + aShapePoint = aSelectionPoint->context()->shape(); + } + } -if (aSelectionFace && aSelectionFace->isInitialized()) { - aShape = aSelectionFace->value(); - if (!aShape && aSelectionFace->context()) - aShape = aSelectionFace->context()->shape(); -} + if (aSelectionFace && aSelectionFace->isInitialized()) { + aShape = aSelectionFace->value(); + if (!aShape && aSelectionFace->context()) + aShape = aSelectionFace->context()->shape(); + } -if (aShape){ - std::string aError; - std::shared_ptr theNormal(new GeomAPI_Edge); - if( !GeomAlgoAPI_NormalToFace::normal(aShape, - aShapePoint, - theNormal, - aError)) + if (aShape) { + std::string aError; + std::shared_ptr theNormal(new GeomAPI_Edge); + if( !GeomAlgoAPI_NormalToFace::normal(aShape, + aShapePoint, + theNormal, + aError)) setError("Error in bounding box calculation :" + aError); GeomDirPtr theDir; @@ -98,8 +94,8 @@ if (aShape){ theDir = theNormal->line()->direction(); } } - aPnt->translate(theDir, 100 ); - + aPnt->translate(theDir, 100); + std::shared_ptr anEdge = GeomAlgoAPI_EdgeBuilder::line(theNormal->firstPoint(), aPnt); @@ -111,6 +107,7 @@ if (aShape){ } } +//================================================================================================= void FeaturesPlugin_CreateNormalToFace::attributeChanged(const std::string& theID) { } diff --git a/src/FeaturesPlugin/FeaturesPlugin_CreateNormalToFace.h b/src/FeaturesPlugin/FeaturesPlugin_CreateNormalToFace.h index 77ad40c52..83210022b 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_CreateNormalToFace.h +++ b/src/FeaturesPlugin/FeaturesPlugin_CreateNormalToFace.h @@ -25,7 +25,6 @@ #include #include -#include /// \class FeaturesPlugin_CreateNormalToFace /// \ingroup Plugins @@ -47,16 +46,16 @@ public: } /// Attribute name for face selected. - inline static const std::string& OBJECTS_LIST_ID() + inline static const std::string& FACE_SELECTED_ID() { - static const std::string MY_OBJECTS_LIST_ID("main_objects"); - return MY_OBJECTS_LIST_ID; + static const std::string MY_FACE_ID("face"); + return MY_FACE_ID; } /// Attribute name for vertex selected. inline static const std::string& VERTEX_SELECTED_ID() { - static const std::string MY_VERTEX_SELECTED_ID("tool_objects"); + static const std::string MY_VERTEX_SELECTED_ID("vertex"); return MY_VERTEX_SELECTED_ID; } diff --git a/src/FeaturesPlugin/FeaturesPlugin_NormalToFace.cpp b/src/FeaturesPlugin/FeaturesPlugin_NormalToFace.cpp index ab98fed58..a70e8fd79 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_NormalToFace.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_NormalToFace.cpp @@ -20,7 +20,6 @@ #include "FeaturesPlugin_NormalToFace.h" #include -#include #include #include #include @@ -31,10 +30,7 @@ #include #include #include -#include #include -#include -#include #include #include #include @@ -44,16 +40,17 @@ #include #include -#include +//================================================================================================= FeaturesPlugin_NormalToFace::FeaturesPlugin_NormalToFace() { } +//================================================================================================= void FeaturesPlugin_NormalToFace::initAttributes() { // attribute for object selected - data()->addAttribute(OBJECTS_LIST_ID(), ModelAPI_AttributeSelection::typeId()); + data()->addAttribute(FACE_SELECTED_ID(), ModelAPI_AttributeSelection::typeId()); data()->addAttribute(VERTEX_SELECTED_ID(), ModelAPI_AttributeSelection::typeId()); // attributes for result message and values data()->addAttribute(CREATENORMAL_ID(), ModelAPI_AttributeBoolean::typeId()); @@ -63,35 +60,35 @@ void FeaturesPlugin_NormalToFace::initAttributes() } +//================================================================================================= void FeaturesPlugin_NormalToFace::execute() { -AttributeSelectionPtr aSelectionFace = selection(OBJECTS_LIST_ID()); -AttributeSelectionPtr aSelectionPoint = selection(VERTEX_SELECTED_ID()); - -GeomShapePtr aShape; -GeomShapePtr aShapePoint; - if(!string(VERTEX_OPTION_ID())->value().empty()) -{ - if (aSelectionPoint && aSelectionPoint->isInitialized()) { - aShapePoint = aSelectionPoint->value(); - if (!aShapePoint && aSelectionPoint->context()) - aShapePoint = aSelectionPoint->context()->shape(); + AttributeSelectionPtr aSelectionFace = selection(FACE_SELECTED_ID()); + AttributeSelectionPtr aSelectionPoint = selection(VERTEX_SELECTED_ID()); + + GeomShapePtr aShape; + GeomShapePtr aShapePoint; + if (!string(VERTEX_OPTION_ID())->value().empty()) { + if (aSelectionPoint && aSelectionPoint->isInitialized()) { + aShapePoint = aSelectionPoint->value(); + if (!aShapePoint && aSelectionPoint->context()) + aShapePoint = aSelectionPoint->context()->shape(); } -} + } -if (aSelectionFace && aSelectionFace->isInitialized()) { - aShape = aSelectionFace->value(); - if (!aShape && aSelectionFace->context()) - aShape = aSelectionFace->context()->shape(); -} + if (aSelectionFace && aSelectionFace->isInitialized()) { + aShape = aSelectionFace->value(); + if (!aShape && aSelectionFace->context()) + aShape = aSelectionFace->context()->shape(); + } -if (aShape){ - std::string aError; - std::shared_ptr theNormal(new GeomAPI_Edge); - if( !GeomAlgoAPI_NormalToFace::normal(aShape, - aShapePoint, - theNormal, - aError)) + if (aShape) { + std::string aError; + std::shared_ptr theNormal(new GeomAPI_Edge); + if( !GeomAlgoAPI_NormalToFace::normal(aShape, + aShapePoint, + theNormal, + aError)) setError("Error in bounding box calculation :" + aError); GeomDirPtr theDir; @@ -101,26 +98,23 @@ if (aShape){ theDir = theNormal->line()->direction(); } } - aPnt->translate(theDir, 100 ); - + aPnt->translate(theDir, 100); + std::shared_ptr anEdge = - GeomAlgoAPI_EdgeBuilder::line(theNormal->firstPoint(), - aPnt); + GeomAlgoAPI_EdgeBuilder::line(theNormal->firstPoint(), aPnt); ResultConstructionPtr aConstr = document()->createConstruction(data()); aConstr->setInfinite(true); aConstr->setShape(anEdge); setResult(aConstr); } - - if(boolean(CREATENORMAL_ID())->value()) - { - if( !myCreateFeature.get() ) + + if (boolean(CREATENORMAL_ID())->value()) { + if (!myCreateFeature.get()) createNormal(); updateNormal(); - }else{ - if( myCreateFeature.get() ) - { + } else { + if (myCreateFeature.get()) { myCreateFeature->eraseResults(); SessionPtr aSession = ModelAPI_Session::get(); DocumentPtr aDoc = aSession->activeDocument(); @@ -130,10 +124,11 @@ if (aShape){ } } +//================================================================================================= void FeaturesPlugin_NormalToFace::attributeChanged(const std::string& theID) { - if (theID == OBJECTS_LIST_ID()) { - if( myCreateFeature.get() ) + if (theID == FACE_SELECTED_ID()) { + if (myCreateFeature.get()) updateNormal(); } } @@ -142,7 +137,7 @@ void FeaturesPlugin_NormalToFace::attributeChanged(const std::string& theID) void FeaturesPlugin_NormalToFace::createNormal() { SessionPtr aSession = ModelAPI_Session::get(); - + DocumentPtr aDoc = aSession->activeDocument(); if (aDoc.get()) { @@ -150,17 +145,17 @@ void FeaturesPlugin_NormalToFace::createNormal() } } +//================================================================================================= void FeaturesPlugin_NormalToFace::updateNormal() { - myCreateFeature->selection(FeaturesPlugin_CreateNormalToFace::OBJECTS_LIST_ID()) - ->setValue( selection(OBJECTS_LIST_ID())->context() , - selection(OBJECTS_LIST_ID())->value() ); + myCreateFeature->selection(FeaturesPlugin_CreateNormalToFace::FACE_SELECTED_ID()) + ->setValue( selection(FACE_SELECTED_ID())->context() , + selection(FACE_SELECTED_ID())->value() ); myCreateFeature->string(FeaturesPlugin_CreateNormalToFace::VERTEX_OPTION_ID()) ->setValue( string(VERTEX_OPTION_ID())->value()); - if(!string(VERTEX_OPTION_ID())->value().empty()) - { + if (!string(VERTEX_OPTION_ID())->value().empty()) { myCreateFeature->selection(FeaturesPlugin_CreateNormalToFace::VERTEX_SELECTED_ID()) ->setValue( selection(VERTEX_SELECTED_ID())->context() , selection(VERTEX_SELECTED_ID())->value() ); diff --git a/src/FeaturesPlugin/FeaturesPlugin_NormalToFace.h b/src/FeaturesPlugin/FeaturesPlugin_NormalToFace.h index 1b171ff9e..261b29770 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_NormalToFace.h +++ b/src/FeaturesPlugin/FeaturesPlugin_NormalToFace.h @@ -25,7 +25,6 @@ #include #include -#include /// \class FeaturesPlugin_NormalToFace /// \ingroup Plugins @@ -47,16 +46,16 @@ public: } /// Attribute name for face selected. - inline static const std::string& OBJECTS_LIST_ID() + inline static const std::string& FACE_SELECTED_ID() { - static const std::string MY_OBJECTS_LIST_ID("main_objects"); - return MY_OBJECTS_LIST_ID; + static const std::string MY_FACE_SELECTED_ID("face"); + return MY_FACE_SELECTED_ID; } /// Attribute name for vertex selected. inline static const std::string& VERTEX_SELECTED_ID() { - static const std::string MY_VERTEX_SELECTED_ID("tool_objects"); + static const std::string MY_VERTEX_SELECTED_ID("vertex"); return MY_VERTEX_SELECTED_ID; } @@ -92,7 +91,7 @@ public: private: - void createNormal(); + void createNormal(); void updateNormal(); FeaturePtr myCreateFeature; diff --git a/src/FeaturesPlugin/NormalToFace_widget.xml b/src/FeaturesPlugin/NormalToFace_widget.xml index e130762e4..a0b818a56 100644 --- a/src/FeaturesPlugin/NormalToFace_widget.xml +++ b/src/FeaturesPlugin/NormalToFace_widget.xml @@ -1,5 +1,5 @@ - - - diff --git a/src/FeaturesPlugin/Test/TestNormalToFace.py b/src/FeaturesPlugin/Test/TestNormalToFace.py new file mode 100644 index 000000000..179b2246a --- /dev/null +++ b/src/FeaturesPlugin/Test/TestNormalToFace.py @@ -0,0 +1,66 @@ +# 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 +# + +""" + Unit test of ... +""" +#========================================================================= +# Initialization of the test +#========================================================================= + + +import os +import math + +from ModelAPI import * +from salome.shaper import model + + +__updated__ = "2020-11-12" + + +#========================================================================= +# test creating normal to face +#========================================================================= +def test_Normal_to_face(): + + model.begin() + file_path = os.path.join(os.getenv("DATA_DIR"),"Shapes","Brep","box1.brep") + partSet = model.moduleDocument() + Part_1 = model.addPart(partSet) + Part_1_doc = Part_1.document() + Import_1 = model.addImport(Part_1_doc,file_path) + model.do() + ### Create Normal + Normal_1 = model.getNormal(Part_1_doc, model.selection("FACE", "box1_1/Shape_6")) + model.end() + + assert (len(Normal_1.results()) > 0) + assert(Normal_1.feature().error() == "") + anAxisResult = modelAPI_ResultConstruction(Normal_1.feature().firstResult()) + assert (anAxisResult is not None) + + +if __name__ == '__main__': + + test_Normal_to_face() + + #========================================================================= + # End of test + #========================================================================= diff --git a/src/FeaturesPlugin/doc/FeaturesPlugin.rst b/src/FeaturesPlugin/doc/FeaturesPlugin.rst index fb8e2a344..11cddbe42 100644 --- a/src/FeaturesPlugin/doc/FeaturesPlugin.rst +++ b/src/FeaturesPlugin/doc/FeaturesPlugin.rst @@ -24,6 +24,7 @@ Features plug-in provides a set of common topological operations. It implements importResultFeature.rst linearCopyFeature.rst measurementFeature.rst + normalToFaceFeature.rst pipeFeature.rst placementFeature.rst recoverFeature.rst diff --git a/src/FeaturesPlugin/doc/TUI_NormalToFaceFeature.rst b/src/FeaturesPlugin/doc/TUI_NormalToFaceFeature.rst new file mode 100644 index 000000000..eb8b036f8 --- /dev/null +++ b/src/FeaturesPlugin/doc/TUI_NormalToFaceFeature.rst @@ -0,0 +1,22 @@ + + .. _tui_create_Normal_To_Face: + +Create Normal to a face +======================= + +.. literalinclude:: examples/createNormalToFace.py + :linenos: + :language: python + +:download:`Download this script ` + + .. _tui_create_Normal_To_Face_At_Vertex: + +Create Normal to a face at vertex +================================= + +.. literalinclude:: examples/createNormalToFaceAtVertex.py + :linenos: + :language: python + +:download:`Download this script ` \ No newline at end of file diff --git a/src/FeaturesPlugin/doc/examples/createNormalToFace.py b/src/FeaturesPlugin/doc/examples/createNormalToFace.py new file mode 100644 index 000000000..a1f973011 --- /dev/null +++ b/src/FeaturesPlugin/doc/examples/createNormalToFace.py @@ -0,0 +1,15 @@ +from salome.shaper import model +import os + +model.begin() +file_path = os.path.join(os.getenv("DATA_DIR"),"Shapes","Brep","box1.brep") +partSet = model.moduleDocument() +Part_1 = model.addPart(partSet) +Part_1_doc = Part_1.document() +Import_1 = model.addImport(Part_1_doc,file_path) +model.do() + +### Create BoundingBox +Normal_1 = model.getNormal(Part_1_doc, model.selection("FACE", "box1_1/Shape_6")) +model.do() +model.end() diff --git a/src/FeaturesPlugin/doc/examples/createNormalToFaceAtVertex.py b/src/FeaturesPlugin/doc/examples/createNormalToFaceAtVertex.py new file mode 100644 index 000000000..c59aa67c5 --- /dev/null +++ b/src/FeaturesPlugin/doc/examples/createNormalToFaceAtVertex.py @@ -0,0 +1,17 @@ + +from salome.shaper import model +import os + +model.begin() +file_path = os.path.join(os.getenv("DATA_DIR"),"Shapes","Brep","box1.brep") +partSet = model.moduleDocument() +Part_1 = model.addPart(partSet) +Part_1_doc = Part_1.document() +Import_1 = model.addImport(Part_1_doc,file_path) +model.do() + +### Create BoundingBox +Normal_1 = model.getNormal(Part_1_doc, model.selection("FACE", "box1_1/Shape_6"), + model.selection("VERTEX", "[box1_1/Shape_2][box1_1/Shape_4][box1_1/Shape_6]")) +model.do() +model.end() diff --git a/src/FeaturesPlugin/doc/images/normal.png b/src/FeaturesPlugin/doc/images/normal.png new file mode 100644 index 0000000000000000000000000000000000000000..16080764e8d275a433c96cfb3c849a9d1bd931e0 GIT binary patch literal 655 zcmV;A0&x9_P)z@;j(q!3lK=n!AY({UO#lFTB>(_`g8%^e{{R4h=>PzA zFaQARU;qF*m;eA5Z<1fdMgRZ;1xZ9fRCwBA{Qv(y12q9a05LI882|(jQ3hU9S0~yV z00G3r$jHb*2!jAI>OdGEfT-?efB+(B;8iuX|41|kA@u+OM5+q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images/normalToFaceResult.png new file mode 100644 index 0000000000000000000000000000000000000000..ecfb260ab9a0efbf3924a3c16b59c7754bea6b1d GIT binary patch literal 2777 zcmZWr2~<g#_%G4c_W!rmTkpPm?>_sSbJsa{bEzKA zYDirq003&PE|hNoKnV)ICU6)yQ#(VL20zO24z50M@JWV;alrr03`akPcT5E13_UI! zI2IjqD%>nSG%h?mI{tVJV;M8h1Pgz!RWl;Fya6+UR<^z-cC2 z`yPUN5I{Qwz`sFI%7~i**JLk*sXI)uRfR*=%u{N6 zni|)&Y}~aQL?#xI^XsSWN;v&qhoR3qKN)?m&)MOxny?$RA_7cBfC~;r9@SFJ zEjSuy`>Xoi`C7rw`Coj_ChG_@pUyA0cClrGB66q^{}~aF$Q6m z#?ve}dh>6ltIu&okUU}fj1A=G6|Y1YS%W}E5ysvQNbPha z-N~tUQI|~5=R-x88gEM@NA?VD+v;lYed}Za%ISnD+OH?*=|(S%J_%D;?nLvoM6!wM zAw=BaBwGbG><|W#v&nhn*L^PwU>*yDy`!F+hBU0ndc2!PIf5JE+P^+sB5T9i_R`C4 z@ptphgbn?r(^LCY*hFjyk?36v3ko}67qHe;(Pc-%aEfqUJ=Zify(aT8i#5IQ8qJI~ zeeL3l6+03)?j*%$zTR1x0{ZzDEVmFofrfi`_drjYrD1!p>nK zQt<^gb|xD$QxMOZ{W(EmR!Sbcbh46l&2PvinScxo-6h$DmgKx!Y6gE^W*rKQo86C| zJZOn5O$jHJW_Hk2Z#7Ggl*ND<-PK;f+f1@j5es-bs+7GX9H>a`hz`p>@ItGhBi)RU zw!0zPji@^-V|;9e+WVzpYC851gXBl?Q7c2t6}oW*dl*&e6m5^OXJgxL1#7dmC7C0G z8(95grLEd)k+4x1}q0Ill!I`s{h!Ky*;#RivOHV{$@F#+6GqpVYU4-)q1|g6Knq5raN+I zx$!%hD2&(ITdrQQZX4`llTrJSaY}myIj5B;RF&AcXDz>J6VcQvh|w?Vm#oOPP$}Z& z?M`@iY-s^%?}#n^y|QdZL_2s-{o(jW$<-=^6pwt!Tj*J1!m@{nL#YjX(i8X^t66S2icF=Pi(-jW3G0!uIp8Z0V@Jc9IIm z$YOjUy*#MztRg(8sN;c|R@4%Y>h-9z8(%s~wL$!zq@Pa5d#% zbbFQL4SMUJyWaTE zdaEtFX5+=IxnxR6+gSHWJim4BTIXZpU>mi|pY{O4>-#U9GmeGtl2GNn zbH~@a_hkbo7N_e!kX5@Q@*U~LSHyzr879hs6Ts<5b2XIFj^UE=#u)zmLax(~7s#@t zfck-B#XOTU24-)6$>F=_Hm$6D#pYG^zXwVC_?+b}{J`hmsm+Jlx5RB08$h%s%?ZSA2) z>t8`9jvUUu!0n)kqWAm#=YdVlwsQH2(R@U-@dj^)--ESFieVUi6^_>FJ5{E4(Z|DoVgIkh5yjNR;O<+GX{Cqp%IG5b49z7VG*w+zr zNSjg?M1baU0Cf!(C>XHZb*+t`wNnO^g5`DqrnaDL`7D;?o4$w$=PdFlfOZKfR!FE% z%EC2n@{AEw4*OJ}@&YR*Dx#d7({}&|=%=G{O literal 0 HcmV?d00001 diff --git a/src/FeaturesPlugin/doc/images/normalToFaceResultwithVertex.png b/src/FeaturesPlugin/doc/images/normalToFaceResultwithVertex.png new file mode 100644 index 0000000000000000000000000000000000000000..98f1aa8ed9875d7a6cc11a010fc5ebe019a46b56 GIT binary patch literal 2685 zcmZ{m2~?8X7RM>Org=$IpI&pQoY0p;H&fCSa>~qsFw&g0)JhyuaY}{kI+4AMTT$0u zk@{2`l%9zbhH0iKnReC81nntkp(0>};PgIixbMBY-naHz=bXL1efIwLIp1&n@khPg zz+1L&0f9hZ_roqez$gKMHfSrz12g$7RXt$Xl;q@&QUIPzg@^)Rt%Y$tfjJf*g-H!h zj0ByIi;s;oPdb$t85x&!CLS{<*8&59wkW&1IHJ=2KFg+EG4#{z6k1KEZ`3z5+w4L# zFjS>jqF28HlcC%7~WF?-Wopo%Lc{ZTP&3$->iG?&o0P7*g+>v`u>g18=D@R<*!u+n9aJ^ z7@DIB%@L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dFqWRv=e#=EYUy=vO8M4LO6u^7{LZpZNC^dv9%|}x zcu!vx@{-vxTFDRFvo0-4!^pDffvWYXRQ(sKt7@l#dt$ASzcv%yr# zbW|zKh{g>}oD&MwTl7V-0p8P{N(bIoMmWbZ`PHr~QaH?V47<#}m5(Zi@m4aMyb--M znQnYo$aN@IRD0d0`yr)8UjVLh>lwBdqKO@%UR-Fv$}-^HJ5CrVnU3P}CvqRxw{u4S zIrwahwt!5ZsBB4v(>rQM!3lG(r$Vz(eAo)3V&rG!91%?2#_}J=psfYfx6ONhL7#)# zZ_$2z$F1=9;8^q}Nx$rsK~Y^wPfcb-s-7-FC}5BZi=V1UT>f#$f+sA^F;Rw8Z+)7&u+e zx*x(z<;ZRnwEm6ZZm@uNbVpk0Agl-oN(ki6Q?$YgCn1WT&!Y zq`i$cyeR+C3%8XuEbojj*YclNV8`Ryd#L5-5d)1|<6tM!j%$CSO)y;VFgbD8$@9Q1 zUROY?m7D(13+obxoe1cgb#1Vwj=so;|0|c+mH(lrfVW^J@+E-E;1(Ku3$+>8dA$o< q(he?}Av&)~skO{sWDcNoWbn&@0<9QU01D8LAa_@9mujc5i~k1w#!|Qd literal 0 HcmV?d00001 diff --git a/src/FeaturesPlugin/doc/normalToFaceFeature.rst b/src/FeaturesPlugin/doc/normalToFaceFeature.rst new file mode 100644 index 000000000..b4f9b16b2 --- /dev/null +++ b/src/FeaturesPlugin/doc/normalToFaceFeature.rst @@ -0,0 +1,71 @@ +.. |normalToFace.icon| image:: images/normal.png + +Normal to a face +================ + +The **Normal to a face** feature displays the normal to a face. A vertex can be specified to indicate the position of the normal else the center of face is used. + +the resulting normal can be created via a dedicated check-box **Create normal**. If this last is checked corresponding result and feature would be created. + +If the check-box **Create normal** isn't checked, **Apply** button does not generate any result and has the same effect as **Cancel** for this feature. + +To display the normal to a face in the active part: + +#. select in the Main Menu *Inspection - > Normal to a face* item or +#. click |normalToFace.icon| **Normal to a face** button in the toolbar + +The property panel is shown below. + +.. figure:: images/normalToFacePropertyPanel.png + :align: center + + Normal to a face + + +Input fields: + +- **Face** contains face selected in 3D OCC viewer or object browser. +- **Vertex** contains optionnal vertex selected in 3D OCC viewer or object browser. +- **Create normal** check-box allow the creation of the normal (result and feature). + +**TUI Command**: + +.. py:function:: model.getNormal(Part, face) + + :param part: The current part object. + :param object: A face in format *model.selection("FACE", face)*. + :return: Created normal to a face at center. + +Result +"""""" + +Result of **Normal to a face**. + +.. figure:: images/normalToFaceResult.png + :align: center + + Normal to a face + +**See Also** a sample TUI Script of :ref:`tui_create_Normal_To_Face` operation. + + +**TUI Command**: + +.. py:function:: model.getNormal(Part, face, vertex) + + :param part: The current part object. + :param object: A face in format *model.selection("FACE", face)*. + :param object: A vertex in format *model.selection("VERTEX", vertex)*. + :return: Created normal to a face at vertex. + +Result +"""""" + +Result of **Normal to aface** where **Vertex** is selecteted. + +.. figure:: images/normalToFaceResultwithVertex.png + :align: center + + Normal to a face at vertex + +**See Also** a sample TUI Script of :ref:`tui_create_Normal_To_Face_At_Vertex` operation. \ No newline at end of file diff --git a/src/FeaturesPlugin/plugin-Features.xml b/src/FeaturesPlugin/plugin-Features.xml index 3e17f562a..4a480d18f 100644 --- a/src/FeaturesPlugin/plugin-Features.xml +++ b/src/FeaturesPlugin/plugin-Features.xml @@ -180,11 +180,11 @@ + icon="icons/Features/normale.png" helpfile="normalToFaceFeature.html"> + icon="icons/Features/axis.png" helpfile="normalToFaceFeature.html" internal="1"> -- 2.39.2