# Smoothing Connected Ball Bézier Curves by Energy Minimization

Authors: Juncheng Li; Chengzhi Liu
Journal: Complexity
 (2022)

---

## Abstract

In this paper, we aim at smoothing two connected ball Bézier curves fromCr−1 to Crr≥1 by minimizing the energies of the curves. We propose the algorithms based on internal energy minimization and curve attractor minimization. Then, we combine the internal energy and the curve attractor and give the algorithm based on combined energy minimization. All algorithms are established by solving bi-objective minimizations. Some numerical examples show that the proposed algorithms are effective, making them useful for smoothing 3D objects constructed by connected ball Bézier curves.


---

## Body

## 1. Introduction

It is known that every object in nature has thickness. In the field of computer-aided design (CAD) and computer graphics (CG), a curve or a surface without thickness is just a mathematical abstraction or simplification to represent the shapes of objects (see [1]). Because a ball curve (see [2]) can be viewed as an ordinary curve with variable thickness in geometry, it can be used in modeling tubular shapes with variable thickness widely existing in nature. According to definition of the ball curve, specific models could be designed by concretizing the basis. For example, the ball B-spline curve (BBSC) derived from B-spline basis has attracted much attention in recent years. Owing to the fact that BBSC is defined by replacing control points in the B-spline curve with control balls, most algorithms can be easily obtained by applying the B-spline curve to the BBSC. Without providing an exhaustive survey, we list some studies where the proposed algorithms relate to BBSC (see, e.g., [2–7]). Since the Bézier curve and surface (see [8]) have long been a basic tool for geometric design and shape representation and have been widely used in practical engineering (see [9, 10]), the ball Bézier curve derived from the Bernstein basis is also worthy of attention. In this paper, we focus on the ball Bézier curve (BBC).Although the BBC can be used to represent tubular shapes with variable thickness, we may need to connect two or more BBCs for designing some complex objects in practical applications. To make the connected BBCs have overall smoothness, they should satisfy certain continuity conditions. Generally, there are two metrics for the continuity between connected parametric curves: parametric continuity (also calledCn continuity) and geometric continuity (also called Gn continuity) (see [11]). The smooth continuity between connected BBCs we are concerned with here is the parametric continuity. Let us consider the issues. If two BBCs satisfy Cr−1 connection, how can we smooth the connected BBCs from Cr−1 to Cr? Theoretically, we can modify the control balls of the connected BBCs so as to make the corresponding continuity conditions hold, but the modification of control balls without specific objectives may not meet the needs of practical applications. Recently, some objective functionals have been proposed for modifying the shape of curves. These objective functionals can be roughly divided into two categories: the internal energy of curves and the external energy of curves. The internal energy of a curve oftentimes includes three forms: the stretch energy, the strain energy, and the curvature variation energy (see [12–17]). The external energy of a curve usually includes two forms: the point attractor and the curve attractor (see [17]). The curve attractor minimization is applied to smooth two connected curves defined by control points (see [17]), and the same methodology was extended to smooth two connected ball curves defined by control balls (see [2]). In this paper, we, respectively, use the internal energy minimization and the curve attractor minimization to smooth two connected BBCs. We think that the energy of each segment of two connected BBCs should be as small as possible, rather than considering that the total energy of two connected BBCs should be as small as possible. Therefore, we use bi-objective minimization to achieve this goal.The main contributions of this paper are as follows:(a)
We give a scheme for smoothing two connected BBCs fromC0 to C1 by minimizing the internal energy. The scheme makes the internal energy of each segment of two connected BBCs as small as possible, rather than the total internal energy of two connected BBCs as small as possible.(b)
We present a scheme for smoothing two connected BBCs fromC0 to C1 by minimizing the curve attractor. The scheme synchronously minimizes the distance between each adjusted control point and its original position, instead of minimizing the total distance between all adjusted control points with their original positions.(c)
We combine the internal energy minimization and the curve attractor minimization to smooth two connected BBCs fromC0 to C1 in a new way, which extends the application of previous methods.The remainder of this paper is organized as follows. In Section2, we give the preliminaries for the issues to be discussed. In Section 3, we present the algorithm for smoothing two connected BBCs from C0 to C1 by minimizing the internal energy. In Section 4, we propose the algorithm for smoothing two connected BBCs from C0 to C1 by minimizing the curve attractor. In Section 5, we combine the internal energy and the curve attractor to smooth two connected BBCs from C0 to C1 and conclude the corresponding algorithm. In Section 6, we bring some numerical examples to illustrate the effectiveness of the proposed algorithms. Finally, the conclusion is provided in Section 7.


## 2. Preliminaries

