I want to create Nurbs curves which approximate a periodic planar curve well, while having a degree of 2 and as few control points as possible. What i have done so far is determine where the inflection points on the original curve are, and then set the minimal Nurbs control points to 2*inflection_points. from there, I manually adjust each control point so that the Nurbs curve approximates the original curve well, as shown below:

The black curve is the original planar curve which is baked into the Rhino environment. The red curve is a Nurbs curve with 8 manually moved control points, this process took half an hour.

Contrarily, this is what it looks like to use the Rebuild Curve function with degree set to two and 8 control points:

You can see that this is a significantly worse result. But I do not want to spend 30 minutes on every curve optimizing the control points. Any idea how to do this?

I had a go just connecting your variables to goat and optimising to minimise squared distance from a few sampled points to the original curve: FitReducedNurbs_goat.gh (22.6 KB)
Seems to work pretty well (I just used the default solver options).

I’d really like to.
But my knowledge about c# constantly goes up and down (i forget everything in some day… i got problems) … the VB part + finalizing the script would take some 3/4 days for me… by doing nothing else.
So… or i start and finish that in that same week, or i have to start again in future.
I haven’t found a quiet week to put it down since that post of mine, sadly…