Merge branch 'binary_brep' into 'master'

allow reading of binary brep files

See merge request ngsolve/netgen!654
This commit is contained in:
Lackner, Christopher 2024-06-24 18:28:10 +02:00
commit 32f291c66e

View File

@ -14,6 +14,7 @@
#include "occgeom.hpp" #include "occgeom.hpp"
#include "Partition_Spliter.hxx" #include "Partition_Spliter.hxx"
#include <BinTools.hxx>
#include <BOPAlgo_Builder.hxx> #include <BOPAlgo_Builder.hxx>
#include <BRepBndLib.hxx> #include <BRepBndLib.hxx>
#include <BRepBuilderAPI_Copy.hxx> #include <BRepBuilderAPI_Copy.hxx>
@ -1636,10 +1637,14 @@ namespace netgen
BRep_Builder aBuilder; BRep_Builder aBuilder;
Standard_Boolean result = BRepTools::Read(occgeo->shape, filename.string().c_str(), aBuilder); Standard_Boolean result = BRepTools::Read(occgeo->shape, filename.string().c_str(), aBuilder);
if(!result)
{
result = BinTools::Read(occgeo->shape, filename.string().c_str());
if (!result) if (!result)
{ {
delete occgeo; delete occgeo;
return NULL; throw Exception("Could not read BREP file " + filename.string());
}
} }
occgeo->changed = 1; occgeo->changed = 1;