3D printing model slicing feature compensation method

By constructing the deformation trend axis curve and normal deformation vector field, and combining it with a multilayer perceptron, non-uniform slicing compensation of 3D printed models was achieved. This solved the geometric deviation problem of complex geometric features and high curvature areas in existing technologies, and improved printing accuracy and surface quality.

CN122851976BActive Publication Date: 2026-11-24SHENYANG DUWEI TECH DEV CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202611331425.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-08-31
Publication Date
2026-11-24
Estimated Expiration
2046-08-31

AI Technical Summary

Technical Problem

Existing slicing compensation technology cannot effectively handle non-uniform geometric deviations generated during the molding process of 3D printed models, especially in complex geometric features and high curvature areas, resulting in a decrease in the dimensional accuracy and surface quality of the printed parts.

Method used

By extracting the three-dimensional shape features of the model, constructing the deformation trend axis curve, calculating the normal deformation vector field, and using a multilayer perceptron to drive the interlayer deformation compensator, non-uniform contour offset is achieved, and a set of compensated slice contours is generated.

Benefits of technology

It improves printing accuracy, enhances the consistency of interlayer contours and surface quality, and reduces contour distortion and interlayer misalignment, making it particularly suitable for high-precision manufacturing of complex curved surfaces and suspended structures.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122851976B_ABST
    Figure CN122851976B_ABST
Patent Text Reader

Abstract

This invention discloses a method for compensating slicing features in 3D printed models, belonging to the field of 3D printing technology. The method includes: acquiring triangular mesh data of the 3D model to be printed and performing layered slicing processing to generate an original set of slice contours; constructing a central axis curve of 3D deformation trend within the model entity based on the curvature changes of the contour segments; calculating the normal deformation vector field at the slice plane of each layer based on the geometric relationship between the central axis curve and the original slice contours of each layer; driving a pre-constructed inter-layer deformation compensator through the normal deformation vector field to non-uniformly offset each contour point, generating a compensated set of slice contours; and converting the compensated set of slice contours into motion control commands for the printing equipment. This method achieves adaptive compensation for the slicing features of 3D printed models and can effectively correct shape deviations caused by factors such as material shrinkage.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of 3D printing technology, specifically a method for compensating for sliced ​​features in 3D printed models. Background Technology

[0002] 3D printing technology constructs solid models by layering materials. During the printing process, the materials undergo phase transformations such as melting and solidification, inevitably resulting in volume shrinkage and thermal deformation. This leads to geometric deviations between the final product and the original design model. These deviations are particularly pronounced in sharp features, thin-walled structures, and high-curvature areas of the model, directly affecting the dimensional accuracy and surface quality of the printed part.

[0003] Existing slicing compensation techniques typically use a globally uniform scaling factor or fixed offset to compensate for the overall slice contour. This fixed compensation method ignores the differences in deformation levels between different regions within the model. For models with complex geometric features or non-uniform wall thickness distributions, global uniform compensation may result in insufficient compensation in severely deformed areas and overcompensation in slightly deformed areas, introducing new shape errors. Another common approach is point-by-point deformation prediction based on finite element simulation. Although it can simulate non-uniform deformation, the calculation process is extremely time-consuming and cannot meet the real-time processing requirements of actual printing. Furthermore, the simulation parameters rely on empirical settings, making it difficult to accurately reflect real printing process conditions. Some solutions attempt to correct the contour through preset offset rules, but these rules are mostly based on local geometric information at the two-dimensional level, lacking consideration of the overall three-dimensional deformation trend of the model. They cannot coordinate the deformation continuity between layers, easily causing misalignment of adjacent layer contours and exacerbating the surface step effect of the molded part. Summary of the Invention

[0004] To address the problem that existing slicing compensation techniques struggle to effectively handle non-uniform geometric deviations generated during the molding process of 3D printed models, this invention provides a 3D printing model slice feature compensation method. This method aims to extract the overall deformation trend reflecting the 3D shape characteristics of the model and drive a coordinated inter-layer compensation process guided by this trend. This achieves adaptive non-uniform correction of the contour of each slice layer, accurately compensating for printing deformation while maintaining a smooth transition between layer contours, thus reducing over-compensation and under-compensation.

[0005] The objective of this invention can be achieved through the following technical solutions: This invention provides a 3D printing model slice feature compensation method, which improves printing accuracy by non-uniformly offsetting the contours of the 3D model after layering and slicing.

[0006] This method acquires triangular mesh data of the 3D model to be printed, and generates an original set of slice contours through layered slicing. Based on the curvature changes of each contour segment, a 3D deformation trend central axis curve is constructed inside the model entity. Specifically, the contour of each layer is discretized and the curvature values ​​of the line segment endpoints are obtained. The endpoint with the largest curvature value is used as the feature anchor point of that layer; when there are multiple endpoints with the largest curvature, the endpoint closest to the geometric center of that layer is preferred. The feature anchor points of all layers are linearly interpolated and connected in order of layer height to obtain the initial central axis curve. Then, the average radial distance from all contour points to the initial central axis curve is calculated. The spatial position of the central axis curve is iteratively corrected using this average radial distance until the difference between the average radial distances of the two corrections converges, thus obtaining the deformation trend central axis curve.

[0007] Based on the geometric relationship between the deformation trend axis curve and the original slice contours of each layer, the normal deformation vector field at the slice plane of each layer is calculated. For the current layer, the intersection point of the slice plane and the deformation trend axis curve is determined as the deformation center point, and the direction vector from the deformation center point to each contour point is calculated as the original radial vector. The Euclidean distance between each contour point and the deformation center point is obtained and compared with a preset reference distance to generate a radial scaling factor; this reference distance is preferably the average value of the Euclidean distances between all contour points and the deformation center point in the current layer. The original radial vector is multiplied by the corresponding radial scaling factor to obtain the normal deformation vector of each contour point, and the set constitutes the normal deformation vector field of the current layer.

