From 901ba4f298d9a24e4ca6f3cae8c223b7c51da7d8 Mon Sep 17 00:00:00 2001 From: jfa Date: Fri, 10 Mar 2023 15:32:01 +0000 Subject: [PATCH] Porting Salome to OCCT 7.7.0 --- src/STLPlugin/STLPlugin_ImportDriver.cxx | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/STLPlugin/STLPlugin_ImportDriver.cxx b/src/STLPlugin/STLPlugin_ImportDriver.cxx index 319535473..b63c54600 100644 --- a/src/STLPlugin/STLPlugin_ImportDriver.cxx +++ b/src/STLPlugin/STLPlugin_ImportDriver.cxx @@ -24,6 +24,7 @@ // KERNEL includes #include #include +#include // GEOM includes #include "GEOM_Function.hxx" @@ -34,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -70,7 +72,7 @@ Standard_Integer STLPlugin_ImportDriver::Execute(Handle(TFunction_Logbook)& log) TCollection_AsciiString aFileName = aData.GetFileName().ToCString(); - MESSAGE( "Import STL to file " << aFileName ); + MESSAGE( "Import STL from file " << aFileName ); // Set "C" numeric locale to save numbers correctly Kernel_Utils::Localizer loc; @@ -82,6 +84,16 @@ Standard_Integer STLPlugin_ImportDriver::Execute(Handle(TFunction_Logbook)& log) if( aShape.IsNull() ) return 0; +#if OCC_VERSION_LARGE >= 0x07070000 + BRepBuilderAPI_Sewing aSewingTool; + aSewingTool.Init(1.0e-06, Standard_True); + aSewingTool.Load(aShape); + aSewingTool.Perform(); + TopoDS_Shape aSewedShape = aSewingTool.SewedShape(); + if (!aSewedShape.IsNull()) + aShape = aSewedShape; +#endif + // Fix the orientation of closed shell or solid. if( BRep_Tool::IsClosed( aShape ) ) { TopAbs_ShapeEnum aType = aShape.ShapeType(); -- 2.39.2