public static void CatmulRom(this PathWriter pw, double[] xyCoords) { Curve4Points curve4_points = pw._c4_points; pw.MoveTo(xyCoords[2], xyCoords[3]);//*** for (int i = 0; i < xyCoords.Length - (4 * 2);) { Curves.CatromToBezier( xyCoords[i], xyCoords[i + 1], xyCoords[i + 2], xyCoords[i + 3], xyCoords[i + 4], xyCoords[i + 5], xyCoords[i + 6], xyCoords[i + 7], pw._c4_points ); pw.Curve4(curve4_points.x1, curve4_points.y1, curve4_points.x2, curve4_points.y2, curve4_points.x3, curve4_points.y3 ); i += 2; } }