Improved Contraction-Expansion Algorithm for Curve and Surface Fitting