## 3 Proposed Method
### Optimized Multi-Rectangles Toolpath Generation for MSRs  
For the task of freeform surface finishing, UV strategy is usually adopted for freeform surface toolpath generation, various algorithms are developed based on UV strategy, such as iso-parametric, iso-scallop, iso-planar, and so on [4]. UV strategy consists of forward cutting and sideward cutting. The calculation of forward steps and sideward steps for a T-spline surface using a ball-end cutting tool can be found in our previous research [5]. UV strategy is convenient to implement for rectangular areas, which is efficient for a NURBS-represented freeform surface due to its rectangle parametric space. However, T-spline has the capability to describe a freeform surface with arbitrary parametric space using a single patch, including a non-rectangle surface and a surface with holes as shown in Figure 6a,b. Hence, it is not straightforward to introduce a UV strategy for the T-spline surface. In our previous research work [5], a multi-rectangles toolpath generation algorithm is presented for T-spline surface based on UV strategy. The T-spline surface can be decomposed into multi rectangles in parametric space, and UV strategies are adopted for each rectangular area intuitively as shown in Figure 6c,d.  
Typically, UV strategy can generate two kinds of toolpath for the same area (U-direction and V-direction). The total length is almost the same for these two types of generated toolpath if the same parameters are employed. However, the reversing number of the cutting tool is totally different for these two types of toolpath, which has significant influence for machining time due to the acceleration and deceleration of the cutting tool near the reversing position. As shown in Figure 6, the reversing number is 37 and 52 in Figure 6c,d separately.  
In our previous research work [5], the global UV strategy is used for each rectangular area to generate the toolpath, which cannot achieve the minimum reversing number. In the study, the type of UV strategy is considered for each rectangular area by means of the U-V ratio \(r_{uv}\) that is defined in Equation (21), where \(len_{u}\) denotes the length of the rectangular area in U direction, and \(len_{v}\) denotes the similar meaning in V direction.  
\[r_{uv}=len_{u}/len_{v} \tag{21}\]  
The \(len_{u}\) and \(len_{v}\) are calculated using Euclidean distance of the sampling points along U or V direction, as shown in Equation (22), where \(m\) and \(n\) are the number of sampling points along U and V direction.  
\[\left\{\begin{array}{l}\sum_{i=1}^{m-1}\sqrt{\left(P_{i+1}-P_{i}\right)^{2} }\\ \sum_{j=1}^{n-1}\sqrt{\left(P_{j+1}-P_{j}\right)^{2}}\end{array}\right. \tag{22}\]  
If \(r_{uv}\) is bigger than 1, U direction is selected for the forward step calculation of toolpath. If \(r_{uv}\) is smaller than 1, V direction is selected for forward step calculation of toolpath. And if \(r_{uv}\) is equal to 1, U and V direction can be selected arbitrarily for toolpath generation. After optimization, the total reversing number of cutting tool achieves the minimum for the whole T-spline surface. As shown in Figure 5e,f the reversing number is 21 and 32 separately.