Elsevier

Computer-Aided Design

Volume 128, November 2020, 102905
Computer-Aided Design

Fast Automatic Knot Placement Method for Accurate B-spline Curve Fitting,☆☆

https://doi.org/10.1016/j.cad.2020.102905Get rights and content

Highlights

  • We automatically compute a set of knots that enable low error approximation for smooth datasets.

  • Our algorithm is fast, run-time scaling linearly with the input data size.

  • We can give a good estimate of the number of knots needed for a given error threshold.

Abstract

The choice of knot vector has immense influence on the resulting accuracy of a B-spline approximation of a curve. However, despite the significance of this problem and the various solutions that were proposed in the literature, optimizing the number and placement of knots remains a difficult task. This paper presents a novel method for the approximation of a curve by a B-spline of arbitrary order, which automatically determines a knot vector that achieves high approximation quality. At the core of our approach is a feature function that characterizes the amount and spatial distribution of geometric details in the input curve by estimating its derivatives. Knots are then selected in such a way as to evenly distribute the feature contents across their intervals. A comparison to the state of the art for a wide variety of curves shows that our method is faster and achieves more accurate reconstruction results, while typically reducing the number of necessary knots.

Introduction

Curve fitting using B-splines is a fundamental problem in many applications such as computer-aided design (CAD), geometric modeling, and reverse engineering [1], [2]. High-accuracy fitting is also being explored in data analysis and compression for large scale simulations [3]. The problem of B-spline curve fitting involves finding a B-spline curve that minimizes the least squares error between a sequence of input data points and the fitted spline [4], [5]. In this type of fitting problem, variables include the order of the B-spline, the number of knots, the knot locations, and the control point values.

Often, a uniform knot vector with a predetermined number of knots is used. Fixing the knot vector and optimizing only the control points reduces the B-spline fitting problem to a linear least squares problem. However, using uniform knots may fail to capture details of the input dataset. In contrast, solving for the knot vector in addition to the control points can improve the fitting result dramatically [6], leading to the problem of knot optimization.

Knot optimization consists of finding the placement of as few knots as possible for a B-spline curve that fits some desired approximation error criterion. This is a challenging problem for two reasons. First, the unknown number and locations of knots result in a large and nonlinear optimization problem, which is computationally difficult. Second, analytic expressions for optimal knot locations, or even for general characteristics of optimal knot distributions for a desired error criterion, are not easy to derive [6].

In this work, we use the derivatives of the input data to calculate a feature function that captures the amount and distribution of detail in the data, where higher feature values indicate that a higher knot density is needed to capture the detail and reach the desired approximation error tolerance. Using the cumulative distribution function (CDF) of the feature function, interior knots are distributed, such that higher feature values result in more knots. This approach affords the fitted B-spline more flexibility in those locations, thereby reducing the approximation error. Fig. 1 shows an overview of our knot placement method for an approximation using an order-3 B-spline. Given an input dataset (Fig. 1a) and its third derivative (Fig. 1b), our method calculates a CDF of the feature function (Fig. 1c) using the third derivative. Knot locations, indicated by the black triangles, are determined by a set amount of variation of the feature function (Fig. 1d). The approximation is solved using the resulting knot vector, successfully capturing the detail of the input data points (Fig. 1e).

Our approach works for 1-dimensional input data and parametric curves in 2 or higher dimensions. It is fast and produces high accuracy approximation for a wide range of input data that are smooth and sampled densely enough for high-order derivatives to be estimated from the data. The order of the derivatives depends on the order of the B-spline used for the approximation. The knot placement method works for a B-spline approximation of any order, with the resulting approximation error close to a user-supplied target error.

The remainder of the paper starts with a presentation of related work in Section 2. Section 3 briefly reviews technical details of B-spline approximation. We present our method in Section 4, and compare it with prior work in Section 5. Finally, conclusions are drawn, and future work is discussed in Section 6.

Section snippets

Related work

Knot optimization for B-spline fitting is a well studied topic. Many approaches can be found in the literature. Piegl and Tiller [4] proposed their new knot placement method (NKTP) that places knots with averages of representative parameters forgroups of input points. This leads to a stable system of equations and a uniform distribution of knots along the parameter domain. Liang et al. [7] describe an iterative knot insertion (IKI) method that starts with the fewest knots possible, finds knot

Preliminary

