You are on page 1of 26

Accepted Manuscript

Curve and surface fitting models based on the diagonalizable differential


systems

Chong-Jun Li, Lin-Lin Xie, Wen-Bin Du, Hai-Dong Li, Huan Bao

PII: S0377-0427(17)30208-X
DOI: http://dx.doi.org/10.1016/j.cam.2017.04.037
Reference: CAM 11117

To appear in: Journal of Computational and Applied


Mathematics
Received date : 12 October 2016
Revised date : 18 April 2017

Please cite this article as: C.-J. Li, et al., Curve and surface fitting models based on the
diagonalizable differential systems, Journal of Computational and Applied Mathematics (2017),
http://dx.doi.org/10.1016/j.cam.2017.04.037

This is a PDF file of an unedited manuscript that has been accepted for publication. As a service to
our customers we are providing this early version of the manuscript. The manuscript will undergo
copyediting, typesetting, and review of the resulting proof before it is published in its final form.
Please note that during the production process errors may be discovered which could affect the
content, and all legal disclaimers that apply to the journal pertain.
Curve and Surface Fitting models based on the
diagonalizable differential systems I

Chong-Jun Li∗, Lin-Lin Xie, Wen-Bin Du, Hai-Dong Li, Huan Bao
School of Mathematical Sciences, Dalian University of Technology, Dalian 116024,China

Abstract

Curve and surface fitting is an important problem in computer aided geomet-


ric design, including many methods, such as the B-spline method, the NURBS
method and so on. However, many curves and surfaces in the natural or en-
gineering fields need to be described by differential equations. In this paper,
we propose a new curve and surface fitting method based on the homogeneous
linear differential systems. In order to approximate general curves or sur-
faces well, the diagonalizable differential systems with variable coefficients are
adopted, which have explicit solutions. The fitting algorithms are presented for
curves and surfaces from discrete points. Some numerical examples show that
the two algorithms can obtain good fitting accuracy as the B-spline method.
Keywords: Curve fitting; Surface fitting; Differential system; Explicit
solution; B-spline

1. Introduction

Curve and Surface reconstruction is an important process in Computer Aided


Design and Manufacturing. Many surfaces, such as aeroengine blades and air-
foils need be designed to satisfy some corresponding aerodynamic differential
equations. However, the traditional surface construction methods based on the

I This work was supported by the National Natural Science Foundation of China (Nos.

11290143 and 11471066), the Fundamental Research of Civil Aircraft (MJF-2012-04), and the
Fundamental Research Funds for the Central Universities (DUT15LK44).
∗ Corresponding author: Chong-Jun Li

Email: chongjun@dlut.edu.cn

Preprint submitted to Journal of LATEX Templates May 12, 2017


discrete geometric data, such as the standard B-spline and NURBS methods,
do not directly represent the kinetic properties of the surfaces.
Some methods have been proposed to construct the curves or surfaces ac-
cording to their physical constraints such as hydrodynamic and aerodynamic
constrains. Ye et al. [1] developed a method for the geometric design of func-
tional surfaces directly from their underlying physical constraints which involve
normal vectors of the surfaces.
Miura et al. [2, 3, 4] proposed the streamline modeling to overcome the
instability problem of traditional shape representation schemes. Streamlines
are a family of curves that are instantaneously tangent to the velocity vector of
the flow. In streamline modeling, directions of the tangent vectors not positions
of the control points are blended to define the streamlines and a surface is
constructed as a set of streamlines. In their models, if the first partial derivative
of the surface with respect to the arc length parameter s is known, then the
surface S(s, t) can be defined by
Z s
∂S(s, t)
S(s, t) = S(s0 , t) + ds, (1)
s0 ∂s

where s0 is a fixed point in s parameter space and the curve S(s0 , t) is called
an initial curve.
In addition, the machining of free-form surfaces is usually done on 3- or
5-axis CNC machines. When machined surfaces require certain finish quality
or superior aerodynamic effect, it is sometimes desirable to be machined with
boundary-conformed or streamline-like toolpaths [5, 6, 7].
As mentioned above, the construction of streamlines has been involved in
both CAD and CAM. In fact, the streamline can be regraded as a solution
curve determined by a corresponding differential dynamic system with the ini-
tial point. Recently, Yang et al. [8] showed that free-form curves with properly
defined basis functions were the solutions of linear differential systems. Li et al.
[9] proposed a method for reconstruction of a linear ordinary differential sys-
tem with good accuracy from a set of non-degenerate discrete sample points of
the solution. The linear ordinary differential system considered in [9] only con-