A ball Bézier curve (BBC) of degreen can be defined as (see [2])(1)Bt=∑i=0nBi,ntbi;ri,where 0≤t≤1, Bi,nt=ni1−tn−iti, and bi;ri is the control ball which represents a ball centered at bixi,yi,zi with radius ri. Geometrically, a BBC can be viewed as a Bézier curve with variable thickness.Since∑i=0nBi,ntbi;ri=∑i=0nBi,ntbi;∑i=0nBi,ntri, a BBC can be regarded as having two parts: the skeleton (or center curve) ct=∑i=0nBi,ntbi which is a Bézier curve and the radius function rt=∑i=0nBi,ntri which is a Bézier scalar function. Then, equation (1) can be simplified as(2)Bt=ct;rt.Figure1 shows an illustration of a quadratic BBC.Figure 1
A quadratic BBC with skeleton and control balls. (a) Skeleton and control balls. (b) Quadratic BBC.
(a)(b)From equation (2), a BBC of degree (m) and a BBC of degree (n) can be expressed as(3)B1t=c1t;r1t,B2t=c2t;r2t,where(4)c1t=∑i=0mBi,mtpi,r1t=∑i=0mBi,mtri,c2t=∑j=0nBj,ntqj,r2t=∑j=0nBj,ntsj.Since the expression of BBC is very similar to that of standard Bézier curve, we can easily obtain theCn continuity conditions of connecting two BBCs from that of the standard Bézier curve. Here, we only give the C1 continuity conditions of connecting two BBCs which is shown in the following theorem without proof.Theorem 1.
TheC1 continuity conditions of two connected BBCs B1t and B2t are given by(5)q0=pm=d,s0=rm=R,q1=m+nnd−mnpm−1,s1=m+nnR−mnrm−1,where d and R, respectively, represent the center and radius of the connecting control ball.Figure 2
Two BBCs reachingCr (r = 0, 1) connection. (a) C0 connection. (b) C1 connection.
(a)(b)Remark 1.
The conditionsq0=pm and s0=rm in equation (5) imply that two BBCs should reach C0 connection first, which means combining the end of B1t with the beginning of B2t. Diagrams of two BBCs reaching Cr (r = 0, 1) connection are shown in Figure 2.
In the following sections, we consider the internal energy minimization and the point attractor minimization to smooth two connected BBCs fromC0 to C1.Remark 2.
Actually, we can consider smoothing two connected BBCs fromCr−1 to Crr≥1. Without loss of generality, we only discuss smoothing two connected BBCs from C0 to C1 in the following sections. The methods of smoothing two connected BBCs from Cr−1 to Crr≥2 could refer to the process of that from C0 to C1.


## 3. Internal Energy Minimization

