A method, system and storage medium for optimizing graphic contour based on flexible cutting

By segmenting and adjusting curve parameters of the graphic outline trajectory, combined with curve fitting deformation detection, the technical problem of the influence of coordinate point density in graphic files is solved, and free control and robustness improvement of accuracy and efficiency in flexible cutting technology are achieved. .

CN118196352BActive Publication Date: 2024-09-10杭州泛海科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410179133.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-02-18
Publication Date
2024-09-10
Estimated Expiration
2044-02-18

AI Technical Summary

Technical Problem

In the existing flexible material cutting technology, the density of discrete coordinate points in graphics files is too sparse or too dense, resulting in reduced processing accuracy or affecting efficiency, making it difficult to achieve free control of accuracy and efficiency.

Method used

By segmenting the graphic outline trajectory and establishing a segmented curve model, adjusting curve parameters to control discrete point density, optimizing the cutting process, and combining curve fitting deformation detection and correction, free control of processing accuracy and efficiency is achieved.

Benefits of technology

It improves the processing accuracy and efficiency of graphics files, enhances the controllability of curve dispersion, balances accuracy and efficiency, and improves the robustness of the cutting process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118196352B
    Figure CN118196352B
Patent Text Reader

Abstract

The present application relates to the field of graphics cutting technology, and specifically discloses a graphics contour optimization method, system and storage medium based on flexible cutting, the method comprising: obtaining an original graphics file, and obtaining a discrete coordinate point set based on the original graphics file; extracting contour vertices based on the discrete coordinate point set; dividing the discrete coordinate point set according to the contour vertices to obtain multiple segmentation subsets; for each segmentation subset, generating a segmentation curve according to the discrete coordinate points contained therein, and adjusting the segmentation subset by a preset curve parameter threshold to obtain a new segmentation subset; combining all new segmentation subsets to obtain a new graphics file. The present application re-establishes a geometric model for the original graphics file, and by adjusting the curve parameters, the density of discrete points in different curve segments can be controlled, thereby achieving free adjustment of processing accuracy and processing efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of graphic cutting technology, and in particular to a graphic contour optimization method, system and storage medium based on flexible cutting. Background Art

[0002] Before the flexible material is cut, the graphics to be cut will be laid out through the nesting software to output a graphic file consisting of continuous discrete coordinate points, and then the cutting will be completed according to the graphic file.

[0003] Since the use of graphic files for cutting is equivalent to expressing the contour trajectory of the graphic in the form of discrete points, the problem with this method is that if the discreteness of the coordinate points is too sparse, the processing accuracy will be reduced, and if the discreteness of the coordinate points is too dense, there will be too many point coordinates, affecting the processing efficiency. Summary of the invention

[0004] The purpose of this application is to provide a method, system and storage medium for optimizing graphic contours based on flexible cutting, by re-establishing the geometric model of the graphic contour and then adjusting the curve parameters to achieve discreteness control, so as to achieve free control of the cutting process over accuracy and work efficiency.

[0005] In a first aspect, the present application provides a method for optimizing a graphic contour based on flexible cutting, which adopts the following technical solution:

[0006] Obtaining an original graphic file, and obtaining a discrete coordinate point set according to the original graphic file;

[0007] Extract contour vertices based on a set of discrete coordinate points;

[0008] According to the contour vertices, the discrete coordinate point set is divided to obtain multiple segment subsets;

[0009] For each segment subset, a segment curve is generated according to the discrete coordinate points contained therein, and the segment subset is adjusted through a preset curve parameter threshold to obtain a new segment subset;

[0010] All new subsets of segments are combined to obtain a new graph file.

[0011] Through the above technical solution, the original graphics are segmented according to their contour trajectory, and a segmented curve model is established. The discrete point density of different segmented curves can be adjusted by setting curve parameters to optimize the original graphics. At the same time, the setting and control of curve parameters can also achieve free control of processing accuracy and processing efficiency.

[0012] Optionally, extract contour vertices based on a set of discrete coordinate points, including:

[0013] Traverse the discrete coordinate point set, taking three consecutive coordinate points as a group, and obtain multiple vertex test groups;

[0014] For each vertex test group, two vectors are obtained for the three coordinate points through the preset cutting direction;

[0015] Calculate the angle formed by the two vectors, and determine whether the angle is greater than a preset first angle threshold;

[0016] If so, the coordinate point in the middle of the vertex test group is recorded as the contour vertex.

[0017] Optionally, the segment subset is adjusted by a preset curve parameter threshold to obtain a new segment subset, including:

[0018] Based on the segmented curve, the constraint conditions are constructed by the preset curve parameter thresholds;