[0008] A pre-built interlayer deformation compensator is driven by a normal deformation vector field to perform non-uniform offset on each contour point in the original slice contour set. The interlayer deformation compensator is initialized as a multilayer perceptron with the same topology as the original slice contour set. The normal deformation vector field is used as the network input feature to drive the network to output the initial compensation displacement for each contour point. Specifically, the three-dimensional coordinates, normal deformation vector, and neighborhood curvature value of the current contour point can be combined into a multi-dimensional input feature vector, which is then transformed by the nonlinearity of the hidden layer of the multilayer perceptron to output a scalar value as the initial compensation displacement. During training, the variance of the output displacement of different contour points on the same slice contour is used as the regularization loss term. The initial compensation displacement of the current contour point on its adjacent contour points on its respective slice contour is obtained, and the displacement gradient is calculated: the previous and next adjacent points are determined along the contour direction, and their initial compensation displacements are obtained respectively. The first difference between the next adjacent point and the current point and the second difference between the current point and the previous adjacent point are calculated, and the average of the two differences is used as the displacement gradient. If the current point is the start or end point of the contour, the end point or start point is used as the adjacent point to form a closed loop. When the displacement gradient exceeds a preset smoothing threshold, the initial compensation displacement of the current contour point is reduced as the final compensation displacement. This smoothing threshold can be dynamically adjusted according to the perimeter of the slice contour; the larger the perimeter, the smaller the smoothing threshold. After moving each contour point according to the final compensation displacement, they are reconnected to generate a compensated slice contour set.

[0009] For regions with drastic curvature changes in the compensated contour, local enhancement can be performed. The compensated slice contour set is scanned layer by layer, calculating the discrete curvature of each contour point on each contour segment, and comparing it with the local curvature sequence to obtain the local curvature outlier. When the outlier exceeds a preset abrupt change threshold, a preset number of points are expanded along the contour direction centered on the current contour point to form a candidate region. When the interval between adjacent candidate regions is less than a merging threshold, they are merged into the same feature compensation region. Contour points within this feature compensation region are locally resampled to increase point density. For newly added contour points, the normal deformation vector is recalculated based on the deformation trend axis curve, and the inter-layer deformation compensator is driven to output the new compensation displacement. After local correction, the compensated slice contour set is updated.

[0010] To address the high deformation risk of suspended structures, after acquiring triangular mesh data, connectivity analysis is performed to extract triangular faces from all suspended structures, forming a set of suspended feature faces. The minimum support distance between each suspended triangular face and its adjacent slice directly below it is calculated. When the minimum support distance exceeds a preset unsupported critical distance, it is marked as a high-risk deformation region. The original slice contour index corresponding to the high-risk deformation region at the time of slice layering is sent to the inter-layer deformation compensator, instructing it to increase the initial compensation displacement for these contours.

[0011] After generating the compensated slice contour set, periodic error elimination can be performed. The geometric center of each closed contour is extracted, and the offset vector between it and the intercept point of the deformation trend axis curve on the corresponding layer plane is calculated, generating a one-dimensional offset vector sequence. Time series analysis is performed on this sequence to identify trend and periodic terms. When the amplitude of the periodic term exceeds a preset multiple of the slope of the trend term, reverse rotation compensation is applied to all contour points of the corresponding contour layer to eliminate the influence of the periodic term.

[0012] The compensated slice contour set is ultimately converted into motion control commands for the printing equipment. This method constructs a deformation trend axis curve reflecting the changes in model shape and generates a normal deformation vector field driven by curvature and distance. It utilizes a multilayer perceptron to achieve non-uniform contour offset, which can compensate for material shrinkage and local deformation during the printing process. It is particularly suitable for high-precision manufacturing of complex curved surfaces and suspended structures, improves the consistency of interlayer contours and surface quality, and effectively suppresses edge distortion caused by abrupt contour changes.

[0013] The beneficial effects of this invention are: Based on the curvature changes of each contour segment in the original slice contour set, a deformation trend axis curve in three-dimensional space is constructed inside the model entity, and the normal deformation vector field at each slice plane is calculated with this axis curve as the center. This scheme starts from the overall three-dimensional morphology of the model and extracts the internal skeleton lines that characterize the bending and orientation features of the model, so that the definition of deformation direction is no longer limited to the local information of a single slice. The normal deformation vector field is obtained by multiplying the direction vector from the deformation center point to each contour point with a scaling factor generated based on radial distance comparison, where the deformation center point is the intersection of the deformation trend axis curve and the slice plane. This design abstracts complex non-uniform deformation into radial scaling motion based on the three-dimensional axis curve. The direction and magnitude of the compensation displacement are determined by the intrinsic morphological characteristics of the model, enabling slice compensation to adaptively match the deformation requirements of different segments of the model. For models with bending, torsion, and other spatial orientations, it can effectively avoid contour distortion and inter-layer misalignment caused by ignoring the three-dimensional deformation direction.

[0014] Using the normal deformation vector field as input features, a multilayer perceptron with the same topology as the original slice contour set is driven. It outputs the initial compensation displacement for each contour point and adjusts the displacement by calculating the displacement gradient of adjacent contour points and comparing it with a preset smoothing threshold. The multilayer perceptron can learn the nonlinear mapping relationship between the normal deformation vector and the final compensation displacement, overcoming the limitations of fixed rules or simple formulas for compensation. The smoothing adjustment based on displacement gradient analyzes the difference in compensation displacement between the current contour point and its adjacent points. When the gradient exceeds the threshold, it actively reduces the displacement, preventing excessive local displacement jumps in curvature abrupt regions. This ensures a smooth transition of the compensated contour, eliminates contour jaggedness or ripples introduced by compensation, and improves the geometric continuity of the compensated contour and the surface quality of the printed part. Attached Figure Description

