Hi
I have a C# code question I can’t solve. I hope someone can help me pointing in the right direction. I’m writing a curve subdivision code in C#, but I’m stuck at the last statement, which is creating a curve in the Rhino interface. Any help will be much appreciated.
for (int j = 0; j < iterationCount; j++)
{
List<Point3d> newControlPoints = new List<Point3d>();
for (int i = 0; i < controlPoints.Count - 1; i++)
{
Point3d oneQuarterPoint = 0.75 * controlPoints[i] + 0.25 * controlPoints[i + 1];
newControlPoints.Add(oneQuarterPoint);
Point3d threeQuarterPoint = 0.25 * controlPoints[i] + 0.25 * controlPoints[i + 1];
newControlPoints.Add(threeQuarterPoint);
}
controlPoints = newControlPoints;
}
curve = new PolylineCurve(controlPoints);
19_1119_C#_Intro.gh (8.3 KB)