[0019] Based on the first principle that any two consecutive coordinate points in the segmented subset satisfy the constraint conditions, the coordinate points of the segmented subset are supplemented;

[0020] Under the condition that the first principle is met, the coordinate points in the segment subset are deleted based on the second principle that if any two coordinate points in the segment subset meet the constraint condition, there is no other coordinate point between the two coordinate points;

[0021] The final segment subset is recorded as a new segment subset.

[0022] Optionally, based on the segmented curve, constraints are constructed by using preset curve parameter thresholds, including:

[0023] Any two points in the segment curve are respectively the first coordinate point and the second coordinate point;

[0024] Calculate the tangent lines of the first coordinate point and the second coordinate point in the segmented curve respectively, and record them as the first tangent line and the second tangent line;

[0025] Based on the first tangent and the second tangent, an average tangent is obtained, and the coordinates of the point in the segmented curve are calculated according to the average tangent, which is recorded as the third coordinate point;

[0026] Based on the third coordinate point, calculating the curve parameter between the first coordinate point and the second coordinate point;

[0027] The constraint condition is that the curve parameter is less than a preset curve parameter threshold.

[0028] Optionally, for each segment subset, before generating a segment curve according to the discrete coordinate points contained therein, the following steps are performed:

[0029] According to the segmented subsets, determine whether there is a fitting curve risk through a preset method;

[0030] If so, a risk correction is fitted to the subset of segments.

[0031] Optionally, based on the segment subset, a preset method is used to determine whether there is a fitting curve risk, including:

[0032] Traverse the segment subsets and take three consecutive coordinate points as a group, which is recorded as a deformation test group;

[0033] The three coordinate points in the deformation test group are the front point, the middle point and the rear point, and two vectors are obtained by taking the middle point as the starting point and the front point and the rear point as the end points respectively;

[0034] Calculate the angle between two vectors and the magnitude of each vector;

[0035] If the angle between the two vectors is greater than a preset second angle threshold, and the modulus of at least one of the vectors is greater than a preset modulus threshold, the midpoint is recorded as a fitting deformation point;

[0036] After the traversal is completed, if a fitting deformation point appears, there is a risk of fitting the curve.

[0037] Optionally, fit risk corrections to subsets of segments, including:

[0038] Determine the fitting deformation point and obtain the associated coordinate point of the fitting deformation point;

[0039] Based on the fitting deformation points and associated coordinate points, the fitting risk correction of the segmented subsets is performed using the midpoint method.

[0040] Optionally, after combining all new segment subsets to obtain a new graph file, also include:

[0041] Estimate the machining accuracy based on the new graphic file and the original graphic file;

[0042] Estimate the processing efficiency based on the number of coordinate points contained in the new graphics file;

[0043] Based on the processing accuracy and processing efficiency, the preset curve parameter threshold is adjusted through the preset processing requirements.

[0044] In a second aspect, the present application provides a graphics contour optimization system based on flexible cutting, comprising:

[0045] The original graphics acquisition module 101 is used to acquire the original graphics file and obtain a discrete coordinate point set according to the original graphics file;

[0046] A contour vertex extraction module 102, used to extract contour vertices based on a discrete coordinate point set;

[0047] A graphics segmentation module 103, used to divide the discrete coordinate point set according to contour vertices to obtain multiple segment subsets;

[0048] The graphic segmentation adjustment module 104 is used to generate a segmentation curve for each segmentation subset according to the discrete coordinate points contained therein, and adjust the segmentation subset by a preset curve parameter threshold to obtain a new segmentation subset;

[0049] The graphics update reorganization module 105 is used to combine all new segment subsets to obtain a new graphics file.

[0050] In a third aspect, the present application provides a computer-readable storage medium storing a computer program that can be loaded by a processor and execute the above-mentioned method for optimizing a graphic contour based on flexible cutting.

[0051] In summary, the present application first segments the original graphics according to its contour trajectory and establishes a segmented curve model. The sparseness of discrete points of different segmented curves can be adjusted by setting curve parameters to optimize the original graphics file. At the same time, the setting and control of curve parameters can also achieve free control of processing accuracy and processing efficiency. In addition, through the detection and correction of curve fitting deformation, the robustness of optimizing the original graphics file by controllable adjustment of curve discreteness is further improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] Figure 1 It is a flow chart of a method for optimizing a graphic contour based on flexible cutting provided in an embodiment of the present application;

[0053] Figure 2 It is a flowchart of obtaining a contour vertex framework provided by an embodiment of the present application;

[0054] Figure 3 is a flow chart for adjusting each segment subset provided by an embodiment of the present application;

