This is a bug in OpenCascade (and is still present in 7.5.0). In BRepOffsetAPI_ThruSections.cxx, lines 482-499 are
Code: Select all
try {
// Calculate the resulting shape
if (myWires.Length() == 2 || myIsRuled) {
// create a ruled shell
CreateRuled();
}
else {
// create a smoothed shell
CreateSmoothed();
}
}
catch (Standard_Failure const&)
{
NotDone();
return;
}
// Encode the Regularities
BRepLib::EncodeRegularity(myShape);
When you only have the first two sections selected, it creates a ruled surface. This fails due to a zero-length normal, which throws an exception. That exception is nicely caught, calls
NotDone(), and returns without ever calling
BRepLib::EncodeRegularity(myShape);. However,
CreateSmoothed() fails
without an exception, it just
returns when it detects that it can't make the shell. So the catch is never hit, and
EncodeRegularity is called. It proceeds to try to use the TShape without ever checking it for null. And we die.
Is this something we should try to code around by doing our own detection, or just file an upstream bug report?