For all issues regarding the Forums use, please, refer to the Forum Rules.

Our Solutions

Need professional assistance?
Consider our:

Support Offerings

 

Need to speed up your development?
Have a look at our:

Samples & Tools

 

Need some functionality extending standard OCCT capabilities?
Check out our:

Adv. Components

Related pages

BRepAlgoAPI_Common fails on 2 shapes loaded from files

Dima's picture
Forums: 

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.

Contact us

Attention: DO NOT use this form for all kind of request for the removal of your personal data. Please follow this link for such cases.