BHoM / Rhinoceros_Toolkit

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

Rhinoceros_Engine: Add support for converting BH.oM.Geometry.NurbsCurve ToRhino in Rhino 7 #215

Closed rolyhudson closed 1 year ago

rolyhudson commented 2 years ago

I believe that for the method ToRhino(this BHG.NurbsCurve bCurve) all that is required is adding

case 7:
    return ToRhino6(bCurve)

Edit: The need for version specific methods for NurbsCurve converts arises due to differences between Rhino 5 and 6.

Rhino 7 will work with the methods defined in ToRhino6. My tests show the Rhino 5 is the only case where a special method is needed.

Current code structure suggests this approach will need upgrading with each new version of Rhino but with Rhino 7 this does not appear to be the case. I propose to change the code structure so that we have a standard ToRhino(BH.oM.Geometry.NurbsCurve) as per all the other convert method. ToRhino5(BH.oM.Geometry.NurbsCurve) is only called when the user is running Rhino5.

For reference @al-fisher + @rwemay + @alelom this issue has come up in pulling and converting Rapid Prototyping model options that use surfaces. The ToRhino method is called when rendering the geometry but also handy for converting back to rhino and leveraging rhino / grasshopper surface modelling tools.