Data processing method for product 3D printing model design
By extracting and clustering the structural feature value of the initial 3D model of the 3D printing model, intelligent hierarchy is realized, solving the problem of poor hierarchy of the 3D printing model, and improving the printing effect and hierarchy accuracy.
Patent Information
- Application Number
- CN202510678596.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-26
- Publication Date
- 2025-06-24
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the 3D printing model design, poor stratification of the three-dimensional model leads to poor molding effect, resulting in serious layering, loss of details, and difficulty in removing support.
The initial 3D model is generated through 3D scanning, the structural feature values of the three-dimensional contour points are extracted, clustered analysis is performed, and the number of cluster categories is adaptively set to realize intelligent hierarchy of the set of three-dimensional contour points.
The layering accuracy of the 3D printing model is improved, the appearance of layered texture is reduced, the printing effect is enhanced, and the problems of obvious surface texture and heavy printing traces are avoided.
Smart Images

Figure CN120198697A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing, and particularly to a data processing method for product 3D printing model design. Background Art
[0002] 3D printing (three-dimensional printing) technology is an additive manufacturing method of "from scratch" and has been widely popularized in product design. When a 3D printer makes a product model, the model is printed layer by layer. The layer thickness and layer interval of the model will affect the final forming effect of the product model. If the layer thickness is unreasonable, there will be structures with poor forming effects on the model, such as severe layer lines, serious loss of details, and difficult removal of supports. By controlling the layer thickness, the influence of the staircase effect can be reduced to a certain extent. Therefore, usually, the product structure is first stratified from the three-dimensional model, the model is intelligently divided, and each stratified structure is placed and printed separately in a better way to improve the printing effect of the product 3D model.
[0003] Therefore, to solve the problems such as poor stratification of the three-dimensional model resulting in poor forming and deviation of the three-dimensional physical model during the design of the 3D printing model, this application proposes a data processing method for product 3D printing model design. First, an initial 3D model to be printed is generated through 3D scanning or existing virtual design software, then the structure of the initial 3D model is analyzed, the structural feature values of each three-dimensional contour point of the initial 3D model are extracted, and clustering analysis is performed on the set of three-dimensional contour points based on the structural feature values of each three-dimensional contour point, and then the stratification position is obtained, realizing intelligent stratification of the initial 3D model and obtaining a product 3D model with reasonable layer thickness. Summary of the Invention
[0004] To solve the above technical problems, this application provides a data processing method for product 3D printing model design to solve the existing problems.
[0005] A data processing method for product 3D printing model design of this application adopts the following technical solutions:
[0006] An embodiment of this application provides a data processing method for product 3D printing model design, and this method includes the following steps:
[0007] Generate an initial 3D model by 3D scanning;
[0008] Obtain the set of three-dimensional contour points of the initial 3D model according to the three-dimensional contour extraction algorithm;
[0009] Obtain the local three-dimensional window of the three-dimensional contour points centered on the three-dimensional contour points in sequence, and obtain the slope of the three-dimensional contour points according to the initial 3D model surface within the local three-dimensional window of the three-dimensional contour points;
[0010] Obtain the local structural similarity of the three-dimensional contour points according to the gray values of the three-dimensional contour points included in the local three-dimensional window of the three-dimensional contour points on the coordinate plane; construct a local contour change matrix according to the contour change conditions of the three-dimensional contour points in different directions; obtain the local contour change coefficient according to the local contour change matrix; obtain the structural eigenvalue of the three-dimensional contour points according to the local structural similarity and the local contour change coefficient of the three-dimensional contour points;
[0011] Determine the metric distance during clustering according to the differences among the structural eigenvalues, spatial distances, and slopes of the three-dimensional contour points, and evaluate the clustering effect of the three-dimensional contour points within the range of the preset number of clustering categories based on the metric distance to obtain the optimal number of clustering categories;
[0012] Determine the stratification coefficient of the clustering category according to the slopes and structural eigenvalues of the three-dimensional contour points in the clustering category, and perform stratification adjustment on the initial 3D model according to the stratification coefficient.
[0013] Preferably, the specific steps for obtaining the slope of each three-dimensional contour point according to the initial 3D model surface within the local three-dimensional window of each three-dimensional contour point are as follows:
[0014] For each three-dimensional contour point, centered on the three-dimensional contour point, obtain a local three-dimensional window of the three-dimensional contour point with a size of ;
[0015] Use the method of surface fitting to fit the coordinates of the three-dimensional contour points within the local three-dimensional window to obtain the initial 3D model surface, and make a tangent plane to the corresponding initial 3D model surface within the local three-dimensional window of the three-dimensional contour point, which is denoted as the local tangent plane of the three-dimensional contour point;
[0016] Determine the slope of the three-dimensional contour point according to the angle between the local tangent plane of the three-dimensional contour point and the horizontal plane.
[0017] Preferably, the specific steps for obtaining the local structural similarity of the three-dimensional contour points according to the gray values of the three-dimensional contour points included in the local three-dimensional window of the three-dimensional contour points on the coordinate plane are as follows:
[0018] For each three-dimensional contour point, centered on the three-dimensional contour point, obtain a local three-dimensional window of the three-dimensional contour point with a size of ;
[0019] Calculate the gray mean values of the three-dimensional contour points included in the local three-dimensional window of the three-dimensional contour point on the x-plane, y-plane, and z-plane in sequence;
[0020] Determine the local structural similarity of the three-dimensional contour points based on the average gray value and the square of the average gray value of the three-dimensional contour points on the x-plane, y-plane, and z-plane within the local three-dimensional window of the three-dimensional contour points.
[0021] Preferably, constructing the local contour change matrix according to the contour change conditions of the three-dimensional contour points in different directions is specifically as follows:
[0022] For each three-dimensional contour point, calculate the second-order partial derivative of the gray value of the three-dimensional contour point in the direction in sequence, and calculate the second-order mixed partial derivative of the gray value of the three-dimensional contour point in the direction in sequence;
[0023] Take the second-order partial derivative of the three-dimensional contour point in the direction and the second-order mixed partial derivative in the direction as each element of the local contour change matrix of the three-dimensional contour point, and determine the local contour change matrix of the three-dimensional contour point.
[0024] Preferably, the specific steps for obtaining the local contour change coefficient of the three-dimensional contour point according to the local contour change matrix are as follows:
[0025] For each three-dimensional contour point, calculate the three eigenvalues of the local contour change matrix of the three-dimensional contour point, and record the eigenvalue with the largest absolute value as the first eigenvalue;
[0026] Determine the local contour change coefficient of the three-dimensional contour point according to the ratio of the first eigenvalue to the exponential function with the negative product of the absolute values of the three eigenvalues as the base of the natural constant as the exponent.
[0027] Preferably, obtaining the structural eigenvalue of the three-dimensional contour point according to the local structural similarity and the local contour change coefficient of the three-dimensional contour point is specifically as follows:
[0028] For each three-dimensional contour point, determine the structural eigenvalue of the three-dimensional contour point according to the ratio of the local contour change coefficient of the three-dimensional contour point to the exponential function with the local structural similarity as the base of the natural constant as the exponent.
[0029] Preferably, determining the metric distance during clustering according to the differences between the structural eigenvalues, spatial distances, and slopes between the three-dimensional contour points is specifically as follows:
[0030] For each three-dimensional contour point, calculate the sum of the square of the difference in the structural eigenvalue between the three-dimensional contour point and the clustering center, the square of the difference in the slope, and the square of the difference between the three-dimensional coordinates, and take the arithmetic square root of the sum value as the metric distance between the three-dimensional contour point and the clustering center.
[0031] Preferably, the specific steps for obtaining the optimal number of clustering categories are as follows:
[0032] For each different value of K, when calculating the number of clustering categories as K, calculate the metric distance between the three-dimensional contour points within each clustering category and the clustering center, and use the cumulative result of all the metric distances over the K clustering categories as the evaluation parameter for the within-class difference when the number of clustering categories is K;
[0033] Calculate the product of the absolute value of the difference between the structural feature values of the three-dimensional contour points in any two different clustering categories and the absolute value of the difference between the slopes, and use the minimum value among all the products in any two different clustering categories as the evaluation parameter for the between-class difference between any two different clustering categories;
[0034] Use the ratio of the cumulative result of the between-class difference evaluation parameter over the K clustering categories to the evaluation parameter for the within-class difference when the number of clustering categories is K as the clustering effect detection coefficient when the number of clustering categories is K;
[0035] Use the value of K corresponding to the maximum clustering effect detection coefficient as the optimal K value for the clustering division of the three-dimensional contour point set of the initial 3D model.
[0036] Preferably, the hierarchical coefficient of the clustering category is determined according to the slope and structural feature value of the three-dimensional contour points in the clustering category, specifically:
[0037] Based on the optimal K value, divide the three-dimensional contour points in the initial 3D model into different clustering categories;
[0038] For each clustering category, according to the three-dimensional contour points included in the clustering category, calculate the mean value of the slopes of the three-dimensional contour points within the clustering category, and calculate the mean value of the structural feature values of the three-dimensional contour points of the clustering category;
[0039] Use the result of linearly weighting the mean value of the slopes and the mean value of the structural feature values as the hierarchical coefficient of the clustering category.
[0040] Preferably, the hierarchical adjustment of the initial 3D model is performed according to the hierarchical coefficient, specifically:
[0041] For each clustering category, first normalize the hierarchical coefficient of the clustering category to ensure that the hierarchical coefficient is within (0, 1), and set a hierarchical coefficient threshold. Take the three-dimensional contour points within the clustering category with a hierarchical coefficient higher than the hierarchical coefficient threshold as the hierarchical points of the product 3D model in sequence;
[0042] The hierarchical direction of the product 3D model is a plane perpendicular to the Z-axis. Pass planes perpendicular to the Z-axis through each hierarchical point to determine the dividing planes corresponding to each hierarchical point, and the dividing planes are perpendicular to the Z-axis.
[0043] This application has at least the following beneficial effects:
[0044] Through local structure analysis of each three-dimensional contour point of the initial 3D model, this application constructs a metric distance and adaptively sets the number of clustering categories during the clustering process of the three-dimensional contour points, achieving an accurate division of the set of three-dimensional contour points. Then, based on the clustering division result of the set of three-dimensional contour points of the initial 3D model, the intelligent layering of the 3D printing model is completed. This application combines the structural eigenvalue and slope information of each three-dimensional contour point on the contour surface of the initial 3D model to detect the structural condition of each three-dimensional contour point on the initial 3D model, solves the problem of poor layering effect of the initial 3D model, improves the layering accuracy of the initial 3D model, ensures the printing effect of the initial 3D model, and avoids the problems of obvious surface texture and heavy printing traces after the initial 3D model is printed. At the same time, this application performs clustering analysis on the set of three-dimensional contour points of the initial 3D model through a clustering algorithm, which can achieve clustering of three-dimensional contour points with similar features into the same category, facilitating the analysis of the features of three-dimensional contour points, accelerating the analysis speed of three-dimensional contour points, optimizing the metric distance by combining the structural eigenvalue, slope, and three-dimensional coordinate information of each three-dimensional contour point, improving the classification accuracy of three-dimensional contour points, and adaptively setting the number of clustering categories during the clustering process of the set of three-dimensional contour points according to the clustering effect detection coefficient, with high clustering accuracy. Through the layering adjustment of the initial 3D model, the layering effect of the product 3D model can be improved, and the adaptive intelligent layering of the product 3D model can be realized. Description of the Drawings
[0045] To more clearly illustrate the technical solutions and advantages in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0046] Figure 1 It is a flowchart of a data processing method for product 3D printing model design provided by this application;
[0047] Figure 2 It is a schematic diagram of 3D model layering. Detailed Embodiments
[0048] In order to further elaborate on the technical means and effects adopted by this application to achieve the predetermined invention purpose, the following, in combination with the drawings and preferred embodiments, details the specific embodiments, structures, features, and effects of a data processing method for product 3D printing model design proposed according to this application. In the following description, different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. In addition, the specific features, structures, or characteristics in one or more embodiments can be combined in any suitable form.
[0049] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the technical field to which this application belongs.
[0050] The following specifically describes the specific solution of a data processing method for product 3D printing model design provided by this application in conjunction with the accompanying drawings.
[0051] A data processing method for product 3D printing model design provided by an embodiment of this application.
[0052] Specifically, the following is a data processing method for product 3D printing model design. Please refer to Figure 1 , and the method includes the following steps:
[0053] Step S001, generate an initial 3D model to be printed through 3D scanning.
[0054] Since the 3D printing process itself determines that slopes with a very small angle to the plane will produce obvious layer lines. Therefore, if the structural conditions of the product itself are not considered and the same layer thickness is directly used for laser printing on slope structures with a small angle to the plane, it will result in obvious layer lines on the formed surface of the final product 3D model, affecting the 3D model printing effect. Therefore, before printing the 3D model of the product, the initial 3D model to be printed can be obtained on virtual design software first, and the initial 3D model can be layered and structurally divided, and the final effect of the product 3D model can be improved by controlling the layer thickness. First, an initial 3D model to be printed is generated through 3D scanning or existing virtual design software according to the product design structure diagram. It should be noted that the process of producing the initial 3D model by virtual design software and 3D scanning technology is a well-known prior art, and the implementer can select the method and process for obtaining the initial 3D model by himself. In this embodiment, 3D laser scanning technology is used in cooperation with an RGB camera to obtain an initial 3D model with RGB information. The specific process of producing the initial 3D model by 3D laser scanning technology in cooperation with an RGB camera is a well-known prior art and is not within the scope of protection of this embodiment, so no detailed description is made. Thus, an initial 3D model to be printed can be obtained through 3D laser scanning technology in cooperation with an RGB camera.
[0055] Step S002, extract the three-dimensional contour of the initial 3D model, and extract and analyze the structural feature values of each three-dimensional contour point.
[0056] For the obtained initial 3D model, in this embodiment, based on the three-dimensional contour feature information of the initial 3D model, the structural condition of the initial 3D model will be detected and extracted, so as to adaptively set the printing layering position of the product 3D model based on the three-dimensional structure information of the initial 3D model. First, this embodiment will extract the three-dimensional contour of the initial 3D model. It should be noted that there are many algorithms for extracting the three-dimensional contour of the initial 3D model, and the specific extraction process is a well-known prior art and is not within the scope of protection of this embodiment, so it will not be elaborated specifically.
[0057] For the 3D printing process, the layer formed by the initial 3D model is actually stepped. The smaller the angle between the slope surface and the plane, the larger the distance d between layers, the more obvious the surface texture of the model, and the worse the printing effect, as Figure 2 shown. Considering that when the initial 3D model is printed, the slope surface with a very small angle with the plane will produce obvious layer textures, and in the area where the local structure of the initial 3D model is relatively complex, printing traces are extremely likely to appear during the 3D printing process, and the surface texture of the complex area is relatively deep. Therefore, in this embodiment, the surface condition of the initial 3D model will be detected according to the structural feature values of the three-dimensional contour points. The specific process of extracting the structural feature values of the three-dimensional contour points of the initial 3D model is as follows:
[0058] To improve the layering speed of the initial 3D model and improve the layering accuracy, this embodiment will perform clustering analysis on the set of three-dimensional contour points of the initial 3D model. Most of the metric distances in the traditional clustering process are the Euclidean distance and the gray value difference between pixel points. However, for a three-dimensional model, the different local structures of its surface three-dimensional contour points will have a greater impact on the clustering result. Therefore, to improve the clustering accuracy of the set of three-dimensional contour points of the initial 3D model, this embodiment will first extract the structural feature values of the three-dimensional contour points of the initial 3D model to detect the structural condition of the three-dimensional contour points, and optimize the clustering process of the set of three-dimensional contour points according to the structural feature values of the three-dimensional contour points to improve the clustering accuracy.
[0059] First, for the set of three-dimensional contour points composed of the three-dimensional contour points of the initial 3D model, this embodiment will analyze the angle between the surface where each three-dimensional contour point is located and the horizontal plane to detect the surface slope where the three-dimensional contour points of the initial 3D model are located. Taking each three-dimensional contour point as the center in turn, the local For the three-dimensional window, the value of W can be set by the implementer himself / herself. In this embodiment, the size of the local three-dimensional window is set to W = 11. Secondly, the method of three-dimensional surface fitting is used to perform surface fitting based on the coordinate information of the three-dimensional contour points within the local three-dimensional window of each three-dimensional contour point, obtaining the initial 3D model surface within the local three-dimensional window of each three-dimensional contour point, and making a tangent plane to the corresponding initial 3D model surface within the local three-dimensional window of each three-dimensional contour point, denoted as the local tangent plane of each three-dimensional contour point. Further, the angle between the local tangent plane of each three-dimensional contour point and the horizontal plane is obtained, denoted as the slope of each three-dimensional contour point, to characterize the local structure of each three-dimensional contour point in the initial 3D model. Among them, three-dimensional surface fitting with point cloud data is a well-known prior art and is not within the scope of protection of this embodiment, so it will not be elaborated specifically.
[0060] Then, in this embodiment, considering that the structures of different parts of the product are different, there are areas with simple structures and areas with complex structures on the surface of the initial 3D model. And printing traces are likely to occur in the process of 3D printing in the complex areas on the surface of the initial 3D model. Therefore, the layer-by-layer situation of the initial 3D model can be adaptively controlled according to the complexity of the surface contour of the initial 3D model. For the set of three-dimensional contour points, in this embodiment, the distribution of the three-dimensional contour points contained within the local three-dimensional window of each three-dimensional contour point will be detected. For each three-dimensional contour point, the gray-scale mean values of the three-dimensional contour points contained in the x-plane, y-plane, and z-plane within the local three-dimensional window of the three-dimensional contour point are calculated in turn. Among them, the gray-scale value of the three-dimensional contour point can be obtained by gray-scale conversion according to the RGB value of the three-dimensional contour point. The gray-scale conversion is a well-known technology in the field of image processing, and the specific process will not be elaborated. According to the gray-scale mean values of the three-dimensional contour points on the x-plane, y-plane, and z-plane within the local three-dimensional window of the three-dimensional contour point and the square of the gray-scale mean value, the local structure similarity of the three-dimensional contour point is determined. The expression of the local structure similarity of the three-dimensional contour point is:
[0061]
[0062] In the formula, is the local structure similarity of the three-dimensional contour point k, are respectively the gray-scale mean values of the three-dimensional contour points contained in the x-plane, y-plane, and z-plane within the local three-dimensional window of the three-dimensional contour point s, To avoid the minimum value of the denominator being zero, the implementer can set it himself / herself. In this embodiment, it is set to 0.1. The larger the local structure similarity index, the higher the contour gray-scale similarity of the x-plane, y-plane, and z-plane within the local three-dimensional window corresponding to the three-dimensional contour point s, that is, the more uniform and consistent the gray-scale distribution in all directions of the three-dimensional contour point.
[0063] Meanwhile, to improve the clustering accuracy of the three-dimensional contour point set for intelligent partitioning of the initial 3D model according to the three-dimensional contour features of the initial 3D model. Specifically, for each three-dimensional contour point, in this embodiment, the local contour change condition of each three-dimensional contour point is detected, and the local contour change matrix of each three-dimensional contour point is obtained according to the contour change situation of each three-dimensional contour point in each direction. For each three-dimensional contour point, taking the three-dimensional contour point s as an example, the second-order partial derivatives of the gray value of the three-dimensional contour point s in the direction are calculated in sequence, and the second-order mixed partial derivatives of the gray value of the three-dimensional contour point s in the direction are calculated in sequence. The second-order partial derivative of the three-dimensional contour point s in the direction and the second-order mixed partial derivative of the three-dimensional contour point s in the direction are used as the elements of the local contour change matrix of the three-dimensional contour point s to determine the local contour change matrix of the three-dimensional contour point. The local contour change matrix of the three-dimensional contour point s can be expressed as:
[0064]
[0065] In the formula, is the local contour change matrix of the three-dimensional contour point s, are the second-order partial derivatives of the three-dimensional contour point s in the direction respectively, where , , , are the second-order mixed partial derivatives of the three-dimensional contour point s in the direction respectively.
[0066] It should be noted that the specific calculation of the second-order partial derivative and the second-order mixed partial derivative is the prior art. The local contour change matrix of the three-dimensional contour point is used to characterize the local contour change situation of the three-dimensional contour point on the surface of the initial 3D model.
[0067] Preferably, as an example, the process of obtaining the second-order mixed partial derivative in the increasing direction is as follows: for the three-dimensional contour point s, in the increasing direction of the x direction, the difference between the gray values of the contour points adjacent to the contour point divided by the difference in the x coordinates is approximately expressed as: , where , are the gray values of the three-dimensional contour point s and the contour point s + 1 adjacent to the three-dimensional contour point s respectively, , are the x coordinates of the three-dimensional contour point s and the contour point s + 1 adjacent to the three-dimensional contour point s respectively, is the first-order partial derivative of the contour point s in the increasing direction of the x direction. After that, then for By taking a second derivative in the x direction, the second-order partial derivative of the three-dimensional contour point s in the increasing direction of the x direction can be obtained. Furthermore, since the local contour change matrix of the three-dimensional contour point is a real symmetric matrix, the eigenvalues of the local contour change matrix of each three-dimensional contour point are calculated. The local contour change matrix of each three-dimensional contour point corresponds to three eigenvalues. The eigenvalue size of the local contour change matrix is used to characterize the degree of local contour change of the three-dimensional contour point in the direction of the eigenvector. For each three-dimensional contour point, the eigenvalue with the largest absolute value among the three eigenvalues of the local contour change matrix is recorded as the first eigenvalue, and then the local contour change coefficient of the three-dimensional contour point is determined based on the absolute values of the first eigenvalue and the three eigenvalues. The local contour change coefficient expression of the three-dimensional contour point is specifically as follows:
[0068]
[0069] In the formula, is the local contour variation coefficient of the three-dimensional contour point s, e is a natural constant, are the three eigenvalues of the local contour change matrix of the three-dimensional contour point s, is the absolute value of the first eigenvalue.
[0070] Among them, the larger the local contour variation coefficient of the 3D contour point is, the more drastic the contour variation of the 3D contour point in each direction is, and the more complex the contour is.
[0071] Finally, the structural feature value of each 3D contour point is obtained according to the local structural similarity and local contour variation coefficient of each 3D contour point, which is used to detect and characterize the local contour status of each 3D contour point on the initial 3D model. For each 3D contour point, the structural feature value of the 3D contour point is determined according to the local contour variation coefficient and local structural similarity of the 3D contour point. The specific expression of the structural feature value of the 3D contour point is:
[0072]
[0073] In the formula, is the structural eigenvalue of the three-dimensional contour point s, is the local contour variation coefficient of the 3D contour point s, is the local structural similarity of the 3D contour point s, It is an exponential function with the natural constant e as its base.
[0074] At this point, the slope and structural characteristic value of each three-dimensional contour point of the initial 3D model can be extracted according to the above method, and the surface condition of each three-dimensional contour point in the initial 3D model can be characterized.
[0075] Furthermore, the K-means clustering algorithm is combined to cluster and divide the three-dimensional contour point set. For each three-dimensional contour point, according to the square of the difference in the structural feature values between the three-dimensional contour point and the clustering center point, the square of the slope difference, and the square of the difference between the three-dimensional coordinates of the three-dimensional contour point and the corresponding three-dimensional coordinates of the clustering center point, the metric distance between the three-dimensional contour point and the clustering center point is determined. The metric distance expression is:
[0076]
[0077] In the formula, is the structural feature value of the three-dimensional contour point s, is the clustering center point 's structural feature value, is the slope of the three-dimensional contour point s, is the clustering center point 's slope, is the three-dimensional coordinate information of the three-dimensional contour point s, is the clustering center point 's three-dimensional coordinate information, is the metric distance between the three-dimensional contour point s and the clustering center point and is used as the metric distance in the K-means clustering process of the three-dimensional contour point set.
[0078] Meanwhile, considering that for the K value in the K-means clustering process, it is mostly randomly selected in the traditional way, which has great randomness for the initial 3D model surface contour. Therefore, in this embodiment, the K value in the K-means clustering process will be adaptively set.
[0079] First, to avoid the problem of slow convergence and excessive number of iterations in the clustering process, the maximum and minimum number of clustering categories for clustering the three-dimensional contour point set by the K-means algorithm are first set, denoted as respectively. According to the specific structural situation of the initial 3D model, the implementer can set the maximum and minimum number of clustering categories of the three-dimensional contour point set of the initial 3D model by himself / herself. In this embodiment, it is set as: .
[0080] Furthermore, sequentially from Start to perform clustering analysis on the three-dimensional contour point set of the initial 3D model by combining the K-means algorithm and the above-mentioned metric distance. To achieve the adaptive selection of the optimal K value during the clustering iteration process, in this embodiment, a clustering effect detection coefficient is obtained according to the relationship between the three-dimensional contour points within each category and the corresponding clustering center points after clustering analysis. Calculate the sum of the squares of the differences between the three-dimensional contour points within each clustering category and the corresponding clustering category center points when the clustering category is K, and determine the first distance sum; calculate the minimum value of the product of the absolute value of the slope difference and the absolute value of the structural feature value difference between the three-dimensional contour points of any two different clustering categories, and determine the second distance sum; determine the clustering effect detection coefficient when the clustering category is K according to the ratio of the second distance sum to the first distance sum. The specific process is as follows:
[0081] First, evaluate the within-class difference according to the metric distance between the three-dimensional contour points within all clustering clusters and the clustering center when the clustering category is K. The evaluation parameter is expressed as :
[0082]
[0083] In the formula, is the k-th clustering category, is the number of three-dimensional contour points in the k-th clustering category, is the metric distance between the three-dimensional contour point s and the clustering center point in the k-th clustering category.
[0084] Secondly, evaluate the between-class difference in the local structure of the three-dimensional contour points in any two clustering categories based on the differences in the structural feature values and slopes between the three-dimensional contour points within any two clustering categories among the K clustering categories. The between-class difference evaluation parameter between the i-th and j-th clustering categories is expressed as :
[0085]
[0086] In the formula, min() is the minimum value function, 、 are the sets of three-dimensional contour points within the i-th and j-th clustering categories respectively. a and b represent the three-dimensional contour points a and b in the i-th and j-th clustering categories respectively, is the absolute value of the difference between the structural feature values of the three-dimensional contour points a and b, is the absolute value of the difference between the slopes of the three-dimensional contour points a and b.
[0087] After that, comprehensively evaluate the clustering effect when the clustering category is K based on the within-class difference and the between-class difference between different clustering clusters when the clustering category is K. The clustering effect detection coefficient is expressed as :
[0088]
[0089] Among them, the larger the clustering effect detection coefficient is, the better the clustering effect of the corresponding three-dimensional contour point set. Therefore, in this embodiment, the K value corresponding to the maximum value of the clustering effect detection coefficient is used as the optimal K value for clustering and partitioning the three-dimensional contour point set of the initial 3D model.
[0090] Thus, the clustering and partitioning of the three-dimensional contour point set of the initial 3D model can be realized according to the above method to obtain each category, and the three-dimensional contour points included in each category have the same or similar local three-dimensional feature information, which can realize the rapid detection of the three-dimensional surface contour condition of the initial 3D model.
[0091] Step S003: Realize the intelligent layering of the product 3D printing model according to the clustering result of the three-dimensional contour point set of the initial 3D model.
[0092] For each clustering category, in this embodiment, the slope mean value of the clustering category will be calculated according to the three-dimensional contour points included in the clustering category, and the mean value of the structural feature values of the clustering category will be calculated. Through the slope mean value and the mean value of the structural feature values of the clustering category, the layering coefficient of the clustering category is determined. The expression is:
[0093]
[0094] In the formula, is the layering coefficient of clustering category i, is the slope mean value of all three-dimensional contour points in clustering category i, is the mean value of the structural feature values of all three-dimensional contour points in clustering category i, are all weight factors, which can be set by the implementer. In this embodiment, they are set to .
[0095] Secondly, normalize the layering coefficients of each clustering category to ensure that the layering coefficients are in (0, 1), and set a layering coefficient threshold. The three-dimensional contour points in the clustering category with a layering coefficient higher than the layering coefficient threshold are all used as the layering points of the final product 3D model in sequence. It should be noted that the layering direction of the product 3D model is the plane perpendicular to the Z-axis. Passing a plane perpendicular to the Z-axis through each layering point can obtain the corresponding layer plane of each layering point, that is, the layering direction is along the Z-axis for layering. At the same time, the implementer can set the layering coefficient threshold by himself. In this embodiment, the layering coefficient threshold is set to 0.75.
[0096] In summary, in the embodiment of the present application, through the local structure analysis of each three-dimensional contour point of the initial 3D model, a metric distance is constructed, and the number of clustering categories in the clustering process of the three-dimensional contour points is adaptively set, so as to achieve an accurate division of the set of three-dimensional contour points. Furthermore, according to the clustering division result of the set of three-dimensional contour points of the initial 3D model, the intelligent layering of the 3D printing model of the product is completed, and the final 3D model of the product is obtained.
[0097] In the embodiment of the present application, by combining the structural feature values and slope information of each three-dimensional contour point on the contour surface of the initial 3D model, the structural conditions of each three-dimensional contour point on the initial 3D model are detected, solving the problem of poor layering effect of the initial 3D model, improving the layering accuracy of the 3D model of the product, ensuring the printing effect of the 3D model of the product, and avoiding the problems of obvious surface texture and heavy printing traces after the 3D model of the product is printed.
[0098] At the same time, in the embodiment of the present application, through the clustering algorithm, the clustering analysis of the set of three-dimensional contour points of the initial 3D model can be realized, so that the three-dimensional contour points with similar features can be aggregated into the same category, which is convenient for the analysis of the features of the three-dimensional contour points, speeds up the analysis speed of the three-dimensional contour points, optimizes the metric distance by combining the structural feature values, slopes and three-dimensional coordinate information of each three-dimensional contour point, improves the classification accuracy of the three-dimensional contour points, and adaptively sets the number of clustering categories in the clustering process of the set of three-dimensional contour points according to the clustering effect detection coefficient, with high clustering accuracy. Furthermore, the layering effect of the 3D model of the product can be improved, and the adaptive intelligent layering of the 3D model of the product can be realized.
[0099] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
[0100] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between each embodiment can be referred to each other. The key point of each embodiment is to illustrate the differences from other embodiments.
Claims
1. A data processing method for the design of a 3D printing model of a product, characterized in that, The method includes the following steps: 3D scanning to generate an initial 3D model; Obtaining a set of three-dimensional contour points of the initial 3D model according to a three-dimensional contour extraction algorithm; Successively obtaining a local three-dimensional window of each three-dimensional contour point centered on the three-dimensional contour point, and obtaining the slope of the three-dimensional contour point according to the initial 3D model surface within the local three-dimensional window of the three-dimensional contour point; Obtaining the local structural similarity of the three-dimensional contour point according to the gray values of the three-dimensional contour points included in the local three-dimensional window of the three-dimensional contour point in the coordinate plane; constructing a local contour change matrix according to the contour change conditions of the three-dimensional contour point in different directions; obtaining the local contour change coefficient of the three-dimensional contour point according to the local contour change matrix; obtaining the structural eigenvalue of the three-dimensional contour point according to the local structural similarity and the local contour change coefficient of the three-dimensional contour point; Determining the metric distance for clustering according to the differences between the structural eigenvalues, spatial distances, and slopes among the three-dimensional contour points, and evaluating the clustering effect of the three-dimensional contour points within a preset range of the number of clustering categories based on the metric distance to obtain the optimal number of clustering categories; Determining the stratification coefficient of the clustering category according to the slopes and structural eigenvalues of the three-dimensional contour points in the clustering category, and performing stratification adjustment on the initial 3D model according to the stratification coefficient.
2. The data processing method for product 3D printing model design according to claim 1, characterized in that, The specific steps for obtaining the slope of each three-dimensional contour point according to the initial 3D model surface within the local three-dimensional window of each three-dimensional contour point are as follows: For each three-dimensional contour point, centered on the three-dimensional contour point, obtain a local three-dimensional window of three-dimensional contour points with a size of ; Using the method of surface fitting to fit the coordinates of the three-dimensional contour points within the local three-dimensional window to obtain the initial 3D model surface, and making a tangent plane of the corresponding initial 3D model surface within the local three-dimensional window of the three-dimensional contour point through the three-dimensional contour point, which is denoted as the local tangent plane of the three-dimensional contour point; Determining the slope of the three-dimensional contour point according to the angle between the local tangent plane of the three-dimensional contour point and the horizontal plane.
3. A data processing method for product 3D printing model design according to claim 1, characterized in that, The specific steps for obtaining the local structural similarity of the three-dimensional contour point according to the gray values of the three-dimensional contour points included in the local three-dimensional window of the three-dimensional contour point in the coordinate plane are as follows: For each three-dimensional contour point, centered on the three-dimensional contour point, obtain a local three-dimensional window of the three-dimensional contour points with a size of ; Successively calculating the gray mean values of the three-dimensional contour points included in the local three-dimensional window of the three-dimensional contour point in the x-plane, y-plane, and z-plane; Determining the local structural similarity of the three-dimensional contour point according to the gray mean values and the squares of the gray mean values of the three-dimensional contour points in the x-plane, y-plane, and z-plane within the local three-dimensional window of the three-dimensional contour point.
4. A data processing method for product 3D printing model design according to claim 1, characterized in that, The specific steps for constructing a local contour change matrix according to the contour change conditions of the three-dimensional contour point in different directions are as follows: For each three-dimensional contour point, calculate the second-order partial derivative of the gray value of the three-dimensional contour point in the direction in sequence, and calculate the second-order mixed partial derivative of the gray value of the three-dimensional contour point in the direction in sequence; Taking the second-order partial derivative of the three-dimensional contour points in the direction and the second-order mixed partial derivative in the direction as the elements of the local contour change matrix of the three-dimensional contour points, the local contour change matrix of the three-dimensional contour points is determined.
5. A data processing method for product 3D printing model design according to claim 1, characterized in that The specific steps for obtaining the local contour change coefficient of the three-dimensional contour point according to the local contour change matrix are as follows: For each three-dimensional contour point, calculating the three eigenvalues of the local contour change matrix of the three-dimensional contour point, and obtaining the eigenvalue with the largest absolute value, which is denoted as the first eigenvalue; Determining the local contour change coefficient of the three-dimensional contour point according to the ratio of the first eigenvalue to the exponential function with the negative exponent of the product of the absolute values of the three eigenvalues with the natural constant as the base.
6. A data processing method for product 3D printing model design according to claim 1, characterized in that The specific steps for obtaining the structural eigenvalue of the three-dimensional contour point according to the local structural similarity and the local contour change coefficient of the three-dimensional contour point are as follows: For each three-dimensional contour point, determine the structural feature value of the three-dimensional contour point according to the ratio of the local contour change coefficient of the three-dimensional contour point to the exponential function with the natural constant as the base and the local structural similarity as the exponent.
7. A data processing method for product 3D printing model design according to claim 1, characterized in that, The metric distance during clustering is determined according to the differences between the structural feature values, spatial distances, and slopes between three-dimensional contour points, specifically as follows: For each three-dimensional contour point, calculate the sum of the square of the difference in structural feature values, the square of the difference in slopes, and the square of the difference in three-dimensional coordinates between the three-dimensional contour point and the cluster center, and take the arithmetic square root of the sum value as the metric distance between the three-dimensional contour point and the cluster center.
8. A data processing method for product 3D printing model design according to claim 1, characterized in that, The specific steps to obtain the optimal number of cluster categories are as follows: For each different K value, calculate the metric distance between the three-dimensional contour points within each cluster category and the cluster center when the number of cluster categories is K, and take the cumulative result of all the metric distances over K cluster categories as the evaluation parameter for the within-class difference when the number of cluster categories is K; Calculate the product of the absolute value of the difference between the structural feature values and the absolute value of the difference between the slopes of the three-dimensional contour points in any two different cluster categories, and take the minimum value among all the products in any two different cluster categories as the evaluation parameter for the between-class difference between any two different cluster categories; Take the ratio of the cumulative result of the between-class difference evaluation parameter over K cluster categories to the evaluation parameter for the within-class difference when the number of cluster categories is K as the clustering effect detection coefficient when the number of cluster categories is K; Take the K value corresponding to the maximum clustering effect detection coefficient as the optimal K value for the clustering division of the three-dimensional contour point set of the initial 3D model.
9. A data processing method for product 3D printing model design according to claim 1, characterized in that, The hierarchical coefficient of the cluster category is determined according to the slopes and structural feature values of the three-dimensional contour points in the cluster category, specifically as follows: Based on the optimal K value, divide the three-dimensional contour points in the initial 3D model into different cluster categories; For each cluster category, calculate the mean value of the slopes of the three-dimensional contour points within the cluster category and the mean value of the structural feature values of the three-dimensional contour points in the cluster category according to the three-dimensional contour points included in the cluster category; Take the linearly weighted result of the mean value of the slopes and the mean value of the structural feature values as the hierarchical coefficient of the cluster category.
10. A data processing method for product 3D printing model design according to claim 1, characterized in that, The initial 3D model is hierarchically adjusted according to the hierarchical coefficient, specifically as follows: For each cluster category, first normalize the hierarchical coefficient of the cluster category to ensure that the hierarchical coefficient is in (0, 1), and set a hierarchical coefficient threshold. Take all the three-dimensional contour points within the cluster category with a hierarchical coefficient higher than the hierarchical coefficient threshold as the hierarchical points of the product 3D model in turn; The hierarchical direction of the product 3D model is the plane perpendicular to the Z-axis. Pass planes perpendicular to the Z-axis through each hierarchical point to determine the corresponding hierarchical planes for each hierarchical point, and the hierarchical planes are perpendicular to the Z-axis.