[0055] Figure 4 It is a flowchart of constructing constraint conditions provided in an embodiment of the present application;

[0056] Figure 5 is a flow chart for determining whether there is a fitting curve risk provided in an embodiment of the present application;

[0057] Figure 6 It is a schematic diagram of a graphic contour optimization system based on flexible cutting provided in an embodiment of the present application. DETAILED DESCRIPTION

[0058] The following is combined with Figure 1 -Attached Figure 6 , further details of this application are given.

[0059] This application provides a method for optimizing the contour of a graphic based on flexible cutting, see Figure 1 , including the following steps:

[0060] S100: Obtain an original graphic file, and obtain a discrete coordinate point set according to the original graphic file.

[0061] S200, extracting contour vertices based on a discrete coordinate point set.

[0062] S300 , dividing the discrete coordinate point set according to contour vertices to obtain multiple segment subsets.

[0063] S400 , for each segment subset, a segment curve is generated according to the discrete coordinate points contained therein, and the segment subset is adjusted by a preset curve parameter threshold to obtain a new segment subset.

[0064] S500: Combine all new segment subsets to obtain a new graphic file.

[0065] Among them, the original graphic file is a graphic file output after the cutting graphic is nested by the nesting software. The graphic file is composed of continuous discrete coordinate points and is usually stored and represented in HPGL or PLT format.

[0066] Because the discrete coordinate points in the original graphic file are equivalent to the dot generation based on the cutting graphic contour trajectory, all the discrete coordinate points in the graphic file themselves represent the contour trajectory of the cutting graphic, and the cutting process is actually to input these discrete coordinate points in the graphic file, and the machine processes these points to achieve graphic cutting.

[0067] Since the cutting graphics are mostly winding, in order to ensure accuracy, it is best to have as many points as possible. However, when there are too many points, the processing efficiency will be reduced. Therefore, in order to balance the processing accuracy and efficiency, the density of the coordinate points will be adjusted according to the smoothness of the graphic contour trajectory, that is, the density of the discrete coordinate points in the original graphic file will be adjusted.

[0068] Therefore, in the embodiment of the present application, the discrete coordinate points contained in the original graphic file are firstly extracted, and these coordinate points are added to a pre-established data set, which is recorded as a discrete coordinate point set.

[0069] Because the contour trajectory corresponding to the graphic file may have different smoothness at different points, in order to better adjust the density of the points in the graphic file, some key points will be selected in the graphic file. These key points are equivalent to the points in the graphic contour trajectory where the smoothness of the track changes greatly. These key points are recorded as contour vertices.

[0070] In the embodiment of the present application, after a set of discrete coordinate points is extracted from a graphic file, it is necessary to first determine the contour vertices.

[0071] Specifically, see Figure 2 , based on a set of discrete coordinate points, extract contour vertices, including the following steps:

[0072] S210 , traverse the discrete coordinate point set, taking three consecutive coordinate points as a group, and obtain multiple vertex test groups.

[0073] S220 , for each vertex test group, obtain two vectors for three coordinate points through a preset cutting direction.

[0074] S230: Calculate the angle formed by the two vectors, and determine whether the angle is greater than a preset first angle threshold.

[0075] S240: If the angle is greater than a preset first angle threshold, the coordinate point in the middle of the vertex test group is recorded as a contour vertex.

[0076] Because graphic cutting is performed by point, which is actually a cut in units of two points, the vector formed by two consecutive coordinate points represents the cutting direction, and the contour vertex can be regarded as the point where the cutting direction changes greatly between the two times, so the contour vertex can be determined by the vector formed between the coordinate points.

[0077] That is, traverse the discrete coordinate point set, take three consecutive coordinate points as a group, and record them as vertex test groups. Each group of coordinate points can be repeated. For example, the discrete coordinate point set is {p1, p2, p3, p4...}, the first vertex test group is {p1, p2, p3}, the second vertex test group is {p2, p3, p4}, and so on. In this way, multiple vertex test groups can be formed based on the discrete coordinate point set. In addition, it is worth noting that in the discrete coordinate point set, assuming that the point where cutting starts is the starting point, then this point is both the starting point and the end point. Of course, it is also the first coordinate point in the discrete coordinate point set, and this point is the contour vertex by default.

[0078] For each vertex test group, two vectors can be obtained for the three coordinate points according to the cutting direction. The so-called vector is the vector formed by the two coordinate points. Taking the vertex test group {p1, p2, p3} as an example, the vector formed by the coordinate points p1 and p2 is p1p2, and the vector formed by the coordinate points p2 and p3 is p2p3.