In this section, we adopt internal energy to smooth two connected BBCs fromC0 to C1. In most cases, the internal energy of a parametric curve bt can be approximately expressed as Ek=∫01bkt2dt, k=1,2,3, where k denotes the derivative of order and ⋅ represents the 2-norm.Since a BBCBt is considered to contain two parts, the internal energy of Bt can be expressed as two separate parts:(6)Ek=∫01ckt2dt,(7)Rk=∫01rkt2dt.From equation (5), we only need to adjust the control balls pm−1;rm−1 and q1;s1 for smoothing the two connected BBCs from C0 to C1. Let p˜m−1;r˜m−1 denote the adjusted position of the control ball pm−1;rm−1, and q˜1;s˜1 be that of the control ball q1;s1. Let Ω1=0,1,…,m−2,m and Ω2=0,2,…,n−1,n denote the index set of the control balls which keep unchanged. Then, from equations (3), (6), and (7), the internal energy of each segment of the two connected BBCs after smoothing can be expressed as(8)E1,kp˜m−1≔∫01c1kt2dt=∫01f1kt+Bm−1,mktp˜m−12dt=∫01f1kt2dt+2p˜m−1⋅∫01f1ktBm−1,mktdt+p˜m−12∫01Bm−1,mkt2dt,R1,kr˜m−1≔∫01r1kt2dt=∫01g1kt+Bm−1,mktr˜m−12dt=∫01g1kt2dt+2r˜m−1∫01g1ktBm−1,mktdt+r˜m−12∫01Bm−1,mkt2dt,E2,kq˜1≔∫01c2kt2dt=∫01f2kt+B1,nktq˜12dt=∫01f2kt2dt+2q˜1⋅∫01f2ktB1,nktdt+q˜12∫01B1,nkt2dt,R2,ks˜1≔∫01r2kt2dt=∫01g2kt+B1,nkts˜12dt=∫01g2kt2dt+2s˜1∫01g2ktB1,nktdt+s˜12∫01B1,nkt2dt,where “.” means the inner product of two vectors, and(9)f1t=∑i∈Ω1Bi,mtpi,g1t=∑i∈Ω1Bi,mtri,f2t=∑j∈Ω2Bj,ntqj,g2t=∑j∈Ω2Bj,ntsj.Since we believe that the internal energy of each segment of two connected BBCs after smoothing should be as small as possible, the bi-objective minimizations can be obtained as follows:(10)minE1,kp˜m−1,E2,kq˜1T,(11)minR1,kr˜m−1,R2,ks˜1T.Because equation (5) should be satisfied when smoothing the two connected BBCs from C0 to C1, we have(12)q˜1=m+nnd−mnp˜m−1,(13)s˜1=m+nnR−mnr˜m−1.It is not difficult to find thatq˜1 can be regarded as a function of p˜m−1, and s˜1 can be regarded as a function of r˜m−1. For convenience, we set the two functions as αp˜m−1 and βr˜m−1.By substituting (12) into (10), we have(14)minE1,kp˜m−1,E2,kp˜m−1T,where E2,kp˜m−1≔E2,kαp˜m−1.Note that the radii of the control balls should be nonnegative, that is,r˜m−1≥0 and m+n/nR−m/nr˜m−1≥0, namely, 0≤r˜m−1≤m+n/mR. Here, the radius equal to 0 means that a control ball degenerates to be a point. By substituting (13) into (11) and adding the constraint with radius, we have(15)minr˜m−1∈DR1,kr˜m−1,R2,kr˜m−1T,where R2kr˜m−1≔R2kβr˜m−1, D≔r˜m−1∈R|0≤r˜m−1≤m+n/mR.Generally, (14) and (15) can be transformed into the single-objective minimizations:(16)minEkp˜m−1≔λkE1,kp˜m−1+1−λkE2,kp˜m−1,and(17)minr˜m−1∈DRkr˜m−1≔ωkR1,kr˜m−1+1−ωkR2,kr˜m−1,where λk, 0≤λk≤1 and ωk, 0≤ωk≤1 are the weights. If the solution of equation (16) is unique, it must be the noninferior solution of equation (14), and so is the relationship between equations (15) and (17) (see, e.g., [18]). We discuss equations (16) and (17) separately.Before solving equation (18), we need to determine the values of λk. To this end, we consider the single-objective minimizations(18)minE1,kp˜m−1,(19)minE2,kp˜m−1.Lemma 1.
The solution of equation (18), denoted by p˜m−11, is(20)p˜m−11=−∫01f1ktBm−1,mktdt∫01Bm−1,mkt2dt.The solution of equation (19), denoted by p˜m−12, is(21)p˜m−12=m+nmd+nm∫01f2ktB1,nktdt∫01B1,nkt2dt.Proof.
The gradients ofE1kp˜m−1 expressed in equation (8) can be calculated by(22)∂E1,kp˜m−1∂p˜m−1=2∫01f1ktBm−1,mktdt+2p˜m−1∫01Bm−1,mkt2dt.
Then, we have∂2E1,kp˜m−1/∂p˜m−12=2e∫01Bm−1,mkt2dt, where e is the unit vector. Since ∫01Bm−1,mkt2dt>0 always holds, equation (18) has a unique solution which can be solved by ∂E1,kp˜m−1/∂p˜m−1=0. We then gain equation (20) by computing from equation (22).
The gradients ofE2,kp˜m−1 expressed by equations (8) can be calculated by(23)∂E2,kp˜m−1∂p˜m−1=−2mn∫01f2ktB1,nktdt+m+nnd−mnp˜m−1∫01B1,nkt2dt.
Because equation (19) has a unique solution which can be solved by ∂E2,kp˜m−1/∂p˜m−1=0, we then obtain equation (24) by computing from equation (23).
Next, we determine the value ofλk in equation (16) by using the sorting algorithm (see e.g., [18]) described in Algorithm 1.
Algorithm 1: Determining the value of λk in equation (16).
Step 1. Compute δi,kj≔Ei,kp˜m−1j−Ei,kp˜m−1i, i,j=1,2.Step 2. Let gi,k≔∑j=12δi,kj, i=1,2.Step 3. Compute λi,k≔gi,k/g1,k+g2,k, i=1,2.Step 4. If λ1,k≥λ2,k, the weight is taken as λk=λ2,k; else, the weight is taken as λk=λ1,k.
We then obtain the following theorem.Theorem 2.
Given two BBCsB1t and B2t that satisfy C0 connection. For smoothing the two connected BBCs from C0 to C1, the centers of the adjusted control balls which minimized the internal energy Ekp˜m−1 are given by(24)p˜m−1=−BA,q˜1=m+nnd−mnp˜m−1,where(25)A≔λk∫01Bm−1,mkt2dt+m2n21−λk∫01B1,nkt2dt,B≔λk∫01f1ktBm−1,mktdt−mn1−λk∫01f2ktB1,nktdt+m+nnd∫01B1,nkt2dt.Proof.
The gradients ofEkp˜m−1 expressed in equation (16) can be calculated by(26)∂Ekp˜m−1∂p˜m−1=λk∂E1,kp˜m−1∂p˜m−1+1−λk∂E2,kp˜m−1∂p˜m−1=2Ap˜m−1+2B.
Since equation (16) has a unique solution which can be solved by ∂Ekp˜m−1/∂p˜m−1=0, we then get equation (24) by computing from equation (26) and combining it with equation (12).
Analogously, we should determine the values ofωk before solving equation (17). Hence, the following single-objective minimizations are considered:(27)minr˜m−1∈DR1,kr˜m−1,and(28)minr˜m−1∈DR2,kr˜m−1.Lemma 2.
The solution of equation (27), denoted by r˜m−11, is given by the cases as follows:(i)
Ifr˜m−11∈D, we have r˜m−11=r˜m−11, where r˜m−11=−∫01g1ktBm−1,mktdt/∫01Bm−1,mkt2dt.(ii)
Ifr˜m−11∉D and R1,k0≤R1,km+n/mR, we have r˜m−11=0.(iii)
Ifr˜m−11∉D and R1,k0>R1,km+n/mR, we have r˜m−11=m+n/mR.The solution of equation (28), denoted by r˜m−12, is given by the cases as follows:(i)
Ifr˜m−12∈D, we have r˜m−11=r˜m−12, where r˜m−12=m+n/mR+n/m∫01g2ktB1,nktdt/∫01B1,nkt2dt.(ii)
Ifr˜m−12∉D and R2,k0≤R2,km+n/mR, we have r˜m−12=0.(iii)
Ifr˜m−12∉D and R2,k0>R2,km+n/mR, we have r˜m−12=m+n/mR.Proof.
From equation (8), we have(29)dR1,kr˜m−1dr˜m−1=2∫01g1ktBm−1,mktdt+2r˜m−1∫01Bm−1,mkt2dt.
By computing from equation (29), the unique stable point of R1,kr˜m−1, denoted by r˜m−11, can be obtained. There are two cases.Case 1. r˜m−11∈D. Because d2R1,kr˜m−1/dr˜m−12=2∫01Bm−1,mkt2dt>0, the solution of equation (27) must be r˜m−11=r˜m−11.Case 2. r˜m−11∉D. That means R1,kr˜m−1 is monotonous. If R1,k0≤R1,km+n/mR, the solution of equation (27) should be r˜m−11=0; else, the solution of equation (27) should be r˜m−11=m+n/mR. Thus, we obtain the solution of equation (27). In a similar way, we can reach the solution of equation (28).
The value ofωk in equation (17) can be determined by using the sorting algorithm (see e.g., [18]) described in Algorithm 2.
Algorithm 2: Determining the value of ωk in equation (17).
Step 1. Compute εi,kj≔Ri,kr˜m−1j−Ri,kr˜m−1i, i,j=1,2.Step 2. Let hi,k≔∑j=12εi,kj, i=1,2.Step 3. Compute ωi,k≔hi,k/h1,k+h2,k, i=1,2.Step 4. If ω1,k≥ω2,k, the weight is taken as ωk=ω2,k; else, the weight is taken as ωk=ω1,k.
We then obtain the following theorem.Theorem 3.
Given two BBCsB1t and B2t that satisfy C0 connection. For smoothing the two connected BBCs from C0 to C1, the radii of the adjusted control balls which minimized the internal energy Rkr˜m−1 are given by the cases as follows:(i)
If−b/a∈D, the radii of the adjusted control balls are(30)r˜m−1=−ba,s˜1=m+nnR−mnr˜m−1,where(31)a≔ωk∫01Bm−1,mkt2dt+m2n21−ωk∫01B1,nkt2dt,b≔ωk∫01g1ktBm−1,mktdt−mn1−ωk∫01g2ktB1,nktdt+m+nnR∫01B1,nkt2dt.(ii)
If−b/a∉D and Rk0≤Rkm+n/mR, the radii of the adjusted control balls are(32)r˜m−1=0,s˜1=m+nnR.(iii)
If−b/a∉D and Rk0>Rkm+n/mR, the radii of the adjusted control balls are(33)r˜m−1=m+nmR,s˜1=0.Proof.
From equation (17), we have(34)dRkr˜m−1dr˜m−1=ωkdR1,kr˜m−1dr˜m−1+1−ωkdR2,kr˜m−1dr˜m−1=2ar˜m−1+2b.
By computing from equation (34), the unique stable point of Rkr˜m−1, denoted by r˜m−1∗, is r˜m−1∗=−b/a. There are two cases.Case 1. r˜m−1∗∈D. Because d2Rkr˜m−1/dr˜m−12=2a>0, we then get equation (30) by combining it with equation (13).Case 2. r˜m−1∗∉D. That means Rkr˜m−1 is monotonous. If Rk0≤Rkm+n/mR, we can get equation (32) by combining it with equation (13); else, we can get equation (33) by combining it with equation (13).
We roughly describe the methods of smoothing two connected BBCs fromC0 to C1 by minimizing the internal energy as shown in Algorithm 3.
Algorithm 3: Smoothing two connected BBCs from C0 to C1 by minimizing the internal energy.
Step 1. Input two BBCs that satisfy C0 connection.Step 2. Select the value of k to determine which kind of internal energy is adopted.Step 3. Use Algorithm 1 to determine the weight in equation (18) and compute the centers of the adjusted control balls by Theorem 2.Step 4. Use Algorithm 2 to determine the weight in equation (19) and compute the radii of the adjusted control balls by Theorem 3.Step 5. Output two BBCs that satisfy C1 connection.Remark 3.
It is noted that the methods in [2] took the total internal energy of two connected BBCs as the minimization target. Different from [2], we make the internal energy of each segment of two connected BBCs as small as possible, rather than considering the total internal energy of two connected BBCs as small as possible.


