Closed adecler closed 3 years ago
See #540 for more.
I think we never return converted BHoM geometries, we always return BHoM Geometries. When a downstream component requests a different type the casting happens "on the wire", but the output of the component is still a BHoM Geometry. The problem comes from the fact that that the we return a string representation of the BHoM Geometries exactly equal to the gh one, and that is hugely misleading! https://github.com/BHoM/Grasshopper_Toolkit/blob/700b8ef1b3aa3b16993d4eb25a28a4453b6f4397/Grasshopper_Engine/Objects/Types/GH_IBHoMGeometry.cs#L99-L147 Maybe something like this might be clearer.
m_Value?.GetType().ToString() + " as " + GH_Format.FormatArc((Rhino.Geometry.Arc)value)
Description:
This is required to get access to
CastFrom(object source)
andCastTo<Q>(ref Q target)
methods. This will solve the problem of Rhino geometry not being casted back and forth (e.g.CreateCustom
&GetProperty
components).Related issues:
540: GetProperty returns unconverted BHoM geometries
529: CreateCustom does not convert breps
This will have to be done for 4.0 instead of 3.3 since this represent a change that can potentially break the components using
Param_ScriptVariable
.