[0079] The angle between the two vectors can be calculated based on the dot product and the modulus of the two vectors, and it is determined whether the angle is greater than a preset first angle threshold. The preset first angle threshold here represents the limit value of the change in the cutting direction, for example, it is set to 20, 15, etc., and can be set according to actual conditions. This application does not make any specific limitations.

[0080] If the angle between the two vectors is greater than the preset first angle value, it means that the cutting direction has changed significantly. Therefore, the coordinate point in the middle of the vertex test group is recorded as the contour vertex. All vertex test groups are calculated and judged in turn to obtain all contour vertices.

[0081] After having the contour vertices, the entire graphic contour trajectory can be segmented according to the contour vertices, that is, the discrete coordinate point set can be divided to form multiple data sets, recorded as segment subsets. For example, the contour vertices obtained from the discrete coordinate point set {p1, p2, p3, p4...} are (p2, p5, p12, ..., pn), which is a positive integer. Then the segment subsets formed are: {p1, p2}, {p2, ..., p5}, {p5, ..., p12}, ..., {pn, ..., p1}. The first and last coordinate points in each segment subset are contour vertices. On the one hand, when the discreteness of the coordinate points is adjusted later, the contour vertices will not change. On the other hand, it is also convenient for the subsequent reorganization of the segment subsets to form an optimized graphic file.

[0082] After extracting contour vertices and dividing the discrete coordinate point set into multiple segmentation subsets, a segmentation curve is generated for each segmentation subset based on the discrete coordinate points it contains, and the segmentation subset is adjusted through a preset curve parameter threshold to obtain a new segmentation subset.

[0083] For the segmented subset, a segmented curve is generated according to the discrete coordinate points it contains, mainly through curve fitting functions. For example, B-spline curves are generated directly according to discrete coordinate points through spline in Matlab, or B-spline curves are generated through the three-curve interpolation fitting function GeomAPI_Interpolate in the geometry engine OpenCasCade. There are many ways to generate curves based on discrete coordinate points, which are not specifically limited in this application.

[0084] After generating a segmented curve for each segmented subset, it is necessary to optimize and adjust the segmented subset based on the smoothness of the curve and the density of the coordinate points.

[0085] Specifically, see Figure 3 , adjusting the segment subset by a preset curve parameter threshold to obtain a new segment subset, including the following steps:

[0086] S410 . Constructing constraint conditions based on the segmented curve by using preset curve parameter thresholds.

[0087] S420, taking any two consecutive coordinate points in the segment subset satisfying the constraint condition as the first principle, supplementing the coordinate points in the segment subset.

[0088] S430. When the first principle is satisfied, the coordinate points in the segment subset are deleted based on the second principle that if any two coordinate points in the segment subset satisfy the constraint condition, there is no other coordinate point between the two coordinate points.

[0089] S440: Record the finally obtained segment subset as a new segment subset.

[0090] Among them, the preset curve parameter thresholds include angle deviation thresholds and curvature deviation thresholds. The so-called angle deviation represents the deviation between the tangent line at a certain point in the curve and the cutting direction at that point; the so-called curvature deviation represents the degree to which the curve deviates from the straight line, or the curvature of the curve.

[0091] Angle deviation and curvature deviation together characterize the smoothness of the curve. Because when achieving the same cutting accuracy, the higher the curve smoothness, the fewer positioning points are required, and the lower the curve smoothness, the more positioning points are required. Therefore, we will first build constraints based on the segmented curve through the preset curve parameter threshold. The so-called constraints represent the subdivision of the curve, and the curve formed between every two coordinate points reaches the set smoothness.

[0092] Specifically, see Figure 4 , based on the segmented curve, the constraint condition is constructed by the preset curve parameter threshold, including the following steps:

[0093] S411. Any two points in the scoring segment curve are respectively the first coordinate point and the second coordinate point.

[0094] S412, respectively calculating the tangent lines of the first coordinate point and the second coordinate point in the segmented curve, and recording them as the first tangent line and the second tangent line.

[0095] S413. Based on the first tangent and the second tangent, obtain an average tangent, and calculate the coordinates of the point in the segmented curve according to the average tangent, which are recorded as the third coordinate point.

[0096] S414. Calculate the curve parameter between the first coordinate point and the second coordinate point based on the third coordinate point.

[0097] S415: Taking the curve parameter being smaller than a preset curve parameter threshold as a constraint condition.

[0098] For any two points in the piecewise curve, they are recorded as the first coordinate point and the second coordinate point respectively, and the tangents of the first coordinate point and the second coordinate point in the piecewise curve are calculated respectively, that is, the partial derivatives of the two coordinate points in the piecewise curve are calculated, and the calculated tangents are recorded as the first tangent and the second tangent respectively.

