Optimal Design of Curves by B-Spline Functions