2
tains a constant coefficient matrix, thus, the corresponding solution curves are
a special kind of streamlines in exponential matrix form. However, the general
curves can not be represented by a simple homogeneous linear differential sys-
tem with constant coefficients. In this paper, we improve the differential system
by using variable coefficients so that more streamlines can be reconstructed well.
The surface is also reconstructed as a set of streamlines, and each streamline
is represented as a solution curve of a linear differential system with variable
coefficients.
Our main works are as follows. In section 2, we introduce the method for
curve fitting based on homogeneous linear differential system with constant co-
efficients. In section 3, the diagonalizable differential system is adopted, such
that the solutions can be represented explicitly in exponential matrix form. An
algorithm is proposed for constructing the solution curve to fitting the given
discrete points. Several numerical examples show that the algorithm can obtain
good accuracy as the B-spline method, and satisfy the end interpolation condi-
tions. In section 4, we extend this algorithm to the case of surface to fitting the
given discrete points, which can also obtain satisfactory accuracy.

2. The streamline fitting model based on the linear differential system


with constant coefficients

For a given set of discrete points of a target curve, Xi = (xi , yi , zi ) ∈ R3 , i =


0, 1, 2, · · · , n, the problem is to reconstruct the curve X(t) as a solution of a
homogeneous linear differential system (LDS) with an initial condition, i.e.,

 dX(t) = AX(t),
dt
(2)
 X(0) = X ,
0

where A ∈ R3×3 is an unknown matrix to be determined.


When A is a constant matrix, Eq. (2) is the simplest differential dynamic
system, and the solution can be represented explicitly by

X(t) = eAt X0 , (3)

3
where the exponential of the matrix A is defined by the Taylors series
t2 2 tk
eAt = I + tA + A + · · · + Ak + · · · . (4)
2! k!
Parameterized the discrete points by Xi = X(ti ), i = 0, 1, · · · , n, then the re-
construction problem can be expressed as the fitting problem
n
X n
X
P0 model : min kX(ti ) − Xi k2 = min keAti X0 − Xi k2 . (5)
A∈R3×3 A∈R3×3
i=0 i=0

However, the above optimization problem cannot be solved directly, since the
unknown matrix A is involved in the Taylors series of the exponential function.
We need revise the original P0 problem by the following two approximate prob-
lems.
1) By the LDS (2), the P0 model can be transformed to the following problem
Xn 2
dX(ti )
min − AXi
A∈R 3×3 dt . (6)
i=0

Let ∆ti = ti − ti−1 , i = 1, 2, . . . , n. The derivatives can be approximated by


numerical differentiations, for example, by two points scheme,
dX(ti ) Xi − Xi−1
' , i = 1, 2, . . . , n, (7)
dt ∆ti
or by three points scheme,
dX(ti ) ∆ti ∆ti+1 − ∆ti ∆ti+1
' Xi+1 + Xi − Xi−1 .
dt ∆ti+1 (∆ti + ∆ti+1 ) ∆ti ∆ti+1 ∆ti (∆ti + ∆ti+1 )
(8)
Thus we can obtain the following approximate fitting models by Eq. (7) or
Eq. (8):

n
X
P1−1 model : min
3×3
kXi − Xi−1 − ∆ti AXi k2 , (9)
A∈R
i=1
n−1
X
P1−2 model : min
3×3
kαXi+1 + βXi + γXi−1 − δAXi k2 , (10)
A∈R
i=1

where α = (∆ti )2 , β = (∆ti+1 )2 −(∆ti )2 , γ = −(∆ti+1 )2 , δ = ∆ti ∆ti+1 (∆ti+1 +


∆ti ).

4
2) In addition, the LDS (2) can be transformed into the following integral
equations, Z ti
AX(t)dt = Xi − Xi−1 , i = 1, 2, . . . , n. (11)
ti−1

The integral can be approximated by numerical quadrature, for example, by the


trapezoid formula,
Z ti
∆ti
AX(t)dt ' A(Xi + Xi−1 ), (12)
ti−1 2

we can obtain another approximate fitting model:


Xn 2
∆ti ∆ti
P2 model : min (I − A)Xi − (I + A)Xi−1
A∈R3×3 2 2 . (13)
i=1

As a result, the reconstruction problem of the homogeneous linear differen-


tial system with an initial condition can be transformed into the optimization
problems (9) or (10) or (13). When A is determined, we can compute more
discrete points on the curve which is the solution of the LDS (2).
To illustrate the effectiveness of the above method, we consider the following
examples.

