Development of the geometrical feature extraction tool using DBSCAN clustering for toolpath generation in incremental forming

Incremental forming is an emerging manufacturing technique, which allows the forming of the components without product-specic dies. The process uses Computer Numerical Control (CNC) machine tools to form complicated geometries. A punch, mostly a ball end tool, follows the toolpath obtained from the 3D model of the desired geometry to deform a blank into the desired shape. The objective of the current research is to develop a geometrical feature extraction technology to generate the toolpaths for the incremental forming process. A novel geometrical feature extraction tool, developed using attribute clustering techniques is proposed here. The proposed technology extracts geometrical features from the sliced contoured data of the geometry using Density-Based Spatial Clustering of Applications with Noise (DBSCAN) clustering and convex hull algorithms. Initially, the DBSCAN clustering technique is used for parent feature extraction. Later, child features are extracted from the parent features with the help of a convex hull algorithm. This paper discusses in detail the algorithms developed to extract geometrical features. The performance of the developed algorithms is validated with three different multi-featured geometries representing different types of families like geometries with natural partitions (features are connected with edges), geometries with smoothly connected features, and free form geometries. The results show that the techniques work successfully with different complicated geometries to extract the features. The outcome of this research would help evolve a system for an automatic generation of the feature-based toolpaths for the incremental forming (and similar) processes. in the domains like syntactic pattern recognition, state transition diagrams and automata, logic (if-then) rules and expert systems, graph-based approach, convex-hull volumetric decomposition, cell-based volumetric decomposition, hint-based approach, and hybrid approach. This paper proposes a novel geometrical feature extraction tool, developed using attribute clustering techniques for toolpath development for IF.


Introduction
Toolpath planning is vital for various manufacturing processes, including CNC milling, 3D printing, and Incremental Forming (IF). The procedure of toolpath development somewhat differs for these manufacturing processes. Besides, for manufacturing most of the complex free form geometries, except 3D printing, geometrical feature extraction is a critical part of the toolpath development. A variety of methods are reported for geometrical feature extraction using surface mesh or a point cloud. These methods are categorised into seven domains, namely, edge detection methods, region growing methods, attribute clustering methods, shape tting methods, model-driven methods, deep learning methods, and hybrid methods [1]. In another work of Babic et al. [2], the feature recognition methods were categorised in the domains like syntactic pattern recognition, state transition diagrams and automata, logic (if-then) rules and expert systems, graph-based approach, convex-hull volumetric decomposition, cell-based volumetric decomposition, hint-based approach, and hybrid approach. This paper proposes a novel geometrical feature extraction tool, developed using attribute clustering techniques for toolpath development for IF.
Lu et al. [3] introduced a feature-based toolpath (FBT) generation method for the IF process, in which, unlike the constant Z-height sliced toolpath, equipotential lines based on boundary edges were generated and used for toolpath generation. This method was not suitable for complex parts where the number of boundary edges is more than two. In another work, automatic feature recognition and sequencing strategy were developed by Lingam et al. [4]. In their method, feature separation and recognition steps were performed using silhouette loops on the surface, followed by sequencing of features and toolpath generation. However, nding the silhouette loop involved huge complexity. Ndip-Agbor et al. [5] proposed a new toolpath strategy for toolpath generation for multifeatured parts in case of double-sided incremental forming (DSIF). Their method discussed the strategies of feature separation using a contour relation map and forming using a hierarchical tree structure. Behera et al. [6] had reported optimised toolpath generation algorithms. They proposed a network analysis methodology using topological conceptual graphs to reduce geometrical inaccuracies in the formed part through toolpaths. The FBT strategies mentioned above uses the Stereolithographic (STL) le format for feature extraction. However, the conversion of Computer Aided Design (CAD) surfaces to STL leads to tessellation errors, which cause the loss of topological or geometrical information.
In addition, to minimize the tessellation error (refer Fig. 1), if the number of triangular facets used for the approximation of the geometry is increased, the STL le size becomes large. Thus, feature extraction using STL les makes the process in exible and computationally expensive, which further increases the lead time of the toolpath development process. Direct slicing uses the exact contours of a CAD model as the input; and thus, is more precise. It eradicates the restrictions of STL and avoids tessellation errors associated with the use of an STL model [7][8][9].
Several feature extraction techniques are reported in the literature, while some of the relevant papers are discussed here. In the works of Liu et al [10], Bhandarkar and Nagi [11], and Öztürk et al. [12], the automatic part feature extraction technologies were developed based on Initial Graphics Exchange Speci cation (IGES), neural network approach with boundary representation and Standard for the Exchange of Product model data (STEP) le formats respectively. Lavoué et al. [13] used the curvature values of the triangles of the surface mesh for the geometrical feature extraction using the K-means clustering technique. Zhang et al. [14]used the region growing method for feature extraction using meanshift clustering to cluster the vertices of the mesh. Nagargoje et al. [15] evaluated the performance evaluation clustering techniques to identify the best technique for toolpath development and rated Density-Based Spatial Clustering of Applications with Noise (DBSCAN) clustering over K-means, Hierarchical, and Spectral clustering techniques.
The DBSCAN [16-18] is a density-based clustering technique in which the clusters are built based on density and connectivity of the points in the dataset. The density-based clustering techniques divide the points in the dataset into three categories, namely, core points, border points, and noise or outliers. Two basic input parameters, i.e., epsilon neighbourhood radius (ε) and the minimum number of points (Minpts) inside the epsilon neighbourhood radius are used to categorize the dataset. Based on the de nitions of the points, the clusters are formed. For more details, kindly refer to [16].

