Complex spline curve variable-step-size high-precision approximation method

By selecting straight line or arc approximation combined with variable step length and termination discrimination strategies, the problem of insufficient approximation curve segment length in the prior art is solved, high-precision approximation and efficient processing are achieved, and processing quality and efficiency are improved.

CN120491556APending Publication Date: 2025-08-15JINCHENG NANJING ELECTROMECHANICAL HYDRAULIC PRESSURE ENG RES CENT AVIATION IND OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510537211.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-27
Publication Date
2025-08-15

AI Technical Summary

Technical Problem

The prior art is difficult to maximize the length of the approximation curve segment while ensuring the approximation accuracy and iterative calculation amount, resulting in frequent acceleration and deceleration causing machine tool impacts, affecting processing quality and efficiency.

Method used

According to the local geometric characteristics of the approximation curve, the approximation error is measured using the bidirectional Hausdorff distance, and the approximation accuracy fluctuation range and approximation curve segment length are controlled by the variable step length method, and the iteration process is controlled in combination with the termination discrimination strategy.

Benefits of technology

The length of the approximate curve segment is significantly improved, the number of small segments is reduced, and the processing quality and efficiency is improved. Simulation experiments show that the number of approximate curve segments has decreased by 54%, and the length of the minimum approximate curve segment has increased by 2.4 times. In actual experiments, the surface roughness of the EDM cutting processing has decreased, and the efficiency of the EDM forming processing has increased by 30%.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120491556A_ABST
    Figure CN120491556A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of computer-aided manufacturing, and relates to a variable-step-size high-precision approximation method for a complex spline curve. The method comprises the following steps: selecting an approximation curve as a straight line or a circular arc according to a local geometric characteristic of an approximated curve, namely a curve curvature, measuring an approximation error between the approximated curve and the approximation curve by using a bidirectional Hausdorff distance, controlling an approximation precision fluctuation range and an approximation curve segment length based on a variable step size method, and controlling an approximation iteration process by using a termination discrimination strategy, therefore, on the premise that the approaching progress is guaranteed, the length of the minimum approaching curve section and the number of machining codes are increased as much as possible, and then the machining efficiency and the machining quality are guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of computer-aided manufacturing and relates to a high-precision approximation method for a complex spline curve with a variable step size. Background Art

[0002] With the continuous development of modern industry, the number of parts with complex spline curve boundaries is increasing. Since standard G-code does not support non-circular curves, and CAM systems require contour offsets to compensate for tool radius when generating machining paths, the offset paths of other curves, except for straight lines and arcs, will not be expressed in the form of the original curve equation after accounting for the compensation. Therefore, before generating tool paths, discrete approximation must be performed to obtain machining codes that can be recognized by the CNC system.

[0003] However, for curves with large changes in curvature, the approximation line segments obtained when using straight line approximation to achieve a certain accuracy are relatively short (less than 0.1mm). To avoid machine tool impact caused by pauses during processing and affecting processing quality, the CNC system needs to ensure the continuous execution of these micro-segment programs. Too small a segment length will cause the feed speed to fluctuate frequently and it will be difficult to reach the command speed. If speed smoothing is to be achieved, it is necessary to predict many segments in advance. However, conventional domestic CNC systems, especially EDM machine CNC systems, often do not have a look-ahead function and cannot determine whether there are geometric corners or program deceleration points afterwards. Therefore, they cannot accelerate or decelerate in time, which will cause machine tool impact and affect processing quality. Although some high-end EDM machine CNC systems have a certain look-ahead function, considering dozens or even hundreds of program segments in advance to perform acceleration analysis and deceleration area judgment on each axis to achieve a smooth transition of the curve turning point requires a large amount of calculation, and completely real-time calculation is very difficult. Summary of the Invention

[0004] Purpose of the Invention

