From 156b5b941ca6025c1567079604972fb69c568f82 Mon Sep 17 00:00:00 2001 From: rraphael Date: Fri, 11 Dec 2020 14:24:48 +0100 Subject: [PATCH] import stl: put result into solid --- src/GeomAlgoAPI/GeomAlgoAPI_STLImport.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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(); -- 2.39.2