BRepAlgoAPI_Common fails on 2 shapes loaded from files

Hello.

I'm new with OCC. Actually I'm faced a strange problem when creating shape intersection.

The code is as following:

IGESControl_Reader reader;
IFSelect_ReturnStatus status =
reader.ReadFile( "D:/work/data/shape.igs" );
reader.TransferRoots();
TopoDS_Shape first_shape = reader.OneShape( );

IGESControl_Reader reader2;
IFSelect_ReturnStatus status2 = reader2.ReadFile( "D:/work/data/prism.igs" );
reader2.TransferRoots();
TopoDS_Shape second_shape = reader2.OneShape( );

TopoDS_Shape common;
try {
common = BRepAlgoAPI_Common(first_shape, second_shape);
} catch (Standard_Transient& e) {

}

IGESControl_Writer wr;
wr.AddShape(common);
wr.ComputeModel();
wr.Write("D:/work/data/common.igs");

Actually OCC drops assertion on "wr.AddShape(common);" and common is not empty but not and intersection.

Guys, any suggestions on this?

Attachments: 
Dima's picture

Btw, if try to find Fuse of these 2 shapes, then I get valid union of 2 shapes.