From: rraphael Date: Wed, 2 Dec 2020 11:28:17 +0000 (+0100) Subject: add import stl file X-Git-Tag: V9_7_0a1~13^2~22 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=a4fd88094f08edc76053106ad66411c9b88b6340;p=modules%2Fshaper.git add import stl file --- diff --git a/src/ExchangePlugin/ExchangePlugin_ImportFeature.cpp b/src/ExchangePlugin/ExchangePlugin_ImportFeature.cpp index 24c821f1c..ee9e7a798 100644 --- a/src/ExchangePlugin/ExchangePlugin_ImportFeature.cpp +++ b/src/ExchangePlugin/ExchangePlugin_ImportFeature.cpp @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -187,6 +188,8 @@ void ExchangePlugin_ImportFeature::importFile(const std::string& theFileName) theMaterialShape, anError); } else if (anExtension == "IGES" || anExtension == "IGS") { aGeomShape = IGESImport(theFileName, anExtension, anError); + } else if (anExtension == "STL") { + aGeomShape = STLImport(theFileName, anError); } else { anError = "Unsupported format: " + anExtension; } diff --git a/src/ExchangePlugin/plugin-Exchange.xml b/src/ExchangePlugin/plugin-Exchange.xml index 8f2445633..c6f58a196 100644 --- a/src/ExchangePlugin/plugin-Exchange.xml +++ b/src/ExchangePlugin/plugin-Exchange.xml @@ -5,9 +5,9 @@ helpfile="importFeature.html" internal="1"> - + - + - + + + + + + + - + - + @@ -66,6 +77,13 @@ + + + + + diff --git a/src/GeomAlgoAPI/CMakeLists.txt b/src/GeomAlgoAPI/CMakeLists.txt index a03ae213f..1948f8161 100644 --- a/src/GeomAlgoAPI/CMakeLists.txt +++ b/src/GeomAlgoAPI/CMakeLists.txt @@ -50,6 +50,7 @@ SET(PROJECT_HEADERS GeomAlgoAPI_BREPExport.h GeomAlgoAPI_STEPExport.h GeomAlgoAPI_STLExport.h + GeomAlgoAPI_STLImport.h GeomAlgoAPI_IGESExport.h GeomAlgoAPI_Transform.h GeomAlgoAPI_ShapeTools.h @@ -117,6 +118,7 @@ SET(PROJECT_SOURCES GeomAlgoAPI_BREPExport.cpp GeomAlgoAPI_STEPExport.cpp GeomAlgoAPI_STLExport.cpp + GeomAlgoAPI_STLImport.cpp GeomAlgoAPI_IGESExport.cpp GeomAlgoAPI_Transform.cpp GeomAlgoAPI_ShapeTools.cpp diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_STLImport.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_STLImport.cpp new file mode 100644 index 000000000..1c0c6ce4c --- /dev/null +++ b/src/GeomAlgoAPI/GeomAlgoAPI_STLImport.cpp @@ -0,0 +1,47 @@ +// 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 +// + +#include +#include "GeomAlgoAPI_Tools.h" +#include +#include + + +std::shared_ptr STLImport(const std::string& theFileName, + std::string& theError) +{ + TopoDS_Shape aResShape; + StlAPI_Reader aReader; + + try + { + if(!aReader.Read(aResShape, theFileName.c_str())) + { + theError = "Can't import file."; + aResShape.Nullify(); + } + } + catch (Standard_Failure const& anException) { + theError = anException.GetMessageString(); + aResShape.Nullify(); + } + std::shared_ptr aGeomShape(new GeomAPI_Shape); + aGeomShape->setImpl(new TopoDS_Shape(aResShape)); + return aGeomShape; +} diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_STLImport.h b/src/GeomAlgoAPI/GeomAlgoAPI_STLImport.h new file mode 100644 index 000000000..8f491c723 --- /dev/null +++ b/src/GeomAlgoAPI/GeomAlgoAPI_STLImport.h @@ -0,0 +1,32 @@ +// 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 + +#ifndef GEOMALGOAPI_STLIMPORT_H_ +#define GEOMALGOAPI_STLPIMPORT_H_ + +#include +#include + +#include + +/// Implementation of the import STL files algorithms +GEOMALGOAPI_EXPORT +std::shared_ptr STLImport(const std::string& theFileName, + std::string& theError); + +#endif /* GEOMALGOAPI_STLIMPORT_H_ */ diff --git a/test.squish/shared/testdata/exchange/stl-examples/cubeCylinder_ASCII.stl b/test.squish/shared/testdata/exchange/stl-examples/cubeCylinder_ASCII.stl new file mode 100644 index 000000000..b4b45cbda --- /dev/null +++ b/test.squish/shared/testdata/exchange/stl-examples/cubeCylinder_ASCII.stl @@ -0,0 +1,856 @@ +solid + facet normal 0.000000e+00 0.000000e+00 -1.000000e+00 + outer loop + vertex -1.250000e-01 6.250000e-02 0.000000e+00 + vertex -7.242166e-02 9.629005e-02 0.000000e+00 + vertex -6.250000e-02 6.250000e-02 0.000000e+00 + endloop + endfacet + facet normal 0.000000e+00 -0.000000e+00 -1.000000e+00 + outer loop + vertex -9.903656e-02 1.193520e-01 0.000000e+00 + vertex -7.242166e-02 9.629005e-02 0.000000e+00 + vertex -1.250000e-01 6.250000e-02 0.000000e+00 + endloop + endfacet + facet normal 0.000000e+00 0.000000e+00 -1.000000e+00 + outer loop + vertex -1.338947e-01 1.243638e-01 0.000000e+00 + vertex -9.903656e-02 1.193520e-01 0.000000e+00 + vertex -1.250000e-01 6.250000e-02 0.000000e+00 + endloop + endfacet + facet normal 0.000000e+00 0.000000e+00 -1.000000e+00 + outer loop + vertex -1.659288e-01 1.097343e-01 0.000000e+00 + vertex -1.338947e-01 1.243638e-01 0.000000e+00 + vertex -1.250000e-01 6.250000e-02 0.000000e+00 + endloop + endfacet + facet normal 0.000000e+00 -0.000000e+00 -1.000000e+00 + outer loop + vertex -1.659288e-01 1.097343e-01 0.000000e+00 + vertex -1.250000e-01 6.250000e-02 0.000000e+00 + vertex -1.849683e-01 8.010828e-02 0.000000e+00 + endloop + endfacet + facet normal 0.000000e+00 0.000000e+00 -1.000000e+00 + outer loop + vertex -1.849683e-01 8.010828e-02 0.000000e+00 + vertex -1.250000e-01 6.250000e-02 0.000000e+00 + vertex -1.849683e-01 4.489172e-02 0.000000e+00 + endloop + endfacet + facet normal 0.000000e+00 0.000000e+00 -1.000000e+00 + outer loop + vertex -1.849683e-01 4.489172e-02 0.000000e+00 + vertex -1.250000e-01 6.250000e-02 0.000000e+00 + vertex -1.659288e-01 1.526565e-02 0.000000e+00 + endloop + endfacet + facet normal 0.000000e+00 0.000000e+00 -1.000000e+00 + outer loop + vertex -1.250000e-01 6.250000e-02 0.000000e+00 + vertex -1.338947e-01 6.361600e-04 0.000000e+00 + vertex -1.659288e-01 1.526565e-02 0.000000e+00 + endloop + endfacet + facet normal 0.000000e+00 -0.000000e+00 -1.000000e+00 + outer loop + vertex -1.250000e-01 6.250000e-02 0.000000e+00 + vertex -9.903656e-02 5.648000e-03 0.000000e+00 + vertex -1.338947e-01 6.361600e-04 0.000000e+00 + endloop + endfacet + facet normal 0.000000e+00 0.000000e+00 -1.000000e+00 + outer loop + vertex -1.250000e-01 6.250000e-02 0.000000e+00 + vertex -7.242166e-02 2.870995e-02 0.000000e+00 + vertex -9.903656e-02 5.648000e-03 0.000000e+00 + endloop + endfacet + facet normal 0.000000e+00 0.000000e+00 -1.000000e+00 + outer loop + vertex -1.250000e-01 6.250000e-02 0.000000e+00 + vertex -6.250000e-02 6.250000e-02 0.000000e+00 + vertex -7.242166e-02 2.870995e-02 0.000000e+00 + endloop + endfacet + facet normal 9.594930e-01 2.817326e-01 0.000000e+00 + outer loop + vertex -7.242166e-02 9.629005e-02 3.125000e-02 + vertex -6.250000e-02 6.250000e-02 0.000000e+00 + vertex -7.242166e-02 9.629005e-02 0.000000e+00 + endloop + endfacet + facet normal 9.594930e-01 2.817326e-01 0.000000e+00 + outer loop + vertex -7.242166e-02 9.629005e-02 3.125000e-02 + vertex -6.250000e-02 6.250000e-02 3.125000e-02 + vertex -6.250000e-02 6.250000e-02 0.000000e+00 + endloop + endfacet + facet normal 6.548607e-01 7.557496e-01 0.000000e+00 + outer loop + vertex -7.242166e-02 9.629005e-02 0.000000e+00 + vertex -9.903656e-02 1.193520e-01 0.000000e+00 + vertex -9.903656e-02 1.193520e-01 3.125000e-02 + endloop + endfacet + facet normal 6.548607e-01 7.557496e-01 -0.000000e+00 + outer loop + vertex -7.242166e-02 9.629005e-02 0.000000e+00 + vertex -9.903656e-02 1.193520e-01 3.125000e-02 + vertex -7.242166e-02 9.629005e-02 3.125000e-02 + endloop + endfacet + facet normal 1.423148e-01 9.898214e-01 0.000000e+00 + outer loop + vertex -9.903656e-02 1.193520e-01 0.000000e+00 + vertex -1.338947e-01 1.243638e-01 0.000000e+00 + vertex -1.338947e-01 1.243638e-01 3.125000e-02 + endloop + endfacet + facet normal 1.423148e-01 9.898214e-01 -0.000000e+00 + outer loop + vertex -9.903656e-02 1.193520e-01 0.000000e+00 + vertex -1.338947e-01 1.243638e-01 3.125000e-02 + vertex -9.903656e-02 1.193520e-01 3.125000e-02 + endloop + endfacet + facet normal -4.154150e-01 9.096320e-01 0.000000e+00 + outer loop + vertex -1.338947e-01 1.243638e-01 0.000000e+00 + vertex -1.659288e-01 1.097343e-01 0.000000e+00 + vertex -1.659288e-01 1.097343e-01 3.125000e-02 + endloop + endfacet + facet normal -4.154150e-01 9.096320e-01 0.000000e+00 + outer loop + vertex -1.338947e-01 1.243638e-01 0.000000e+00 + vertex -1.659288e-01 1.097343e-01 3.125000e-02 + vertex -1.338947e-01 1.243638e-01 3.125000e-02 + endloop + endfacet + facet normal -8.412536e-01 5.406407e-01 0.000000e+00 + outer loop + vertex -1.849683e-01 8.010828e-02 3.125000e-02 + vertex -1.659288e-01 1.097343e-01 0.000000e+00 + vertex -1.849683e-01 8.010828e-02 0.000000e+00 + endloop + endfacet + facet normal -8.412536e-01 5.406407e-01 0.000000e+00 + outer loop + vertex -1.849683e-01 8.010828e-02 3.125000e-02 + vertex -1.659288e-01 1.097343e-01 3.125000e-02 + vertex -1.659288e-01 1.097343e-01 0.000000e+00 + endloop + endfacet + facet normal -1.000000e+00 0.000000e+00 0.000000e+00 + outer loop + vertex -1.849683e-01 4.489172e-02 0.000000e+00 + vertex -1.849683e-01 4.489172e-02 3.125000e-02 + vertex -1.849683e-01 8.010828e-02 0.000000e+00 + endloop + endfacet + facet normal -1.000000e+00 0.000000e+00 0.000000e+00 + outer loop + vertex -1.849683e-01 4.489172e-02 3.125000e-02 + vertex -1.849683e-01 8.010828e-02 3.125000e-02 + vertex -1.849683e-01 8.010828e-02 0.000000e+00 + endloop + endfacet + facet normal -8.412536e-01 -5.406408e-01 -0.000000e+00 + outer loop + vertex -1.659288e-01 1.526565e-02 3.125000e-02 + vertex -1.849683e-01 4.489172e-02 0.000000e+00 + vertex -1.659288e-01 1.526565e-02 0.000000e+00 + endloop + endfacet + facet normal -8.412536e-01 -5.406408e-01 0.000000e+00 + outer loop + vertex -1.659288e-01 1.526565e-02 3.125000e-02 + vertex -1.849683e-01 4.489172e-02 3.125000e-02 + vertex -1.849683e-01 4.489172e-02 0.000000e+00 + endloop + endfacet + facet normal -4.154151e-01 -9.096320e-01 0.000000e+00 + outer loop + vertex -1.659288e-01 1.526565e-02 0.000000e+00 + vertex -1.338947e-01 6.361600e-04 0.000000e+00 + vertex -1.338947e-01 6.361600e-04 3.125000e-02 + endloop + endfacet + facet normal -4.154151e-01 -9.096320e-01 0.000000e+00 + outer loop + vertex -1.659288e-01 1.526565e-02 0.000000e+00 + vertex -1.338947e-01 6.361600e-04 3.125000e-02 + vertex -1.659288e-01 1.526565e-02 3.125000e-02 + endloop + endfacet + facet normal 1.423148e-01 -9.898214e-01 0.000000e+00 + outer loop + vertex -1.338947e-01 6.361600e-04 0.000000e+00 + vertex -9.903656e-02 5.648000e-03 0.000000e+00 + vertex -9.903656e-02 5.648000e-03 3.125000e-02 + endloop + endfacet + facet normal 1.423148e-01 -9.898214e-01 0.000000e+00 + outer loop + vertex -1.338947e-01 6.361600e-04 0.000000e+00 + vertex -9.903656e-02 5.648000e-03 3.125000e-02 + vertex -1.338947e-01 6.361600e-04 3.125000e-02 + endloop + endfacet + facet normal 6.548608e-01 -7.557495e-01 0.000000e+00 + outer loop + vertex -9.903656e-02 5.648000e-03 0.000000e+00 + vertex -7.242166e-02 2.870995e-02 0.000000e+00 + vertex -7.242166e-02 2.870995e-02 3.125000e-02 + endloop + endfacet + facet normal 6.548608e-01 -7.557495e-01 0.000000e+00 + outer loop + vertex -9.903656e-02 5.648000e-03 0.000000e+00 + vertex -7.242166e-02 2.870995e-02 3.125000e-02 + vertex -9.903656e-02 5.648000e-03 3.125000e-02 + endloop + endfacet + facet normal 9.594930e-01 -2.817326e-01 0.000000e+00 + outer loop + vertex -6.250000e-02 6.250000e-02 3.125000e-02 + vertex -7.242166e-02 2.870995e-02 0.000000e+00 + vertex -6.250000e-02 6.250000e-02 0.000000e+00 + endloop + endfacet + facet normal 9.594930e-01 -2.817326e-01 0.000000e+00 + outer loop + vertex -6.250000e-02 6.250000e-02 3.125000e-02 + vertex -7.242166e-02 2.870995e-02 3.125000e-02 + vertex -7.242166e-02 2.870995e-02 0.000000e+00 + endloop + endfacet + facet normal 9.594930e-01 2.817326e-01 0.000000e+00 + outer loop + vertex -7.242166e-02 9.629005e-02 6.250000e-02 + vertex -6.250000e-02 6.250000e-02 3.125000e-02 + vertex -7.242166e-02 9.629005e-02 3.125000e-02 + endloop + endfacet + facet normal 9.594930e-01 2.817326e-01 0.000000e+00 + outer loop + vertex -7.242166e-02 9.629005e-02 6.250000e-02 + vertex -6.250000e-02 6.250000e-02 6.250000e-02 + vertex -6.250000e-02 6.250000e-02 3.125000e-02 + endloop + endfacet + facet normal 6.548607e-01 7.557496e-01 0.000000e+00 + outer loop + vertex -7.242166e-02 9.629005e-02 3.125000e-02 + vertex -9.903656e-02 1.193520e-01 3.125000e-02 + vertex -9.903656e-02 1.193520e-01 6.250000e-02 + endloop + endfacet + facet normal 6.548607e-01 7.557496e-01 -0.000000e+00 + outer loop + vertex -7.242166e-02 9.629005e-02 3.125000e-02 + vertex -9.903656e-02 1.193520e-01 6.250000e-02 + vertex -7.242166e-02 9.629005e-02 6.250000e-02 + endloop + endfacet + facet normal 1.423148e-01 9.898214e-01 0.000000e+00 + outer loop + vertex -9.903656e-02 1.193520e-01 3.125000e-02 + vertex -1.338947e-01 1.243638e-01 3.125000e-02 + vertex -1.338947e-01 1.243638e-01 6.250000e-02 + endloop + endfacet + facet normal 1.423148e-01 9.898214e-01 -0.000000e+00 + outer loop + vertex -9.903656e-02 1.193520e-01 3.125000e-02 + vertex -1.338947e-01 1.243638e-01 6.250000e-02 + vertex -9.903656e-02 1.193520e-01 6.250000e-02 + endloop + endfacet + facet normal -4.154150e-01 9.096320e-01 0.000000e+00 + outer loop + vertex -1.338947e-01 1.243638e-01 3.125000e-02 + vertex -1.659288e-01 1.097343e-01 3.125000e-02 + vertex -1.659288e-01 1.097343e-01 6.250000e-02 + endloop + endfacet + facet normal -4.154150e-01 9.096320e-01 0.000000e+00 + outer loop + vertex -1.338947e-01 1.243638e-01 3.125000e-02 + vertex -1.659288e-01 1.097343e-01 6.250000e-02 + vertex -1.338947e-01 1.243638e-01 6.250000e-02 + endloop + endfacet + facet normal -8.412536e-01 5.406407e-01 0.000000e+00 + outer loop + vertex -1.849683e-01 8.010828e-02 6.250000e-02 + vertex -1.659288e-01 1.097343e-01 3.125000e-02 + vertex -1.849683e-01 8.010828e-02 3.125000e-02 + endloop + endfacet + facet normal -8.412536e-01 5.406407e-01 0.000000e+00 + outer loop + vertex -1.849683e-01 8.010828e-02 6.250000e-02 + vertex -1.659288e-01 1.097343e-01 6.250000e-02 + vertex -1.659288e-01 1.097343e-01 3.125000e-02 + endloop + endfacet + facet normal -1.000000e+00 0.000000e+00 0.000000e+00 + outer loop + vertex -1.849683e-01 4.489172e-02 3.125000e-02 + vertex -1.849683e-01 4.489172e-02 6.250000e-02 + vertex -1.849683e-01 8.010828e-02 3.125000e-02 + endloop + endfacet + facet normal -1.000000e+00 0.000000e+00 0.000000e+00 + outer loop + vertex -1.849683e-01 4.489172e-02 6.250000e-02 + vertex -1.849683e-01 8.010828e-02 6.250000e-02 + vertex -1.849683e-01 8.010828e-02 3.125000e-02 + endloop + endfacet + facet normal -8.412536e-01 -5.406408e-01 -0.000000e+00 + outer loop + vertex -1.659288e-01 1.526565e-02 6.250000e-02 + vertex -1.849683e-01 4.489172e-02 3.125000e-02 + vertex -1.659288e-01 1.526565e-02 3.125000e-02 + endloop + endfacet + facet normal -8.412536e-01 -5.406408e-01 0.000000e+00 + outer loop + vertex -1.659288e-01 1.526565e-02 6.250000e-02 + vertex -1.849683e-01 4.489172e-02 6.250000e-02 + vertex -1.849683e-01 4.489172e-02 3.125000e-02 + endloop + endfacet + facet normal -4.154151e-01 -9.096320e-01 0.000000e+00 + outer loop + vertex -1.659288e-01 1.526565e-02 3.125000e-02 + vertex -1.338947e-01 6.361600e-04 3.125000e-02 + vertex -1.338947e-01 6.361600e-04 6.250000e-02 + endloop + endfacet + facet normal -4.154151e-01 -9.096320e-01 0.000000e+00 + outer loop + vertex -1.659288e-01 1.526565e-02 3.125000e-02 + vertex -1.338947e-01 6.361600e-04 6.250000e-02 + vertex -1.659288e-01 1.526565e-02 6.250000e-02 + endloop + endfacet + facet normal 1.423148e-01 -9.898214e-01 0.000000e+00 + outer loop + vertex -1.338947e-01 6.361600e-04 3.125000e-02 + vertex -9.903656e-02 5.648000e-03 3.125000e-02 + vertex -9.903656e-02 5.648000e-03 6.250000e-02 + endloop + endfacet + facet normal 1.423148e-01 -9.898214e-01 0.000000e+00 + outer loop + vertex -1.338947e-01 6.361600e-04 3.125000e-02 + vertex -9.903656e-02 5.648000e-03 6.250000e-02 + vertex -1.338947e-01 6.361600e-04 6.250000e-02 + endloop + endfacet + facet normal 6.548608e-01 -7.557495e-01 0.000000e+00 + outer loop + vertex -9.903656e-02 5.648000e-03 3.125000e-02 + vertex -7.242166e-02 2.870995e-02 3.125000e-02 + vertex -7.242166e-02 2.870995e-02 6.250000e-02 + endloop + endfacet + facet normal 6.548608e-01 -7.557495e-01 0.000000e+00 + outer loop + vertex -9.903656e-02 5.648000e-03 3.125000e-02 + vertex -7.242166e-02 2.870995e-02 6.250000e-02 + vertex -9.903656e-02 5.648000e-03 6.250000e-02 + endloop + endfacet + facet normal 9.594930e-01 -2.817326e-01 0.000000e+00 + outer loop + vertex -6.250000e-02 6.250000e-02 6.250000e-02 + vertex -7.242166e-02 2.870995e-02 3.125000e-02 + vertex -6.250000e-02 6.250000e-02 3.125000e-02 + endloop + endfacet + facet normal 9.594930e-01 -2.817326e-01 0.000000e+00 + outer loop + vertex -6.250000e-02 6.250000e-02 6.250000e-02 + vertex -7.242166e-02 2.870995e-02 6.250000e-02 + vertex -7.242166e-02 2.870995e-02 3.125000e-02 + endloop + endfacet + facet normal 9.594930e-01 2.817326e-01 0.000000e+00 + outer loop + vertex -7.242166e-02 9.629005e-02 9.375000e-02 + vertex -6.250000e-02 6.250000e-02 6.250000e-02 + vertex -7.242166e-02 9.629005e-02 6.250000e-02 + endloop + endfacet + facet normal 9.594930e-01 2.817326e-01 0.000000e+00 + outer loop + vertex -7.242166e-02 9.629005e-02 9.375000e-02 + vertex -6.250000e-02 6.250000e-02 9.375000e-02 + vertex -6.250000e-02 6.250000e-02 6.250000e-02 + endloop + endfacet + facet normal 6.548607e-01 7.557496e-01 0.000000e+00 + outer loop + vertex -7.242166e-02 9.629005e-02 6.250000e-02 + vertex -9.903656e-02 1.193520e-01 6.250000e-02 + vertex -9.903656e-02 1.193520e-01 9.375000e-02 + endloop + endfacet + facet normal 6.548607e-01 7.557496e-01 -0.000000e+00 + outer loop + vertex -7.242166e-02 9.629005e-02 6.250000e-02 + vertex -9.903656e-02 1.193520e-01 9.375000e-02 + vertex -7.242166e-02 9.629005e-02 9.375000e-02 + endloop + endfacet + facet normal 1.423148e-01 9.898214e-01 0.000000e+00 + outer loop + vertex -9.903656e-02 1.193520e-01 6.250000e-02 + vertex -1.338947e-01 1.243638e-01 6.250000e-02 + vertex -1.338947e-01 1.243638e-01 9.375000e-02 + endloop + endfacet + facet normal 1.423148e-01 9.898214e-01 -0.000000e+00 + outer loop + vertex -9.903656e-02 1.193520e-01 6.250000e-02 + vertex -1.338947e-01 1.243638e-01 9.375000e-02 + vertex -9.903656e-02 1.193520e-01 9.375000e-02 + endloop + endfacet + facet normal -4.154150e-01 9.096320e-01 0.000000e+00 + outer loop + vertex -1.338947e-01 1.243638e-01 6.250000e-02 + vertex -1.659288e-01 1.097343e-01 6.250000e-02 + vertex -1.659288e-01 1.097343e-01 9.375000e-02 + endloop + endfacet + facet normal -4.154150e-01 9.096320e-01 0.000000e+00 + outer loop + vertex -1.338947e-01 1.243638e-01 6.250000e-02 + vertex -1.659288e-01 1.097343e-01 9.375000e-02 + vertex -1.338947e-01 1.243638e-01 9.375000e-02 + endloop + endfacet + facet normal -8.412536e-01 5.406407e-01 0.000000e+00 + outer loop + vertex -1.849683e-01 8.010828e-02 9.375000e-02 + vertex -1.659288e-01 1.097343e-01 6.250000e-02 + vertex -1.849683e-01 8.010828e-02 6.250000e-02 + endloop + endfacet + facet normal -8.412536e-01 5.406407e-01 0.000000e+00 + outer loop + vertex -1.849683e-01 8.010828e-02 9.375000e-02 + vertex -1.659288e-01 1.097343e-01 9.375000e-02 + vertex -1.659288e-01 1.097343e-01 6.250000e-02 + endloop + endfacet + facet normal -1.000000e+00 0.000000e+00 0.000000e+00 + outer loop + vertex -1.849683e-01 4.489172e-02 6.250000e-02 + vertex -1.849683e-01 4.489172e-02 9.375000e-02 + vertex -1.849683e-01 8.010828e-02 6.250000e-02 + endloop + endfacet + facet normal -1.000000e+00 0.000000e+00 0.000000e+00 + outer loop + vertex -1.849683e-01 4.489172e-02 9.375000e-02 + vertex -1.849683e-01 8.010828e-02 9.375000e-02 + vertex -1.849683e-01 8.010828e-02 6.250000e-02 + endloop + endfacet + facet normal -8.412536e-01 -5.406408e-01 -0.000000e+00 + outer loop + vertex -1.659288e-01 1.526565e-02 9.375000e-02 + vertex -1.849683e-01 4.489172e-02 6.250000e-02 + vertex -1.659288e-01 1.526565e-02 6.250000e-02 + endloop + endfacet + facet normal -8.412536e-01 -5.406408e-01 0.000000e+00 + outer loop + vertex -1.659288e-01 1.526565e-02 9.375000e-02 + vertex -1.849683e-01 4.489172e-02 9.375000e-02 + vertex -1.849683e-01 4.489172e-02 6.250000e-02 + endloop + endfacet + facet normal -4.154151e-01 -9.096320e-01 0.000000e+00 + outer loop + vertex -1.659288e-01 1.526565e-02 6.250000e-02 + vertex -1.338947e-01 6.361600e-04 6.250000e-02 + vertex -1.338947e-01 6.361600e-04 9.375000e-02 + endloop + endfacet + facet normal -4.154151e-01 -9.096320e-01 0.000000e+00 + outer loop + vertex -1.659288e-01 1.526565e-02 6.250000e-02 + vertex -1.338947e-01 6.361600e-04 9.375000e-02 + vertex -1.659288e-01 1.526565e-02 9.375000e-02 + endloop + endfacet + facet normal 1.423148e-01 -9.898214e-01 0.000000e+00 + outer loop + vertex -1.338947e-01 6.361600e-04 6.250000e-02 + vertex -9.903656e-02 5.648000e-03 6.250000e-02 + vertex -9.903656e-02 5.648000e-03 9.375000e-02 + endloop + endfacet + facet normal 1.423148e-01 -9.898214e-01 0.000000e+00 + outer loop + vertex -1.338947e-01 6.361600e-04 6.250000e-02 + vertex -9.903656e-02 5.648000e-03 9.375000e-02 + vertex -1.338947e-01 6.361600e-04 9.375000e-02 + endloop + endfacet + facet normal 6.548608e-01 -7.557495e-01 0.000000e+00 + outer loop + vertex -9.903656e-02 5.648000e-03 6.250000e-02 + vertex -7.242166e-02 2.870995e-02 6.250000e-02 + vertex -7.242166e-02 2.870995e-02 9.375000e-02 + endloop + endfacet + facet normal 6.548608e-01 -7.557495e-01 0.000000e+00 + outer loop + vertex -9.903656e-02 5.648000e-03 6.250000e-02 + vertex -7.242166e-02 2.870995e-02 9.375000e-02 + vertex -9.903656e-02 5.648000e-03 9.375000e-02 + endloop + endfacet + facet normal 9.594930e-01 -2.817326e-01 0.000000e+00 + outer loop + vertex -6.250000e-02 6.250000e-02 9.375000e-02 + vertex -7.242166e-02 2.870995e-02 6.250000e-02 + vertex -6.250000e-02 6.250000e-02 6.250000e-02 + endloop + endfacet + facet normal 9.594930e-01 -2.817326e-01 0.000000e+00 + outer loop + vertex -6.250000e-02 6.250000e-02 9.375000e-02 + vertex -7.242166e-02 2.870995e-02 9.375000e-02 + vertex -7.242166e-02 2.870995e-02 6.250000e-02 + endloop + endfacet + facet normal 9.594930e-01 2.817326e-01 0.000000e+00 + outer loop + vertex -7.242166e-02 9.629005e-02 1.250000e-01 + vertex -6.250000e-02 6.250000e-02 9.375000e-02 + vertex -7.242166e-02 9.629005e-02 9.375000e-02 + endloop + endfacet + facet normal 9.594930e-01 2.817326e-01 0.000000e+00 + outer loop + vertex -7.242166e-02 9.629005e-02 1.250000e-01 + vertex -6.250000e-02 6.250000e-02 1.250000e-01 + vertex -6.250000e-02 6.250000e-02 9.375000e-02 + endloop + endfacet + facet normal 6.548607e-01 7.557496e-01 0.000000e+00 + outer loop + vertex -7.242166e-02 9.629005e-02 9.375000e-02 + vertex -9.903656e-02 1.193520e-01 9.375000e-02 + vertex -9.903656e-02 1.193520e-01 1.250000e-01 + endloop + endfacet + facet normal 6.548607e-01 7.557496e-01 -0.000000e+00 + outer loop + vertex -7.242166e-02 9.629005e-02 9.375000e-02 + vertex -9.903656e-02 1.193520e-01 1.250000e-01 + vertex -7.242166e-02 9.629005e-02 1.250000e-01 + endloop + endfacet + facet normal 1.423148e-01 9.898214e-01 0.000000e+00 + outer loop + vertex -9.903656e-02 1.193520e-01 9.375000e-02 + vertex -1.338947e-01 1.243638e-01 9.375000e-02 + vertex -1.338947e-01 1.243638e-01 1.250000e-01 + endloop + endfacet + facet normal 1.423148e-01 9.898214e-01 -0.000000e+00 + outer loop + vertex -9.903656e-02 1.193520e-01 9.375000e-02 + vertex -1.338947e-01 1.243638e-01 1.250000e-01 + vertex -9.903656e-02 1.193520e-01 1.250000e-01 + endloop + endfacet + facet normal -4.154150e-01 9.096320e-01 0.000000e+00 + outer loop + vertex -1.338947e-01 1.243638e-01 9.375000e-02 + vertex -1.659288e-01 1.097343e-01 9.375000e-02 + vertex -1.659288e-01 1.097343e-01 1.250000e-01 + endloop + endfacet + facet normal -4.154150e-01 9.096320e-01 0.000000e+00 + outer loop + vertex -1.338947e-01 1.243638e-01 9.375000e-02 + vertex -1.659288e-01 1.097343e-01 1.250000e-01 + vertex -1.338947e-01 1.243638e-01 1.250000e-01 + endloop + endfacet + facet normal -8.412536e-01 5.406407e-01 0.000000e+00 + outer loop + vertex -1.849683e-01 8.010828e-02 1.250000e-01 + vertex -1.659288e-01 1.097343e-01 9.375000e-02 + vertex -1.849683e-01 8.010828e-02 9.375000e-02 + endloop + endfacet + facet normal -8.412536e-01 5.406407e-01 0.000000e+00 + outer loop + vertex -1.849683e-01 8.010828e-02 1.250000e-01 + vertex -1.659288e-01 1.097343e-01 1.250000e-01 + vertex -1.659288e-01 1.097343e-01 9.375000e-02 + endloop + endfacet + facet normal -1.000000e+00 0.000000e+00 0.000000e+00 + outer loop + vertex -1.849683e-01 4.489172e-02 9.375000e-02 + vertex -1.849683e-01 4.489172e-02 1.250000e-01 + vertex -1.849683e-01 8.010828e-02 9.375000e-02 + endloop + endfacet + facet normal -1.000000e+00 0.000000e+00 0.000000e+00 + outer loop + vertex -1.849683e-01 4.489172e-02 1.250000e-01 + vertex -1.849683e-01 8.010828e-02 1.250000e-01 + vertex -1.849683e-01 8.010828e-02 9.375000e-02 + endloop + endfacet + facet normal -8.412536e-01 -5.406408e-01 -0.000000e+00 + outer loop + vertex -1.659288e-01 1.526565e-02 1.250000e-01 + vertex -1.849683e-01 4.489172e-02 9.375000e-02 + vertex -1.659288e-01 1.526565e-02 9.375000e-02 + endloop + endfacet + facet normal -8.412536e-01 -5.406408e-01 0.000000e+00 + outer loop + vertex -1.659288e-01 1.526565e-02 1.250000e-01 + vertex -1.849683e-01 4.489172e-02 1.250000e-01 + vertex -1.849683e-01 4.489172e-02 9.375000e-02 + endloop + endfacet + facet normal -4.154151e-01 -9.096320e-01 0.000000e+00 + outer loop + vertex -1.659288e-01 1.526565e-02 9.375000e-02 + vertex -1.338947e-01 6.361600e-04 9.375000e-02 + vertex -1.338947e-01 6.361600e-04 1.250000e-01 + endloop + endfacet + facet normal -4.154151e-01 -9.096320e-01 0.000000e+00 + outer loop + vertex -1.659288e-01 1.526565e-02 9.375000e-02 + vertex -1.338947e-01 6.361600e-04 1.250000e-01 + vertex -1.659288e-01 1.526565e-02 1.250000e-01 + endloop + endfacet + facet normal 1.423148e-01 -9.898214e-01 0.000000e+00 + outer loop + vertex -1.338947e-01 6.361600e-04 9.375000e-02 + vertex -9.903656e-02 5.648000e-03 9.375000e-02 + vertex -9.903656e-02 5.648000e-03 1.250000e-01 + endloop + endfacet + facet normal 1.423148e-01 -9.898214e-01 0.000000e+00 + outer loop + vertex -1.338947e-01 6.361600e-04 9.375000e-02 + vertex -9.903656e-02 5.648000e-03 1.250000e-01 + vertex -1.338947e-01 6.361600e-04 1.250000e-01 + endloop + endfacet + facet normal 6.548608e-01 -7.557495e-01 0.000000e+00 + outer loop + vertex -9.903656e-02 5.648000e-03 9.375000e-02 + vertex -7.242166e-02 2.870995e-02 9.375000e-02 + vertex -7.242166e-02 2.870995e-02 1.250000e-01 + endloop + endfacet + facet normal 6.548608e-01 -7.557495e-01 0.000000e+00 + outer loop + vertex -9.903656e-02 5.648000e-03 9.375000e-02 + vertex -7.242166e-02 2.870995e-02 1.250000e-01 + vertex -9.903656e-02 5.648000e-03 1.250000e-01 + endloop + endfacet + facet normal 9.594930e-01 -2.817326e-01 0.000000e+00 + outer loop + vertex -6.250000e-02 6.250000e-02 1.250000e-01 + vertex -7.242166e-02 2.870995e-02 9.375000e-02 + vertex -6.250000e-02 6.250000e-02 9.375000e-02 + endloop + endfacet + facet normal 9.594930e-01 -2.817326e-01 0.000000e+00 + outer loop + vertex -6.250000e-02 6.250000e-02 1.250000e-01 + vertex -7.242166e-02 2.870995e-02 1.250000e-01 + vertex -7.242166e-02 2.870995e-02 9.375000e-02 + endloop + endfacet + facet normal 0.000000e+00 0.000000e+00 1.000000e+00 + outer loop + vertex -7.242166e-02 9.629005e-02 1.250000e-01 + vertex -1.250000e-01 6.250000e-02 1.250000e-01 + vertex -6.250000e-02 6.250000e-02 1.250000e-01 + endloop + endfacet + facet normal 0.000000e+00 0.000000e+00 1.000000e+00 + outer loop + vertex -7.242166e-02 9.629005e-02 1.250000e-01 + vertex -9.903656e-02 1.193520e-01 1.250000e-01 + vertex -1.250000e-01 6.250000e-02 1.250000e-01 + endloop + endfacet + facet normal 0.000000e+00 0.000000e+00 1.000000e+00 + outer loop + vertex -9.903656e-02 1.193520e-01 1.250000e-01 + vertex -1.338947e-01 1.243638e-01 1.250000e-01 + vertex -1.250000e-01 6.250000e-02 1.250000e-01 + endloop + endfacet + facet normal 0.000000e+00 0.000000e+00 1.000000e+00 + outer loop + vertex -1.338947e-01 1.243638e-01 1.250000e-01 + vertex -1.659288e-01 1.097343e-01 1.250000e-01 + vertex -1.250000e-01 6.250000e-02 1.250000e-01 + endloop + endfacet + facet normal 0.000000e+00 0.000000e+00 1.000000e+00 + outer loop + vertex -1.659288e-01 1.097343e-01 1.250000e-01 + vertex -1.849683e-01 8.010828e-02 1.250000e-01 + vertex -1.250000e-01 6.250000e-02 1.250000e-01 + endloop + endfacet + facet normal 0.000000e+00 0.000000e+00 1.000000e+00 + outer loop + vertex -1.250000e-01 6.250000e-02 1.250000e-01 + vertex -1.849683e-01 8.010828e-02 1.250000e-01 + vertex -1.849683e-01 4.489172e-02 1.250000e-01 + endloop + endfacet + facet normal 0.000000e+00 0.000000e+00 1.000000e+00 + outer loop + vertex -1.250000e-01 6.250000e-02 1.250000e-01 + vertex -1.849683e-01 4.489172e-02 1.250000e-01 + vertex -1.659288e-01 1.526565e-02 1.250000e-01 + endloop + endfacet + facet normal 0.000000e+00 0.000000e+00 1.000000e+00 + outer loop + vertex -1.250000e-01 6.250000e-02 1.250000e-01 + vertex -1.659288e-01 1.526565e-02 1.250000e-01 + vertex -1.338947e-01 6.361600e-04 1.250000e-01 + endloop + endfacet + facet normal 0.000000e+00 0.000000e+00 1.000000e+00 + outer loop + vertex -1.250000e-01 6.250000e-02 1.250000e-01 + vertex -1.338947e-01 6.361600e-04 1.250000e-01 + vertex -9.903656e-02 5.648000e-03 1.250000e-01 + endloop + endfacet + facet normal 0.000000e+00 0.000000e+00 1.000000e+00 + outer loop + vertex -7.242166e-02 2.870995e-02 1.250000e-01 + vertex -1.250000e-01 6.250000e-02 1.250000e-01 + vertex -9.903656e-02 5.648000e-03 1.250000e-01 + endloop + endfacet + facet normal 0.000000e+00 0.000000e+00 1.000000e+00 + outer loop + vertex -6.250000e-02 6.250000e-02 1.250000e-01 + vertex -1.250000e-01 6.250000e-02 1.250000e-01 + vertex -7.242166e-02 2.870995e-02 1.250000e-01 + endloop + endfacet + facet normal 0.000000e+00 -1.000000e+00 0.000000e+00 + outer loop + vertex 1.250000e-01 0.000000e+00 0.000000e+00 + vertex 1.250000e-01 0.000000e+00 1.250000e-01 + vertex 0.000000e+00 0.000000e+00 1.250000e-01 + endloop + endfacet + facet normal 0.000000e+00 -1.000000e+00 0.000000e+00 + outer loop + vertex 1.250000e-01 0.000000e+00 0.000000e+00 + vertex 0.000000e+00 0.000000e+00 1.250000e-01 + vertex 0.000000e+00 0.000000e+00 0.000000e+00 + endloop + endfacet + facet normal 0.000000e+00 -0.000000e+00 -1.000000e+00 + outer loop + vertex 1.250000e-01 1.250000e-01 0.000000e+00 + vertex 1.250000e-01 0.000000e+00 0.000000e+00 + vertex 0.000000e+00 0.000000e+00 0.000000e+00 + endloop + endfacet + facet normal 0.000000e+00 0.000000e+00 -1.000000e+00 + outer loop + vertex 0.000000e+00 1.250000e-01 0.000000e+00 + vertex 1.250000e-01 1.250000e-01 0.000000e+00 + vertex 0.000000e+00 0.000000e+00 0.000000e+00 + endloop + endfacet + facet normal -1.000000e+00 0.000000e+00 0.000000e+00 + outer loop + vertex 0.000000e+00 0.000000e+00 0.000000e+00 + vertex 0.000000e+00 1.250000e-01 1.250000e-01 + vertex 0.000000e+00 1.250000e-01 0.000000e+00 + endloop + endfacet + facet normal -1.000000e+00 0.000000e+00 0.000000e+00 + outer loop + vertex 0.000000e+00 0.000000e+00 0.000000e+00 + vertex 0.000000e+00 0.000000e+00 1.250000e-01 + vertex 0.000000e+00 1.250000e-01 1.250000e-01 + endloop + endfacet + facet normal 1.000000e+00 0.000000e+00 0.000000e+00 + outer loop + vertex 1.250000e-01 1.250000e-01 1.250000e-01 + vertex 1.250000e-01 0.000000e+00 0.000000e+00 + vertex 1.250000e-01 1.250000e-01 0.000000e+00 + endloop + endfacet + facet normal 1.000000e+00 -0.000000e+00 0.000000e+00 + outer loop + vertex 1.250000e-01 0.000000e+00 1.250000e-01 + vertex 1.250000e-01 0.000000e+00 0.000000e+00 + vertex 1.250000e-01 1.250000e-01 1.250000e-01 + endloop + endfacet + facet normal 0.000000e+00 1.000000e+00 0.000000e+00 + outer loop + vertex 1.250000e-01 1.250000e-01 1.250000e-01 + vertex 1.250000e-01 1.250000e-01 0.000000e+00 + vertex 0.000000e+00 1.250000e-01 1.250000e-01 + endloop + endfacet + facet normal 0.000000e+00 1.000000e+00 0.000000e+00 + outer loop + vertex 0.000000e+00 1.250000e-01 1.250000e-01 + vertex 1.250000e-01 1.250000e-01 0.000000e+00 + vertex 0.000000e+00 1.250000e-01 0.000000e+00 + endloop + endfacet + facet normal 0.000000e+00 0.000000e+00 1.000000e+00 + outer loop + vertex 1.250000e-01 1.250000e-01 1.250000e-01 + vertex 0.000000e+00 0.000000e+00 1.250000e-01 + vertex 1.250000e-01 0.000000e+00 1.250000e-01 + endloop + endfacet + facet normal 0.000000e+00 0.000000e+00 1.000000e+00 + outer loop + vertex 1.250000e-01 1.250000e-01 1.250000e-01 + vertex 0.000000e+00 1.250000e-01 1.250000e-01 + vertex 0.000000e+00 0.000000e+00 1.250000e-01 + endloop + endfacet +endsolid diff --git a/test.squish/shared/testdata/exchange/stl-examples/cubeCylinder_BIN.stl b/test.squish/shared/testdata/exchange/stl-examples/cubeCylinder_BIN.stl new file mode 100644 index 000000000..52219bf54 Binary files /dev/null and b/test.squish/shared/testdata/exchange/stl-examples/cubeCylinder_BIN.stl differ diff --git a/test.squish/suite_FEATURE_EXCHANGE/tst_STL-import/import.py b/test.squish/suite_FEATURE_EXCHANGE/tst_STL-import/import.py new file mode 100644 index 000000000..a184a0b1e --- /dev/null +++ b/test.squish/suite_FEATURE_EXCHANGE/tst_STL-import/import.py @@ -0,0 +1,22 @@ +from salome.shaper import model +import os + +stlDataDir = os.environ.get('SALOME_SRC_DIR')+ "/../SHAPER/test.squish/shared/testdata/exchange/stl-examples" + +model.begin() +partSet = model.moduleDocument() +Part_1 = model.addPart(partSet) +Part_1_doc = Part_1.document() +Import_1 = model.addImport(Part_1_doc, stlDataDir+"/cubeCylinder_BIN.stl") +Import_2 = model.addImport(Part_1_doc, stlDataDir+"/cubeCylinder_ASCII.stl") +model.do() +Import_1.setName("Compound_1") +Import_1.result().setName("Compound_1_1") +Import_1.result().subResult(0).setName("Compound_1_1_1") +Import_1.result().subResult(1).setName("Compound_1_1_2") +Import_2.setName("Compound_2") +Import_2.result().setName("Compound_2_1") +Import_2.result().subResult(0).setName("Compound_2_1_1") +Import_2.result().subResult(1).setName("Compound_2_1_2") +model.do() +model.end()