Example 1. Given the homogeneous linear differential system (LDS) with an


initial condition as follows.

 dX(t)
= AX(t),
dt
 X(0) = X ,
0

   
0 −1 0 1
   
   
where A =  1 0 0 , X0 =  −1 . We take 100 sampled points
   
0 0 1 1
by the Runge-Kutta method, then use the methods by P1−1 model (9), P1−2
model (10) and P2 model (13) to reconstruct the LDS respectively. In Fig. 1,
we show the reconstructed curves by the three models and the B-spline method in
comparison. The maximal errors of the exponential curves obtained by different
methods are shown in Table 1. Since the curve is determined by the system
with 9 entries of A, we choose the cubic B-spline curves with 4 control points

5
Sample points
P1_1 model
3
P1_2 model
P2 model
2.5 B−spline

1.5

1
0.5
1.5
0 1.4
1.3
−0.5 1.2
1.1
−1 1

Figure 1: Reconstructed curves by P1−1 , P1−2 , P2 models and the B-spline method respec-
tively in Example 1.

(12 entries) or 5 control points (15 entries) for comparison. From the Table 1,
we can see that P2 model can obtain good fitting accuracy as the cubic B-spline
method with more control points.

Example 2. Given the homogeneous linear differential system(LDS) with an


initial condition as follows.

 dX(t)
= AX(t),
dt
 X(0) = X ,
0

   
0 −1 0 1
   
   
where A =  1 0 0 , X0 =  0 . The exact solution curve is a
   
0 0 0 1
circle. We also take 100 sampled points by the Runge-Kutta method, then use the

6
Table 1: The maximal fitting errors of the curves by different methods in Example 1.

Method P1−1 model P1−2 model P2 model B-spline(4 CPs) B-spline(5 CPs)

Maximal error 0.0058 0.0029 0.0018 0.0025 0.0011

Table 2: The maximal fitting errors of the curves by different methods in Example 2.

Method P1−1 model P1−2 model P2 model B-spline(4 CPs) B-spline(11 CPs)

Maximal error 0.1760 0.0031 0.0031 0.3704 0.0031

methods by P1−1 model (9), P1−2 model (10) and P2 model (13) to reconstruct
the LDS respectively. In Fig. 2, we show the reconstructed curves by the three
models and the B-spline method. The maximal errors by different models are
shown in Table 2. We can see that P2 model can obtain good fitting accuracy as
the cubic B-spline method with 11 control points.

Example 3. In this example, the discrete points lie on an elementary profile


of a blade surface. There are 71 points on the half profile1 . In Fig. 3, we show
the reconstructed results, and the maximal errors are shown in Table 3.

From the Examples 1 and 2, we can see that the P1−2 model and P2 model

1 The data is provided by LMIB and School of Energy and Power Engineering from Beihang
University supported by the National Natural Science Foundation of China (No.11290140).

Table 3: The maximal fitting errors of the curves by different methods in Example 3.

methods P1−1 model P1−2 model P2 model B-spline(10 CPs)

maximal error 0.9825 0.6016 0.4107 0.0698

7
Sample points
P1_1 model
P1_2 model
P2 model
B−spline

1.5

1 0.5
1
0
1
1.5 −0.5
1
0.5
0 −1
−0.5
−1
−1.5
−1.5

Figure 2: Reconstructed curves by P1−1 , P1−2 , P2 models and the B-spline method respec-
tively in Example 2.

8
Sample points
P model
1_1
180
P1_2 model
170 P2 model
B−spline
160

150

140

130

120
45
40 186
184
35 182
30 180
178
25 176

Figure 3: Reconstructed curves by P1−1 , P1−2 , P2 models and the B-spline method respec-
tively in Example 3.

can obtain good results for the discrete data taken from the solution curve of a
LDS. However, for a general curve or discrete data such as in Example 3, it is
hard to reconstruct the curve only by a simple LDS with constant coefficients.
So we need consider the LDS with variable coefficients in next section.

3. The streamline fitting model based on the diagonalizable differen-


tial system with variable coefficients

In order to improve the versatility of the LDS, we consider the case with
variable coefficients, i.e.,

 dX(t)
= A(t)X(t),
dt
(14)
 X(0) = X ,
0

where A(t) is an unknown matrix of functions to be determined. As a well-


known difficulty of differential equations, the solution cannot be represented
explicitly for an arbitrary A(t).