[0015] The invention will now be further described with reference to the accompanying drawings.

[0016] Figure 1 This is a flowchart of the 3D printing model slice feature compensation method; Figure 2 This is a flowchart of the method for generating the central axis curve of the deformation trend; Figure 3 This is a flowchart of the compensation displacement smoothing process based on the displacement gradient of multiple contour points; Figure 4 This is a schematic diagram of the feature compensation region identification and local secondary sampling process based on curvature local outlier degree. Detailed Implementation

[0017] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0018] See Figure 1 This invention provides a method for compensating slicing features in 3D printed models, comprising the following steps: acquiring triangular mesh data of the 3D model to be printed; performing layered slicing processing on the model based on the triangular mesh data to generate an original slice contour set; constructing a deformation trend axis curve in 3D space within the model entity based on the curvature changes of each contour segment in the original slice contour set; calculating the normal deformation vector field at the slice plane of each layer based on the geometric relationship between the deformation trend axis curve and the original slice contours of each layer; driving a pre-built inter-layer deformation compensator through the normal deformation vector field to non-uniformly offset each contour point in the original slice contour set to generate a compensated slice contour set; and converting the compensated slice contour set into motion control commands for the printing device.

[0019] In specific implementation, please refer to Figure 2 The process involves discretizing each layer of the original slice contour set, dividing the continuous line segments constituting each layer into ordered line segment endpoints. These endpoints represent discrete coordinate points on the contour, with adjacent endpoints forming a contour line segment. The process of obtaining the curvature values ​​of all line segment endpoints on each layer of the slice contour is as follows: for the i-th line segment endpoint, select the preceding line segment endpoint that is immediately adjacent to it in the contour sequence. and the endpoint of the next line segment The curvature value of the i-th line segment endpoint is calculated using the coordinates of these three points. The formula for calculating the curvature value is:

[0020] in, This represents the curvature value of the endpoint of the i-th line segment. This represents the three-dimensional coordinate vector of the endpoint of the i-th line segment. This represents the three-dimensional coordinate vector of the endpoint of the line segment preceding the endpoint of the i-th line segment in the contour sequence. This represents the three-dimensional coordinate vector of the endpoint of the next line segment after the endpoint of the i-th line segment in the contour sequence. Indicates by and The straight line determined by two points Point to the straight line vertical distance, Point With point The Euclidean distance between them. When the contour is a closed contour, the endpoint of the line segment after the last line segment endpoint is taken as the endpoint of the first line segment of the contour, and the endpoint of the line segment before the first line segment endpoint is taken as the endpoint of the last line segment of the contour, so as to form a closed loop calculation.

[0021] After obtaining the curvature values ​​of all line segment endpoints on each slice contour, the endpoint with the largest curvature value is determined as the feature anchor point of that slice contour. If multiple line segment endpoints in the same slice contour have the same maximum curvature value, the endpoint closest to the geometric center of that slice contour is selected as the feature anchor point. The geometric center of the slice contour is obtained by calculating the arithmetic mean of the coordinates of all line segment endpoints on that slice contour; the geometric center is a three-dimensional coordinate point. The distance is calculated using Euclidean distance, and the endpoint with the largest curvature value and the shortest Euclidean distance to the geometric center is selected as the feature anchor point.

[0022] After obtaining the feature anchor points of all layers, these feature anchor points are sorted in ascending order according to the height value of their respective slice layers. Two adjacent feature anchor points are then connected sequentially to form a spatial polyline that runs through all layers; this spatial polyline is the initial central axis curve. The connection method is a straight line connection, that is, a three-dimensional spatial straight line is drawn directly between the coordinates of every two adjacent feature anchor points of different height layers, and all straight line segments connected end-to-end form the complete initial central axis curve.

[0023] Centered on the initial central axis curve, calculate the shortest distance from each contour point in all layers of the original slice contour set to the initial central axis curve, and take the arithmetic mean of all shortest distances as the average radial distance. The shortest distance from a contour point to the initial central axis curve is the minimum value among the shortest Euclidean distances from that contour point to all straight line segments that constitute the initial central axis curve.

[0024] After obtaining the average radial distance, iterative correction of the initial central axis curve begins. In each iteration, for each feature anchor point constituting the current central axis curve, all contour points in the slice layer containing that feature anchor point are obtained, and the geometric center of these contour points is calculated. The feature anchor point is moved along the direction from its own position towards this geometric center, with the moving distance equal to half the difference between the current average radial distance and the distance from the feature anchor point to this geometric center. After moving all feature anchor points, the updated central axis curve is obtained. The average radial distance from all contour points in the original slice contour set to the updated central axis curve is recalculated using the updated central axis curve, resulting in a new average radial distance. The new average radial distance is compared with the average radial distance obtained in the previous iteration, and the absolute value of the difference between the two is calculated. The above iterative process is repeated until the difference between the average radial distances calculated in two adjacent iterations is less than a preset convergence threshold, at which point the iteration stops. The convergence threshold is set to 0.01 mm, a value that matches the positioning resolution of current mainstream fused deposition modeling (FDM) printing equipment, ensuring the accuracy of the axis correction. The central axis curve obtained when the iteration stops is the deformation trend central axis curve.

[0025] In practice, for a given original slice outline of a current layer, the slicing plane containing that original slice outline is first determined. The slicing plane is a two-dimensional plane perpendicular to the printing stacking direction, and its spatial position is determined by the layer height value of the current layer during layered slicing. The intersection operation is performed between the deformation trend axis curve and the slicing plane of the current layer to obtain a three-dimensional spatial intersection point, which is defined as the deformation center point of the current layer.

