-// Copyright (C) 2014-2020 CEA/DEN, EDF R&D
+// Copyright (C) 2014-2023 CEA, EDF
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
#include <GeomAlgoAPI_STLImport.h>
+
#include "GeomAlgoAPI_Tools.h"
+
+#include <Basics_OCCTVersion.hxx>
+
+#include <TopoDS.hxx>
#include <TopoDS_Shape.hxx>
-#include <StlAPI_Reader.hxx>
#include <TopoDS_Shell.hxx>
-#include <TopoDS.hxx>
#include <BRepBuilderAPI_MakeSolid.hxx>
+#include <BRepBuilderAPI_Sewing.hxx>
+#include <StlAPI_Reader.hxx>
std::shared_ptr<GeomAPI_Shape> STLImport(const std::string& theFileName,
std::string& theError)
theError = "Can't import file.";
aResShape.Nullify();
}
+#if OCC_VERSION_LARGE >= 0x07070000
+ BRepBuilderAPI_Sewing aSewingTool;
+ aSewingTool.Init(1.0e-06, Standard_True);
+ aSewingTool.Load(aResShape);
+ aSewingTool.Perform();
+ TopoDS_Shape aSewedShape = aSewingTool.SewedShape();
+ if (!aSewedShape.IsNull())
+ aResShape = aSewedShape;
+#endif
if(aResShape.ShapeType() == TopAbs_SHELL)
{
BRepBuilderAPI_MakeSolid soliMaker(TopoDS::Shell(aResShape));