Curve and surface fitting by implicit polynomials: Optimum degree finding and heuristic refinement. (October 2017)