[0026] Calculate the direction vector from the deformation center point to each contour point on the original slice contour of the current layer. For a contour point, subtract the three-dimensional coordinates of the deformation center point from its three-dimensional coordinates to obtain a three-dimensional vector. Normalize this three-dimensional vector by dividing it by its magnitude; the resulting direction vector is the original radial vector of this contour point. Perform the above operation on all contour points sequentially to obtain the original radial vector of each contour point.

[0027] In an optional implementation, the Euclidean distance between each contour point and the deformation center point on the original slice contour of the current layer is obtained. For a contour point, the Euclidean distance is obtained by calculating the Euclidean norm between the three-dimensional coordinates of the contour point and the three-dimensional coordinates of the deformation center point. After calculating the Euclidean distances corresponding to all contour points, these Euclidean distances are summed and divided by the total number of contour points to obtain the average value of the Euclidean distances between all contour points and the deformation center point on the original slice contour of the current layer. This average value is used as a preset reference distance.

[0028] The process of obtaining the radial scaling factor for each contour point is as follows: For each contour point, divide the preset reference distance by the corresponding Euclidean distance; the resulting ratio is the radial scaling factor for that contour point. The magnitude of the radial scaling factor reflects the required degree of radial deformation of the contour point relative to the deformation center point; when the contour point is within the reference distance, the radial scaling factor is greater than 1; when the contour point is outside the reference distance, the radial scaling factor is less than 1.

[0029] Optionally, the radial scaling factor is calculated according to the following formula:

[0030] in, This represents the radial scaling factor of the j-th contour point on the original slice contour of the current layer. This represents the preset baseline distance, which is the average Euclidean distance between all contour points on the original slice contour of the current layer and the deformation center point. This represents the Euclidean distance between the j-th contour point on the original slice contour of the current layer and the deformation center point. By accumulating all contour points of the current layer The value is obtained by dividing the result by the total number of contour points in the current layer.

[0031] The original radial vector of each contour point is multiplied by its corresponding radial scaling factor to obtain a three-dimensional vector, which is the normal deformation vector of the corresponding contour point. The direction of the normal deformation vector is the same as that of the original radial vector, and its magnitude is equal to the product of the magnitude of the original radial vector and the radial scaling factor. Since the original radial vector has been normalized, the magnitude of the normal deformation vector is equal to the radial scaling factor. The normal deformation vectors corresponding to all contour points on the original slice contour of the current layer are aggregated into a set, which constitutes the normal deformation vector field at the slice plane of the current layer.

[0032] In specific implementation, please refer to Figure 3The inter-layer deformation compensator is initialized as a multilayer perceptron (MLP). The topology of the MLP is consistent with that of the original slice contour set; that is, the MLP processes the data of each contour point on the slice contour layer by layer, but the network weights are shared across all contour points. The MLP consists of one input layer, four hidden layers, and one output layer. The input layer has seven neurons, corresponding to the seven dimensions of the multidimensional input feature vector. The first hidden layer contains sixty-four neurons, the second hidden layer contains one hundred and twenty-eight neurons, the third hidden layer contains sixty-four neurons, and the fourth hidden layer contains thirty-two neurons. Each hidden layer is followed by a modified linear unit activation function. The output layer contains one neuron and does not use an activation function; it directly outputs a scalar value, which is the initial compensation displacement. Neurons in adjacent layers are fully connected.

[0033] For each contour point in the original slice contour set, a multidimensional input feature vector is constructed. This multidimensional input feature vector consists of seven values: the three-dimensional coordinates of the contour point contain three values—the x, y, and z coordinates in the printing space coordinate system; the normal deformation vector of the contour point contains three values—the three components of the normal deformation vector along the x, y, and z axes; and the neighborhood curvature value of the contour point on its respective slice contains one value, obtained by taking the curvature values ​​of the three contour points before and after the contour point on its slice contour and calculating the arithmetic mean of these curvature values. These seven values ​​are then concatenated sequentially into a seven-dimensional vector, which serves as the multidimensional input feature vector corresponding to this contour point.

[0034] A multidimensional input feature vector is fed into the input layer of a multilayer perceptron. Each of the seven neurons in the input layer receives a value from the seven-dimensional vector and passes it verbatim to the first hidden layer. In the first hidden layer, the value from the input layer is multiplied by its corresponding connection weight, summed, and then a bias value is added. This sum is then processed by a modified linear unit function to obtain the output value, which is passed to the second hidden layer. Subsequent hidden layers perform the same operation until the output layer. The output layer receives the output value from the fourth hidden layer, multiplies it by its connection weight, sums it, and then adds the output layer bias value to obtain the output scalar value. This output scalar value serves as the initial compensation displacement for the corresponding contour point.

[0035] When training the multilayer perceptron (MLP), a pre-collected set of 3D model printing deformation sample data is used. Each sample contains a set of original slice contours of a 3D model and the corresponding true compensation displacement, which is obtained by measurement after actual printing. The original slice contours in the samples are used to generate a normal deformation vector field and neighborhood curvature values ​​as described above, constructing a multidimensional input feature vector which is then input into the MLP to obtain the initial compensation displacement prediction value. The mean square error between the predicted value and the true compensation displacement is calculated as the contour fidelity loss term. Simultaneously, for all contour points on the same slice contour, the variance of the initial compensation displacement output by the MLP for these contour points is calculated, and this variance is used as the regularization loss term. The regularization loss term is calculated as follows: obtain the initial compensation displacement of n contour points on the same slice contour. Calculate the mean of these initial compensation displacements. Then calculate The total loss function is optimized by minimizing the sum of the contour fidelity loss term and the regularization loss term. The weight coefficient λ of the regularization loss term is set to 0.01. This value is selected from four candidate values ​​(0.001, 0.01, 0.1, and 1.0) based on the contour continuity index on the validation set through grid search, ensuring smooth displacement changes on the same contour without excessive loss of accuracy. The weights and bias parameters of the multilayer perceptron are updated using an adaptive moment estimation optimizer. The initial learning rate is set to 0.001, and the batch size is set to the number of contour points on the entire slice contour. Training stops when the total loss function value decreases by less than one percent over ten consecutive training epochs.