[0099] Then, based on the first tangent and the second tangent, the average tangent is obtained. The so-called average tangent is the average value of the first tangent and the second tangent. The coordinates of the point in the segmented curve can be calculated based on the average tangent, which is recorded as the third coordinate point. The third coordinate point is actually a simulated coordinate point where the tangent in the segmented curve is the average tangent.

[0100] Finally, based on the third coordinate point, the curve parameter between the first coordinate point and the second coordinate point can be calculated, and the curve parameter is less than the preset curve parameter threshold as a constraint condition. The first coordinate point, the second coordinate point and the third coordinate point are respectively expressed as , and , the angle deviation is , the curvature deviation is , then the angle deviation and curvature deviation can be expressed as:

[0101]

[0102]

[0103] The constraint condition is that the angle deviation and the curvature deviation are respectively less than the preset angle deviation threshold and the curvature deviation threshold.

[0104] After constructing the constraints, the density of coordinate points in the segmented subset can be adjusted according to the constraints. First, the coordinate points in the segmented subset are supplemented based on the first principle that any two consecutive coordinate points in the segmented subset satisfy the constraints.

[0105] That is, traverse the segment subset, record the first coordinate point in the segment subset as the starting point, and the last coordinate point as the ending point. Starting from the starting point, take two consecutive coordinate points as a group, record them as a test group, substitute the two coordinate points of this group into the above constraint expression, if the constraint is not met, then supplement the coordinate points of this group, that is, take the midpoint of the two coordinate points in this group as the supplemented coordinate point, and then take the current starting point and the newly supplemented point as the test group, and continue to judge; if the constraint is met, continue to the next group, that is, record the next coordinate point of the starting point as the new starting point, and then get the next test group, and then judge again, and so on, until the new starting point is the ending point, the traversal ends, and at this time, any two consecutive coordinate points in the segment subset meet the constraint.

[0106] Any two consecutive coordinate points in the segmented subset satisfy the constraints, which means that the segmented subset has met the set accuracy requirements. However, considering the maximization of processing efficiency, the number of coordinate points should be minimized while the processing accuracy meets the requirements. Therefore, while satisfying the first principle, the second principle is also set, that is, if any two coordinate points in the segmented subset satisfy the constraints, there is no other coordinate point between the two coordinate points, and the coordinate points of the segmented subset are deleted.

[0107] For example, for the coordinate points p1, p2, and p3 in the segmented subset, if the constraints between p1 and p2 are satisfied, and the constraints between p1 and p3 are also satisfied, then obviously deleting the coordinate point p2 will not affect the smoothness of the curve between p1 and p3, so the coordinate point p2 will be deleted from the segmented subset. That is to say, in the segmented subset, it should be ensured that if any two coordinate points satisfy the constraints, there should be no other coordinate points between the two coordinate points, that is, they should be continuous coordinate points.

[0108] According to the second principle, similarly, the segment subsets can be traversed, judgments can be made in sequence, the coordinate points that should be deleted can be deleted from the segment subsets, and the finally obtained segment subset can be recorded as a new segment subset.

[0109] Each segment subset is adjusted through the first principle and the second principle to obtain the corresponding new segment subset. Finally, all the new segment subsets are reorganized to obtain a new graphic file, that is, an optimized graphic file. Cutting with this graphic file can maximize the processing efficiency while meeting the cutting accuracy.

[0110] It is taken into consideration that fitting deformation may occur when curve fitting is performed based on discrete coordinate points. This is because when adjusting the segmented subset, its fitted segmented curve is used as a reference. Once fitting deformation occurs, it will cause deviations in the adjustment of the segmented subset, thereby affecting the generation of the graphic file.

[0111] Therefore, in the embodiment of the present application, for each segment subset, before generating a segment curve according to the discrete coordinate points contained therein, the following steps are also included:

[0112] S610: Determine whether there is a fitting curve risk based on the segmented subsets by a preset method.

[0113] S620: If there is a fitting curve analysis, a fitting risk correction is performed on the segmented subsets.

[0114] The main reason for fitting deformation when fitting discrete coordinates lies in the discrete coordinate points themselves. When there is a significant change in the smoothness of the trajectory at a certain coordinate point and the distance between it and its continuous coordinate points is relatively large, the possibility of fitting deformation at this point will be relatively high when performing curve fitting.

[0115] Therefore, we can first determine whether there is a fitting curve risk based on the segment subsets.

