From: rraphael Date: Fri, 11 Dec 2020 13:24:48 +0000 (+0100) Subject: import stl: put result into solid X-Git-Tag: V9_7_0a1~13^2~17 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=156b5b941ca6025c1567079604972fb69c568f82;p=modules%2Fshaper.git import stl: put result into solid --- diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_STLImport.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_STLImport.cpp index 1c0c6ce4c..f7ecae9d0 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_STLImport.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_STLImport.cpp @@ -21,7 +21,9 @@ #include "GeomAlgoAPI_Tools.h" #include #include - +#include +#include +#include std::shared_ptr STLImport(const std::string& theFileName, std::string& theError) @@ -36,6 +38,13 @@ std::shared_ptr STLImport(const std::string& theFileName, theError = "Can't import file."; aResShape.Nullify(); } + if(aResShape.ShapeType() == TopAbs_SHELL) + { + BRepBuilderAPI_MakeSolid soliMaker(TopoDS::Shell(aResShape)); + soliMaker.Build(); + if(soliMaker.IsDone()) + aResShape = soliMaker.Shape(); + } } catch (Standard_Failure const& anException) { theError = anException.GetMessageString();