Methodology
In this section, the algorithms developed for the geometrical feature extraction are discussed in detail. The section is organised as follows: the details of the development of sliced contoured datasets are discussed at the starting of the section, this is followed by the formation of parent features using DBSCAN technique, and the section ends with the formation of child features using convex hull algorithms.

Development of datasets
In this section, the procedure for the development of the datasets is discussed. Figure 2 shows the procedure for the development of the dataset.
The process starts with modelling of the required geometry using a CAD platform. Later, slicing of part geometries is performed. Slicing is a process of contour generation due to the intersection of a plane with the part geometry. In this research, the planes parallel to the Z plane are used as the intersection planes. The slicing of the surface geometry results in densely connected points forming a closed contour(s). In the multifeatured geometries, the number of contours for each slice would be greater than one. The spatial coordinates of the surface-plane intersection are extracted for further processing. Later, this dataset is divided into different subsets based on Z coordinate values of the points (i.e., sorting of the points based on the Z coordinate value of the points). The number of subsets depends on the depth of the component and the distance between two consecutive intersecting planes (step depth).

Contour Clustering by DBSCAN
Here, the focus would be to correctly identify and segregate each contour present in a slice in the dataset using the DBSCAN clustering algorithm. For the geometries, that can be formed incrementally, the contours generated due to slicing are well separated in most of the cases. If at some point, the contours intersect or part intersection occurs, the developed contour can be formed in a single cycle. Thus, the intersecting contours are treated as a single feature and will not affect the toolpath generation. The outliers or noise, in general, does not appear in the clusters to be formed in this application.
The owchart for the process of contour clustering by DBSCAN is shown in Fig. 4. At the dataset development stage, the dataset is converted into the subset. Initially, the subset one, i.e., the rst slice, is chosen for the contour clustering. In the next step, the input parameters of the DBSCAN are calculated for the subset one. As discussed in Sect. 1, there are two input parameters of the DBSCAN algorithm, the lowest possible value of minimum points is two, and the same is chosen here to avoid the merging of two closely spaced contours. The maximum value of the Euclidean distance between pairs of points in the subset is taken as the value of the radius of the epsilon neighbourhood. Using these input parameters, the DBSCAN clustering solutions are obtained for slice 1. The obtained solutions may contain single or multiple clusters based on the contours available in subset 1. In the next step, each of these clusters is stored separately; also, the mean of the points in each cluster and area of the polygon made by points in the cluster is calculated and stored for further processing. The process is repeated for all subsets (slices) and means, and the areas of the clusters on each slice are stored for the process of formation of the parent feature. Figure 5 shows the output of contour clustering; to get the insight of the process, one slice per dataset is selected randomly and shown here. The mean and area of the polygons are also highlighted. The details of the dataset, the input parameter of the DBSCAN, and the number of clusters identi ed for contour clustering are given in Table 1. It is visible that for datasets 1 and 3, the means of the clusters can be separable from each other, whereas, for dataset 2, the means of the clusters cannot be distinguished from each other.

