ConvertToBeziers command in Grasshopper

I would like to access Rhino’s ‘ConvertToBeziers’ command from Grasshopper and get all the consecutive Bezier Spans from a NURBS curve in a list? Any suggestions?

https://developer.rhino3d.com/api/RhinoCommon/html/M_Rhino_Geometry_BezierCurve_CreateBeziers.htm

https://developer.rhino3d.com/api/RhinoCommon/html/M_Rhino_Geometry_BezierCurve_CreateCubicBeziers.htm

Thank you, that should clearly do the job. Can some body point me to an example how to use a Rhino Command within C#/VB withing Grasshopper or set me up an scripting component with “CreateBeziers”

private void RunScript(Curve C, ref object B)
  {
    BezierCurve[] bzCrvs = BezierCurve.CreateBeziers(C);
    NurbsCurve[] bzNurbs = new NurbsCurve[bzCrvs.Length];

    for (int i = 0; i < bzCrvs.Length; i++)
    {
      bzNurbs[i] = bzCrvs[i].ToNurbsCurve();
    }

    B = bzNurbs;
  }

ConvertToBeziers.gh (3.9 KB)

1 Like

Thank you Michael!