9
In addition, there is another difficulty in computation on matrix of functions.
That is, a matrix of functions and its derivative don’t satisfy the commutative
law of multiplication, i.e., A0 (t)A(t) isn’t equal to A(t)A0 (t) in general. Note
that the multiplication between the diagonal matrices can be commutative, we
consider the curve fitting model based on the diagonalizable linear differential
system with variable coefficients in this section.
In this case, the solution of the differential system (14) can be represented
as
Rt
X(t) = T −1 e 0
D(τ )dτ
T X0 , (15)

when the variable coefficient matrix can be diagonalized, i.e., A(t) = T −1 D(t)T ,
where T is an invertible constant matrix and D(t) is a diagonal matrix of func-
tions.
In fact, let Z 
t
B(t) = T −1 D(τ )dτ T,
0
then B(t) satisfy
B 0 (t) = T −1 D(t)T = A(t),

and Z  Z 
t t
T −1 D(t) D(τ )dτ T = T −1 D(τ )dτ D(t)T,
0 0
i.e., A(t)B(t) = B(t)A(t), when A(t) can be diagonalized. Eq. (15) can be
represented as
X(t) = eB(t) X0 and X(0) = X0 . (16)

It is easy to verify that


d d B(t)
(X(t)) = (e X0 )
dt dt
d 1
= (I + B(t) + B 2 (t) + · · · )X0
dt 2!
1
= (B 0 (t) + (B 0 (t)B(t) + B(t)B 0 (t)) + · · · )X0
2!
1
= (A(t) + (A(t)B(t) + B(t)A(t)) + · · · )X0
2!
1
= A(t)(I + B(t) + B 2 (t) + · · · )X0
2!
= A(t)X(t).

10
Furthermore, in some cases of curve fitting, it requires not only that the
error is less than a given precision, but also that the fitting curve can interpo-
late the first and last points. So for a given set of discrete points of a target
curve X(t), t ∈ [0, 1], Xi = (xi , yi , zi ) ∈ R3 , i = 0, 1, 2, · · · , n, our problem is
to reconstruct the curve which satisfy the following diagonalizable differential
system with two end conditions [10],


 dX(t)
= T −1 D(t)T X(t),

 dt
X(0) = X0 , (17)



 X(1) = X ,
n

where T ∈ R3×3 is an unknown invertible matrix and D(t) is an unknown


diagonal matrix of functions to be determined.
In order to reconstruct the differential system, we compute D(t) and T as
follows.
1) When T is determined, using the solution (15) of differential system (17), we
obtain
Rt
D(τ )dτ
T X(t) = e 0 T X0 . (18)

Denote Yi = log((T X(ti ))/(T X0 )) by the


 computation on each  entry of the
d (t) 0 0
 1 
 
vectors T X(ti ) and T X0 . Let D(t) =  0 d2 (t) 0  and G(t) =
 
0 0 d3 (t)
 R 
t
d (τ )dτ
 R0 1 
 t 
 0 d2 (τ )dτ , then G(ti ) = Yi , i = 1, 2, · · · n. Considering X(1) = Xn , we
 R 
t
0
d3 (τ )dτ
can obtain the following approximate fitting model:
n
X
min ||Gj (ti ) − Yi,j ||2 (19)
G
i=0

s.t. Gj (1) = Yn,j , j = 1, 2, 3, (20)


R ti
where Gj (ti ) = 0
dj (τ )dτ , Yi,j is the j-th component of Yi . In this paper,
we assume that G(t) is a cubic B-spline which the corresponding knots are

11
determined according to the data points as presented later, i.e., G(t) can be
represented as
p
X
G(t) = Pk Bk,3 (t), (21)
k=1

where Bk,3 (t), k = 1, 2, · · · , p, are the cubic B-spline basis. When G(t) is
determined, we can obtain D(t) by

D(t) = diag(G0 (t)). (22)

2) The role of T is to transform the original data Xi , i = 0, 1, 2, · · · , n, to