Formation of groups
After the contour clustering operation is performed for each slice, the groups of contours are formed.
These groups are called parent features. To form the groups, the matrices of means and the polyarea are used. In this section, the procedure for the formation of parent features is discussed in detail. Figure 6 shows the owchart for the procedure of formation of parent features. The matrix of means comprises the means of the multiple contours found as results of the contour clustering for each slice. In the 2D space of X and Y coordinates, the mean of the contour is a parameter that represents the location of the contour. The contours having their means in the close neighbourhood of each other are likely to form a group. Thus, the DBSCAN clustering is used here to form groups based on means of contours. For the groups that are not distinguishable based on the means of the clusters are separated on the basis of the areas of the polygons. The logic is that the areas of the outer clusters would be greater than the areas of the inner clusters. After the formation of the groups based on the means, each group is scanned for slices with concentric clusters. If the slices with concentric clusters are present in the group, the separation of the concentric clusters is performed. After the identi cation of the slices, the areas of the clusters on the slices are called and DBSCAN clustering applied. As the areas for the outer cluster are greater than the inner ones, DBSCAN easily performs the separation process. Figure 7 shows the procedure for the separation of concentric clusters. Figure 8 shows the plots of the means for each cluster on all the slices, where the groups of clusters are formed using the DBSCAN clustering of the means of the clusters. The details of the dataset, input parameters of the DBSCAN, and the number of clusters identi ed for group formation using means are given in Table 2. For the geometries having convex-concave features (2nd geometry in Fig. 3), some of the slices may have concentric contours. For such concentric contours, the mean of the points coincides. In such cases, it is impossible to form two different groups as a convex and concave feature. Thus, the areas of the contours are used for the separation of the concentric features. For the contours developed due to the convex feature, the area of the contours increases with the depth of the component. Whereas, for the concave feature, the area of the contours decreases with the depth of the component. The DBSCAN clustering is applied to separate the contours based on the area of the contours.
From Fig. 8 (b), it is noticed that only 1 group is formed using the means of clusters as means of the clusters are coincident; whereas the maximum clusters on any slice are 3 (refer Fig. 5 (b)). This condition occurs when the clusters are concentric. Thus, this group must follow the step of separation of the concentric clusters. Figure 9 shows the application of the DBSCAN to the areas of the polygons for dataset 2. From Fig. 9, it can be noticed that totally 3 sub-groups are formed. There are 114 slices in the group from slice 1 to slice 111; slice 114 consists of two clusters, whereas slices 112, and 113 have 3 slices each.

Identi cation of the Child Features
After identi cation of the parent features, the child features of the geometries can be extracted using the technique developed with the help of convex hull of the polygon. For a given set of points in the plane, the convex hull of the set is the smallest convex polygon that contains all the points of it. The output of the feature extraction using the DBSCAN clustering is used as the input for the extraction of child feature. The ow chart for the child feature extraction is shown in Fig. 10.
After extraction of the parent feature, each parent feature is analysed separately for child feature extraction, and the points lying inside the convex hull of each slice are extracted. Figure 11 shows the process of application of the convex hull algorithm to polygons. After application of the convex hull algorithm, the points inside the convex hull polygon are selected for further processing. The output of the points inside the convex hull polygon is a single set of points and needs to be separated into distinct sets of points for separate child features. To separate the features, DBSCAN clustering is applied to the extracted points. Figure 12 shows the separate clusters after application of DBSCAN clustering to the extracted points, the asterisk marks are the means of clusters identi ed. This process is repeated for all slices of the parent feature.
After the application of DBSCAN clustering to the extracted points, the clusters are formed, and the means of clusters are used to form the group. Again, the DBSCAN algorithm is applied to the means of clusters to form groups, these groups are child features of the parent features.

