I’m developing a Grasshopper plugin that involves passing polyline data between components.
Here is a demo use case:
- Component comA:
- In:
rectangle3d
– iA - Out:
PolylineCurve
– oA
- In:
- Component comB:
- In:
PolylineCurve
(either from Rhino, or oA) – iB - Out:
PolylineCurve
– oB
- In:
As the Grasshopper SDK does not have a pManager.AddPolylineCurveParameter
, I guess what I should use is AddCurveParameter
for iB
Now I have several questions related to this process:
-
What should be the data type of oA?
PolylineCurve
orCurve
orGH_Curve
? -
What should be the data type of iB?
As I need to process iB as a polyline, if I usePolylineCurve
, Grasshopper will report error:Invalid Cast: Curve >> PolylineCurve
.
Or should I useGH_Curve
orCurve
? Then how should I cast it back toPolylineCurve
? -
When should
GH_Curve
be chosen overCurve
? It seems the SDK has implicit methods to automatically castCurve
toGH_Curve
, then is there any reason I should use it?