Hi…
I am trying to create Arrays of the underlying DataTypes to use them with Cuda.
The following Code works for the Types i need
GH_Boolean => Boolean
GH_Integer => int
GH_Number => double
GH_Vector => Vector3d
GH_Matrix => Matrix
GH_Surface => Brep
internal NewType[] HandleData<GH_Type, NewType>(GH_Type[] array) where GH_Type : GH_Goo
{
NewType[] newArray = new NewType[array.Length];
for (int i = 0; i < array.Length; i++)
{
Array[i] = (NewType)array[i].Value;
}
return newArray;
}
The only one where it does not work is GH_Point => Point3d. The reason is simple because GH_Point is not GH_Goo or GH_GeometricGoo respectively, but implements the IGH_Geometric interface. I am wondering, why that is the case and if it wouldnt be possible to have GH_Point being consistent with the other types.