While testing the Rhinoceros_Toolkit, I realised we cannot do this currently:
This is because Rhino does not has a parent class for all of its geometries (the highest abstraction it has is GeometryBase but e.g. a Point is not a GeometryBase). Effectively, the highest parent class to Rhino's geometries is System.Object.
which needed in order to make the Grasshopper Goos work.
However (after a discussion with @al-fisher and @IsakNaslundBh) we realized that the logic should belong to a IFromRhino(object obj) method in Rhinoceros_Toolkit, because this is really a "Convert" logic belonging to Rhino, not Grasshopper. The Grasshopper GH_IBHoMGeometry.CastFrom() method should call Rhino's IFromRhino(object obj).
Suggestions to restore compliance:
Move the logic inside GH_IBHoMGeometry.CastFrom() to a new IFromRhino(object obj) method in Rhinoceros_Toolkit.
Broken rules:
While testing the Rhinoceros_Toolkit, I realised we cannot do this currently:
This is because Rhino does not has a parent class for all of its geometries (the highest abstraction it has is
GeometryBase
but e.g. aPoint
is not aGeometryBase
). Effectively, the highest parent class to Rhino's geometries isSystem.Object
.However, we can do this:
This is because we have this logic: https://github.com/BHoM/Grasshopper_Toolkit/blob/97068c716ce0690fd0f1057e1ac6898a47039fc5/Grasshopper_Engine/Objects/Types/GH_IBHoMGeometry.cs#L200-L231
which needed in order to make the Grasshopper Goos work.
However (after a discussion with @al-fisher and @IsakNaslundBh) we realized that the logic should belong to a
IFromRhino(object obj)
method in Rhinoceros_Toolkit, because this is really a "Convert" logic belonging to Rhino, not Grasshopper. The GrasshopperGH_IBHoMGeometry.CastFrom()
method should call Rhino'sIFromRhino(object obj)
.Suggestions to restore compliance:
Move the logic inside
GH_IBHoMGeometry.CastFrom()
to a newIFromRhino(object obj)
method in Rhinoceros_Toolkit.