[0005] To this end, this paper proposes a high-precision approximation method with variable step size for complex spline curves, which is used to maximize the length of the approximation curve segment to reduce the number of program segments while ensuring the approximation accuracy and iterative calculation amount, thereby reducing the speed fluctuation caused by frequent acceleration and deceleration, and improving the processing quality and efficiency.

[0006] Technical Solution

[0007] A high-precision variable-step-size approximation method for complex spline curves is proposed. The approximation curve is selected as a straight line or an arc according to the local geometric characteristics of the approximated curve, namely the curve curvature. The bidirectional Hausdorff distance is used to measure the approximation error between the approximated curve and the approximation curve. The fluctuation range of the approximation accuracy and the length of the approximation curve segment are controlled based on the variable-step-size method. The termination judgment strategy is used to control the approximation iteration process. Under the premise of ensuring the approximation progress, the length of the minimum approximation curve segment and the number of processing codes are increased as much as possible, thereby ensuring processing efficiency and quality.

[0008] The approximated curve refers to a given curve used to generate a processing code, including a non-circular conic curve, a NURBUS curve, a B-spline curve, a PH curve, and the like.

[0009] The local geometric characteristics of the approximated curve refer to the curvature of the approximated curve at the current approximation point. For a curve C(x(t), y(t)) expressed in the form of a parametric equation, the curvature K of any point is

[0010] The selection of an approximating curve based on the local geometric characteristics of the approximated curve means that the curvature of the current point reflects the degree of curvature of the curve at that point. The larger the curvature, the more curved the curve is at the approximation point. In this case, if a straight line is used for approximation, the length of the small line segment is often very small, and circular arc approximation is suitable. The smaller the curvature, the smoother the curve is at this point. In this case, using circular arc approximation will result in excessive computational complexity, and a simple straight line segment approximation is suitable. Therefore, the present invention uses the curvature of the current discrete point to adaptively select the approximating curve. When the curvature of the current point is greater than a preset curvature threshold, circular arc approximation is used. Conversely, when the curvature of the current point is less than the preset threshold, straight line approximation is used.

[0011] The arc approximation means that if the curvature of the current approaching point is greater than the curvature threshold, the arc segment is used to approximate the curve. At this time, three known points are required to uniquely determine the arc segment equation. Specifically, an arc is drawn with the current approaching point as the center and the current approximation step as the radius. The intersection of the arc and the approximated curve is the next approach point under the current approximation step. The arc of the approximated curve between the current approaching point and the next approaching point is then discretized with equal arc length to obtain the midpoint of the arc of the approximated curve. The arc drawn through the current approaching point, the midpoint of the arc of the approximated curve and the next approaching point is the approximation arc required for arc approximation.

[0012] Linear approximation involves using a straight line segment for approximation if the curvature of the current approaching point is less than the curvature threshold. Only two points are needed to uniquely determine the approximating line. Specifically, an arc is constructed with the current approaching point as the center and the current approximation step as the radius. The intersection of this arc and the approximated curve is the next approaching point for the current approximation step. A line segment is constructed through the current and next approaching points to create the approximating line.

[0013] The two-way Hausdorff distance is: let a and b be any point in point set A and point set B respectively, then the one-way Hausdorff distance from A to B is defined as the maximum value of the minimum distance from each point in A to all points in B: The bidirectional Hausdorff distance between point set A and point set B, that is, the approximation error, is defined as: H(A,B)=max(h(A,B),h(B,A)).

[0014] The approximation error between the approximated curve and the approximating curve refers to the following: Since the bow height error is only applicable to measuring the approximation error when approximating a straight line segment, and the radial error measurement methods used in existing literature are computationally intensive when approximating multiple arc segments, the present invention uses the bidirectional Hausdorff distance between the approximating curve point set and the approximated curve point set, obtained through discrete sampling, as the error measurement criterion. A larger bidirectional Hausdorff distance indicates a greater approximation error between the approximating curve and the approximated curve, and vice versa.

