CAD Model Segmentation Algorithm Using the Fusion of PERT and Spectral Technology

. For complex CAD models, model segmentation technology is an important support for model retrieval and reuse. In this article, we ﬁrst propose a novel CAD model segmentation method that uses the fusion of the program/project evaluation and review technique (PERT) and the Laplacian spectrum theory. By means of PERT, spectral theory, and the CAD models’ geometrical and topological information, we transform the b-rep model faces into two-dimensional coordinate points corresponding to the nodes of the attributed adjacent graph (AAG). The k -means approach with the Silhouette coeﬃcient was employed to conduct un-supervised learning of the coordinate points. The experimental results demonstrate that (1) the proposed approach can eﬀectively transform the b-rep model into a two-dimensional coordinate point set; (2) the k -means algorithm can eﬃciently cluster points to achieve segmentation; and (3) in view of human cognition, the segmentation results are more reasonable. It can eﬀectively divide the point set into several groups to achieve the model segmentation.


Introduction
In terms of the CAD model retrieval, model decomposition as important support technology has been a concerned issue in computational geometry.For complex CAD models, model segmentation technology is an important support for model retrieval and reuse.Especially in partial retrieval, it aims at dividing the complex CAD model into several simple components.at is to say, a CAD model will be converted into a set with all components as elements.Subsequently, the efficiency of the partial retrieval is determined by the granularity of the model elements.When the models are complex, the triangles in mesh models are not sufficiently large as the face in b-rep models [1].erefore, it is imperative to introduce model segmentation, where models are divided into several model components with some basic shape features, replacing triangles or faces.
Traditional segmentation methods are primarily used for mesh models instead of general mechanical CAD models [1].
eir core idea is to divide the model surface into a group of connected subgrids with a simple shape, i.e., by calculating the discrete curvature [2,3]. is kind of segmentation could be interpreted only in a purely geometric sense without any semantic meaning.It is difficult for the segmented regions to be used for model retrieval.Furthermore, these methods require more computational cost which limits the algorithm usage for mechanical CAD models.
To solve the issue mentioned above, we introduce a novel segmentation approach using the fusion of the program (or project) evaluation and review technique (PERT) and the spectral theory.
e PERT is used in project management to analyze and schedule the tasks involved in completing a given project.It is a statistical tool based on network diagram to calculate the time parameters and allocate resources for each task [4].Castro et al. presented how to use the PERT to control the project [5].Ballesteros-Pérez updated the PERT and proposed a refined M-PERT to conduct the modeling of real-life projects and deal with activities that have uncertain durations [6].
Spectral theory is a branch of mathematics that relates the eigenvalue spectra of the adjacency matrix or Laplacian matrix of graphs with other geometric invariants of the graph [7,8].Graph spectrum is an ordered sequence of eigenvalues of adjacency matrices, which can describe topological structure information of graphs in vector form, and the computation time is polynomial.
e Laplacian matrix can be used to find many useful properties of a graph [9].Chung proposed a refined version of the graph spectra, which is based on the Laplacian matrix of the graph and correlates with the graph invariants better than the spectra of the original adjacency matrix [10].
In this article, we propose an innovative method for b-rep model: employing the PERT and spectral theory to preprocess the CAD models to transform each face of the b-rep model into a two-dimensional coordinate point, and taking use of he k-means approach with the Silhouette coefficient to conduct unsupervised learning of the coordinate points.e clustering results are evaluated by the Silhouette coefficient, which could ensure the accuracy and uniqueness.In this study, we mitigate the problem by means of a new partitioning method, and the research results show that the partitioning results are more reasonable boundary regions.