[0036] When obtaining the initial compensation displacement of the current contour point's adjacent contour points on its respective slice contour, the adjacent contour points are determined along the direction of the original slice contour. For closed contours, following the counter-clockwise sequence of the contour, the current contour point has a preceding and a following adjacent contour point. When the current contour point is the first point in the contour sequence, the last point in the contour sequence is taken as the preceding adjacent contour point; when the current contour point is the last point in the contour sequence, the first point in the contour sequence is taken as the following adjacent contour point, thus forming a closed-loop process. For open contours, if the current contour point is the starting point, there is no preceding adjacent contour point, and only the following adjacent contour point is considered for subsequent calculations; if the current contour point is the ending point, there is no following adjacent contour point, and only the preceding adjacent contour point is considered for subsequent calculations; if the current contour point is neither the starting point nor the ending point, then both preceding and following adjacent contour points exist. The initial compensation displacement of the preceding adjacent contour point is obtained separately. and the initial compensation displacement of the next adjacent contour point .

[0037] Calculate the displacement gradient between the current contour point and the initial compensation displacement of adjacent contour points using the following formula:

[0038] in, This represents the displacement gradient corresponding to the k-th contour point. This represents the initial compensation displacement of the k-th contour point. This represents the initial compensation displacement of the previous adjacent contour point of the k-th contour point. This represents the initial compensation displacement of the next adjacent contour point of the k-th contour point. For the case where there is only one adjacent contour point, the displacement gradient... Take directly or That is, the only difference between two adjacent points.

[0039] In an optional implementation, a smoothing threshold is preset to limit the abrupt change in displacement between adjacent contour points. The smoothing threshold is dynamically adjusted based on the perimeter of the current layer slice contour: the perimeter value of the current layer slice contour is obtained by summing the Euclidean distances between all adjacent contour points on the slice contour; the preset baseline smoothing coefficient is divided by the perimeter value to obtain the smoothing threshold. The baseline smoothing coefficient is set to 0.5 mm². The principle behind this value is that on a typical contour with a perimeter of 100 mm, the smoothing threshold is approximately 0.005 mm, which is on the same order of magnitude as the positioning resolution of the printing device, thereby avoiding contour fluctuations while maintaining detail compensation capabilities.

[0040] When the displacement gradient of a certain contour point When the smoothing threshold is exceeded, the initial compensation displacement of this contour point is reduced. The reduction process involves calculating the smoothing threshold and the displacement gradient. The ratio of [value] to [value] is compared, and the smaller of the two is taken as the adjustment coefficient; the initial compensation displacement is [value]. Multiplying by an adjustment factor yields the reduced displacement, which serves as the final compensation displacement for this contour point. When the displacement gradient... When the initial compensation displacement is less than or equal to the smoothing threshold, It is directly used as the final compensation displacement.

[0041] After obtaining the final compensation displacement for each contour point in the original slice contour set, each contour point is moved along the direction of its normal deformation vector by the distance indicated by the final compensation displacement to obtain the spatial position of the compensated contour point. All compensated contour points on the same layer of slice contour are reconnected according to the connection order of the original contour to form a new closed or open contour. The new contours of all layers together constitute the compensated slice contour set.

[0042] In specific implementation, please refer to Figure 4 After converting the compensated slice contour set into motion control commands for the printing device, the compensated slice contour set is scanned layer by layer. The layer-by-layer scanning process involves sequentially reading the contour data of each slice contour in the compensated slice contour set, according to the slice layer height from low to high. The contour data includes the three-dimensional coordinate sequence of all contour points constituting that layer's slice contour and the connecting line segments between adjacent contour points. For each layer's slice contour, the discrete curvature of each contour point on each contour line segment is calculated. The discrete curvature is calculated as follows: on the compensated slice contour, for the m-th contour point... Get its previous contour point and the next contour point The curvature of the circular arc is calculated using the coordinates of three points, and this curvature is used as the discrete curvature value of the m-th contour point. .

[0043] After obtaining the discrete curvature value of each contour point, a local curvature sequence is constructed for each contour point. The local curvature sequence consists of eleven discrete curvature values: the discrete curvature values ​​of the five consecutive contour points before and after the current contour point along the contour direction, and the discrete curvature value of the current contour point itself. The median of the local curvature sequence is calculated and denoted as [the median value is missing from the original text]. The interquartile range (IQR) of the local curvature sequence is calculated. The IQR is the difference between the third quartile and the first quartile of the local curvature sequence. The process of obtaining the local curvature outlier of the current contour point is calculated using the following formula:

[0044] in, This represents the local outlier of the curvature at the m-th contour point in the compensated slice contour set. This represents the discrete curvature value of the m-th contour point. Let represent the median of the local curvature sequence corresponding to the m-th contour point, and IQR represent the interquartile range of the local curvature sequence corresponding to the m-th contour point. To represent a very small positive number, The value is set to 0.0001. This value is chosen to avoid division by zero errors when IQR is zero, and it is much smaller than the curvature value, so it will not have a substantial impact on the calculation results of local curvature outliers.