[0015] The variable step length method mentioned above refers to the use of a variable step length method based on the approximation error in order to maximize the length of the approximation curve segment while ensuring machining accuracy and making the approximation error fluctuation range controllable. Specifically, the approximation error of the current approximation curve is compared with the approximation accuracy range. If the approximation error is greater than the upper bound of the approximation accuracy, the search step length is reduced by a proportion of ε; if the approximation error is less than the lower bound of the approximation accuracy, the step length is increased by a proportion of ε, and the search process is repeated until the error meets the approximation accuracy range. The variable step length strategy can be expressed as: Where, e i is the approximation error of the current approximation curve, [e min ,e max ] is the approximation accuracy range, r is the search step size, and ε is the step size change rate.

[0016] The termination decision strategy involves calculating the curvature of each approximation point and selecting an approximating curve before the iteration begins. In addition to determining the end of the approximation based on whether the current discrete point coincides with the curve endpoint, the approximation is then performed on the segment of the approximated curve between the current discrete point and the curve endpoint. If the approximation error is less than the maximum allowable error, the entire approximation process is terminated and the current approximation curve is retained. Otherwise, the iteration process continues.

[0017] Furthermore, the method is applicable to the approximation of any non-circular parametric curve in a two-dimensional plane.

[0018] Furthermore, the specific implementation of the method requires the use of existing 3D modeling software, such as NX, Solidworks, CATIA, etc. Specifically, the secondary development interface provided by the software, such as NXOpenC and NXOpen C++, is used to perform curvature calculation, approximation curve calculation, discrete point set acquisition, approximation error calculation, variable step size calculation, and termination judgment.

[0019] Furthermore, the results obtained by the method include a reduction in the number of approximation curve segments, an increase in the minimum approximation curve segment length, and an improvement in processing efficiency. Specifically, the reduction in the number of approximation curve segments and the increase in the minimum approximation curve segment length are verified by simulation experiments, and the improvement in processing efficiency and surface quality are verified by forming electrospark machining experiments and wire-cut electrospark machining experiments. The beneficial effects of this application are:

[0020] The present invention provides a variable-step-size, high-precision approximation method for complex spline curves. The method employs an approximation curve selection strategy based on the curve curvature, which can significantly increase the length of the approximation curve at the curve corners while reducing the number of small line segments in the overall processing code. The error measurement method based on the bidirectional Hausdorff distance is computationally efficient and applicable to linear approximation, circular arc approximation, and even various curve approximations. The variable-step-size method effectively controls the range of approximation error and the length of the approximated curve segment, thereby significantly increasing the length of the approximated curve segment while ensuring approximation accuracy. Simulation experiments show that compared to existing methods, this method can reduce the number of processing codes by 54% and increase the minimum approximation curve segment length by 2.4 times while ensuring approximation accuracy. Actual experimental results show that this method can significantly improve the surface roughness of wire-cut EDM and increase the processing efficiency of die-cut EDM by 30%. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 This is a schematic diagram of the variable step-size approximation method proposed by the present invention;

[0022] Figure 2 It is the termination judgment strategy in the variable step-size approximation method proposed by the present invention;

[0023] Figure 3 The butterfly spline curve used in the present invention;

[0024] Figure 4 The approximation error and curve segment length distribution of the parameter screening method compared with the present invention;

[0025] Figure 5This is the approximation error and curve segment length distribution of the variable step-size approximation algorithm proposed in this invention. DETAILED DESCRIPTION

[0026] In order to make the purpose, technical solutions and advantages of the implementation of the present invention clearer, the technical solutions in the embodiments of the present invention will be described in more detail below in conjunction with the embodiments of the present invention. In the examples, the same or similar reference numerals throughout represent the same or similar originals or elements with the same or similar functions. The described embodiments are part of the embodiments of the present invention, not all of the embodiments. The embodiments described below by reference are illustrative and intended to be used to explain the present invention, and should not be understood as limiting the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention. The following is a detailed description in conjunction with the embodiments of the present invention.