a proper region in plane or space such that Yi = log((T X(ti ))/(T X0 )), i =
1, 2, · · · , n, are well defined. Next, we discuss how to determine the T when
the discrete points Xi ∈ R2 or Xi ∈ R3 for some certain cases, respectively.
Case a) For Xi ∈ R2 , we need ensure that each element of vector T X(ti ) is
nonzero and has the same sign with the corresponding element of vector T X0 ,
in order that Yi = log((T X(ti ))/(T X0 )) are well defined. If Xi , i = 0, 1, 2, · · · , n,
lie in an angular region with the origin as the vertex and this angle is less than π,
we can find a T satisfying the condition as mentioned above. In fact, assume that
the boundary lines of this angular region are l1 and l2 , and the angle between the
line l1 and the positive x-axis is θ1 , the angle between the line l2 and the positive
x-axis is θ2 . Let X̃1 = (cosθ1 sinθ1 )T and X̃2 = (cosθ2 sinθ2 )T , then X̃1 and
X̃2 are linearly independent and can be viewed as a set of bases in R2 . Assume
e1 = (1 0)T and e2 = (0 1)T , U is a matrix satisfying [X̃1 X̃2 ] = [e1 e2 ]U
and U is invertible. Then if we denote ζi by the coordinates of the points Xi
in the system {O; X̃1 , X̃2 }, we have ζi = U −1 Xi [11]. Clearly, all the points
ζi , i = 0, 1, 2, · · · , n, fall in the same quadrant in the system {O; X̃1 , X̃2 } and
T = U −1 .

Algorithm 1. The algorithm of computing T in the 2D plane


Input: given discrete points Xi = (xi yi )T , i = 0, 1, · · · , n; given the η (0 < η <
0.1).
(1) Compute argument of each complex number xi + yi j, where j is the imagi-

12
nary unit;
(2) Compute the minimal argument θ1 and maximal argument θ2 : If θ2 − θ1 +
2η < π, go to step (3);
 −1
cos(θ1 − η) cos(θ2 + η)
(3) Compute T : T =   ;
sin(θ1 − η) sin(θ2 + η)
Output: the matrix T .

Remark 1. η is used to guarantee that all the points ζi , i = 0, 1, · · · , n, are


not on the two axes.

Case b) For Xi ∈ R3 , we also need ensure that each element of vector T X(ti ) is
nonzero and has the same sign with the corresponding element of vector T X0 , in
order that Yi = log((T X(ti ))/(T X0 )) are well defined. If Xi , i = 0, 1, 2, · · · , n,
lie in a triangular cone with the origin as the vertex, we can find a T satisfying
the condition as mentioned above. In fact, assume that the three edges of a
triangular cone are q1 , q2 and q3 , and the direction vectors of q1 , q2 and q3 are
a, b, c respectively. Then a, b and c are linearly independent and can be viewed
as a set of bases in R3 . Assume e1 = (1 0 0)T , e2 = (0 1 0)T and e3 = (0 0 1)T ,
U is a matrix satisfying [a b c] = [e1 e2 e3 ]U and U is invertible. Then if
we denote ζi by the coordinates of the points Xi in the system {O; a, b, c}, we
have ζi = U −1 Xi [11]. Clearly, all the points Xi , i = 0, 1, 2, · · · , n, fall in the
same octant in the system {O; a, b, c} and T = U −1 .

Algorithm 2. The algorithm of computing T in the 3D space


Input: given discrete points Xi = [xi , yi , zi ], i = 0, 1, · · · , n.
(1) Compute the barycenter Q of Xi and the radius r of a sphere with center Q
−−→
and including all the points Xi ; If |OQ| < r, goto step (2);
−−→
(2) Compute the plane S with normal vector OQ;
(3) Find three points ξ1 , ξ2 , ξ3 on the plane S and lie on the circle whose center
is Q and radius is 2r;
h i−1
(4) Compute T : T = ξ1 /||ξ1 || ξ2 /||ξ2 || ξ3 /||ξ3 || ;

13
Output: the matrix T .

Remark 2. If all points Xi , i = 0, 1, · · · , n, lie in one quadrant or one octant,


T can be taken as the identity matrix.

At last, when T is determined, the problem of determining D(t) translates


into a curve fitting problem by the B-spline method. In [12], Park and Lee
presented an approach of B-spline curve fitting to a set of ordered points by
using the dominant points to obtain better curve approximation. When the
dominant points are selected, the knots are computed by using the parameter
values of the selected dominant points. In this paper, we also use this approach
with the dominant points to reconstruct G(t). In the algorithm for dominant
points selection, we compute discrete curvature by the method in [13].
To sum up, we propose the fitting algorithm for reconstructing the curve by
the diagonalizable differential system from the given discrete points.

Algorithm 3. Curve fitting algorithm based on the diagonalizable differential


system
Input: given discrete points Xi , i = 0, 1, · · · , n; maximal error ε; some seed
points set V from the points.
(1) Parameterization: calculate the parameter ti of each point Xi , ti ∈ [0, 1],
(here we calculate ti using the method of accumulative chord length);
(2) Compute T using Algorithm 1 or Algorithm 2;
(3) Select a new dominant point from the points and store it in the seed points
set V ;
(4) Determine knots by using the parameter values of the selected dominant
points;
(5) Compute control points Pk by solving the least-squares problem (19),(20);
(6) If max kXi − T −1 ediag(G(ti )) T X0 k ≥ ε, repeat steps (3)-(5); otherwise,
i=0,1,...,n
end;
Output: the matrix T , D(t) = diag(G0 (t)) and X(t) = T −1 ediag(G(t)) T X0 .

