## 1 Introduction  
Freeform surfaces play a critical role in the field of shipbuilding, automotive, and aerospace. Toolpath generation is the fundamental task for freeform surface manufacturing. The ideal toolpath should be generated uniformly across the whole surface, and the scallop height should be maintained below the specified value. From the geometric point of view, the freeform surface is generally designed feature-by-feature to satisfy the modeling functionality, and different features usually have diverse manufacturing properties. Therefore, it is difficult to achieve a consistent scallop using single toolpathgeneration algorithms for different features, such as the iso-parametric algorithm [1], iso-planner algorithm [2], and iso-scallop algorithm [3]. Hence, a region-based toolpath generation algorithm has been investigated in the last two decades to solve the problem [4].  
NURBS (Non-Uniform Rational B-spline Surface) is adopted mostly for region-based toolpath generation algorithms, and the boundaries of the sub-regions are represented using analytical curves or discrete points. Hence, a freeform surface behaves like trimmed NURBS after segmentation, which will introduce gaps near the boundaries of sub-regions, and a lot of time-consuming work is needed for toolpath repair with human-machine interaction. T-spline is the latest technology for shape modeling of a freeform surface, and can represent multiple patches watertightly without introducing gaps, which is an ideal tool for region-based freeform surface toolpath generation. Hence, T-spline is adopted to represent a freeform surface for region-based toolpath generation. In our previous research work, region-based toolpath generation algorithms for T-spline surfaces are proposed [5; 6; 7] without considering T-spline surface features. However, this feature is important not only for modeling, but also for manufacturing. Hence, feature recognition technology is studied for region-based toolpath generation in this study.  
It is imperative to recognize the machining features of the T-spline surface for toolpath generation, specifically to segment the T-spline surface into different sub-regions with feature-preserving in order to achieve the high-quality machining toolpath of T-spline surface. In our previous research work [7], the concept of Manufacturing-Suitable Region (MSR) was proposed that consists of sub-regions of a T-spline surface, and owns similar machining properties. The concept of MSR provides new possibilities for region-based T-spline toolpath generation, and three technical routes were presented for the MSRs construction of the T-spline surface (manual, human-machine interaction, and automatic). In the report, the automatic segmentation method is investigated based on watershed technology, which has been applied successfully in image segmentation and mesh segmentation.  
In the paper, watershed-based feature recognition technology is employed to divide the T-spline surface into a set of MSRs, and the toolpath for ball-end finishing milling is generated using the optimized multi-rectangle toolpath generation algorithm for each MSR. The paper is organized as follows. The basic concepts of T-spline and feature recognition technology are reviewed in Section 2. Section 3 presents the proposed method consists of watershed-based feature recognition, MSR generation using T-spline local refinement and PolyBoundingBox construction, and optimized multi-rectangle toolpath generation algorithm. Experiments and discussion are given in Section 4. We end with the conclusion in Section 5.