I've been developing a DLL in C++ that uses OpenCascade. The application that makes use of it is developed in Delphi. The "hooking" mechanism is achieved by exporting classes and functions in the DLL and writing Delphi code that will understand them. So far, so good.
I don't recall having any problems like this before, but today I found something really bizarre.
One of the methods implemented in the DLL allows the user to cut a solid with a face thus dividing the solid in two (or more, depending on the shape). To do that, I use the Fuse operation plus a few extra tricks. If I run the Delphi executable from Windows Explorer or from Visual Studio (with or without the debugger attached to it), everything works as expected. However, if I run the executable from Delphi, either with or without the debugger attached, the operation misses a few faces. It's the same program and the same test case, still the results differ.
I have no clue how the launching application can affect the behavior of the same executable in OCC's internals. If anyone has an idea, please tell me.
Here's the wrong result: http://ceniza666.googlepages.com/fusebad.png
Here's the right result:
The tree nodes named "Element" represent Faces. In 'wrong' you can see that each Subspace has only 5 faces, instead of 6. In 'right' the number of faces is correct, and even one of them "Element 4" belonged to the shape before the fuse operation.