Results And Discussion
In this section, the nal outcomes of the feature extraction using DBSCAN clustering and convex hull algorithm are discussed in detail. Results of the parent feature extraction and the child feature extraction are discussed separately for each dataset.

Extraction of the parent features
As discussed in Sect. 2.2, at the stage of formation of groups by the means of clusters; for dataset 1, 3 groups formed are as the parent features. Also, there is no need for further processing for the separation of concentric features. Figure 13 shows the parent features extracted from dataset 1 using DBSCAN clustering. The dog bone shaped feature is termed as parent feature 1, two conical features are termed as parent feature 2 and 3, respectively. Features 1, 2, and 3 in Fig. 13 correspond to the groups 1 (red), 2 (black), and 3 (green) in Fig. 8 (a), respectively. Figure 14 shows the application of the convex hull algorithm to the parent features of dataset 1. Here, the child features are extracted from the parent feature 1 only, as for the parent features 2 and 3 do not show any points inside the convex hull of the polygons. Figure 15 shows the child features extracted using parent feature 1 for dataset 1.

Dataset 2
3.2.1. Formation of the parent features As shown in Fig. 8 (b), at the stage of group formation using the means of clusters for dataset 2, only one group can be formed as the mean of all clusters coincides. The corresponding feature is shown in Fig. 16.
For these kinds of geometries, additional processing, i.e., separation of groups using the areas of clusters is performed. The results of the separation of the features using areas of the clusters are shown in Fig. 17. As shown in Fig. 8 (c), at the stage of group formation using the means of clusters for dataset 3, seven groups are formed, and some noise points are also visible. The noise point represents the null group and does not form the features. The parent features formed for dataset 3 based on the means of the clusters are shown in Fig. 22. As there are no concentric groups formed, the groups formed here are distinct, and thus, termed as parent features. As the parent feature 2 consists of only 2 slices and located outside of the main geometry, it is deleted and not considered for child feature extraction.

Conclusions
This paper proposes a feature extraction technique for toolpath development for the incremental forming process using DBSCAN clustering and convex hull algorithms. The algorithms to extract the parent and child features from sliced contoured data are developed using DBSCAN clustering and convex hull algorithm, respectively. Three different multifeatured geometries are considered to check the performance of the developed algorithms. From the results obtained the following conclusions are drawn: It was observed that the DBSCAN clustering technique works successfully for the contour clustering application irrespective of the shape of the contours in the datasets.
The algorithms developed for feature extraction using DBSCAN and convex hull algorithms automatically detect the number of geometrical features, i.e., the number of the features to extract is not given as an input to the algorithm.
The developed process facilitates the advantage of direct slicing of the CAD models and eliminates the errors arising in the toolpaths due to tessellation errors caused by STL slicing.
The developed methodology is suitable for the smoothly connected features (absence of natural boundary or edge between features) as well as for the geometries having more than two boundary edges.
The results show that the developed techniques work successfully with different types of complicated geometries that can be formed by using the IF process.
This technology being a novel approach to extract and represent the geometrical features in complex geometries will provide exibility while developing the IF toolpaths.

Declarations
Funding: This research was nancially supported by Impacting Research, Innovation, and Technology (IMPRINT) INDIA through a Project of Government of India (Project Number: 5506). The authors wish to acknowledge the funding agencies.

Con icts of interest/Competing interests:
There are, however, no con icts, nancial or otherwise that are related to this study or its outcome. The study staffs have no con icts of interest to report. The authors declare that they have no competing interests.
Availability of data and material: All the data and material used in the study is given in the manuscript.
Code availability: The codes are developed using MATLAB ® based on the algorithms described in the manuscript.
Authors' contributions: Algorithm for application of DBSCAN for the contour clustering Flowchart for the procedure of formation of parent features    Process of application of convex hull algorithm    Child features extracted for parent feature 1 (Dataset 3)

Figure 25
Child features extracted for parent feature 5 (Dataset 3)