The application of piecewise polynomials to problems of curve and surface approximation