Related Works
3D CAD model segmentation has been an important issue in the computer design area.Various algorithms have been proposed for segmentation.
Most 3D mesh model segmentation algorithms are based on 2D image segmentation, i.e., the 2D space extends to the 3D space.e approaches can be broadly classified into three categories: (1) Region-based: based on features of models (e.g., surface), divide the model into different and nonoverlaping regions using methods such as the region growing method [11,12] and the watershed algorithm [13,14].(2) Graph-based: it generally represents the model in terms of an undirected graph (dual graph [3] and attributed adjacent graph [15]) and segmented by graph cuts [16], normalized cuts [17], and spectral theory [18].(3) e extracted features of the model are clustered, and the points or surfaces of a model having similar property can be obtained according to the clustering result [3,19,20].
Especially for the mesh model and the point cloud model, clustering-based methods are typical and widely used.e clustering algorithm is an unsupervised learning method; it does not require training samples.Many clustering methods are critical for model segmentation.Examples include hierarchical clustering [21,22], fuzzy clustering with graph cuts [23], and spectral clustering [24], and Shlafman et al. introduced the steps of applying the kmeans clustering algorithm to 3D polyhedral models segmentation systematically [25].Garland proposed a hierarchical clustering methodology such that the clusters can be well approximated with planar elements, which can be used for CAD model segmentation [26].Katz and Tal used a hierarchical fuzzy k-means algorithm to segment the objects [21].As in Shlafman et al., their algorithm clusters triangles with a distance function that is a weighted sum of the geodesic distance of the barycenter and the angle between the triangles [25].In the binary partitioning case, their algorithm partitions the mesh into two segmentation areas and a fuzzy area.
Previous literature on problems related to mesh model segmentation abound.However, for mechanical 3D CAD solid models, segmentation methods are rare.
Hitherto, few segmentation methods for CAD models have appeared.Wang et al. proposed a feature-based partitioning algorithm that extracts features from the attributed adjacency graphs using ant colony clustering to conduct the multiobjective optimization.
e segmentation effect is achieved by optimizing the partitioning face and partitioning order [27].From the assembly point of view, Wang et al. likewise developed a graph partitioning method based on ant clustering.e complicated CAD model was first represented and simplified by the attributed adjacent graph, and subsequently the connection mode and part attribute of the model were analyzed to construct the correlation degree matrix, according to the model topological connection relations to reconstruct the local range and density function of ant clustering algorithm [15].Ma employed a surface region segmentation method for CAD models.According to the boundary concavity, the model is divided into a region set of the least number of areas, which is composed of a few interconnected surfaces [28].
For the sake of clarity, we present the visual comparison of each segmentation method which was analyzed before in Table 1.
ese segmentation methods may encounter both the resulting uncertainty problem and the efficiency problem.
e region-based algorithms exhibit satisfying efficiency, but the results may not be unique, since the algorithm starts with different seed faces [1].e cluster-based algorithms can yield a certain result, but their costs are high [1].Meanwhile, they are less effective to find the meaningful components.Additionally, the b-rep model shape is prominent, the boundary between the surfaces is obvious, and the partitioning result is not ideal by a simple curvature dividing [32].

Model Description
In this section, we will present several basic concepts that are related to the model decomposition; subsequently, the concrete steps of the segmentation method are given.

Attributed Adjacency Graph for CAD Models.
e b-rep model is typically used for the description and analysis of solid models, since the b-rep models could present a visualized boundary of the models and also could represent the 3D model unambiguity [33,34].
CAD systems often use some form of b-rep as their internal representation.Most of them generate and express the AAG of the model faces from a STEP file, as presented by El-Mehalawi and Miller [33].A labeled typical mechanical model with its AAG is shown in Figure 1.An AAG 2 Mathematical Problems in Engineering represents the b-rep structure of an entity.In this context, the AAG is four-tuple and could be formulated as where V is a set of nodes in AAG that represents the model faces; E is a set of edges in AAG that represent the model edges; A is a set of properties containing the face properties and edge properties; and D is the node degree.Oneto-one correspondence occurs between the faces of a model and its AAG nodes and between its edges and its AAG links.

Basic Conceptions.
e geometric information of the b-rep model primarily concludes the face and edge information.Herein, the descriptions of the faces and edges are based on the geometric information.

Faces Code Representation.
e AAG nodes' attributes contain the geometrical and topological information of a face in a CAD model.We present a code F code that describes the properties of a face-like face type, i.e., convexity.ese two properties are represented as follows: where f type and f con are both integers that represent the face type and face convexity.In particular, f type 1, 2, 3, 4 or 5 if the face is a plane, cylinder, cone, sphere, or others, respectively; and f con 1, 2, 3 or 4 if the face is planar, convex, concave, or others, respectively.