[0045] A mutation threshold is preset, which is used to determine whether the change in contour curvature is abnormal. The mutation threshold is obtained by: statistically analyzing the local curvature outlier values ​​of all contour points in the compensated slice contour set, removing outliers whose local curvature outlier values ​​exceed the 95th percentile of all local curvature outlier values, calculating the arithmetic mean of the remaining local curvature outlier values, multiplying the arithmetic mean by three, and using the product as the preset mutation threshold.

[0046] When the curvature of a certain contour point is a local outlier When the abrupt change exceeds a preset threshold, a preset number of contour points are extended forward along the slice contour, centered on this contour point, and simultaneously, a preset number of contour points are extended backward along the slice contour. The preset number is set to five contour points. The basis for this preset number is that for most fused deposition modeling (FDM) slice contours with a layer thickness between 0.1 mm and 0.3 mm, the corresponding physical distance of the extension is within the range of 0.5 mm to 1.5 mm, which is comparable to the span of typical feature transition areas. The continuous contour segment formed after the extension, including the central contour point, is considered as a candidate region.

[0047] In an optional implementation, a merging check is performed on all candidate regions. The interval between two adjacent candidate regions is checked: the endpoint contour point of the preceding candidate region along the contour direction is obtained, and the starting contour point of the following candidate region along the contour direction is obtained. The cumulative length of all contour segments traversed between the endpoint and starting contour points is calculated along the slice contour direction; this cumulative length is the interval between the two adjacent candidate regions. A merging threshold is preset, set to eight times the average distance between adjacent contour points. The average distance between adjacent contour points is calculated by dividing the perimeter of the current layer slice contour by the total number of contour points on the current layer slice contour. The basis for setting the merging threshold to eight times the average distance between adjacent contour points is that, under typical contour sampling density, eight times the distance corresponds to a physical distance of approximately 0.8 mm to 2.4 mm, consistent with the influence range of corner features. Feature abrupt change regions smaller than this interval belong to the same deformation source mechanically. When the interval distance is less than the merging threshold, the two adjacent candidate regions are merged into a single feature compensation region. The merged feature compensation region extends from the starting contour point of the preceding candidate region to the endpoint contour point of the following candidate region. Merge checks are performed on all candidate regions sequentially until no new merges occur. The region that is ultimately retained is the marked feature compensation region.

[0048] Local secondary sampling is performed on all contour points within the feature compensation region. The process involves obtaining the line segment lengths between existing adjacent contour points within the feature compensation region and comparing this length with a target sampling interval. The target sampling interval is set to one-third of the average spacing of all contour points on the slice contour where the feature compensation region is located. This value is chosen to ensure that the density of contour points after secondary sampling is three times the original density, sufficient to capture subtle changes in the compensation amount during subsequent calculations of new compensation displacement. When the line segment length between adjacent contour points is greater than the target sampling interval, new contour points are uniformly inserted into this line segment. The number of inserted contour points is the line segment length divided by the target sampling interval and rounded down. The coordinates of the inserted new contour points are calculated by linear interpolation between the coordinates of the two endpoints of the line segment. After performing the above operation on all line segments within the feature compensation region, the density of contour points within the feature compensation region is increased, and the newly added contour points are incorporated into the compensated slice contour set.

[0049] For the newly added contour points after secondary sampling, the normal deformation vector of the newly added contour points is recalculated based on the deformation trend axis curve. The calculation steps are as follows: determine the slice plane where the newly added contour points are located, and find the intersection point of the slice plane and the deformation trend axis curve as the deformation center point; calculate the direction vector from the deformation center point to the newly added contour points and normalize it as the original radial vector of the newly added contour points; calculate the Euclidean distance between the newly added contour points and the deformation center point, and generate a radial scaling factor by combining it with a preset reference distance; multiply the original radial vector by the radial scaling factor to obtain the normal deformation vector of the newly added contour points.

[0050] The normal deformation vector of the newly added contour points is input into a pre-constructed inter-layer deformation compensator, which outputs the corresponding new compensation displacement. The input feature vector of the inter-layer deformation compensator is constructed in the same way as the original contour points, i.e., a seven-dimensional vector composed of the three-dimensional coordinates of the newly added contour points, the normal deformation vector, and the neighborhood curvature values. The new compensation displacement is used as the final compensation displacement of the newly added contour points. The newly added contour points are moved a distance indicated by the new compensation displacement along the direction of the normal deformation vector, updating the spatial coordinates of the newly added contour points. After performing the above operation on the newly added contour points in all feature compensation regions, the compensated slice contour set is updated.

[0051] In practice, after obtaining the triangular mesh data of the 3D model to be printed, connectivity analysis is performed on the triangular mesh data. The connectivity analysis process is as follows: traverse all triangular faces in the triangular mesh data, assigning an initial unlabeled state to each triangular face; select an unlabeled triangular face as a seed face, assign a new connected component identifier, and add the seed face to a processing queue; remove a triangular face from the processing queue, check its three edges, and for each edge, find adjacent triangular faces that share this edge. If adjacent triangular faces exist and are in an unlabeled state, assign the same connected component identifier to the adjacent triangular faces and add them to the processing queue; repeat the above process until the processing queue is empty. At this point, all triangular faces with the same connected component identifier constitute a connected component. Repeat the above process for all unlabeled triangular faces until all triangular faces have been assigned connected component identifiers.

[0052] Extract all suspended triangular faces from the 3D model to be printed, forming a set of suspended feature faces. The method for determining suspended structures is as follows: For each triangular face, calculate its unit normal vector, which points outward from the 3D model entity; calculate the dot product of the unit normal vector and the unit vector in the vertically upward direction; when the dot product is less than -0.5, it indicates that the angle between the normal vector of the triangular face and the vertically upward direction exceeds 120 degrees, meaning the triangular face is pointing downwards or nearly downwards, and this triangular face is determined to be a suspended structure and included in the set of suspended feature faces.

