Method, system and program product for fitting two-dimensional short line segments into straight line and arc combination
By adopting straight line and arc fitting methods on polyline segments, combined with sequence comparison and optimization strategies, the problems of low efficiency, poor accuracy and continuity in the existing technology are solved, and efficient and accurate two-dimensional short-line segment fitting is achieved. Suitable for complex geometric processing.
Patent Information
- Application Number
- CN202411851360.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-16
- Publication Date
- 2025-01-14
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The prior art is inefficient and poor in processing a large number of two-dimensional short-line segments, making it difficult to ensure the continuity and smoothness of the fitting results, especially in complex figures, which are difficult to process the combination of straight lines and arcs at the same time, and the calculation complexity is high. .
Through sequence comparison and optimization of fitting strategies, linear fitting and arc fitting methods are used for polylines of different nodes, and allowable deviations to be dynamically updated to ensure the continuity and accuracy of the fitting results.
Significantly improve fitting efficiency, ensure high precision and continuity, simplify the process of fitting complex geometric figures, adapt to large-scale data processing, reduce manual intervention, and improve the efficiency of subsequent engineering processing.
Smart Images

Figure CN119313775A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of geometric graphics processing technology, and in particular to a method, system and program product for fitting a two-dimensional short line segment into a combination of a straight line and an arc. Background Art
[0002] In the fields of computer graphics, computer-aided engineering (CAE) and image processing, the fitting and reconstruction of geometric figures is an important and basic technology. In particular, for discrete point sets extracted from images or scanned data, how to perform effective curve fitting for further processing, such as mold processing, CAE meshing, etc., has always been a challenging technical problem. Common curve forms mainly include straight lines and arcs, and these two geometric shapes are extremely common in engineering applications. For example, in the fields of tires, mechanical parts, road maps, building outlines, image recognition, etc., a large number of geometric figures composed of short line segments are often generated. These figures composed of short line segments usually require curve fitting for subsequent processing.
[0003] However, the existing technology has several key technical difficulties when processing a large number of two-dimensional short line segments, which are specifically reflected in the following aspects: 1. Traditional fitting methods usually rely on manual or simple algorithms for fitting, which is inefficient. When the number of short line segments to be processed is large, the amount of calculation required for manual fitting or traditional methods is extremely large, and usually requires a lot of time and computing resources. In addition, since there are often tiny errors between short line segments, traditional methods are easily affected by noise during fitting, resulting in low fitting accuracy and difficulty in processing large-scale data.
[0004] 2. Traditional methods may not guarantee the continuity and smoothness of fitting results during the fitting process, especially when dealing with complex graphics composed of short line segments. Since the connection method and local curvature of each short line segment may vary greatly, it is often difficult to ensure smooth connection of all fitting curves during manual fitting, especially at the inflection point or mutation point of the curve, which is prone to abrupt changes. This makes the fitting results unsuitable for subsequent processing, such as mold processing and CAE analysis.
[0005] 3. In order to achieve accurate fitting, many existing methods use high-order curve fitting technology, such as Bezier curves, spline curves, etc., but the fitting process of these high-order curves is complex and computationally intensive. In actual engineering, although high-order curves can fit complex geometric figures, their computational efficiency is low and they are not easy to apply to scenarios that require efficient processing. Especially when it comes to large-scale graphic data, the computational burden and time cost of these methods cannot be ignored.
[0006] 4. Most of the existing fitting methods are general curve fitting algorithms, which are usually optimized for a certain type of curve, such as straight lines, arcs, etc. For the fitting of mixed curve forms in complex geometric figures (for example, a combination of straight lines and arcs), existing technologies often have difficulty in processing multiple fitting targets at the same time. Especially in the case of inflection points or mutation points, traditional algorithms are usually unable to flexibly process the combination of straight lines and arcs, and the processing process is lengthy and the calculation is cumbersome.
[0007] The applicant's previous applications for Chinese invention patent applications (such as Patent 2021116135564, Patent 2022100923567 and Patent 2022105620611) proposed several simulation analysis methods for tire performance, but none of them solved the above-mentioned technical problems. Summary of the invention
[0008] In order to make up for the shortcomings of the prior art, the present invention proposes a method for fitting two-dimensional short line segments into a combination of straight lines and circular arcs. Through sequence comparison and optimization of fitting strategies, the linear fitting and circular arc fitting methods are respectively used for polylines with different numbers of nodes to effectively fit the combination while ensuring accuracy. This method can not only process complex geometric figures composed of a large number of short line segments, but also ensure the continuity and accuracy of the fitting results, providing more efficient and accurate data support for subsequent engineering processing (such as mold design, CAE analysis, etc.).
[0009] In order to achieve the above-mentioned purpose, the present invention adopts the following technical solutions: A method for fitting a two-dimensional short line segment into a combination of a straight line and a circular arc, the method comprising the following steps: (1) Merge all short line segments into a polyline set L i , where i is the polyline number; (2) For polylines L i Number of nodes NP i For statistics, if NP i <5, keep the original shape of the polyline; if NP i ≥5, fitting processing is performed; (3) A straight line fitting method with a set allowable deviation Tol is used for the polyline, the distance from the node to the fitting straight line is calculated, and the maximum fitting straight line is determined by dynamically updating the end node number j; (4) The arc fitting method with a set allowable deviation Tol is used for the polyline, the distance from the node to the fitting arc is calculated, and the maximum fitting arc is determined by dynamically updating the end node number k; (5) Compare the maximum node number j of the straight line fitting and the maximum node number k of the arc fitting, select the fitting result and update the polyline L i , and repeat steps (3) and (4) until the fitting is completed.
[0010] Preferably, the straight line fitting method in step (3) includes: (a) Select the first node of the polyline as the starting point and the third node as the end point; (b) Calculate the maximum distance from each intermediate node to the current line d i,k ; (c) If d i,k >Tol, record the current straight line fitting result; if d i,k ≤Tol, update the end node number to j+1 and continue fitting; (d) Repeat the above process until the node number reaches the end point of the polyline.
[0011] Preferably, the arc fitting method in step (4) includes: (a) Select the first node of the polyline as the starting point, the fourth node as the initial end point, and construct the candidate arc with the middle node; (b) Calculate the maximum distance from each intermediate node to the current arc d i,n ; (c) If d i,n >Tol, record the current arc fitting result; if d i,n ≤Tol, update the end node number to k+1 and continue fitting; (d) Repeat the above process until the node number reaches the end point of the polyline.
[0012] Preferably, the method for updating the polyline in step (5) includes: (a) From a polyline L i Remove the fitted node set; (b) Renumber the remaining unfitted parts and repeat the fitting process until all nodes are fitted.
[0013] Preferably, the maximum allowable deviation Tol ranges from 0.01 mm to 1 mm.
[0014] Furthermore, the present invention also provides a system for fitting a large number of two-dimensional short line segments into a combination of straight lines and circular arcs, and the system implements the above method, including: (1) a data input module, used for receiving and storing the two-dimensional coordinate data of the short line segment; (2) Data merging module, used to merge short line segments into a polyline set L i (3) a straight line fitting module, used to perform a straight line fitting operation based on a set allowable deviation Tol; (4) an arc fitting module, used to perform an arc fitting operation based on a set allowable deviation Tol; (5) Data update module, used to remove the fitted node set and update the polyline L i ; (6) Output module, used to generate fitted straight line and arc combination data.
[0015] Preferably, the straight line fitting module comprises: (a) A node distance calculation unit, used to calculate the maximum distance from a node to the current line; (b) a dynamic endpoint updating unit, used to dynamically adjust the endpoint node number according to whether the maximum distance exceeds the allowable deviation; And / or, the arc fitting module includes: (a) an arc construction unit, used to construct a candidate arc using a starting point, an end point and a midpoint; (b) a node distance calculation unit, used to calculate the maximum distance from the node to the current arc; (c) A dynamic endpoint updating unit, used to dynamically adjust the endpoint node number according to whether the maximum distance exceeds the allowable deviation.
[0016] Preferably, the data updating module further comprises a renumbering unit for renumbering updated polyline nodes to ensure continuity.
[0017] Furthermore, the present invention also provides a computer-readable storage medium having a computer program or instruction stored thereon, and the method is implemented when the computer program or instruction is executed by a processor.
[0018] Furthermore, the present invention also provides a computer program product, comprising a computer program or instructions, which implement the method when executed by a processor.
[0019] The present invention adopts the above technical solution, through sequence comparison and optimization fitting strategy, for polylines with different numbers of nodes, respectively adopts straight line fitting and arc fitting methods, and effectively performs assembly fitting under the premise of ensuring accuracy. This method can not only process complex geometric figures composed of a large number of short line segments, but also ensure the continuity and accuracy of the fitting results, providing more efficient and accurate data support for subsequent engineering processing (such as mold design, CAE analysis, etc.). This method has significant technical effects and advantages in the following aspects: 1. Significantly improve fitting efficiency: Compared with traditional manual fitting or existing fitting methods, the present invention can significantly improve fitting efficiency through automated algorithms and optimized fitting strategies. Specifically, the method of the present invention can improve fitting efficiency by at least 100 times. This is because the method can efficiently identify and process a large number of short line segments, and simplifies the calculation process by fitting a combination of straight lines and circular arcs, thereby significantly reducing the required time and computing resources.
[0020] 2. Ensure high precision of fitting results: The present invention can ensure high precision of fitting results through precise straight line and arc fitting methods. Different from traditional methods, the present invention sets a reasonable allowable deviation (such as Tol), which can effectively avoid the accumulation of fitting errors and ensure that the maximum distance between the fitting curve and the original short line segment is always kept within the accuracy range. The maximum fitting deviation can be controlled within 0.05mm. This technical effect enables the present invention to be widely used in engineering scenarios with high precision requirements, such as mold design, CAE analysis, etc.
[0021] 3. Ensure the continuity and smoothness of the fitting results: The present invention effectively solves the problem of discontinuous or non-smooth fitting results in traditional methods by combining the fitting methods of straight lines and circular arcs. During the processing, the number of nodes of straight lines and circular arcs can be automatically adjusted according to the fitting error to ensure the smooth transition between the fitting curve and the original graph, especially at the inflection point or mutation point of the curve, avoiding the common problem of discontinuous or abrupt fitting, so that the fitting results are more in line with actual engineering needs.
[0022] 4. Simplify the fitting process of complex geometric figures: In many practical applications, the geometric figures to be fitted are often composed of different types of curves (such as straight lines, arcs, etc.), and traditional fitting methods are often difficult to handle such combinations. The present invention uses straight lines and arcs as basic fitting units, and automatically selects appropriate fitting forms according to the number of nodes and fitting accuracy during the fitting process, so as to flexibly handle complex combined geometric figures. The application of this method makes the polyline fitting process simpler and can avoid the problem of high computational complexity caused by the inability to handle variable shapes.
[0023] 4. Improve the efficiency of subsequent engineering processing: The method of the present invention not only greatly improves the efficiency in the fitting process, but also provides a more simplified and accurate geometric model for subsequent engineering processing (such as mold processing, CAE meshing, etc.). The fitting result contains fewer curve segments, which greatly simplifies the subsequent calculation process. Especially when performing finite element analysis (FEA), the fitted curve model can significantly improve the efficiency of meshing and reduce the amount of calculation, thereby accelerating the product design and optimization process.
[0024] 6. Adapting to the processing requirements of large-scale data: The method of the present invention can effectively process large-scale two-dimensional short-line segment data, and can adapt to graphic data of different scales and complexities while ensuring fitting accuracy and efficiency. Whether it is fitting large-scale graphics such as tires, mechanical drawings, maps, or fitting the contours of industrial parts with complex geometric shapes, the present invention can provide a flexible and efficient solution.
[0025] 7. Easy to implement and promote application: The fitting method provided by the present invention is based on clear straight line and arc fitting rules, the algorithm is simple and easy to implement, and it is suitable for integrated application in various engineering software and graphics processing systems. Its implementation process has a high degree of automation, which can effectively reduce manual intervention, reduce human errors, and improve the automation level of the entire engineering process.
[0026] To sum up, the present invention has significant technical advantages in improving fitting efficiency, ensuring fitting accuracy, smoothness, continuity, etc., and can effectively solve the problems of low efficiency, poor accuracy, discontinuity, etc. in the prior art, and provides a more efficient and accurate solution for various geometric graphics processing fields, and has broad application prospects and high technical value. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 The tire outer contour image obtained by laser scanning; Figure 2 A large number of short line segments of the original tire contour; Figure 3 Merge the original outer contour of the tire into a polyline; Figure 4 is the straight line formed by the fitting process; Figure 5 is the maximum length of the straight line fitting; Figure 6 is the fitted part and the updated polyline; Figure 7 A large number of short line segments before fitting and the effect after fitting; Figure 8 This is the fitting effect of the traditional fitting method. DETAILED DESCRIPTION
[0028] The following is a clear and complete description of the technical solutions in the embodiments of the present invention in conjunction with the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0029] A method for fitting a large number of two-dimensional short line segments into a combination of straight lines and circular arcs, the steps of which are: The first step is to merge all the short line segments, that is, to identify multiple short line segments connected at the beginning and end as a polyline, and store the identified polylines in the graph. L i , where i is the number of polylines identified; The second step is to focus on polylines. L i , count the number of nodes it consists of NP i ,if NP i If less than 5, the original polyline shape is retained. NP i If it is greater than or equal to 5, it will be fitted; The third step is to establish a straight line fitting method. Set the maximum allowable deviation Tol (usually 0.01mm~1mm). L i , extract the sequential node coordinates that make up it, and give them numbers in sequence j , denoted as P i,j ,in i Represents the polyline number, j represents the node number. To maintain continuity, L i The first point j=1 is taken as the starting point (i.e. P i,1 ),Will L i The third point j=3 is taken as the end point (i.e. P i,3 ), which forms a straight line L i,j=3 , where j represents the end node number, calculate L i,j The second point P i,2 Distance from straight line d i,2 ,if d i,2 is greater than Tol, then the composition of this straight line is determined as ( P i,1 , Pi,j=2 ). If d i,j=2 is less than or equal to Tol, then modify the end point of the line to P i,j=4 , forming a new line ( P i,1 , P i,j=4 ), calculate the maximum distance between node P i,k and the line L i,j where k ranges from 1 to j. If d i,k is greater than Tol, then determine that the line composition is ( d i,k , P i,1 ), if P i,j-1 is less than or equal to Tol, then update j to j + 1, and repeat this process until j reaches the last point of this line. Thus, determine the largest line fitting node number j. d i,k is less than or equal to Tol, then update j to j + 1, and repeat this process until j reaches the last point of this line. Thus, determine the largest line fitting node number j.
[0030] Step 4, establish an arc fitting method. Set the maximum allowable deviation Tol (generally ranging from 0.01 mm to 1 mm). For the polyline L i , extract the sequential node coordinates that make it up and number them sequentially j , denoted as P i,j , where i represents the polyline number, j represents the node number. To maintain continuity, take the first point j = 1 of L i as the starting point (i.e., P i,1 ), and take the 4th point j = 4 of L i as the end point (i.e., P i,4 ). Respectively, take P i,2 and P i,3 as the midpoints to form two arcs C i,m=2,k=4 , C i,m=3,k=4 , where k represents the end node number and m represents the second point node number. Calculate the maximum distance between P i,n (1 < n < k) and C i,m=(2,3),k as d i,n . If d i,nGreater than Tol, then determine the composition of this arc as ( P i,1 , P i,m , P i,k-1 ). If d i,n is less than or equal to Tol, then modify the arc end point k = k + 1 to form a new arc ( P i,1 , P i,m , P i,k ), calculate the maximum distance P i,n between the node C i,m,k and the arc d i,n , where m and n are between 1 and k. If d i,n is greater than Tol, then determine the arc composition as ( P i,1 , P i,m , P i,k-1 ). If d i,n is less than or equal to Tol, then update k to k + 1, and repeat this process until k reaches the last point of this polyline. Thus, determine the maximum arc fitting node number k.
[0031] Step 5: Perform fitting processing on polylines with the number of nodes greater than or equal to 5. Respectively use the straight line fitting method in Step 3 and the arc fitting method in Step 4 to L i perform fitting. Obtain the maximum node number j of straight line fitting and the maximum node number k of arc fitting. If j >= k, then take P i,1 and the point P i,j as the straight line fitting result. If k > j, then take the point P i,1 , the point P i,m and P i,k as the arc fitting result. Then update the polyline L i , and remove the nodes that have been fitted from its point sequence. If j >= k, the updated straight line point range is P i,j ~P i,NPi . If j < k, the updated straight line point range is P i,k ~P i,NPiFor the updated polyline, update the point numbering, still keep the starting point numbering as 1, and repeat the above fitting steps until the polyline is completely fitted.
[0032] According to the above method, a large number of two-dimensional short line segments can be fitted into a combination of straight lines and circular arcs. The efficiency can be increased by at least 100 times compared with manual fitting, and continuity is maintained.
[0033] The following is a specific explanation using the laser scanned tire profile as an example: The first step is to obtain the tire profile image by laser scanning. Figure 1 As shown, the details of the short line composition are as follows Figure 2 As shown. All short line segments are merged, that is, multiple short line segments connected at the head and tail are identified as a polyline, such as Figure 3 , store the polylines identified in the drawing in L 1 , in this embodiment, only one polyline is recognized; The second step is to focus on the polyline L 1 The composition of its points is shown in Table 1, and the number of nodes it consists of is counted. NP 1 =3369, NP 1 If it is greater than 5, it needs to be fitted; Table 1 Node composition and numbering of polyline
[0034] The third step is to establish a straight line fitting method. Set the maximum allowable deviation Tol = 0.05 (usually 0.01mm~1mm). L 1 , extract the sequential node coordinates that make up it, and give them numbers in sequence j , denoted as P 1,j ,in i Represents the polyline number, j represents the node number. To maintain continuity, L i The first point j=1 is taken as the starting point (i.e. P i,1 =(-89.072069, 37.01536)), L 1 The third point j=3 is taken as the end point (i.e. P i,3 ), which forms a straight line L i,j=3 ,like Figure 4 As shown, where j represents the end node number, calculate L 1,jThe second point P 1,2 Distance from straight line d 1,3 =0.001mm, d 1,3 If it is less than or equal to Tol=0.05mm, then modify the end point of the straight line to P 1,j=4 , forming a new straight line ( P 1,1 , P 1,4 ), compute nodes P 1,2 and P 1,3 With straight line L 1,4 Maximum distance d 1,2 =0.001mm, d 1,3 =0.0008mm, the maximum distance is d 1,2 =0.001mm, d 1,2 If it is less than or equal to Tol, update j to 4+1=5, and repeat until j=22. At this time, the distance from all points P1,1 to P1,22 to the straight line L1,22 is 0.07 greater than Tol. Therefore, the largest straight line fitting node number j=21 is determined, and the fitting straight line is (P 1,1 , P 1,21 ),like Figure 5 .
[0035] The fourth step is to establish the arc fitting method. Set the maximum allowable deviation Tol = 0.05mm (usually 0.01mm~1mm). L 1 , extract the sequential node coordinates that make up it, and give them numbers in sequence j , denoted as P 1,j ,in i Represents the polyline number, j represents the point number. To maintain continuity, L 1 The first point j=1 is taken as the starting point (i.e. P i,1 ),Will L i The fourth point j=4 is taken as the end point (i.e. P i,4 ), respectively, with P i,2 and P i,3 As the midpoint, two arcs are formed from it C 1,m=2,k=4 , C 1,m=3,k=4, where k represents the end node number and m represents the second node number, and calculate respectively P i,n (1 < n < k) and C i,m=(2,3),k the maximum distance d i,3 = 0.008mm, d i,3 If it is less than or equal to Tol, then modify the arc end point k = k + 1 = 5 to form a new arc ( P 1,1 , P 1,m , P 1,5 ), calculate the node P i,n and the arc C i,m,k the maximum distance d i,n , where m and n are between 1 and k, if d i,4 = 0.009mm, d i,4 If it is less than or equal to Tol, then update k to k + 1 = 6, and repeat like this until k = 8. At this time d i,5 = 0.058mm. Thus, determine the largest arc fitting node number 7.
[0036] Step 5: Perform fitting processing on the polyline with the number of nodes greater than or equal to 5. Respectively use the straight line fitting method in Step 3 and the arc fitting method in Step 4 to L 1 perform fitting. The obtained maximum node number for straight line fitting is j = 21 and the maximum node number for arc fitting is k = 7. If j >= k, then take P i,1 and the point P i,21 as the straight line fitting result. Then update the polyline L1 to remove the nodes that have been fitted from its point sequence. At this time, L1 only contains 3369 - 21 = 3348 nodes, and the updated straight line point range is P i,21 ~ P i,NPi=3369 . For the updated polyline, update the numbers of its points, re - number the nodes P1,j, and the number range is 1 ~ 3348. The updated polyline is as Figure 6 shown. Repeat the above fitting steps until this polyline is completely fitted.
[0037] A large number of short line segments before fitting and the effect after fitting are as Figure 7As shown in the figure, the fitted graph contains 23 arcs and 9 straight line segments, which is reduced to 32 lines compared to the number of segments before fitting (3368). The graph is reduced to about 1%, and the maximum deviation after fitting is 0.048mm, which is extremely accurate. If FEA analysis is performed based on this, the processing efficiency will be increased by 100 times. If the traditional fitting method is used, it is difficult to ensure that the end is connected after fitting, such as Figure 8 The steps of the present invention take about 1 minute, while manual processing requires finding discontinuity points one by one, which takes at least about 15 minutes, and the efficiency is improved by about 15 times, which proves the effectiveness of the patent of the present invention.
[0038] The above is a description of the embodiments of the present invention. Through the above description of the disclosed embodiments, professionals and technicians in the field can implement or use the present invention. Various modifications to these embodiments will be apparent to professionals and technicians in the field. The general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to these embodiments shown in this article, but will conform to the widest range consistent with the principles and novelties disclosed herein.
Claims
1. A method for fitting a two-dimensional short line segment into a combination of a straight line and an arc, characterized in that: The method comprises the following steps: (1) Merge all short line segments into a polyline set L i , where i is the polyline number; (2) For polyline L i The number of nodes NP i For statistics, if NP i <5, keep the original shape of the polyline; if NP i ≥5, fitting processing is performed; (3) A straight line fitting method with a set allowable deviation Tol is used for the polyline, the distance from the node to the fitting straight line is calculated, and the maximum fitting straight line is determined by dynamically updating the end node number j; (4) The arc fitting method with a set allowable deviation Tol is used for the polyline, the distance from the node to the fitting arc is calculated, and the maximum fitting arc is determined by dynamically updating the end node number k; (5) Compare the maximum node number j of the straight line fitting and the maximum node number k of the arc fitting, select the fitting result and update the polyline L i , and repeat steps (3) and (4) until the fitting is completed.
2. The method according to claim 1, characterized in that: The straight line fitting method in step (3) includes: (a) Select the first node of the polyline as the starting point and the third node as the end point; (b) Calculate the maximum distance d from each intermediate node to the current line i,k ; (c) If d i,k >Tol, record the current straight line fitting result; if d i,k ≤Tol, update the end node number to j+1 and continue fitting; (d) Repeat the above process until the node number reaches the end point of the polyline.
3. The method according to claim 1, characterized in that The arc fitting method in step (4) includes: (a) Select the first node of the polyline as the starting point, the fourth node as the initial end point, and construct the candidate arc with the middle node; (b) Calculate the maximum distance d from each intermediate node to the current arc i,n ; (c) If d i,n >Tol, record the current arc fitting result; if d i,n ≤Tol, update the end node number to k+1 and continue fitting; (d) Repeat the above process until the node number reaches the end point of the polyline.
4. The method according to claim 1, characterized in that: The method for updating the polyline in step (5) includes: (a) From the polyline L i Remove the fitted node set; (b) Renumber the remaining unfitted parts and repeat the fitting process until all nodes are fitted.
5. The method according to any one of claims 1 to 4, characterized in that: The maximum allowable deviation Tol has a value range of 0.01 mm to 1 mm.
6. A system for fitting a large number of two-dimensional short line segments into a combination of straight lines and circular arcs, characterized in that: The system implements the method according to any one of claims 1 to 5, including: (1) a data input module, used for receiving and storing the two-dimensional coordinate data of the short line segment; (2) Data merging module, used to merge short line segments into a multi-segment line set L i ; (3) a straight line fitting module, used to perform a straight line fitting operation based on a set allowable deviation Tol; (4) an arc fitting module, used to perform an arc fitting operation based on a set allowable deviation Tol; (5) Data update module, used to remove the fitted node set and update the polyline L i ; (6) Output module, used to generate fitted straight line and arc combination data.
7. The system according to claim 6, characterized in that The straight line fitting module comprises: (a) A node distance calculation unit, used to calculate the maximum distance from a node to the current line; (b) a dynamic endpoint updating unit, used to dynamically adjust the endpoint node number according to whether the maximum distance exceeds the allowable deviation; And / or, the arc fitting module includes: (a) an arc construction unit, used to construct a candidate arc using a starting point, an end point and a midpoint; (b) a node distance calculation unit, used to calculate the maximum distance from the node to the current arc; (c) A dynamic endpoint updating unit, used to dynamically adjust the endpoint node number according to whether the maximum distance exceeds the allowable deviation.
8. The system according to any one of claims 6 to 7, characterized in that: The data updating module further comprises a renumbering unit for renumbering updated polyline nodes to ensure continuity.
9. A computer-readable storage medium having a computer program stored thereon, wherein when the program is run on a computer, the method according to any one of claims 1 to 5 is executed.
10. A computer program product comprising a computer program or instructions, characterized in that When the computer program or instruction is executed by a processor, the method according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Fitting method applied to sponge cutting file
CN114819306A
Track fitting method and device, equipment and storage medium
CN115373338A