Edges Code
Representation.e AAG's edges represent the adjacency relationship between two surfaces in a 3D CAD model.ey, as the intersection boundaries, correspond to one or more edges connecting the two faces.An external edge angle is designed as an angle between the two outside faces of two adjacent surfaces, while the angle between the two inside faces of two adjacent surfaces is called as an internal edge angle.e external edge angle φ and internal edge angle ψ are presented in Figure 2, respectively.Here, the value of edge convexity e con is determined by the external angle φ (shown in Figure 2): (1) Convex Edge.If the external edge angle φ is greater than 180 °(or the internal edge angle ψ is less than 180 °), the edge intersected by two adjacent surfaces is called a convex edge.e two adjacent surfaces can be any convex or concave surfaces.Figure 3(a) shows a convex edge between two adjacent surfaces [35].
(2) Concave Edge.If the external edge angle φ of the two adjacent surfaces is less than 180 °(or the internal edge angle ψ is greater than 180 °).
(3) Adjacency Matrix.e adjacency matrix AM is a square n × n symmetric matrix; its elements of the matrix indicate whether pairs of nodes are adjacent in the attributed adjacency graph G.In this special case, using e con , the AM is de ned as follows: For an AM, a ii 0 and a ij a ji for all i, j ∈ 1, 2, . . ., n { } .

Model Description. By means of AAG, a b-rep model in 3D
Euclidean space E 3 could map into a 2D description space S. In AAG, nodes and edges are represented by shape parameters that can be extracted from the STEP and used for further calculation.Each surface of the 3D CAD model is transformed into a 2D coordinate point f(v t ) by the PERT and the graph theory.
In a single code network, the calculation principle of the earliest start time (ES) is as follows: the maximum value of the earliest finish time (EF) of the front closely activities, wherein the earliest start time plus duration is the earliest finish time of the work.
For example, the ES of activity D depends on the EF of B and C; according to the maximum value principle, the ES of D is 9 (see in Figure 4).
Likewise, the AAG of CAD models can be seen as a single node network (see in Figure 5).Weight is equivalent to duration.e duration is 0 or D, respectively, if the weight is 1 or − 1. e horizontal coordinate of node 3 depends on the maximum value of x 1 and x 2 + D.

Horizontal Coordinates Computation.
According to the PERT, geometry, and topological information of each surface of the model, the horizontal coordinate is determined as follows: Step 1: the coordinate matrix corresponding to the AM is computed line by line as follows: where Cor i,j represents the i-th horizontal coordinate of a point corresponding to node v i .ω 1 and ω 2 are weights.f type,j is the j-th face type, and f con,j is the j-th face convexity.num(a ij ) is the number of − 1 from the first to the i-th row in the j-th column of the AM.D is constant.In this article, the value of D is 10.
Step 2: calculate the temporary coordinates of a node point-by-point.For the i-th node, obtain the j value of all a i,j � 1 in the i-th row of the AM.Record the j values in the temporary array ip.Subsequently, the horizontal coordinate of the i-th node p i (x) is computed as follows: where col(i) represents the 1∼i-th row, max(Cor col(i),i ) is the maximum value in the 1∼i-th row of the i-th column, n represents the n-th value in the temporary array ip, and max(Cor col(i),n ) is the maximum value in the 1∼i-th row of the n-th column.

Vertical Coordinates Computation.
e graph theory is introduced to describe the topological information of the graphs in vector form.A graph spectrum is an ordered sequence of eigenvalues of the AM and can describe the topological structure information of the graphs in vector form; additionally, the computation time is polynomial.
e Laplacian matrix L of the model is calculated based on the AM as follows: where u and v are the nodes of the attributed adjacency graph G and d(u) and d(v) represent the degrees of node u and node v, respectively.

Mathematical Problems in Engineering
(1) Spectral Vector.SpV: the spectral vector is the eigenvalue of the Laplacian matrix L in a descending order.
us, a face f can be described by two-dimensional point coordinates p(f i ) � (p x , p y ), where p x is the horizontal coordinate and p y is the vertical coordinate.

