@mombandre

Please see this were is explains the *Chaikins Algorithm*, and which I used to implement it as well. Hehehe first one that appears in google search and also a very straight forward paper.

To use it, copy and paste the following code in a C# component in Grasshopper.

```
private void RunScript(List<Point3d> pts, int Iterations, ref object A)
{
// More iterations = more precision
// Input a list of points, which would be the contol points
A = ChaikinsAlgorithm(pts, Iterations);
}
// <Custom additional code>
public Polyline ChaikinsAlgorithm(List<Point3d> cPoints, int iterations)
{
// Include startPt
Point3d st = cPoints[0];
// Include EndPt
Point3d end = cPoints[cPoints.Count - 1];
int i = 0;
while (i < iterations)
{
List<Point3d> newCPs = new List<Point3d>();
for (int j = 0; j < cPoints.Count; j++)
{
if(j < cPoints.Count - 1)
{
// Implementing Chaikins method... 3/4 , 1/4 stuff
Point3d quarter = ((cPoints[j + 1] - cPoints[j]) * 0.25) + cPoints[j];
Point3d threeFourths = ((cPoints[j + 1] - cPoints[j]) * 0.75) + cPoints[j];
newCPs.Add(quarter);
newCPs.Add(threeFourths);
}
}
newCPs.Insert(0, st);
newCPs.Insert(newCPs.Count - 1, end);
cPoints = newCPs;
i++;
}
return new Polyline(cPoints);
}
```

I think perhaps the easiest way to go is instead of trying to find out the exact formula of an input curve ( sounds very complicated) you can use an approximation method given a tolerance. This would be much easier and perhaps much more manageable. That will fit in the idea of calculus, right? How small is enough? limits… etc.