[0053] Calculate the minimum support distance between each triangular facet in the set of suspended feature facets and its adjacent slice directly below it. For a triangular facet in the set of suspended feature facets, obtain the three-dimensional coordinates of the three vertices of the facet, and take the minimum value of the z-coordinate of each vertex as the height of the lowest point of the facet. Get the height value relative to the lowest point. The height value of the closest lower slice layer The slice layer height is determined during the layered slicing process. Minimum support distance. Calculate using the following formula:

[0054] in, This represents the minimum support distance between the current triangular facet and the adjacent slice in the layer directly below it. This represents the minimum z-coordinate among the three vertices of the current triangular facet. Indicates that it is located at Directly below and with The height value of the closest slice layer.

[0055] A critical unsupported distance of five millimeters is preset. The rationale for this value is that for common fused deposition modeling (FDM) printing materials, when the extruded filament is suspended in space for more than five millimeters, the sagging deformation due to its own weight from the lack of underlying support will exceed the typical layer thickness, leading to a significant deterioration in forming accuracy. The minimum support distance is calculated for each triangular facet of the suspended structure. Compared with the unsupported critical distance, when the minimum support distance is greater than the unsupported critical distance, the suspended structure to which this triangular facet belongs is marked as a high-risk deformation area.

[0056] Obtain all original slice contours corresponding to the high-risk deformation region during slicing and layering. During the layering and slicing process, for each slice layer, a correspondence has been established between the original slice contour of that slice layer and the intersecting triangular facets in the 3D model. Using this correspondence, find all slice layers that intersect with the triangular facets contained in the high-risk deformation region, extract the original slice contours corresponding to these slice layers, and use the layer number of these original slice contours in the original slice contour set as an index. Send all obtained indices to the interlayer deformation compensator, instructing it to multiply the initial compensation displacement by an amplification factor when generating the initial compensation displacement for the original slice contours corresponding to these indices. The amplification factor is set to 1.3, which was obtained through experimental calibration on a suspended printed deformation test piece. This factor increases the compensation amount in the suspended region by 30% on top of the baseline compensation to offset the additional gravitational sagging effect.

[0057] After generating a compensated slice contour set using the interlayer deformation compensator, the geometric center of each closed contour in the compensated slice contour set is extracted. For a closed contour, the geometric center is obtained by summing the x, y, and z coordinate values ​​of all contour points on the closed contour and dividing each sum by the total number of contour points. The offset vector between the geometric center of each closed contour and the intercept point of the deformation trend axis curve on the corresponding layer plane is calculated. The intercept point of the deformation trend axis curve on the corresponding layer plane is obtained by performing an intersection operation between the slice plane containing the closed contour and the deformation trend axis curve; the intersection point is the intercept point. The offset vector is a three-dimensional vector obtained by subtracting the three-dimensional coordinates of the intercept point from the three-dimensional coordinates of the geometric center. The offset vector contains x-axis, y-axis, and z-axis components.

[0058] The offset vectors of all layers are arranged in ascending order of layer height. The x-axis component of each offset vector is extracted to form a one-dimensional offset vector sequence. Time series analysis is performed on the offset vector sequence. The decomposition method of time series analysis adopts the classic additive model, decomposing the offset vector sequence into a trend term and a periodic term. The trend term is extracted by performing a moving average smoothing process with a window width of five on the offset vector sequence. The moving average window width of five is based on the fact that the interlayer spacing is usually 0.1 mm to 0.3 mm, and the physical height corresponding to five layer heights is 0.5 mm to 1.5 mm, which can filter out high-frequency noise while retaining the low-frequency deformation trend determined by the geometry. The trend term is subtracted from the original offset vector sequence to obtain the residual sequence. A fast Fourier transform is performed on the residual sequence to obtain the spectrum of the residual sequence. The frequency component with the largest amplitude in the spectrum is selected as the dominant frequency of the periodic term, and the sine waveform corresponding to the dominant frequency is used as the periodic term. The amplitude of the periodic term is calculated, and the amplitude is the spectral amplitude corresponding to the dominant frequency. Calculate the slope of the trend term, which is the slope of the straight line obtained after linear fitting of the trend term sequence.

[0059] When the amplitude of the periodic term exceeds a preset multiple of the absolute value of the slope of the trend term, reverse rotation compensation is applied to the corresponding contour layer in the compensated slice contour set. The preset multiple is set to two. The basis for setting the preset multiple to two is that when the amplitude of the periodic fluctuation reaches more than twice the rate of change of the trend, it indicates that the interlayer offset exhibits significant regular oscillation. This regular periodic oscillation is related to extrusion flow pulsation or platform vibration and needs to be corrected independently. The reverse rotation compensation process is as follows: For each slice contour layer corresponding to the periodic term in the compensated slice contour set, the rotation center is taken as the intercept point of the deformation trend axis curve on the plane of that layer, and the plane where the slice contour layer is located is taken as the rotation plane. A rotation angle around the z-axis is applied. The magnitude of the rotation angle is equal to the amplitude value of the periodic term in that layer divided by the average radius of the slice contour layer. The sign of the rotation angle is opposite to the phase of the periodic term. The average radius is the arithmetic mean of the Euclidean distances from the geometric center of the slice contour layer to all contour points on the slice contour. After performing the above rotation transformation on the coordinates of all contour points of each slice contour layer, the influence of the periodic term in the compensated slice contour set is eliminated.