Segmentation Method
Based on the analysis of 3D CAD models, we propose a clustering-based segmentation approach.
e main flow chart is shown in Figure 6.It contains five phases: (1) taking b-rep model as input, (2) building the corresponding face attributed adjacency graphs of the 3D CAD models that are introduced in the literature [33], (3) transforming 3D CAD models into 2D coordinate point sets by using the fusion of PERT technology and spectral theory, (4) clustering 2D coordinate points by using of k-means algorithm based on the Silhouette coefficient, and (5) segmenting the 3D CAD model according to the result of clustering.

e k-Means Clustering Algorithm.
Clustering is an iterative process of separating a set of samples into a number of groups with no supervised learning [36].In general, kmeans is widely used owing to its simplicity, versatility, and relatively higher efficiency over other clustering methods.erefore, we make use of the k-means method to cluster two-dimensional coordinate points.
e k-means clustering algorithm gathers data points into k clusters.e cluster S i (i � 1, 2, . . ., k) is associated with the cluster centroids C i [37].We denote the set of data points as P � P 1 , P 2 , . . ., P n  , and let d(P s , P t ) be the distortion between any two points P s and P t .Herein, d(P s , P t ) denotes the Euclidean distance between P s and P t .
e vital part of the proposed algorithm is to construct and utilize the Laplacian matrix to reduce the dimensionality of the dataset.Furthermore, the former transforms the 3D model into a point set in a lower-dimensional eigenspace by utilizing the eigenvectors of a Laplacian matrix derived from the AAG.Subsequently, the k-means algorithm can be performed on this point set to obtain the final clustering result.
e clustering problem can be taken as partitioning an undirected graph, which is an unsupervised learning process.Suppose that an undirected graph is an AAG, i.e., G � (V, E, A, D).Here, E is represented by an adjacent matrix [38].e evaluation criteria are to render the correlation of the two nodes larger in the same subgraph and smaller between different subgraphs [24].
In general, the isolated point affects the effect of the algorithm significantly.Fortunately, in a CAD model, an isolated face does not exist, and each face is adjacent to one or more faces.

Construction of the Silhouette Coefficient.
e Silhouette coefficient is a method of interpretation and validation of consistency within clusters of data. is is to say, it is a type of evaluation method for the performance of clustering algorithms, which provides a parsimonious graphical representation of how well each sample data lies within its cluster [39].
e Silhouette coefficient value can measure how similar a sample data is to its own cluster (cohesion) compared to other clusters (separation).It ranges from − 1 to +1, where a high value indicates that the sample data is well matched to its own cluster and poorly matched to neighboring clusters [39].Amid the specified iteration times, once the Silhouette coefficient reaches the maximum value, the clustering configuration is appropriate.Conversely, the clustering configuration may have too many or too few clusters with a low Silhouette value.
e Silhouette coefficient of point i is calculated as follows: where a(i) is a measure of how well i is matched to its cluster (the smaller the value, the better the matching) and b(i) is the lowest average distance of i to all points in any other cluster, of which i is not a member [40].e global Silhouette coefficient S is the average of the Silhouette coefficient for all points, which can be calculated as follows: where N is the number of sample points.

e Primary Process of k-Means Based on the Silhouette
Coefficient.e k-means algorithm is used to cluster the point set corresponding to the 3D CAD model to achieve model segmentation.e experimental results show that the optimal cluster is less than 10, so the value of k is [2,10].e specific steps are as follows: Step 1: given the number of clustering k, initially set k � 2.
Step 2: initialize the cluster centroid c(x 0 , y 0 ) randomly for k clusters.
Step 3: calculate the Euclidean distance between each point p i (x, y) and the cluster centroid c to classify; the distance is defined as e nearest cluster centroid is determined by the minimum value of the Euclidean distance.
Step 4: According to the previous results, recalculate the mean value of all points in each cluster; subsequently, determine a new cluster centroid and the formulas are as follows: 6 Mathematical Problems in Engineering where m represents the iterated times and c(x (m) 0 , y (m) 0 ) is the cluster centroid iterated m times.
Step 8: proceed to steps 2-5, obtain the k 0 value corresponding to the maximum of the Silhouette coe cient S; it is considered the optimal cluster number.
Step 9: output the cluster result.

