Access Violation in BRepAlgoAPI_Section::Build()

Hi,

I am getting an access violation in "BRepAlgoAPI_Section" and I really don't know why.
Can anybody reproduce this? Perhaps the brep shapes are invalid? Something else?
(VS2010 Pro, OCCT 6.6.0, Win32/Debug)


BRep_Builder builder;
bool ok;

TopoDS_Shape face;
ok = BRepTools::Read(face, "C:\\temp\\cutter\\face.brep", builder);
if (!ok ) throw std::exception("Cannot load face.brep");
context->Display(new AIS_Shape(face));

TopoDS_Shape tool;
ok = BRepTools::Read(tool, "C:\\temp\\cutter\\tool.brep", builder);
if (!ok ) throw std::exception("Cannot load tool.brep");
context->Display(new AIS_Shape(tool));

BRepAlgoAPI_Section cutter(face, tool, false);
cutter.Approximation(true);
cutter.ComputePCurveOn1(true);
cutter.Build();

First-chance exception at 0x01d87cbc in RapidRepair.exe: 0xC0000005: Access violation reading location 0xfefd0000.
Unexpected exception occurred

Vadim Mikhryutin's picture

Hi Thorsten,

0xfefd0000 is the standard null value for a handle.
The only handle in your code is context, so probably this is a bug in OCCT. Try posting this on bugtracker.

jelle's picture

Shouldnt you check for BRepAlgoAPI_Section.IsDone() ?

Thorsten H's picture

The exception occurrs in build()

Thorsten H's picture

Context is only for debug purposes. Without it the error occurrs too. In "cutter.build()"