I am trying to evaluate OCC for performing complex boolean operations. I've put together following simple cpp program that demonstrates a possible bug in OCC which leads to perpetual hang with 90% CPU usage by the process.
The program attached is single cpp file, with compilation instructions. Just replace $OCC_INSTALL_DIR by the path in which you have OCC 6.5.3 (or any older version) installed. On successful build and run, it will generate an STL at /tmp/0.stl. If you change the value of TOTAL to be greater than 10, you may see the perpetual hang I am talking about. I can get this program to work for all values of TOTAL 10 that I've tried.
I've compiled and run this program on older versions of OCC (6.5.0, 6.3.0) and I see failures of different kind. Sometimes I get Standard_ConstructionError and other times it hangs as described above. Strangely enough when I run an equivalent program written on top of PythonOCC (which I believe uses same 6.3.0 libraries I used with native program), it runs successfully.
You can also see the code at the link https://gist.github.com/3606545