public static int InsertBezierHandle(CadFigure fig, int idx1, int idx2) { CadVertex a = fig.GetPointAt(idx1); CadVertex b = fig.GetPointAt(idx2); CadVertex hp1 = b - a; hp1 = hp1 / 3; hp1 = hp1 + a; CadVertex hp2 = a - b; hp2 = hp2 / 3; hp2 = hp2 + b; hp1.IsHandle = true; hp2.IsHandle = true; fig.InsertPointAt(idx1 + 1, hp1); fig.InsertPointAt(idx1 + 2, hp2); return(2); }