## 4. Curve Attractor Minimization

In this section, we use external energy to smooth two connected BBCs fromC0 to C1. The point attractor and the curve attractor are two widely used external energies of a curve. The point attractor pulls a curve towards a given point, and the curve attractor pulls a curve towards a given curve. Since we expect to smooth the connected BBCs to the new reconnected BBCs, we adopt the curve attractor to optimize the control balls.In fact, the curve attractor used for a curve defined by control points can be regarded as the distance between the adjusted control points and their original positions. Thus, the curve attractor of each segment of the two connected BBCs after smoothing can be expressed as two separate parts:(35)F1p˜m−1≔p˜m−1−pm−12,(36)S1r˜m−1=r˜m−1−rm−12,(37)F2p˜m−1≔q˜1−q12=m+nnd−mnp˜m−1−q12,(38)S2r˜m−1≔s˜1−s12=m+nnR−mnr˜m−1−s12.We then get the bi-objective minimizations:(39)minF1p˜m−1,F2p˜m−1T,(40)minr˜m−1∈DS1r˜m−1,S2r˜m−1T.We transform equations (39) and (40) into the single-objective minimizations:(41)minFp˜m−1≔ηF1p˜m−1+1−ηF2p˜m−1,(42)minr˜m−1∈DSr˜m−1≔ρS1r˜m−1+1−ρS2r˜m−1,where η, 0≤η≤1 and ρ, 0≤ρ≤1 are the weights.To solve equation (41), we consider the single-objective minimizations:(43)minF1p˜m−1,(44)minF2p˜m−1.From equations (35) and (37), we can easily get the lemma as follows.Lemma 3.
The solution of equation (43), denoted by p˜m−11, is p˜m−11=pm−1. The solution of equation (44), denoted by p˜m−12, should satisfy m+n/nd−m/np˜m−12=q1, that is, p˜m−12=m+n/md−n/mq1.We then can determine the value ofη in equation (41) referring to Algorithm 1. Here we do not bring the detailed description of this. Furthermore, we get the solution of equation (41) reached by the theorem as follows.Theorem 4.
Given two BBCsB1t and B2t that satisfy C0 connection. For smoothing the two connected BBCs from C0 to C1, the centers of the adjusted control balls which minimized the curve attractor Fp˜m−1 are given by(45)p˜m−1=ηn2pm−1+1−ηmm+nd−mnq11−ηm2+ηn2,q˜1=m+nnd−mnp˜m−1.Proof.
The gradients ofFp˜m−1 expressed in equation (41) can be calculated by(46)∂Fp˜m−1∂p˜m−1=η∂F1p˜m−1∂p˜m−1+1−η∂F2p˜m−1∂p˜m−1,=2ηp˜m−1−pm−1−21−ηmnm+nnd−mnp˜m−1−q1.
Since equation (41) has a unique optimal solution which can be solved by ∂Fp˜m−1/∂p˜m−1=0, we then get equation (45) by computing from equation (46) and combining it with equation (12).
Similarly, we consider the following single-objective minimizations for solving equation (44):(47)minr˜m−1∈DS1r˜m−1,(48)minr˜m−1∈DS1r˜m−1.
From equations (36) and (38), it is not difficult to obtain the following lemma.Lemma 4.
The solution of equation (47), denoted by r˜m−11, is given by the cases as follows:(i)
Ifrm−1∈D, we have r˜m−11=rm−1.(ii)
Ifrm−1∉D and S10≤S1m+n/mR, we have r˜m−11=0.(iii)
Ifrm−1∉D and S10>S1m+n/mR, we have r˜m−11=m+n/mR.The solution of equation (48), denoted by r˜m−12, is given by the cases as follows:(i)
Ifm+n/mR−n/ms1∈D, we have r˜m−12=m+n/mR−n/ms1.(ii)
Ifm+n/mR−n/ms1∉D and S20≤S2m+n/mR, we have r˜m−12=0.(iii)
Ifm+n/mR−n/ms1∉D and S20>S2m+n/mR, we have r˜m−12=m+n/mR.Then, the value ofρ in equation (42) can be determined referring to Algorithm 2. Here we do not bring the detailed description of this. Furthermore, the solution of equation (42) can be reached by the following theorem.Theorem 5.
Given two BBCsB1t and B2t that satisfy C0 connection. For smoothing the two connected BBCs from C0 to C1, the radii of the adjusted control balls which minimized the curve attractor Sr˜m−1 are given by the cases as follows:(i)
Ifn2rm−1+mm+nR−mns1/m2+n2∈D, the radii of the adjusted control balls are(49)r˜m−1=n2rm−1+mm+nR−mns1m2+n2,s˜1=m+nnR−mnr˜m−1.(ii)
Ifn2rm−1+mm+nR−mns1/m2+n2∉D and S0≤Sm+n/mR, the radii of the adjusted control balls are(50)r˜m−1=0,s˜1=m+nnR.(iii)
Ifn2rm−1+mm+nR−mns1/m2+n2∉D and S0>Sm+n/mR, the radii of the adjusted control balls are(51)r˜m−1=m+nmR,s˜1=0.Proof.
From equation (42), we have(52)dSr˜m−1dr˜m−1=ρdSr˜m−1dr˜m−1+1−ρdSr˜m−1dr˜m−1=21+m2n2r˜m−1−2rm−1+mm+nn2R−mns1.
By computing from equation (52), the unique stable point of Sr˜m−1, denoted by r˜m−1∗, is r˜m−1∗=n2rm−1+mm+nR−mns1/m2+n2. There are two cases.Case 1. r˜m−1∗∈D. Because d2Sr˜m−1/dr˜m−12=21+m2/n2>0, we then get equation (49) by combining it with equation (13).Case 2. r˜m−1∗∉D. That means Sr˜m−1 is monotonous. If S0≤Sm+n/mR, we can get equation (50) by combining it with equation (13); else, we can get equation (51) by combining it with equation (13).
The methods of smoothing two connected BBCs fromC0 to C1 by minimizing the curve attractor can be roughly described in Algorithm 4.
Algorithm 4: Smoothing two connected BBCs from C0 to C1 by minimizing the curve attractor.
Step 1. Input two BBCs that satisfy C0 connection.Step 2. Determine the value of η in equation (40) referring to Algorithm 1 and compute the centers of the adjusted control balls by Theorem 4.Step 3. Determine the value of ρ in equation (41) referring to Algorithm 2 and compute the radii of the adjusted control balls by Theorem 5.Step 4. Output two BBCs that satisfy C1 connection.Remark 4.
It is noted that the methods in [17] took the total distance (i.e., curve attractor) between all adjusted control points with their original positions as the minimization target. Different from [17], we synchronously minimize the distance between each adjusted control point and its original position, instead of minimizing the total distance between all adjusted control points and their original positions.