We review the basics of B-spline in this section, and refer interested readers to Farin [31] for more in-depth material.

A B-spline of order p is a piecewise polynomial function of order p (degree p1) with n control points, and is defined by C(u)=i=1nNi,p(u)Pi,utp,tn+1,where C(u) is the B-spline curve at parameter location u, Pi are the control points, and Ni,p are the pth order B-spline basis functions defined over the knot vector T=t1,t2,,tn+p. We define our B-spline knot vector with

Methodology

Our work is motivated by the idea that an order-p B-spline has a piecewise constant (p1)th derivative, where derivative discontinuities mark the knot locations, as shown in Fig. 2. Given a set of points sampled from an order-p B-spline, one can recover the original B-spline knots by locating the discontinuities in the (p1)th derivative. In practice, the input data points will not be sampled from a B-spline, and will not, in general, have distinct discontinuities in their derivatives.

Experimental results

The performance of our knot placement algorithm was tested against six prior works. We implemented each of the other methods in MATLAB.

Table 1 lists the algorithms, their labels used in the comparison plots, and the main idea of each method. “Instant” refers to placing knots without any iterative process. “Iterative” indicates that a repeated adjustment of the knots is done to improve the approximation. “Locally iterative” indicates that, at each iteration, a small local system is solved,

Conclusion and discussion

We introduced a novel knot placement optimization method that analyzes high-order derivatives of the input data, and generates a knot placement such that the resulting least squares fit has low error. We demonstrated our method’s effectiveness by comparing it to a number of state-of-the-art knot placement methods, and showed that our method can achieve comparable or higher approximation accuracy using fewer knots for a range of 1D and parametric datasets. Our method is also computationally

Declaration of Competing Interest

The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.

Acknowledgments

This work is supported by Advanced Scientific Computing Research, Office of Science, U.S. Department of Energy , under Contract DE-AC02-06CH11357, program manager Laura Biven.

References (34)

  • YauH.-T. et al.

    Real-time nurbs interpolation using fpga for high speed motion control

    Comput Aided Des

    (2006)
  • HoschekJ. et al.

    Fundamentals of computer aided geometric design

    (1993)
  • PeterkaT. et al.

    Foundations of multivariate functional approximation for scientific data

  • PieglL. et al.

    The NURBS book

    (1997)
  • JuppD.

    Approximation to data by splines with free knots

    SIAM J Numer Anal

    (1978)
  • LiangF. et al.

    A novel knot selection method for the error-bounded b-spline curve fitting of sampling points in the measuring process

    Meas Sci Technol

    (2017)
  • DungV.T. et al.

    A direct method to solve optimal knots of b-spline curves: An application for non-uniform b-spline curves fitting

    PLoS One

    (2017)
  • Cited by (29)

    • Nonparametric density estimation with nonuniform B-spline bases

      2024, Journal of Computational and Applied Mathematics
    • Fourier-informed knot placement schemes for B-spline approximation

      2023, Mathematics and Computers in Simulation
    • Geometrically designed variable knot splines in generalized (non-)linear models

      2023, Applied Mathematics and Computation
      Citation Excerpt :

      Such non-linear models have been considered in the Normal case by e.g. [24] but the direct ML estimation of the knot locations requires non-linear least squares optimization, which is often computationally prohibitive with corresponding complications and limitations (due to e.g. multiple extrema, knot confounding or lethargy problems; cf. Beliakov [2], Jupp [17], Zhou and Shen [40] and Kovács and Fekete [21]). Alternative data driven procedures to estimate the knot positions have been proposed by many authors in the Normal case (see e.g. [30,39]). A brief review of the related literature on Normal free-knot spline regression is provided by Kaishev et al. [18].

    • Data approximation by L<sup>1</sup> spline fits with free knots

      2022, Computer Aided Geometric Design
      Citation Excerpt :

      Laube et al. (2018) develop support vector machine method which considers multiple features including curvature, angle and distance to neighbors. Yeh et al. (2020) select the knots by evenly distributing the “geometric feature contents” based on estimated derivatives of a certain order. The limitation of this strategy is that knots must be data points and not completely free.

    View all citing articles on Scopus

    This paper has been recommended for acceptance by J. Peters.

    ☆☆

    This research project is funded by the U.S. Department of Energy, under Contract DE-AC02-06CH11357.

    View full text