Implementation and Results
To verify the proposed algorithm in this study, we performed some experiments for the 3D model segmentation.Here, an example is described to illustrate the implementation of the proposed approach.
5.1.Implementation.Following the discussion above, the proposed algorithm can be formally described as follows: ( e models in Figure 1 show a solid model a. e Laplacian matrix of the model a is depicted in Appendix; all eigenvalues are real and positive and each eigenvalue of SpV 1  1 is the corresponding point vertical coordinate as follows: SpV 1  1 [1.798 1.716 1.607 1.500 1.416 1.335 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 0.950 0.703 0.665 0.536 0.310 0.162 0.000].

Mathematical Problems in Engineering
We now illustrate the determination of the horizontal axis based on a given AM 1 and AAG 1 .
e AAG is an undirected graph.e edge connects two adjacent nodes n and v and is an undirected edge; therefore, it has no specific direction, i.e., e nv and e vn represent the same edge.To avoid duplicate computations, we only use the upper triangular part of AM 1 .Using node 2 and node 4 as an example, node 2 connects node 4 and node 7 with a concave edge; therefore, a 24 and a 27 are equal to − 1(in red) and num(a 24 ) � 2. Node 4 connects node 6 with a concave edge; therefore, a 46 � − 1 (in red) and num(a 46 ) � 1.
According to equations ( 5)∼( 7), we transform the model a into a point set, as shown in Figure 7(a), and subsequently employ the k-means algorithm introduced in Section 3.
Finally, the Silhouette coefficients automatically confirm the number of clusters as k � 4 (shown in Figure 8).e horizontal axis is the number of clusters, and the ordinate is the value of Silhouette coefficient.When k � 4, the value of Silhouette coefficient S is maximum.
e final segmentation result is shown in Figure 7(b).According to this method, the model a could be decomposed into several significant regions (see in Figure 9), where each color represents one part of the model a.

Experiments and Results
. We performed some experiments using the library models to validate the approach proposed herein.
ese tests were implemented on a computer with an Intel 3.20 GHz CPU and a 4.0 GB RAM.
e ACIS 3D Geometric Modeler and Visual C++7.1 development environment were used.
e efficiency and results of the algorithm proposed in this paper are discussed.e method is not only efficient but also could be used in fields of segmentation of general CAD models overcoming the limitations of model types.As it is seen, with utilization of the proposed approach, it is easy to desirably partition the 3D CAD model, and its segmentation results are more in line with human perception.

Run Time for
Segmentation.Time estimation of our approach is visualized in Figure 10.From this curve, we can see that the proposed algorithm is efficient.e implementation on average takes less than a second.e x-axis represents the number of model faces, and the y-axis represents the computational time.
e time cost consists of two parts: one is the coordinates' calculation of points, and the other one is the k-means clustering algorithm complexity.Actually, the former takes a very short time and is negligible.e latter plays a decisive role.at is to say, the complexity of the proposed algorithm strongly depends on the complexity of the k-means algorithm.
erefore, the complexity of proposed algorithmic is O(nkm), where n is the number of model faces, k is the number of clusters, and m is the iterations.As a fast clustering method, k-means clustering algorithm performs quite well, for example, when the size of the AAGs is 587 nodes and the computation time is only 1.374 s. 2 shows the comparison of our approach with method in Ref. [31].As for each model, the faces of the same color represent the same

8
Mathematical Problems in Engineering region and n represents the number of segmentation.e method in Ref. [31] tends to oversegment models.For model 1, it only contains 29 faces.However, the model is divided into 8 regions, and each region does not have sufficient engineering meaning.Furthermore, the segmentations in the four models could not combine the through-hole feature into any other regions, and it also increases the computational complexity of subsequent model comparisons.e segmentation is difficult to apply to model retrieval.All of these models are segmented correctly into meaningful components by our method.Meanwhile, compared with the other methods in Ref. [31], the segmented result in this paper is more consistent with human perception, thus the improving efficiency of model retrieval.
In order to verify the segmentation approach, a set of various models are chosen.
e following are some segmentation experiments for the typical mechanical parts using the proposed method, and the segment results are shown in Figure 11.Rounds and fillets are ignored, since they will not affect the result.Furthermore, the results show that the method proposed is universal, and it is suitable for the segmentation of most conventional CAD models.
Another area that can be benefitted from use of the proposed segmentation method is model reuse.It is possible to get and save meaningful segmented components into the model library for product design.Each segmented component could be conveniently reused by retrieving, copying, and modifying.

Conclusions
In this paper, we develop a segmentation method that is different from the methods of 3D mesh model segmentation.It is innovative to employ the PERT and spectral theory to transform each face of the b-rep model into a two-dimensional coordinate point.We consider both geometrical and topological information and treat model segmentation as a points-clustering problem, using the k-means approach with silhouette coefficient to conduct unsupervised learning of the coordinate points.Additionally, we mainly focus on the concavity of the boundary, since the division mainly appears in the concave edge.at is, the weight between two nodes is − 1. erefore, this method is suitable for many CAD models.
e experimental results clearly show that     Mathematical Problems in Engineering

Figure 1 :Figure 2 :Figure 3 :
Figure 1: Example of an attributed adjacency graph: (a) a solid model with face code; (b) an AAG of the solid model.
Input a set of models M m 1 , m 2 , . . ., m n (2) Transform all the models in M into AAGs G g 1 , g 2 , . . ., g n (3) Transform all the AAGs in G into discrete point set P p(f 1 ), p(f 2 ), . . ., p(f n ) based on equations (5)-(7) (4) Let k 2, and iterate the following steps until k > 10 (the value of k is not xed; instead, it is according to the number of the model faces) (5) Initialize the cluster centroid c(x 0 , y 0 ) randomly for k clusters (6) Compute the centroid for each cluster to obtain a new set of clusters (7) Calculate the Silhouette coe cient S of the k clusters.Obtain the k 0 value corresponding to the maximum of the Silhouette coe cient S (8) Output the nal clustering results in cell array C k 0 Example 1.

Figure 6 :
Figure 6: e ow chart of the proposed segmentation method.

Figure 7 :
Figure 7: (a) Point set for the model a.(b) Result of k-means cluster.

( 1 )
According to the interval parameters and transformational rule, the proposed approach can effectively transform the b-rep model into a twodimensional discrete coordinate point set succinctly.(2) e k-means algorithm can efficiently cluster points to achieve segmentation.e silhouette coefficient could ensure the accuracy and uniqueness and clustering automatically.

Figure 8 :
Figure 8: e curve of the Silhouette coefficients.

Figure 9 :Figure 10 :
Figure 9: Segment result for the model a.

Table 1 :
Summary of the model segmentation method.
[18] modelDual graph is first built, then segmentation is achieved by clustering similar meshes and obtaining minimum graph cuts is method is not usual in CAD models Mejia et al.[18]Mesh modelTreating the mesh model as a connected and undirected graph and relabeling the vertices of the graph based on the Fiedler vector; then, segmentation will be defined by cutting thresholds on it Geometric information is not considered and requiring mesh need to be homogeneous Miandarhoie et al. [3] Mesh model Partitioning the point clouds of mesh model into individual regions can be approximated using extruded surface It lacks semantic meaning Xiao et al. [29] Mesh model Dividing the triangles into sparse and dense regions by the agglomerative hierarchical clustering method, using gauss sphere and mean shift method to segment sparse and dense regions into primary surfaces Segmentation information loss occurs when the method is used for CAD models [30] Shlafman et al. [25] CAD model Using a k-means clustering algorithm to segment model, and the meaningful components of the objects are found e boundaries between the patches are often jagged and not always correct Lavoué et al. [31] Mesh model Classify the vertices according to the absolute values of their principal curvatures into k clusters using the k-means algorithm e parameter k needs to be defined manually .
(3) In view of human cognition, the partitioning results are more reasonable boundary regions with some meaningful engineering semantics.