OpenCascade does not load some brep file but if I try to load with FreeCad they works. The code is:
#include <QCoreApplication>
#include <BRepTools.hxx>
#include <BRep_Builder.hxx>
#include <unistd.h>
int main(int argc, char *argv[])
{
BRep_Builder brbp;
QCoreApplication a(argc, argv);
TopoDS_Shape entityOCC;
bool ret = BRepTools::Read(entityOCC,Standard_CString("draw.brep"), brbp);
if(ret == false)
{
printf("BREP read failed\n");fflush(0);
}else{
printf("CAD brep loaded\n");fflush(0);
}
if(entityOCC.IsNull())
{
printf("Null Shape\n");fflush(0);
}
return a.exec();
}
I am using OpenCascade Community edition 0.18.1-2.4 equivalent to 6.9.1
Edit:
When I execute the program I get an OpenCascade message: "Not a TShape table" But same file is opened with out problem with FreeCad.
It may be that these brep files contain some utf-8 strings. Similar situations occur when i try reading some step file with OpenCascade.