[0116] Specifically, see Figure 5 , according to the segmented subset, a preset method is used to determine whether there is a fitting curve risk, including the following steps:

[0117] S611, traverse the segment subsets, and take three consecutive coordinate points as a group, which is recorded as a deformation test group.

[0118] S612. The three coordinate points in the deformation test group are recorded as the front point, the middle point and the rear point, and two vectors are obtained by taking the middle point as the starting point and the front point and the rear point as the end points.

[0119] S613. Calculate the angle between the two vectors and the modulus of the two vectors.

[0120] S614: If the angle between the two vectors is greater than a preset second angle threshold, and the modulus of at least one vector is greater than a preset modulus threshold, the midpoint is recorded as a fitting deformation point.

[0121] S615. After the traversal is completed, if a fitting deformation point appears, there is a risk of fitting the curve.

[0122] Among them, the preset second angle threshold also represents the limit value of the change in the direction of the tangent of the curve, which is different from the preset first angle threshold mentioned above. Because the curve fitting does not have the concept of direction, the vector angle formed is formed with the middle coordinate point as the vertex.

[0123] First, traverse the segment subset and take three consecutive coordinate points as a group, which is recorded as a deformation test group. For the convenience of explanation, the three coordinate points in the deformation test group are recorded as the front point, the middle point and the back point respectively. With the middle point as the starting point and the front point and the back point as the end point respectively, two vectors can be obtained. Through these two vectors, the angle between the two vectors and the modulus of the two vectors can be calculated.

[0124] If the angle between the two vectors is greater than the preset second angle threshold, and at least one vector has a modulus greater than the preset modulus threshold, it means that the trajectory represented by the discrete coordinate point has undergone a significant change at the midpoint, and the continuous coordinates have a large difference in distance from it. Therefore, it is considered that when performing curve fitting, there is a greater risk of fitting deformation at the midpoint, so the midpoint is recorded as the fitting deformation point.

[0125] After the traversal is completed, if a fitting deformation point appears, it means that there is a fitting curve risk. Conversely, if no fitting deformation point appears, it means that there is no fitting curve risk.

[0126] For the segmented subset, if there is a risk of fitting the curve, the risk of fitting the curve needs to be eliminated before the curve can be fitted.

[0127] Specifically, fitting risk correction for the segmented subsets includes the following steps:

[0128] S621: Determine all fitting deformation points, and obtain associated coordinate points of all fitting deformation points.

[0129] S622. For each fitting coordinate point, based on its associated coordinate point, the segment subset is corrected by taking the midpoint method.

[0130] The associated coordinate point represents a point that assists the fitting deformation point when obtaining the fitting deformation point, that is, a coordinate point whose distance from the fitting deformation point reaches a preset modulus threshold.

[0131] While determining the fitting coordinate point, the associated coordinate point continuous with it can be determined. Based on the fitting deformation point and the associated coordinate point, the segmented subset is corrected by taking the midpoint method, that is, taking a midpoint between the fitting deformation point and the associated coordinate point, assuming it is recorded as the correction test point, and then judging whether the distance between the fitting deformation point and the correction test point is less than the preset modulus threshold.

[0132] If the distance between the fitting deformation point and the correction test point is less than the preset modulus threshold, the correction test point is added to the corresponding position of the segment subset. If the distance between the fitting deformation point and the correction test point is not less than the preset modulus threshold, the midpoint of the fitting deformation point and the correction test point is taken, and then judged again. By analogy, all fitting deformation points can be corrected.

[0133] In addition, considering that different products have different requirements for cutting process accuracy, some products may have high requirements for cutting accuracy. In this case, part of the efficiency needs to be converted into processing accuracy. Although when adjusting the sparsity of coordinate points of segmented subsets, the processing accuracy and efficiency can be controlled by adjusting the preset curve parameter threshold, how to set such a curve parameter threshold to maximize the benefits requires a lot of test data to support it.

[0134] Because after the actual cutting is completed, the cutting accuracy and processing efficiency will be calculated to comprehensively evaluate and optimize the cutting plan. However, before the cutting process is carried out, before a complete balance model of processing accuracy and processing efficiency is built, the generated cutting plan can also be evaluated based on the currently set curve parameter threshold.

[0135] Therefore, in the embodiment of the present application, after all new segment subsets are combined to obtain a new graphic file, the following steps are also included:

[0136] S710. Based on the new graphic file, the processing accuracy is estimated by using a preset standard graphic file.

[0137] S720: Estimate processing efficiency based on the number of coordinate points included in the new graphic file.

[0138] S730: Based on the processing accuracy and processing efficiency, the preset curve parameter threshold is adjusted according to the preset processing requirements.