14
90
Sample points
Algorithm 3
80 B−spline

70

60

50

40

30

20

10

0
0 20 40 60 80 100 120 140

Figure 4: The fitting curves by the B-spline method and Algorithm 3 respectively in Example
4.

To illustrate the effectiveness of our algorithm, we consider the following


examples:

Example 4. In this example, we take 1001 sample points from a NURBS curve
of degree 2 with 9 control points. The knots are 0, 0, 0, 0.17, 0.33, 0.33, 0.67, 0.67,
0.83, 1, 1, 1; the control points are (0, 0), (−150, 50), (−50, 50), (0, 150), (150, 150),
(150, 0), (50, −50), (50, −150), (0, 0); the weights are 1, 2, 3, 1, 0.7071, 1, 3, 2, 1. We
reconstruct the approximate curves by the Algorithm 3 and the cubic B-spline
method with the dominant points selection. The results are
shown in Fig. 4 and
0.9894 −0.0204
the maximal errors are shown in Table 4. The matrix T =  
0.0414 0.9887
is computed by Algorithm 1.

Example 5. In this example, we reconstruct a curve lie in a region cross-


ing two quadrants. As shown in Fig. 5, it is a NURBS curve with knots:
0, 0, 0, 0.17, 0.33, 0.33, 0.67, 0.67, 0.83; weights: 2, 3, 1, 3, 2, 1; control points:

15
Table 4: The maximal fitting errors by different methods in Example 4.

Method B-spline Algorithm 3

Maximal errors 0.0576 0.0508

Number of control points 44 44

Table 5: The maximal fitting errors by different methods in Example 5.

Method B-spline Algorithm 3

Maximal error 0.0353 0.0289

Number of control points 30 30

(−75, 25), (−150, 50),


 (−100, 25), (−50, −50), (−25, −150), (0, 0). By the Al-
−0.7412 0.0643
gorithm 1, T =  . The maximal errors by the cubic
−0.6359 −0.3863
B-spline method and Algorithm 3 are shown in Table 5.

Example 6. The discrete points lie on a elementary profiles of a blade surface.


We show the reconstructed results in Fig. 6 and the maximal errors in Table 6.

Table 6: The maximal fitting errors by different methods in Example 6.

Method B-spline Algorithm 3

Maximal errors 0.0351 0.0282

Number of control points 45 41

16
50
Sample points
Algorithm 3
B−spline

−50

−100
−160 −140 −120 −100 −80 −60 −40 −20

Figure 5: The fitting curves by the B-spline method and Algorithm 3 respectively in Example
5.

Sample points
180
Algorithm 3
170 B−spline

160

150

140

130

120
45
40 186
184
35 182
30 180
178
25 176

Figure 6: The fitting curves by the B-spline method and Algorithm 3 respectively in Example
6.

17
In Examples 4, 5 and 6, the fitting curves are obtained by the standard cubic
B-spline method with selecting dominant points adaptively. In Tables 4, 5 and
6, the results by the Algorithm 3 based on diagonalizable LDS can obtain good
accuracy as the B-spline method.

4. The surface fitting model based on the diagonalizable partial dif-


ferential system with variable coefficients

In this section, we extend the Algorithm 3 for curve fitting to the case of
surface fitting. In order to represent a general surface, we have to revise Eq.(14)
by partial differential equations, that is

 ∂X(t,s) = A(t, s)X(t, s),
∂t
(23)
 X(0, s) = X (s),
0

where A(t, s) is an unknown matrix of functions to be determined.


Similar to curve fitting by a differential system, we assume A(t, s) can be
diagonalized. Then given a set of points of a target surface X(t, s), (t, s) ∈ [0, 1]2 ,
Xi,j = (xi,j , yi,j , zi,j ) ∈ R3 , i = 0, 1, 2, · · · , n, j = 0, 1, 2, · · · , m, the problem is
to reconstruct the surface X(t, s) as a solution of the following partial differential
system with two boundary conditions [10],


 ∂X(t,s)
= T −1 D(t, s)T X(t, s),

 ∂t

X(0, s) = X0 (s), (24)





 X(1, s) = X (s),
