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_Cut bug in cutting overlapping solids, plus suggested work around

Steve Lockley's picture

I have been having problems with BRepAlgoAPI_Cut when I have two solids that have overlapping faces and where one solid is not entirely inside the other. Think of a small cube and a large cube that share one corner. OpenCascade constantly crashed when trying to cut these.
In the end I have tracked it down to a failure in the Angle2D method of BOP_WireSplitter. At the end of this function it creates a gp_Dir2d instance and then crashes when it calls the Angle function. The last two lines are

gp_Dir2d aDir2D(aV2D);

return anAngle;

It appears that in my case both the X and Y value of aDir2D are 0. I haven't had time to work out why but I discovered that if I check for this and just return 0 all works well.

if(aV2D.X()==0 && aV2D.Y()==0)
return 0;
gp_Dir2d aDir2D(aV2D);

return anAngle;

Now I don't know if this is correct, I am not good enough at OpenCascade, but it does work. I would appreciate any comments or if you are more knowledgable and know of another way to fix this properly I would be very greatful. I also have found a problem with cutting using semi-infinite solids which I still looking at. Essentially the wire and face exploration parts of BRepAlgoAPI_Cut don't like to find that the top face is in infinity...any ideas?

Steve Lockley's picture

Can anyone at OpenCascade confirm this is a reasonable fix please?

Forum supervisor's picture

Hello Steve,

Thank you for reporting the problem and suggesting a workaround.
This problem is now registered in our bug tracker as bug OCC21518, and your workaround is attached. Please consult the Release Notes of Open CASCADE Technology for the information about integration of fix.

Best regards,
Forum Supervisor

Steve Lockley's picture

I've had a couple of bugs I've found accepted but the fixes are only available in none-open source releases. Could you advise please when these will be availbale to open source community or perhaps privately what licensing options I can take to get updates

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.