I am using the rayshoot method in python on windows. After some iterations, rhino crashes.
Essentially when the code runs through a certain number of iterations it crashes. Less than this limit it works as expected. It is not running out of RAM, since I can monitor the usage and it sits around 270mb (computer has 128gb). It is not hitting an array limit (its a dict of around 900 key/value), and I checked rhino python interpreter is returning an error if it exceeds the limit (during my debugging).
When the code runs more iterations than it can (which is about 2 seconds of computation time, then on higher iteration takes 10 seconds ) and crashes, rhino just shuts off completely. There is no freezing, hanging, or windows error message, it just closes and thats it. Is there a log or way to figure out the traceback on what caused Rhino to shut off?
Python has a maximum recursion depth set to 996 by default. The issue was that instead of Rhino elegantly returning that error, the recursion depth limit triggers a runtime error and causes Rhino to crash. This could be checked by rhino and return in a non fatal way.
This code run in a local python will return ’ RuntimeError: maximum recursion depth exceeded’ but will make rhino close without any error returned. You can verify it works by changing the count to 900.