From ec032f6e801f92f67997a162604219e13aaf6ffa Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me?= Date: Fri, 23 Oct 2020 16:30:41 +0200 Subject: [PATCH] Documentation and refactoring --- src/ExchangeAPI/ExchangeAPI_Export.cpp | 16 ++--- src/ExchangeAPI/ExchangeAPI_Export.h | 12 ++-- src/ExchangePlugin/doc/TUI_exportFeature.rst | 12 ++++ src/ExchangePlugin/doc/examples/exportSTL.py | 11 ++++ src/ExchangePlugin/doc/exportFeature.rst | 61 ++++++++++++++++++- src/ExchangePlugin/doc/images/ExportSTL.png | Bin 0 -> 18699 bytes src/GeomAlgoAPI/GeomAlgoAPI_STLExport.cpp | 14 +++-- 7 files changed, 103 insertions(+), 23 deletions(-) create mode 100644 src/ExchangePlugin/doc/examples/exportSTL.py create mode 100644 src/ExchangePlugin/doc/images/ExportSTL.png diff --git a/src/ExchangeAPI/ExchangeAPI_Export.cpp b/src/ExchangeAPI/ExchangeAPI_Export.cpp index d1266f3f7..5ee608e61 100644 --- a/src/ExchangeAPI/ExchangeAPI_Export.cpp +++ b/src/ExchangeAPI/ExchangeAPI_Export.cpp @@ -57,30 +57,30 @@ ExchangeAPI_Export::ExchangeAPI_Export(const std::shared_ptr& ExchangeAPI_Export::ExchangeAPI_Export(const std::shared_ptr& theFeature, const std::string & theFilePath, const ModelHighAPI_Selection& theSelectedShape, - double aDeflectionRelative, - double aDeflectionAbsolute, - const bool anIsRelative, - const bool anIsASCII) + double theDeflectionRelative, + double theDeflectionAbsolute, + const bool theIsRelative, + const bool theIsASCII) : ModelHighAPI_Interface(theFeature) { initialize(); fillAttribute("STL", theFeature->string(ExchangePlugin_ExportFeature::EXPORT_TYPE_ID())); fillAttribute(theFilePath, theFeature->string(ExchangePlugin_ExportFeature::STL_FILE_PATH_ID())); - if (anIsRelative) { + if (theIsRelative) { fillAttribute(ExchangePlugin_ExportFeature::STL_DEFLECTION_TYPE_RELATIVE(), theFeature->string(ExchangePlugin_ExportFeature::STL_DEFLECTION_TYPE()) ); - fillAttribute(aDeflectionRelative, + fillAttribute(theDeflectionRelative, theFeature->real(ExchangePlugin_ExportFeature::STL_RELATIVE()) ); } else { fillAttribute(ExchangePlugin_ExportFeature::STL_DEFLECTION_TYPE_ABSOLUTE(), theFeature->string(ExchangePlugin_ExportFeature::STL_DEFLECTION_TYPE()) ); - fillAttribute(aDeflectionAbsolute, + fillAttribute(theDeflectionAbsolute, theFeature->real(ExchangePlugin_ExportFeature::STL_ABSOLUTE()) ); } - if(anIsASCII){ + if(theIsASCII){ fillAttribute(ExchangePlugin_ExportFeature::STL_FILE_TYPE_ASCII(), theFeature->string(ExchangePlugin_ExportFeature::STL_FILE_TYPE())); } diff --git a/src/ExchangeAPI/ExchangeAPI_Export.h b/src/ExchangeAPI/ExchangeAPI_Export.h index fb6784f57..fb2703da5 100644 --- a/src/ExchangeAPI/ExchangeAPI_Export.h +++ b/src/ExchangeAPI/ExchangeAPI_Export.h @@ -146,12 +146,12 @@ ExportPtr exportToXAO(const std::shared_ptr & thePart, */ EXCHANGEAPI_EXPORT ExportPtr exportToSTL(const std::shared_ptr & thePart, - const std::string & theFilePath, - const ModelHighAPI_Selection& theSelectedShape, - double aDeflectionRelative, - double aDeflectionAbsolute, - const bool anIsRelative, - const bool anIsASCII); + const std::string & theFilePath, + const ModelHighAPI_Selection& theSelectedShape, + double theDeflectionRelative, + double theDeflectionAbsolute, + const bool theIsRelative, + const bool theIsASCII); /**\ingroup CPPHighAPI * \brief Exports to XAO file the selected result with groups parts related to it only. diff --git a/src/ExchangePlugin/doc/TUI_exportFeature.rst b/src/ExchangePlugin/doc/TUI_exportFeature.rst index 49eecc5aa..4ef25d686 100644 --- a/src/ExchangePlugin/doc/TUI_exportFeature.rst +++ b/src/ExchangePlugin/doc/TUI_exportFeature.rst @@ -9,4 +9,16 @@ Export File :language: python :download:`Download this script ` + + .. _tui_export_file_STL: + +Export STL File +=============== + +.. literalinclude:: examples/exportSTL.py + :linenos: + :language: python + +:download:`Download this script ` + diff --git a/src/ExchangePlugin/doc/examples/exportSTL.py b/src/ExchangePlugin/doc/examples/exportSTL.py new file mode 100644 index 000000000..01c1aa842 --- /dev/null +++ b/src/ExchangePlugin/doc/examples/exportSTL.py @@ -0,0 +1,11 @@ +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) +Export_1 = model.exportToSTL(Part_1_doc, "/dn48/newgeom/vsv/test.stl", + [model.selection("SOLID", "Box_1_1")],0.0001,0.5,"True","False") +model.do() +model.end() diff --git a/src/ExchangePlugin/doc/exportFeature.rst b/src/ExchangePlugin/doc/exportFeature.rst index e11ede6ad..be71349ab 100644 --- a/src/ExchangePlugin/doc/exportFeature.rst +++ b/src/ExchangePlugin/doc/exportFeature.rst @@ -69,9 +69,10 @@ The Result of operation is an exported file. Export to CAD format -------------------- -It is possible to export objects to files in the following CAD-neutral formats: BREP, STEP, IGES, XAO. +It is possible to export objects to files in the following CAD-neutral formats: BREP, STEP, IGES, XAO, STL. To export objects to a file select in the Main Menu *File -> Export -> To CAD formats...* item. + The following property panel will be opened: .. figure:: images/Export_panel.png @@ -79,15 +80,22 @@ The following property panel will be opened: **Export property panel** -In this panel, it is necessary to select desirable format of export file. It can be **'BREP, STEP, IGES'** or **'XAO'**. In case of first choice the format of exported file will be defined according to file extension. The file name and path can be defined in **Export file** field by direct input or browsing with **'...'** button, which opens **Export file** dialog box: +In this panel, it is necessary to select desirable format of export file. It can be **'BREP, STEP, IGES'** , **'XAO'** or **'STL'** . + + +Export to BREP, STEP, IGES +"""""""""""""""""""""""""" + +In case of first choice the format of exported file will be defined according to file extension. The file name and path can be defined in **Export file** field by direct input or browsing with **'...'** button, which opens **Export file** dialog box: .. figure:: images/ExportFileDlg.png :align: center - **Dialog box tp export in CAD-neutral format** + **Dialog box to export in CAD-neutral format** Selection list in the property panel contains a list of exported objects which can be selected in a viewer or object browser. + **Apply** button exports the file. **Cancel** button cancels the operation. @@ -115,3 +123,50 @@ Result The Result of operation is an exported file. **See Also** a sample TUI Script of :ref:`tui_export_file` operation. + +Result +"""""" + +The Result of operation is an exported file. + +**See Also** a sample TUI Script of :ref:`tui_export_file` operation. + +Export to STL +""""""""""""" +In this case, the following property panel will be opened: + +.. figure:: images/ExportSTL.png + :align: center + + **Dialog box to export in STL format** + + +The file name and path can be defined in **Export file** field by direct input or browsing with ‘…’ button, which opens Export file dialog box. + +**Object** field contains an exported object which can be selected in a viewer or object browser. + +**Deflection** (**Relative** or **Absolute**) has to be chosen and defined in the corresponding field as well as the **File type** which can defined as **Binary** or as **ASCII**. + + +**Apply** button exports the file. + +**Cancel** button cancels the operation. + +**TUI Command**: + +.. py:function:: model.exportToSTL(Part_doc, FileNameString, selectedShape, relative, absolute, isRelative, isASCII) + + :param part: The current part object + :param string: The file name + :param selectedShape: An exporting object + :param relative: value of the relative deflection + :param absolute: value of the absolute deflection + :param isRelative: indicate if use deflection relative + :param isASCII: indicate if the file is in ASCII type + +Result +"""""" + +The Result of operation is an exported STL file. + +**See Also** a sample TUI Script of :ref:`tui_export_file_STL` operation. diff --git a/src/ExchangePlugin/doc/images/ExportSTL.png b/src/ExchangePlugin/doc/images/ExportSTL.png new file mode 100644 index 0000000000000000000000000000000000000000..855af84306ef1ef95555e8b0c98b9bd63387115e GIT binary patch literal 18699 zcmcG$WpEr#mnAG&7PG}HS!gjcw#Z_zm>Df*Y%!z7%uE(DGcz+=7POdQ`J@ahS%^g#9d*}*uW?Oec1V>2($8bxf`&q1VMVQ`iBrplq$43PXlb%NHEP#~u zzPgk~yf6jgD_mX>rihm3_T2k<8=1=^gH|8}S~h^;&mNcVK8YBM30I^A8WPhh%NxZ*TBs1V~dav*-Yc@J!Nq)RFFZAkeo{uSqV+U{v;Mke0 z9{SS^qJCpcJw3}^_`QBOQQC4zBri+v(o?O~8qr9=`DYuInAy*;Ka}Nkbk)?h*>YbZ zxkh7j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T5UD4hg>D{k|Dt|Rvu&L@jFsxR!d>^-jcY~`%@c*IhaauDbs|#9p~{WagckS#GwzZaD%iJqZUFMd;<- zKfBY6L3&|dL*{=2+h@y1X~H<%nO}$5SFstGIXGk@C6I z^U@{e&dGn=b9LnJd7kd}kiYiS!NbdE$&MWzZEaQazrWSU+WA!=jDPF@Q_p6UtIfV= ze_$c=PZ_HT=iAxuKm0B%RhjNB$s51tw08cRClQgRy?W-p;(iwpidR~%jS z@I>@-$q75VBEKIMl9s;w&%A`Ee_h$5UkdF?W z73?H9x)eWe-J7Dn<;L%Bd4tR|7C}b!XX3kLb!sXkw!i2WohZFxh3gYN!H$)u8Kn=$ z#YKAh`o8@yvh~ZYb!-#kmbsglm%g|P%qC1G!tu+$NA@9x4mC~_rd2+>DzDn78i5Jtrw5pUw0#CTi#!1K~A0Z*SoJj zUbu57>-N>vQ(f$s6`#pjhi7N)ym!Z^Ufwy#<;m^DNU>?Dg2IpM!@bgL{CtEa?sHC; j#F5hpx)P+|ANQpcY3pa6mE6G7j2Jv!{an^LB{Ts5osaED literal 0 HcmV?d00001 diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_STLExport.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_STLExport.cpp index a11aa6565..48477c36a 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_STLExport.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_STLExport.cpp @@ -56,7 +56,7 @@ bool STLExport(const std::string& theFileName, try { - double lDeflection = theDeflection; + double aDeflection = theDeflection; StlAPI_Writer aWriter; // copy source shape BRepBuilderAPI_Copy aCopy( theShape->impl(), Standard_False ); @@ -65,13 +65,15 @@ bool STLExport(const std::string& theFileName, aWriter.ASCIIMode() = theIsASCII; if ( theIsRelative ) { Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax; - Bnd_Box bndBox; - BRepBndLib::Add( theShape->impl(), bndBox ); - bndBox.Get( aXmin, aYmin, aZmin, aXmax, aYmax, aZmax ); - lDeflection = MAX3( aXmax-aXmin, aYmax-aYmin, aZmax-aZmin ) * theDeflection; + Bnd_Box aBndBox; + BRepBndLib::Add( theShape->impl(), aBndBox ); + aBndBox.Get( aXmin, aYmin, aZmin, aXmax, aYmax, aZmax ); + aDeflection = MAX3( aXmax-aXmin, aYmax-aYmin, aZmax-aZmin ) * theDeflection; } //Compute triangulation - BRepMesh_IncrementalMesh aMesh( aCopyShape, lDeflection ); + BRepTools::Clean( aCopyShape ); + BRepMesh_IncrementalMesh aMesh( aCopyShape, aDeflection ); + if (!aWriter.Write( aCopyShape, theFileName.c_str())) { theError = "STL Export failed"; return false; -- 2.39.2