n

where T ∈ R3×3 is an unknown invertible matrix and D(t, s) is a diagonal


matrix of functions to be determined, X0 (s) is a curve which passes through
X0,j (j = 0, 1, . . . , m), and Xn (s) passes through Xn,j (j = 0, 1, . . . , m). In this
paper, we assume X0 (s) and Xn (s) are cubic B-spline curves. The analytical
solution of Eq. (24) is
Rt
X(t, s) = T −1 e 0
D(τ,s)dτ
T X0 (s). (25)

18
In order to reconstruct the partial differential system (24), T and D(t, s)
need to be computed. The way to compute T is the same as the curve fitting
model. In the following, we discuss the way to determine the D(t, s).
When T is determined, using the solution (25) of differential system (24),
we obtain
Rt
D(τ,s)dτ
T X(t, s) = e 0 T X0 (s). (26)

Denote Yi,j = log((T X(ti , sj ))/(T X0 (sj ))) by the 


computation on each entry of 
d1 (t, s) 0 0
 
 
the vectors T X(ti , sj ) and T X0 (sj ). Let D(t, s) =  0 d2 (t, s) 0 
 
0 0 d3 (t, s)
 R 
t
d (τ, s)dτ
 R0 1 
 t 
and G(t, s) =  0 d2 (τ, s)dτ , then G(ti , sj ) = Yi,j , i = 1, 2, · · · , n, j =
 R 
t
0
d3 (τ, s)dτ
1, 2, · · · , m. Considering X(1, s) = Xn (s), we can obtain the following approxi-
mate fitting model:
n X
X m
min ||Gk (ti , sj ) − Yi,j,k ||2 (27)
G
i=0 j=0

s.t. Gk (1, sj ) = Yn,j,k , j = 1, 2, · · · , m, k = 1, 2, 3, (28)


R ti
where Gk (ti , sj ) = 0
dk (τ, sj )dτ , Yi,j,k is the k-th component of data point
Yi,j , i = 1, 2, · · · , n, j = 1, 2, · · · , m.
We assume that G(t, s) is a bicubic B-spline surface with the knots de-
termined according to the data points by the algorithm for dominant points
selection for surface fitting [14], that is, G(t, s) can be represented as
p X
X q
G(t, s) = Pl,r Bl,3 (s)Br,3 (t). (29)
l=1 r=1

When G(t, s) is determined, we can compute D(t, s) by


∂G(t, s)
D(t, s) = diag( ). (30)
∂t

19
We present the following algorithm to reconstruct the surface based on the
given discrete points.

Algorithm 4. Surface fitting algorithm based on the diagonalizable partial dif-


ferential system
Input: given discrete points Xi,j , i = 0, 1, · · · , n, j = 0, 1, · · · , m; the maximal
error ε; some seed points set V from the points.
(1) Parameterization: calculate the parameter ti and sj of each point Xi,j ,
ti ∈ [0, 1] and sj ∈ [0, 1], (here we calculate ti and sj using the method of accu-
mulative chord length in t-direction and s-direction respectively);
(2) Compute T using Algorithm 1 or Algorithm 2;
(3) Select a new dominant point from the points and store it in the seed points
set V ;
(4) Determine knots by using the parameter values of the selected dominant
points;
(5) Compute control points Pl,r by solving the least-squares problem (27),(28);
(6) If max kXi,j − T −1 ediag(G(ti ,sj )) T X0 k ≥ ε, repeat steps (3)-(5); other-
i=0,1,...,n
j=0,1,...,m
wise, end;
Output: the matrix T , the expression of D(t, s) and X(t, s) = T −1 ediag(G(t,s)) T X0 (s).

To illustrate the effectiveness of Algorithm 4, we consider the following ex-


ample.

Example 7. The discrete points lie on a blade surface. There are 15 elemen-
tary profiles and 142 points on each profile2 . In Fig. 7, we show the 15
reconstructed curves, and the maximal errors are shown in Table 7. Fig. 8
shows the reconstruction of the blade surface with refined curves determined by
the partial differential system (24) obtained by Algorithm 4.

2 The data is provided by LMIB and School of Energy and Power Engineering from Beihang
University supported by the National Natural Science Foundation of China (No.11290140).

20
Sample points
Algorithm 4
B−spline

180

170

160

150
250
140
200
130
150
120
100
55 50 45 40 35 30 25 20 15 10

Figure 7: Reconstructions of the elementary profiles by the bicubic B-spline method and
Algorithm 4 respectively in Example 7.

Table 7: The maximal fitting errors by different methods in Example 7.