[0139] Among them, the preset standard graphic file represents the point selection standard for cutting the cutting graphic with the highest precision.

[0140] First, after obtaining the new graphic file, the processing accuracy can be estimated based on the original graphic file. For example, all the coordinate points in the standard graphic coordinate file are substituted into the curve function generated by the graphic file, and the difference between the test value and the true value is calculated. By squaring and summing all the differences and taking the root, the final value obtained is equivalent to the standard deviation, which is used to estimate the accuracy of the current new graphic file.

[0141] At the same time, the processing efficiency can be estimated based on the number of coordinate points contained in the new graphic file. Without considering other factors, the processing efficiency is directly related to the number of input coordinate points, so the processing efficiency can be estimated based on the number of coordinate points contained in the new graphic file.

[0142] Based on the processing accuracy and processing efficiency, the preset curve parameter threshold is adjusted through the preset processing requirements. The preset processing requirements can be understood as the requirements for processing accuracy and processing efficiency, whether to tilt towards processing accuracy or processing efficiency. The preset curve parameter threshold can be readjusted to better meet the actual processing needs.

[0143] The present application also provides a graphics contour optimization system based on flexible cutting, see Figure 6 The system includes: an original graphics acquisition module 101, a contour vertex extraction module 102, a graphics segmentation module 103, a graphics segmentation adjustment module 104 and a graphics update and reorganization module 105.

[0144] The original graphic acquisition module 101 is used to acquire the original graphic file and obtain a discrete coordinate point set according to the original graphic file.

[0145] The contour vertex extraction module 102 is used to extract contour vertices based on a discrete coordinate point set.

[0146] The graphic segmentation module 103 is used to divide the discrete coordinate point set according to the contour vertices to obtain multiple segmentation subsets.

[0147] The graphic segmentation adjustment module 104 is used to generate a segmentation curve for each segmentation subset according to the discrete coordinate points contained therein, and adjust the segmentation subset by a preset curve parameter threshold to obtain a new segmentation subset.

[0148] The graphics update reorganization module 105 is used to combine all new segment subsets to obtain a new graphics file.

[0149] In the embodiment of the present application, the original graphic acquisition module 101 is specifically used to acquire the original graphic file, and acquire a discrete coordinate point set according to the original graphic file.

[0150] The contour vertex extraction module 102 is specifically used to extract contour vertices based on the discrete coordinate point set obtained by the original graphic acquisition module 101 .

[0151] The graphic segmentation module 103 is specifically used to divide the discrete coordinate point set according to the contour vertices extracted by the contour vertex extraction module 102 to obtain a plurality of segment subsets.

[0152] The graphic segmentation adjustment module 104 is specifically used to generate a segmentation curve for each segmentation subset generated by the graphic segmentation module 103 according to the discrete coordinate points contained therein, and adjust the segmentation subset by a preset curve parameter threshold to obtain a new segmentation subset.

[0153] The graphic update and reorganization module 105 is specifically used to combine all new segment subsets generated by the graphic segmentation adjustment module to obtain a new graphic file.

[0154] An embodiment of the present application also provides a computer-readable storage medium storing a computer program that can be loaded by a processor and execute any of the above-mentioned graphics contour optimization methods based on flexible cutting.

[0155] The embodiments of this specific implementation are all preferred embodiments of the present application, and are not intended to limit the protection scope of the present application. Therefore, any equivalent changes made according to the principles of the present application should be included in the protection scope of the present application. A method, system and storage medium for optimizing a graphic contour based on flexible cutting.

Claims

1. A method for optimizing a graphic contour based on flexible cutting, characterized in that: include: Obtaining an original graphic file, and obtaining a discrete coordinate point set according to the original graphic file; Extract contour vertices based on a set of discrete coordinate points; According to the contour vertices, the discrete coordinate point set is divided to obtain multiple segment subsets; For each segment subset, a segment curve is generated according to the discrete coordinate points contained therein, and the segment subset is adjusted through a preset curve parameter threshold to obtain a new segment subset; The segment subset is adjusted by a preset curve parameter threshold to obtain a new segment subset, including: Based on the segmented curve, the constraint conditions are constructed by the preset curve parameter thresholds; Based on the first principle that any two consecutive coordinate points in the segmented subset satisfy the constraint conditions, the coordinate points of the segmented subset are supplemented; Under the condition that the first principle is met, the coordinate points in the segment subset are deleted based on the second principle that if any two coordinate points in the segment subset meet the constraint condition, there is no other coordinate point between the two coordinate points; The finally obtained segment subset is recorded as a new segment subset; All new subsets of segments are combined to obtain a new graph file.