[0027] In order to more clearly and intuitively describe the structural principles and working methods of the present invention, the embodiments will be described below in conjunction with the relevant drawings. Figure 1 As shown in FIG, the variable step size approximation method for complex spline curves involved in this embodiment specifically includes:

[0028] Step 1: Figure 3 As shown, a 1 / 2 butterfly spline curve is selected as the curve to be approximated, and the starting point and end point of the approximation are determined according to the characteristics of the curve.

[0029] Step 2: Set the curvature threshold K th It is 0.5 times the maximum curvature of the curve to be approximated, the approximation accuracy range is set to [0.5μm, 1μm], the initial step length r is 2mm, and the step length change rate ε is 0.05.

[0030] Step 3: Set the current discrete approximation point as the starting point of the approximated curve. First, determine whether the starting point and the end point coincide. If so, terminate the approximation process; otherwise, proceed to the following steps.

[0031] Step 4: Use Calculate the curvature K of the approximated curve C(x(t), y(t)) at the current approximation point. Compare K with K th If K>K th , select the arc as the approximate curve. Otherwise, select the straight line as the approximate curve.

[0032] Step 5: Approximate the curve segment between the current approaching point and the endpoint of the approximated curve. If the approximating curve is an arc, bisect the approximated curve segment using the equal arc length method. The arc segment passing through the current approaching point, the midpoint of the approximated curve segment, and the endpoint of the approximated curve is the approximating curve. If the approximating curve is a straight line, the straight line segment passing through the current approaching point and the endpoint of the approximated curve is the approximated curve.

[0033] Step 6: Discretize the approximation curve segment between the current approximation point and the endpoint, as well as its corresponding approximation curve, with equal arc lengths. Set the discretization arc length to 1 μm. Obtain the approximation curve point set and the approximation curve point set. Calculate the bidirectional Hausdorff distance between the two point sets as the approximation error.

[0034] Step 7: Compare the approximation error at this point with the given approximation accuracy range. If the approximation error is within the given approximation accuracy range, terminate the entire approximation process. Output the current approximation curve as the final discrete approximation curve of the approximated curve. Otherwise, proceed to step 8.

[0035] Step 8: Draw an arc with the current approximation point as the center and the current discrete step length as the radius. The arc intersects the approximated curve at a point. The intersection of the arc and the approximated curve is the next approximation point at the current approximation step length. If the approximation curve is an arc, the arc of the approximated curve between the current approximation point and the next approximation point is discretized with equal arc lengths to obtain the midpoint of the approximated curve arc. Draw an arc through the current approximation point, the midpoint of the approximated curve arc, and the next approximation point to obtain the desired approximation arc. If the current approximation curve is a straight line, draw a line segment through the current approximation point and the next approximation point to obtain the desired approximation line.

[0036] Step 9: Discretize the approximation curve segment between the current approximation point and the next approximation point, and its corresponding approximation curve, with the discretized arc length set to 1 μm. Obtain the approximation curve point set and the approximation curve point set. Calculate the bidirectional Hausdorff distance between the two point sets to obtain the approximation error.

[0037] Step 10: Compare the approximation error at this point with the given approximation accuracy range. If the approximation error is within the given approximation accuracy range, terminate the current approximation process. Output the current approximation curve as the latest discrete approximation curve of the approximated curve, set the next approximation point as the discrete approximation point, and jump to step 3. Otherwise, proceed to step 11.

[0038] Step 11: If the approximation error at this time is less than the given approximation error lower bound, set the current approximation step size r to (1+ε)*r. Jump to step 7. If the approximation error at this time is greater than the given approximation error upper bound, set the current approximation step size r to (1-ε)*r. Jump to step 7.

[0039] Step 12: Repeat steps 3-11 until the approximation process is completed, and an approximation curve set of the approximated curve can be obtained.