Method Bicubic B-spline Algorithm 4

Maximal errors 0.0457 0.0318

Number of control points 26 × 17 32 × 17

21
Sample points
Algorithm 4
Refined curves

180

170

160

150
250
140

200
130

120 150
55 50 45 40 35 30 25 20 100
15 10

Figure 8: Reconstruction of the blade surface with refined curves by Algorithm 4 in Example
7.

22
5. Conclusion

In this paper, we discussed the curve and surface fitting methods based on
the homogeneous linear differential system. The main works are as follows:
(1) We introduce the methods for curve fitting based on the homogeneous
linear differential system with constant coefficients.
(2) We propose a curve fitting algorithm based on the diagonalizable linear
differential system with variable coefficients, which has explicit solution and
interpolate the end points. The new algorithm can obtain good fitting accuracy
as the B-spline method.
(3) We also propose the diagonalizable partial differential system with vari-
able coefficients and extend the curve fitting algorithm to the case of surface
fitting with satisfactory accuracy.

Acknowledgements

The authors are grateful to Prof. Zhi-Ming Zheng (supported by the Na-
tional Natural Science Foundation of China grants 11290140, 11290141), Prof.
Jia-Lin Hong and Prof. Xun-Nian Yang (supported by NSFC grant 11290142)
for the share of their first idea and early work in [8] on curve reconstruction by
differential dynamic system. Their valuable comments and suggestions on the
earlier works of the present paper are also appreciated.

References

[1] X. Ye, T.R. Jackson, N.M. Patrikalakis, Geometric design of functional


surfaces, Computer-Aided Design, 28 (9) (1996) 741-752.

[2] K.T. Miura, N. Sakiyama, T. Kaneko, T. Kubo, Streamline modeling: de-


signing free-form surfaces by blending tangent vectors, Sixth IFIP WG5.2
Workshops on Geometric Modelding, 1998, pp. 168-179.

23
[3] K.T. Miura, Unit quaternion integral curve: A new type of fair
free-form curves, Computer Aided Geometric Design, 17 (2000) 39-58.
doi:10.1016/S0167-8396(99)00038-2.

[4] K.T. Miura, L. Wang, F. Cheng, Streamline modeling with subdivision


surfaces on the Gaussian sphere, Computer-Aided Design, 33 (2001) 975-
987. doi:10.1016/S0010-4485(00)00134-2.

[5] T. Kim, S.E. Sarma, Toolpath generation along directions of maximum


kinematic performance; a first cut at machine-optimal paths, Computer-
Aided Design, 34 (2002) 43-468.

[6] D.C.H. Yang, J.J. Chuang, T.H. Oulee, Boundary-confromed toolpath gen-
eration for trimmed free-form surfaces, Computer-Aided Design, 35 (2003)
127-139. doi:10.1016/s0010-4485(02)00047-7.

[7] S. Pavanaskara, S. Pandea, Y. Kwona et al., Energy-efficient vector field


based toolpaths for CNC pocketmachining, Journal of Manufacturing Pro-
cesses, 20 (2015) 314-320. doi:10.1016/j.jmapro.2015.06.009.

[8] X.N. Yang, J.L. Hong, Dynamic evaluation of free-form curves and surfaces,
SIAM Journal on Scientific Computing 39(2017), in press.

[9] C.J. Li, L.L. Xie, H.D. Li, Reconstruction of the linear ordinary differential
system based on discrete points, Journal of Mathematical Research with
Applications, 37 (1) (2017) 73-89.

[10] C.J. Li, Reconstructions on the diagonalizable differential system models,


Technical report, Beihang University, Beijing, 2015.6.

[11] G.H. Golub, C.F. Van Loan, Matrix computations, Johns Hopkins Univer-
sity Press, 1996, pp. 58-59. doi:10.1137/1028073

[12] H. Park, J.H. Lee, B-spline fitting based on adaptive curve refine-
ment using dominant points, Computer-Aided Design, 39 (2007) 439-451.
doi:10.1016/j.cad.2006.12.006.

24
[13] G.H. Liu, Y.S. Wong, T.F. Zhang et al., Adaptive fairing of digitized point
data with discrete curvature, Computer-Aided Design, 34 (4) (2002) 309-
320. doi:10.1016/S0010-4485(01)00091-4.

[14] H. Park, B-spline surface fitting based on adaptive knot placement using
dominant columns, Computer-Aided Design, 43 (3) (2011) 258-264. doi:
10.1016/j.cad.2010.12.001.

25

You might also like