2. The method for optimizing a graphic contour based on flexible cutting according to claim 1, characterized in that: Extract contour vertices based on a set of discrete coordinate points, including: Traverse the discrete coordinate point set, taking three consecutive coordinate points as a group, and obtain multiple vertex test groups; For each vertex test group, two vectors are obtained for the three coordinate points through the preset cutting direction; Calculate the angle formed by the two vectors, and determine whether the angle is greater than a preset first angle threshold; If so, the coordinate point in the middle of the vertex test group is recorded as the contour vertex.

3. The method for optimizing a graphic contour based on flexible cutting according to claim 1, characterized in that: Based on the segmented curve, the constraints are constructed by using the preset curve parameter thresholds, including: Any two points in the segment curve are respectively the first coordinate point and the second coordinate point; Calculate the tangent lines of the first coordinate point and the second coordinate point in the segmented curve respectively, and record them as the first tangent line and the second tangent line; Based on the first tangent and the second tangent, an average tangent is obtained, and the coordinates of the point in the segmented curve are calculated according to the average tangent, which is recorded as the third coordinate point; Based on the third coordinate point, calculating the curve parameter between the first coordinate point and the second coordinate point; The constraint condition is that the curve parameter is less than a preset curve parameter threshold.

4. The method for optimizing a graphic contour based on flexible cutting according to claim 1, characterized in that: For each segment subset, before generating a segment curve according to the discrete coordinate points it contains, it includes: According to the segmented subsets, determine whether there is a fitting curve risk through a preset method; If so, a risk correction is fitted to the subset of segments.

5. The method for optimizing the contour of a graphic based on flexible cutting according to claim 4, characterized in that: Based on the segmented subsets, a preset method is used to determine whether there is a fitting curve risk, including: Traverse the segment subsets and take three consecutive coordinate points as a group, which is recorded as a deformation test group; The three coordinate points in the deformation test group are the front point, the middle point and the rear point, and two vectors are obtained by taking the middle point as the starting point and the front point and the rear point as the end points respectively; Calculate the angle between two vectors and the magnitude of each vector; If the angle between the two vectors is greater than a preset second angle threshold, and the modulus of at least one of the vectors is greater than a preset modulus threshold, the midpoint is recorded as a fitting deformation point; After the traversal is completed, if a fitting deformation point appears, there is a risk of fitting the curve.

6. The method for optimizing the contour of a graphic based on flexible cutting according to claim 5, characterized in that: Fitting risk corrections to subsets of segments includes: Determine the fitting deformation point and obtain the associated coordinate point of the fitting deformation point; Based on the fitting deformation points and associated coordinate points, the fitting risk correction of the segmented subsets is performed using the midpoint method.

7. The method for optimizing the contour of a graphic based on flexible cutting according to claim 1, characterized in that: After all new subsets of segments are combined to obtain a new graph file, it also includes: Estimate the machining accuracy based on the new graphic file and the original graphic file; Estimate the processing efficiency based on the number of coordinate points contained in the new graphics file; Based on the processing accuracy and processing efficiency, the preset curve parameter threshold is adjusted through the preset processing requirements.

8. A graphics contour optimization system based on flexible cutting, characterized in that: include: An original graphics acquisition module (101) is used to acquire an original graphics file and obtain a discrete coordinate point set according to the original graphics file; A contour vertex extraction module (102), used to extract contour vertices based on a discrete coordinate point set; A graphics segmentation module (103), used to divide the discrete coordinate point set according to contour vertices to obtain a plurality of segmentation subsets; The graphic segmentation adjustment module (104) is used to generate a segmentation curve for each segmentation subset according to the discrete coordinate points contained therein, and adjust the segmentation subset by a preset curve parameter threshold to obtain a new segmentation subset, wherein the segmentation subset is adjusted by a preset curve parameter threshold to obtain a new segmentation subset, including: Based on the segmented curve, the constraint conditions are constructed by the preset curve parameter thresholds; Based on the first principle that any two consecutive coordinate points in the segmented subset satisfy the constraint conditions, the coordinate points of the segmented subset are supplemented; Under the condition that the first principle is met, the coordinate points in the segment subset are deleted based on the second principle that if any two coordinate points in the segment subset meet the constraint condition, there is no other coordinate point between the two coordinate points; The finally obtained segment subset is recorded as a new segment subset; The graphics update reorganization module (105) is used to combine all new segment subsets to obtain a new graphics file.

9. A computer-readable storage medium storing a computer program that can be loaded by a processor and execute a method for optimizing a graphic contour based on flexible cutting as claimed in any one of claims 1 to 7.