[0040] Step 13: To test the effectiveness of the method proposed in this invention, the other side of the butterfly curve is discretely approximated using the existing parameter screening method. The distribution of the length of the approximated curve segment and the approximation error are statistically analyzed. The results are as follows: Figure 4 and Figure 5 As shown in Figure 2, it can be seen that the average approximation error of the two algorithms is controlled within 1 μm, but the parameter screening method approximates the position where the curve curvature is larger ( Figure 3 、 4 The positions marked in the middle will have a large approximation error, with the maximum error reaching 4μm, and the length of the approximation curve segments at these positions is already small enough, about 0.093mm. In terms of the number of approximation curve segments, the parameter screening method requires 656 small straight line segments for the given 1 / 2 butterfly curve approximation, and the minimum straight line segment length is about 0.093mm; the variable step size method only requires 300 arc and straight line segments for approximation, and the minimum curve segment length is about 0.224mm. As the proportion of arc approximation increases, the number of segments can be further reduced, and the minimum approximation curve length can also be increased accordingly. Compared with the parameter screening method, the variable step size algorithm can reduce the machining program by 54%, increase the minimum curve segment length by 2.4 times, and can control the approximation error to be strictly within the required range.

[0041] Step 14: To further verify the effectiveness of this method in actual machining, a butterfly spline curve was selected for discrete approximation using both the parameter screening method and the variable step-size algorithm. After generating machining code, wire cutting and die-sinking electro-discharge machining (EDM) were performed to evaluate the machining efficiency of the two methods. The results showed that for wire cutting, the variable step-size approximation algorithm significantly reduced the number of machining code lines and reduced the roughness of the machined surface from Ra1.6 to Ra1.1 without reducing machining efficiency. Results from die-sinking EDM showed that the proposed algorithm could improve machining efficiency by 30%.

[0042] In addition, unless otherwise defined, the technical or scientific terms used in the description of this application should have the ordinary meanings understood by those of ordinary skill in the art to which this application belongs. The words "upper," "lower," "left," "right," "center," "vertical," "horizontal," "inner," and "outer" used in the description of this application are only used to indicate relative directions or positional relationships, and do not imply that the device or component must have a specific orientation, be constructed, or operate in a specific orientation. When the absolute position of the described object changes, its relative positional relationship may also change accordingly. Therefore, they should not be understood as limitations on this application. The words "first," "second," "third," and similar terms used in the description of this application are used only for descriptive purposes to distinguish different components and should not be understood to indicate or imply relative importance. The words "one," "an," or "the" used in the description of this application should not be understood as absolute limitations on quantity, but should be understood as meaning the presence of at least one. The words "include" or "comprises" used in the description of this application mean that the element or object listed before the word includes the elements or objects listed after the word and their equivalents, but does not exclude other elements or objects.

[0043] In addition, it should be noted that, unless otherwise clearly stipulated and limited, the words "install", "connect", "connect" and similar terms used in the description of this application should be understood in a broad sense. For example, the connection can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, an indirect connection through an intermediate medium, or a connection between two components. Technical personnel in the field can understand their specific meanings in this application according to the specific circumstances.

[0044] The above description is only a specific embodiment of the present invention and is not intended to limit the present invention. Within the spirit and principles of the present invention, any technician familiar with the profession may use the technical content disclosed above to change or modify it into an equivalent embodiment with equivalent changes and apply it to other fields. However, any simple modification, equivalent change and modification made to the above embodiment based on the technical essence of the present invention without departing from the content of the technical solution of the present invention, any modification, equivalent replacement, improvement, etc. made should be included in the scope of protection of the present invention.

Claims

1. A high-precision approximation method for complex spline curves with variable step size, characterized by: According to the local geometric characteristics of the approximated curve, namely the curvature of the curve, the approximating curve is selected as a straight line or a circular arc. The bidirectional Hausdorff distance is used to measure the approximation error between the approximated curve and the approximating curve. The fluctuation range of the approximation accuracy and the length of the approximation curve segment are controlled based on the variable step size method, and the termination judgment strategy is used to control the approximation iteration process.

2. The method according to claim 1, wherein The approximated curve refers to a given curve used to generate a processing code, including a non-circular conic curve, a NURBUS curve, a B-spline curve, and a PH curve.

3. The method according to claim 1, wherein The local geometric characteristics of the approximated curve are specifically: the curvature of the approximated curve at the current approximation point. For the curve C(x(t), y(t)) expressed in the form of a parametric equation, the curvature K of any point is 4. The method according to claim 3, wherein The method of selecting an approximating curve based on the local geometric characteristics of the approximated curve is as follows: the curvature of the current point reflects the curvature of the curve at the approximation point; the curvature of the current discrete point is used to adaptively select the approximating curve; when the curvature of the current point is greater than a preset curvature threshold, circular arc approximation is used; On the contrary, when the curvature of the current point is less than the preset threshold, a straight line approximation is adopted.

5. The method according to claim 1, wherein The arc approximation is specifically as follows: if the curvature of the current approaching point is greater than the curvature threshold, the curve is approximated using an arc segment. In this case, three known points are required to uniquely determine the arc segment equation. Specifically, an arc is drawn with the current approaching point as the center and the current approximation step as the radius. The intersection of the arc and the approximated curve is the next approximation point under the current approximation step. The arc of the approximated curve between the current approaching point and the next approaching point is then discretized with equal arc lengths to obtain the midpoint of the arc of the approximated curve. An arc is drawn through the current approaching point, the midpoint of the arc of the approximated curve, and the next approaching point, which is the approximation arc required for arc approximation. The linear approximation is specifically as follows: if the curvature of the current approaching point is less than the curvature threshold, a straight line segment is used for approximation. In this case, only two points are needed to uniquely determine the approximation line. Specifically, an arc is drawn with the current approaching point as the center and the current approximation step as the radius. The intersection of the arc and the approximated curve is the next approximation point under the current approximation step. A line segment is drawn through the current approximation point and the next approximation point, which is the approximation line required for linear approximation. The bidirectional Hausdorff distance is specifically: let a and b be any point in point set A and point set B respectively, then the one-way Hausdorff distance from A to B is defined as the maximum value of the minimum distance from each point in A to all points in B: The bidirectional Hausdorff distance between point set A and point set B, i.e., the approximation error, is defined as: H(A,B)=max(h(A,B),h(B,A)); The approximation error between the approximated curve and the approximating curve is specifically: using the bidirectional Hausdorff distance between the approximating curve point set and the approximated curve point set obtained by discrete sampling as an error measurement standard; the larger the bidirectional Hausdorff distance, the greater the approximation error between the approximating curve and the approximated curve, and vice versa. The variable step size method is specifically as follows: compare the approximation error of the current approximation curve with the approximation accuracy range. If the approximation error is greater than the upper bound of the approximation accuracy, reduce the search step size by a ratio of ε; if the approximation error is less than the lower bound of the approximation accuracy, increase the step size by a ratio of ε, and repeat the search process until the error meets the approximation accuracy range. The variable step size strategy can be expressed as: Where, e i is the approximation error of the current approximation curve, [e min ,e max ] is the approximation accuracy range, r is the search step size, and ε is the step size change rate; The termination judgment strategy is as follows: in addition to judging whether the approximation is completed by whether the current discrete point coincides with the end point of the curve, for each approximation point, before the iteration starts, its curvature is calculated and the approximation curve is selected, and then the curve segment of the approximated curve between the current discrete point and the end point of the curve is approximated; if the approximation error is less than the maximum allowable error, the entire approximation process is terminated and the current approximation curve is retained, otherwise the iteration process continues.

6. The method according to claim 1, wherein The method is applicable to the approximation of any non-circular parametric curve in a two-dimensional plane.

7. The method according to claim 1, wherein The specific implementation of the method needs to be achieved with the help of three-dimensional modeling software.

8. The method according to claim 1, wherein The reduction in the number of approximation curve segments and the improvement in the minimum approximation curve segment length are verified by simulation experiments, and the improvement in machining efficiency and surface quality are verified by forming EDM experiments and wire EDM experiments.