[0060] The foregoing has provided a detailed description of one embodiment of the present invention, but this description is merely a preferred embodiment and should not be construed as limiting the scope of the invention. All equivalent variations and modifications made within the scope of the claims of this invention should still fall within the patent coverage of this invention.

Claims

1. A 3D printing model slicing feature compensation method, characterized in that, The method comprises the following steps: triangular mesh data of a three-dimensional model to be printed is acquired, and layer-by-layer slicing processing is performed on the model based on the triangular mesh data to generate an original slice contour set; a deformation trend centerline curve in three-dimensional space is constructed inside the model entity according to the curvature variation of each contour line segment in the original slice contour set, comprising the following steps: discretizing each layer of slice contour in the original slice contour set to obtain the curvature value of all line segment endpoints on each layer of slice contour; taking the line segment endpoint with the maximum curvature value on each layer of slice contour as the feature anchor point of the layer of slice contour; connecting the feature anchor points of all layers in the order of layer height for linear interpolation in three-dimensional space to generate an initial centerline curve; taking the initial centerline curve as the center, calculating the average radial distance of all contour points in the original slice contour set to the initial centerline curve, and iteratively correcting the spatial position of the initial centerline curve according to the average radial distance until the difference between the average radial distances of the previous and subsequent corrections converges, and taking the centerline curve obtained after convergence as the deformation trend centerline curve; a normal deformation vector field at each layer of slice plane is calculated according to the geometric relationship between the deformation trend centerline curve and each layer of original slice contour, comprising the following steps: for the original slice contour of the current layer, calculating the intersection point of the slice plane where the contour is located and the deformation trend centerline curve, taking the intersection point as the deformation center point of the current layer; calculating the direction vector of the deformation center point pointing to each contour point on the original slice contour of the current layer, taking the direction vector as the original radial vector of the contour point; obtaining the Euclidean distance between each contour point on the original slice contour of the current layer and the deformation center point, and comparing the Euclidean distance with a preset reference distance to generate the radial scaling coefficient of each contour point according to the comparison result; multiplying the original radial vector of each contour point by the corresponding radial scaling coefficient to obtain the normal deformation vector of each contour point, and collecting the normal deformation vectors of all contour points of the current layer as the normal deformation vector field at the slice plane of the current layer; The process involves driving a pre-built interlayer deformation compensator using the normal deformation vector field to non-uniformly offset each contour point in the original slice contour set, generating a compensated slice contour set. This includes the following steps: initializing the interlayer deformation compensator as a multilayer sensing network with the same topology as the original slice contour set; using the normal deformation vector field as input features to drive the multilayer sensing network to output an initial compensation displacement for each contour point in the original slice contour set; obtaining the initial compensation displacements of adjacent contour points on the slice contour of the current contour point, and calculating the displacement gradient between the initial compensation displacements of the current contour point and the adjacent contour points; when the displacement gradient exceeds a preset smoothing threshold, reducing the initial compensation displacement of the current contour point, and using the reduced displacement as the final compensation displacement of the contour point; moving each contour point in the original slice contour set according to the corresponding final compensation displacement, and reconnecting all the moved contour points to form a new contour, which is then used as the compensated slice contour set. The compensated slice contour set is converted into motion control commands for the printing device; Using the normal deformation vector field as the input feature of the multilayer sensing network, the multilayer sensing network outputs an initial compensation displacement for each contour point in the original slice contour set. This includes the following steps: combining the three-dimensional coordinates of the current contour point, the normal deformation vector of the contour point, and the neighborhood curvature value of the current contour point on its respective slice into a multidimensional input feature vector; inputting the multidimensional input feature vector into the input layer of the multilayer sensing network, and after nonlinear transformation through multiple hidden layers of the multilayer sensing network, outputting a scalar value from the output layer, using this scalar value as the initial compensation displacement for the current contour point; during training of the multilayer sensing network, using the variance of the initial compensation displacement output by different contour points on the same slice contour as the network's regularization loss term to constrain the parameter updates of the multilayer sensing network.

2. The method of claim 1, wherein, When using the endpoint of the line segment with the largest curvature value on the contour of each slice as the feature anchor point of that slice contour, if multiple line segment endpoints have the same maximum curvature value, then the endpoint closest to the geometric center of that slice contour is selected as the feature anchor point.

3. The method of claim 2, wherein, The preset reference distance is the average of the Euclidean distances between all contour points and the deformation center point on the original slice contour of the current layer.

4. The method of claim 3, wherein, The smoothing threshold of the displacement gradient is dynamically adjusted according to the perimeter of the current layer slice contour; the larger the perimeter, the smaller the smoothing threshold.

5. The method of claim 4, wherein, The step of obtaining the initial compensation displacement of the current contour point on the adjacent contour points of its respective slice contour, and calculating the displacement gradient between the current contour point and the initial compensation displacement of the adjacent contour points, includes the following steps: On the original slice contour of the current layer, determine the previous and next adjacent contour points of the current contour point along the contour direction; The initial compensation displacement of the previous adjacent contour point and the initial compensation displacement of the next adjacent contour point are obtained respectively. Calculate the first difference between the initial compensation displacement of the next adjacent contour point and the initial compensation displacement of the current contour point, and calculate the second difference between the initial compensation displacement of the current contour point and the initial compensation displacement of the previous adjacent contour point. The average of the first difference and the second difference is used as the displacement gradient of the current contour point.

6. The method of claim 5, wherein, When determining the previous and next adjacent contour points along the contour, if the current contour point is the start or end point of the contour, then the end or start point of the contour is taken as its adjacent point to form a closed loop.

Citation Information

Patent Citations

  • Space engine 3D printing deformation compensation method

    CN120337418A

  • Neural network-based 3D printing error compensation method and system, and device

    WO2020140477A1