摘要

In this paper we present a local fitting algorithm for converting smooth planar curves to B-splines. For a smooth planar curve a set of points together with their tangent vectors are first sampled from the curve such that the connected polygon approximates the curve with high accuracy and inflexions are detected by the sampled data efficiently. Then, a G(1) continuous Bezier spline curve is obtained by fitting the sampled data with shape preservation as well as within a prescribed accuracy. Finally, the Bezier spline is merged into a C(2) continuous B-spline curve by subdivision and control points adjustment. The merging is guaranteed to be within another error bound and with no more inflexions than the Bezier spline. In addition to shape preserving and error control, this conversion algorithm also benefits that the knots are selected automatically and adaptively according to local shape and error bound. A few experimental results are included to demonstrate the validity and efficiency of the algorithm.