## 5. Combined Energy Minimization

In this section, we consider combining the internal energy and the curve attractor to smooth two connected BBCs fromC0 to C1. We express the combined energy of each segment of the two connected BBCs after smoothing as follows:(53)G1,kp˜m−1≔E1,kp˜m−1+F1p˜m−1,T1,kr˜m−1≔R1,kr˜m−1+S1r˜m−1,G2,kp˜m−1≔E2,kp˜m−1+F2p˜m−1,T2,kr˜m−1≔R2,kr˜m−1+S2r˜m−1,where Ei,kp˜m−1 and Ri,kr˜m−1, i=1,2 are the internal energies used in Section 3 and Fip˜m−1 and Sir˜m−1, i=1,2 represent the curve attractor used in Section 4.Thereby, we obtain the bi-objective minimizations:(54)minG1,kp˜m−1,G2,kp˜m−1T,(55)minr˜m−1∈DT1,kr˜m−1,T2,kr˜m−1T.Analogously, we transform equations (54) and (55) into the single-objective minimizations:(56)minGkp˜m−1≔ξkG1,kp˜m−1+1−ξkG2,kp˜m−1,(57)minr˜m−1∈DTkr˜m−1≔ζkT1,kr˜m−1+1−ζkT2,kr˜m−1,where ξk, 0≤ξk≤1 and ζk, 0≤ζk≤1 are the weights.To solve equation (56), we consider the single-objective minimizations:(58)minG1,kp˜m−1,(59)minG2,kp˜m−1.Lemma 5.
The solution of equation (56), denoted by p˜m−11, is(60)p˜m−11=pm−1−∫01f1ktBm−1,mktdt1+∫01Bm−1,mkt2dt.The solution of equation (58), denoted by p˜m−12, is(61)p˜m−12=n∫01f2ktB1,nktdt+m+nd1+∫01B1,nkt2dt−nq1m1+∫01B1,nkt2dt.Proof.
The gradients ofG1kp˜m−1 can be calculated by(62)∂G1,kp˜m−1∂p˜m−1=∂E1,kp˜m−1∂p˜m−1+∂F1p˜m−1∂p˜m−1=2∫01f1ktBm−1,mktdt+2p˜m−1∫01Bm−1,mkt2dt+2p˜m−1−pm−1.
Since equation (58) has a unique solution which can be solved by ∂G1,kp˜m−1/∂p˜m−1=0, we then get equation (60) by computing from equation (62).
The gradients ofG2,kp˜m−1 can be calculated by(63)∂G2,kp˜m−1∂p˜m−1=∂E2,kp˜m−1∂p˜m−1+∂F2p˜m−1∂p˜m−1,=−2mn∫01f2ktB1,nktdt+m+nnd−mnp˜m−1∫01B1,nkt2dt−2mnm+nnd−mnp˜m−1−q1.
Because equation (59) has a unique solution which can be solved by ∂G2,kp˜m−1/∂p˜m−1=0, we then get equation (61) by computing from equation (63).
Then, we can determine the values ofξk in equation (56) referring to Algorithm 1. Here we do not provide detailed description of this. Furthermore, we reach the solution of equation (56) given by the theorem as follows.Theorem 6.
Given two BBCsB1t and B2t that satisfy C0 connection. For smoothing the two connected BBCs from C0 to C1, the centers of the adjusted control balls which minimized the combined energy Gkp˜m−1 are given by(64)p˜m−1=−DC,q˜1=m+nnd−mnp˜m−1,where(65)C≔ξk1+∫01Bm−1,mkt2dt+m2n21−ξk1+∫01B1,nkt2dt,D≔ξk∫01f1ktBm−1,mktdt−pm−1−mn1−ξk∫01f2ktB1,nktdt+m+nnd1+∫01B1,nkt2dt−q1.Proof.
The gradients ofGkp˜m−1 can be calculated by(66)∂Gkp˜m−1∂p˜m−1=ξk∂G1,kp˜m−1∂p˜m−1+1−ξk∂G2,kp˜m−1∂p˜m−1=2Cp˜m−1+2D.
Since equation (56) has a unique solution which can be solved by ∂Gkp˜m−1/∂p˜m−1=0, we then get equation (64) by computing from equation (66) and combining it with equation (12).
For determining the values ofζk in equation (57), we consider the single-objective minimizations:(67)minr˜m−1∈DT1,kr˜m−1,(68)minr˜m−1∈DT2,kr˜m−1.Lemma 6.
The solution of equation (67), denoted by r˜m−11, is given by the cases as follows:(i)
Ifr˜m−11∈D, we have r˜m−11=r˜m−11, where r˜m−11=rm−1−∫01g1ktBm−1,mktdt/1+∫01Bm−1,mkt2dt.(ii)
Ifr˜m−11∉D and T1,k0≤T1,km+n/mR, we have r˜m−11=0.(iii)
Ifr˜m−11∉D and T1,k0>T1,km+n/mR, we have r˜m−11=m+n/mR.The solution of equation (68), denoted by r˜m−12, is given by the cases as follows:(i)
Ifr˜m−12∈D, we have r˜m−11=r˜m−12, where(69)r˜m−12=n∫01g2ktB1,nktdt+m+nR1+∫01B1,nkt2dt−ns1m1+∫01B1,nkt2dt.(ii)
Ifr˜m−12∉D and T2,k0≤T2,km+n/mR, we have r˜m−12=0.(iii)
Ifr˜m−12∉D and T2,k0>T2,km+n/mR, we have r˜m−12=m+n/mR.Proof.
By computing from equations (8) and (36), we have(70)dT1,kr˜m−1dr˜m−1=2∫01g1ktBm−1,mktdt+2r˜m−1∫01Bm−1,mkt2dt+2r˜m−1−rm−1.
By computing from equation (70), the unique stable point of T1,kr˜m−1, denoted by r˜m−11, can be obtained. There are two cases.Case 1. r˜m−11∈D. Because d2T1,kr˜m−1/dr˜m−12=21+∫01Bm−1,mkt2dt>0, the solution of equation (67) must be r˜m−11=r˜m−11.Case 2. r˜m−11∉D. That means T1,kr˜m−1 is monotonous. If T1,k0≤T1,km+n/mR, the solution of equation (67) should be r˜m−11=0; else, the solution of equation (67) should be r˜m−11=m+n/mR. Thus, we obtain the solution of (67). In a similar, the solution of equation (68) can be reached.
We then can determine the values ofζk in equation (57) referring to Algorithm 2. The detailed description is not provided here. Furthermore, the solution of equation (57) can be gained by the following theorem.Theorem 7.
Given two BBCsB1t and B2t that satisfy C0 connection. For smoothing the two connected BBCs from C0 to C1, the radii of the adjusted control balls which minimized the internal energy Tkr˜m−1 are given by the cases as follows:(i)
If−d/c∈D, the radii of the adjusted control balls are(71)r˜m−1=−dc,s˜1=m+nnR−mnr˜m−1,where(72)c≔ζk1+∫01Bm−1,mkt2dt+m2n21−ζk1+∫01B1,nkt2dt,d≔ζk∫01g1ktBm−1,mktdt−rm−1−mn1−ζk∫01g2ktB1,nktdt+m+nnR1+∫01B1,nkt2dt−s1.(ii)
If−d/c∉D and Tk0≤Tkm+n/mR, the radii of the adjusted control balls are(73)r˜m−1=0,s˜1=m+nnR.(iii)
If−d/c∉D and Tk0>Tkm+n/mR, the radii of the adjusted control balls are(74)r˜m−1=m+nmR,s˜1=0.Proof.
Because(75)dTkr˜m−1dr˜m−1=ζkdT1,kr˜m−1dr˜m−1+1−ζkdT2,kr˜m−1dr˜m−1=2cr˜m−1+2d.
By computing from equation (75), the unique stable point of Tkr˜m−1, denoted by r˜m−1∗, is r˜m−1∗=−d/c. There are two cases.Case 1. r˜m−1∗∈D. Because d2Tkr˜m−1/dr˜m−12=2c>0, we then get equation (71) by combining it with equation (13).Case 2. r˜m−1∗∉D. That means Tkr˜m−1 is monotonous. If Tk0≤Tkm+n/mR, we can get equation (73) by combining it with equation (13); else, we can get equation (74) by combining it with (13).
We describe the methods of smoothing two connected BBCs fromC0 to C1 by minimizing the combined energy as shown in Algorithm 5.
Algorithm 5: Smoothing two connected BBCs from C0 to C1 by minimizing the combined energy.
Step 1. Input two BBCs that satisfy C0 connection.Step 2. Select the value of k to determine which kind of combined energy is adopted.Step 3. Determine the value of ξk in equation (54) referring to Algorithm 1 and compute the centers of the adjusted control balls by Theorem 6.Step 4. Determine the value of ζk in equation (55) referring to Algorithm 2 and compute the radii of the adjusted control balls by Theorem 7.Step 5. Output two BBCs that satisfy C1 connection.Remark 5.
Although the internal energy minimization and the curve attractor minimization have been used to smooth two connected curves, respectively, there are no studies to combine them to smooth two connected curves. We combine these two kinds of minimizations in a new way, which extends the applications of previous methods.


