BHoM / Rhinoceros_Toolkit

Set of functionalities for communication with Rhinoceros
GNU Lesser General Public License v3.0
6 stars 2 forks source link

Calling Rhino.Join from convert to Polycurve sometimes leads to a full Rhino crash #220

Closed IsakNaslundBh closed 2 years ago

IsakNaslundBh commented 2 years ago

Description:

In some cases, especially if dragging sliders and rapidly changing geometry Rhino crashes. A case identified looking at the Rhino crash report is the call to Rhino Join curves here:

https://github.com/BHoM/Rhinoceros_Toolkit/blob/ebe6f06321d0c3a90946d142664297e49d66a2de/Rhinoceros_Engine/Convert/ToRhino.cs#L278

The error thrown is a System access violation exception from the unmanaged c++ backend of rhino, and is not an exception that can be caught and is as mentioned leading to a full on Rhino crash.

Steps to reproduce:

Slightly tricky to reproduce as only happening sporadically. Cases found so far is when trying to display a significant amount of Poly curves at the same time and then rapidly changing them by, for example, dragging a slider in GH.

Expected behaviour:

For the same functional behaviour to remain, but avoiding making the risky call to the rhino method. Suggestion is to check if the curves are joined using BHoM methods instead of relying on the rhino ones.

Test file(s):

Will be provided in the PR.

Issue linked to #113 that introduced those lines