## 6. Numerical Examples

In this section, we present some examples to illustrate the effectiveness of the proposed methods. All the numerical examples are implemented by MATLAB.Example 1.
Given a quartic BBCB1t with control balls(76)p0;r0=−10,1,0;0.05,p1;r1=−7,0,1;0.06,p2;r2=−5,1,0;0.04,p3;r3=−1,1,1;0.02,p4;r4=0,1,0;0.03,and a quintic BBC B2t with control points(77)q0;s0=0,1,0;0.03,q1;s1=2,1,1;0.04,q2;s2=5,1,0;0.06,q3;s3=7,0,1;0.05,q4;s4=8,1,0;0.02,q5;s5=10,0,0;0.01.
It implies that the two BBCs satisfyC0 connection. We smooth B1t and B2t from C0 to C1 by the internal energy minimization. By calculation, the adjusted control balls can be obtained as follows:(a)
Whenk = 1, we have(78)p˜3;r˜3=−22796,2524,148;2536400,q˜1;s˜1=227120,2930,−160;1798000.(b)
Whenk = 2, we have(79)p˜3;r˜3=−809193,368195,−45624447;26/1295,q˜1;s˜1=1841549,283975,36024389;1453822.(c)
Whenk = 3, we have(80)p˜3;r˜3=−1661456,857887,71321081;27/400,q˜1;s˜1=2678919,911887,−69525686;−1144115188075855870.
The connection BBCs before and after smoothing are shown in Figure3.Figure 3
Smoothing two connected BBCs fromC0 to C1 by minimizing the internal energy. (a) C0 connection. (b) C1 connection (k = 1). (c) C1 connection (k = 2). (d) C1 connection (k = 3).
(a)(b)(c)(d)Example 2.
Given a quadratic BBCB1t with control balls(81)p0;r0=−4,0,0;0.1,p1;r1=−2,1,1;0.05,p2;r2=0,1,0;0.02,and a cubic BBC B2t with control points(82)q0;s0=0,1,0;0.02,q1;s1=2,1,1;0.05,q2;s2=5,1,0;0.04,q3;s3=7,0,1;0.02.
It implies that the two BBCs satisfyC0 connection. We smooth B1t and B2t from C0 to C1 by the curve attractor minimization. By calculation, the adjusted control balls can be obtained as follows:(83)p˜1;r˜1=−52,1,−14;7260,q˜1;s˜1=53,1,16;165.
The connection BBCs before and after smoothing are shown in Figure4.Figure 4
Smoothing two connected BBCs fromC0 to C1 by minimizing the curve attractor. (a) C0 connection. (b) C1 connection.
(a)(b)Example 3.
Given a quartic BBCB1t with control balls(84)p0;r0=−8,0,1;0.04,p1;r1=−6,1,0;0.05,p2;r2=−3,0,1;0.02,p3;r3=−2,1,1;0.02,p4;r4=0,0,1;0.04,and a quintic BBC B2t with control points(85)q0;s0=0,0,1;0.04,q1;s1=3,1,1;0.04,q2;s2=4,0,1;0.03,q3;s3=6,1,0;0.05,q4;s4=10,0,1;0.02,q5;s5=12,0,0;0.03.
It implies that the two BBCs satisfyC0 connection. We smooth B1t and B2t from C0 to C1 by the combined energy minimization. By calculation, the adjusted control balls can be obtained as follows:(a)
Whenk = 1, we have(86)p˜3;r˜3=−813293,−1135414,758737;1478300,q˜1;s˜1=1727778,25315152,643658;24415.(b)
Whenk = 2, we have(87)p˜3;r˜3=−1279309,−751680,25301323;9/100,q˜1;s˜1=40631227,751850,8082991;172057594037927936.(c)
Whenk = 3, we have(88)p˜3;r˜3=−73042999,43913162,10561093;9/200,q˜1;s˜1=28311453,−46117277,1024997;9250.
The connection BBCs before and after smoothing are shown in Figure5.Figure 5
Smoothing two connected BBCs fromC0 to C1 by minimizing the combined energy. (a) C0 connection. (b) C1 connection (k = 1). (c) C1 connection (k = 2). (d) C1 connection (k = 3).
(a)(b)(c)(d)


## 7. Conclusion

In this paper, we focus on smoothing two connected BBCs fromC0 to C1 by optimizing their control balls. We propose the algorithms based on internal energy minimization, curve attractor minimization, and combined energy minimization. All the algorithms are established on the basis of solving bi-objective minimizations. The internal energy minimization can be applied in the applications which require the energy of each segment of the connected BBCs after smoothing to be as small as possible. The curve attractor minimization can be applied in the applications which require the adjusted control balls of each segment of the connected BBCs after smoothing not to be far away from their original positions. The combined energy minimization can be utilized in the applications which require each segment of the connected BBCs after smoothing to be as optimal as possible in both targets. Numerical examples show the effectiveness of the proposed algorithms. The proposals would help to improve the smooth continuity of connected BBCs which is often encountered in 3D modeling.We give the smoothing schemes of two connected BBCs fromC0 to C1, and the schemes of smoothing two connected BBCs from Cr−1 to Crr≥2 could refer to the process of that from C0 to C1. However, we do not present the schemes of smoothing two connected BBCs from Cr−1 to Cr+1r≥1. We have tried to use the proposed ideology to smooth two connected BBCs from C0 to C2, but the effect is not satisfactory. This will be our next study issue.



---

*Source: 7669483-2022-08-23.xml*