Curve fitting method, device and equipment based on mapping tool

By using an automatic curve fitting method based on plotting tools, the problems of low efficiency and large error in manual fitting of first-order continuous curves are solved, and efficient and accurate curve fitting is achieved.

CN115906298BActive Publication Date: 2026-04-24CITIC DICASTAL CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CITIC DICASTAL CO LTD
Filing Date
2021-08-27
Publication Date
2026-04-24

AI Technical Summary

Technical Problem

In CNC machining, manually fitting first-order continuous curves is inefficient and has large errors. It is difficult to express and fit using mathematical formulas, resulting in low curve fitting efficiency and accuracy.

Method used

A curve fitting method based on plotting tools is adopted. By performing sub-fitting operations within the fitting region, tangent arcs and fitting arcs are generated, and the original curve is automatically fitted until the termination condition is met, thus generating the fitted curve.

Benefits of technology

It improves the efficiency and accuracy of curve fitting, and the generated fitted curve matches the original curve with high precision, with the number of fitted arcs approaching the minimum.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115906298B_ABST
    Figure CN115906298B_ABST
Patent Text Reader

Abstract

The application provides a curve fitting method and device based on a drawing tool and a computer device, and relates to the technical field of machining, and aims to improve the accuracy of curve fitting. The method comprises the following steps: determining a fitting region containing an original curve, performing at least one sub-fitting operation on the original curve in the fitting region until a curve fitting end condition is met, and generating a fitting curve corresponding to the original curve based on a fitting arc corresponding to each sub-fitting operation; wherein the i-th sub-fitting operation of the at least one sub-fitting operation comprises the following steps: generating a fitting arc corresponding to the i-th sub-fitting operation in the fitting region based on a first tangent arc tangent to the original curve, the first tangent arc passing through an arc starting point corresponding to the i-th sub-fitting operation, and the i is an integer greater than 0. The method can segment the original curve in the fitting region for fitting, and the accuracy of the obtained fitting curve is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of machining technology, and in particular to a curve fitting method, apparatus and equipment based on drawing tools. Background Technology

[0002] In CNC machining, it is often necessary to fit first-order continuous curves with circular arcs and straight lines to facilitate machining. However, since first-order continuous curves in engineering are usually composed of multiple spline segments, they are relatively complex and difficult to express and fit using mathematical formulas. Therefore, they cannot be directly used for machining. In related technical fields, technicians usually manually fit first-order continuous curves. However, due to the large number and types of spline segments that need to be fitted, manual curve fitting is inefficient, has large errors, and low accuracy. Summary of the Invention

[0003] This invention provides a curve fitting method, device, and storage medium based on a plotting tool, which improves the efficiency and accuracy of curve fitting.

[0004] In a first aspect, the present invention provides a curve fitting method based on a plotting tool, comprising:

[0005] The fitting region is determined based on the original curve, and the fitting region is the region that includes the original curve.

[0006] In the fitting region, at least one sub-fitting operation is performed on the original curve until the curve fitting termination condition is met; wherein, the i-th sub-fitting operation of the at least one sub-fitting operation includes: generating a fitting arc corresponding to the i-th sub-fitting operation in the fitting region based on a first tangent arc that is tangent to the original curve, the first tangent arc passing through the arc starting point corresponding to the i-th sub-fitting operation, where i is an integer greater than 0;

[0007] Based on the fitting arcs corresponding to each sub-fitting operation in at least one sub-fitting operation, a fitting curve corresponding to the original curve is generated.

[0008] In the curve fitting method based on a plotting tool according to the present invention, optionally, the at least one sub-fitting operation includes at least two sub-fitting operations, wherein when i equals 1, the arc starting point corresponding to the first sub-fitting operation is the starting point of the original curve; when i is greater than 1, the arc starting point corresponding to the i-th sub-fitting operation is the ending point of the fitting arc corresponding to the (i-1)-th sub-fitting operation; or

[0009] The at least one subfitting operation includes a subfitting operation, where when i equals 1, the arc starting point corresponding to the first subfitting operation is the starting point of the original curve.

[0010] In the curve fitting method based on a plotting tool according to the present invention, optionally, the i-th sub-fitting operation includes:

[0011] A first tangent arc is generated within the fitting region; the first tangent arc is the arc with the largest radius among the arcs that pass through the arc starting point corresponding to the i-th sub-fitting operation and are tangent to the original curve;

[0012] The point on the first tangent arc that is closest to the boundary line of the fitted region is determined as the first tangent point;

[0013] A second tangent arc is generated in the fitting region based on the test endpoint; the second tangent arc is the arc with the largest radius among the arcs that are tangent to the first tangent arc at the test endpoint, and the test endpoint is the point between the first tangent point on the first tangent arc and the endpoint of the first tangent arc;

[0014] The endpoint of the i-th subfitting operation is determined on the second tangent arc;

[0015] The curve between the starting point and the ending point of the first tangent arc is determined as the fitting arc corresponding to the i-th sub-fitting operation.

[0016] In the curve fitting method based on a plotting tool according to the present invention, optionally, determining the arc endpoint corresponding to the i-th sub-fitting operation on the second tangent arc includes:

[0017] The point on the second tangent arc that is closest to the boundary line of the fitted region is determined as the second tangent point;

[0018] Between the second tangent point and the endpoint of the second tangent arc, select N reference points;

[0019] In the fitting region, create alternative tangent arcs corresponding to each of the N reference points; wherein, in the direction from the second tangent point to the end point of the second tangent arc, the alternative tangent arc corresponding to the first reference point is the arc with the largest radius among the arcs tangent between the first reference point and the second tangent arc, and the alternative tangent arc corresponding to the kth reference point is the arc with the largest radius among the arcs tangent between the kth reference point and the alternative fitting arcs corresponding to the (k-1)th reference point, where k is an integer less than N and greater than 1;

[0020] The reference point corresponding to the backup tangent arc with the largest radius among the created backup tangent arcs is determined as the arc endpoint corresponding to the i-th sub-fitting operation.

[0021] In the curve fitting method based on a plotting tool according to the present invention, optionally, selecting N reference points between the second tangent point and the endpoint of the second tangent arc includes:

[0022] Following a proportional division method, N reference points are selected between the second tangent point and the endpoint of the second tangent arc; or

[0023] Between the second tangent point and the endpoint of the second tangent arc, N reference points are randomly selected.

[0024] In the curve fitting method based on a plotting tool according to the present invention, optionally, determining the fitting region based on the original curve includes:

[0025] On both sides of the original curve, two boundary lines are generated that are less than the corresponding distance threshold from the original curve;

[0026] The region enclosed by the two boundary lines is defined as the fitting region.

[0027] In the curve fitting method based on a plotting tool according to the present invention, optionally, the curve fitting termination condition includes:

[0028] The distance between the current arc endpoint and the endpoint of the original curve is less than a third distance threshold; wherein, the current arc endpoint is the endpoint of the fitting arc corresponding to the last sub-fitting operation in the at least one sub-fitting operation.

[0029] In the curve fitting method based on a plotting tool according to the present invention, optionally, the at least one sub-fitting operation includes at least two sub-fitting operations, and a fitted curve corresponding to the original curve is generated based on the fitting arcs corresponding to each sub-fitting operation in the at least one sub-fitting operation, including:

[0030] According to the generation order of the fitting arcs corresponding to each sub-fitting operation, the fitting arcs corresponding to each sub-fitting operation are spliced ​​together to obtain the fitting curve corresponding to the original curve.

[0031] A second aspect of the present invention provides a curve fitting device based on a plotting tool, comprising:

[0032] The fitting region determination unit is configured to determine a fitting region based on the original curve, wherein the fitting region is a region that includes the original curve.

[0033] The first fitting unit is configured to perform at least one sub-fitting operation on the original curve in the fitting region until the curve fitting termination condition is met; wherein, the i-th sub-fitting operation of the at least one sub-fitting operation includes: generating a fitting arc corresponding to the i-th sub-fitting operation in the fitting region based on a first tangent arc that is tangent to the original curve, the first tangent arc passing through the arc starting point corresponding to the i-th sub-fitting operation, where i is an integer greater than 0;

[0034] The second fitting unit is configured to generate a fitting curve corresponding to the original curve based on the fitting arcs corresponding to each sub-fitting operation in at least one sub-fitting operation.

[0035] In a third aspect, the present invention provides a computer device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the method described in the first aspect.

[0036] In a fourth aspect, the present invention provides a computer-readable storage medium storing computer instructions that, when executed on a computer, cause the computer to perform the method described in the first aspect.

[0037] Since the embodiments of the present invention adopt the above technical solutions, they have at least the following technical effects:

[0038] In this embodiment of the invention, on the one hand, the original curve is automatically fitted, which can improve the efficiency of curve fitting; on the other hand, the original curve is fitted in segments in the fitting region, which improves the accuracy of the obtained fitted curve. Attached Figure Description

[0039] Figure 1 A flowchart illustrating a curve fitting method based on a plotting tool, provided as an embodiment of the present invention;

[0040] Figure 2 This is a schematic diagram of two boundary lines set for the original curve, provided as an embodiment of the present invention.

[0041] Figure 3 An example diagram provided for an embodiment of the present invention, in which the starting point of the original curve is used as the starting point of the first sub-fitting operation;

[0042] Figure 4 This is a flowchart of the i-th subfitting operation provided in an embodiment of the present invention;

[0043] Figure 5 An example diagram of a first tangent arc is provided for an embodiment of the present invention;

[0044] Figure 6A schematic diagram of a first tangent point provided in an embodiment of the present invention;

[0045] Figure 7 An example diagram of a test endpoint and a second tangential arc provided for an embodiment of the present invention;

[0046] Figure 8 A schematic diagram of a first tangent arc being cut based on the arc endpoint, provided as an embodiment of the present invention;

[0047] Figure 9 A schematic diagram of a first fitting arc and a second fitting arc provided for an embodiment of the present invention;

[0048] Figure 10 A schematic diagram of a fitting curve provided for an embodiment of the present invention;

[0049] Figure 11 An example diagram of curve fitting provided in an embodiment of the present invention;

[0050] Figure 12 A structural diagram of a curve fitting device based on a plotting tool provided in an embodiment of the present invention;

[0051] Figure 13 This is a structural diagram of a computer device provided in an embodiment of the present invention. Detailed Implementation

[0052] To better understand the technical solutions provided by the embodiments of the present invention, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods;

[0053] In the embodiments of this invention, the terms "first" and "second" are used for descriptive purposes only and should not be construed as implying or suggesting relative importance or implicitly indicating the number of indicated technical features. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of the embodiments of this invention, unless otherwise stated, "multiple" means two or more.

[0054] To facilitate a better understanding of the technical solutions of this invention by those skilled in the art, the technical terms involved in this invention are explained below.

[0055] Drafting tools: The drafting tools in the embodiments of the present invention may include, but are not limited to, various software used for drawing two-dimensional or three-dimensional diagrams, such as, but are not limited to, Photoshop, Computer-Aided Design (CAD), AutoCAD, 3DMAX, etc. The embodiments of the present invention do not limit the specific type of drawing software. The following content only uses CAD as an example of a drafting tool for illustration. Those skilled in the art can apply the curve fitting method provided in the embodiments of the present invention to the drafting tools according to actual needs.

[0056] Original curve: The curve that needs to be fitted; the specific type and trend of the original curve are not limited in the embodiments of the present invention. Some contents in this article are only used as an example of the first-order continuous curve in CAD as an example of the original curve for illustrative purposes. Those skilled in the art can set the original curve according to actual needs.

[0057] The following provides a detailed description of the curve fitting method based on plotting tools provided in the embodiments of the present invention. Please refer to [link to relevant documentation]. Figure 1 Specifically, it includes the following steps:

[0058] Step S101: Determine the fitting region based on the original curve. The fitting region is the region that includes the original curve.

[0059] It should be noted that the above-mentioned fitting region is used to constrain the fitting curve obtained by fitting the original curve. Those skilled in the art can set the method of determining the fitting region according to actual needs. In the embodiments of the present invention, two boundary lines with a distance less than the corresponding distance threshold from the original curve can be generated on both sides of the original curve, and the area enclosed by the two boundary lines is determined as the above-mentioned fitting region.

[0060] Furthermore, in order to improve the accuracy of curve fitting, the trend of each of the two boundary lines can be consistent with the trend of the original curve, and the deviation of the trend of each of the two boundary lines from the trend of the original curve can be less than a certain deviation threshold.

[0061] Furthermore, to improve the accuracy and flexibility of curve fitting, in this embodiment of the invention, a corresponding distance threshold can be set for each boundary line, such as... Figure 2 As shown, the two boundary lines mentioned above are respectively denoted as the first boundary line (i.e., Figure 1 The inner boundary is in the middle) and the second boundary line is in the middle. Figure 2If the outer boundary is defined, a first distance threshold can be set for the first boundary line and a second distance threshold can be set for the second boundary line. The first distance threshold and the second distance threshold can be the same or different. Those skilled in the art can set the first distance threshold and the second distance threshold according to the required accuracy, such as, but not limited to, setting both the first distance threshold and the second distance threshold to 0.005 mm, 0.01 mm, 0.02 mm, etc.

[0062] In the above process, the two boundary lines can be generated based on the original curve using a three-dimensional surface offset method; alternatively, the original curve can be directly copied to obtain a copy curve, and the copy curve can be moved to both sides of the original curve to generate the two boundary lines. In this embodiment of the invention, the specific method for generating the two boundary lines is not limited in detail, and those skilled in the art can set it according to actual needs.

[0063] Step S102: In the above-mentioned fitting region, perform at least one sub-fitting operation on the original curve until the curve fitting termination condition is met; wherein, the i-th sub-fitting operation of the above-mentioned at least one sub-fitting operation includes: generating a fitting arc corresponding to the i-th sub-fitting operation in the above-mentioned fitting region based on a first tangent arc that passes through the arc starting point corresponding to the i-th sub-fitting operation and is tangent to the original curve, where i is an integer greater than 0.

[0064] As one example, please refer to Figure 3 In this embodiment of the invention, the starting point of the original curve is taken as the starting point of the first sub-fitting operation, and the ending point of the original curve is determined as the ending point of the finally obtained fitted curve; the curve fitting termination condition can be that the distance between the current arc endpoint and the ending point of the original curve meets the third distance threshold, and the current arc endpoint is the endpoint of the fitting arc corresponding to the last sub-fitting operation in the above at least one sub-fitting operation.

[0065] That is, in the i-th sub-fitting operation, if the endpoint of the arc corresponding to the i-th sub-fitting operation reaches the endpoint of the original curve, it is considered that the curve fitting termination condition is met, which indicates that the curve has been fitted to the endpoint of the original curve. In this embodiment of the invention, the third distance threshold is not limited. Those skilled in the art can set it according to actual needs, such as, but not limited to, setting the third distance threshold to 0, 0.01mm or 0.1mm.

[0066] As one embodiment, in this embodiment of the invention, when the curve fitting termination condition is met, only one sub-fitting operation may be performed. In this case, the above-mentioned at least one sub-fitting operation includes one sub-fitting operation. When i equals 1, the arc starting point corresponding to the first sub-fitting operation is the starting point of the original curve.

[0067] Step S103: Based on the fitting arcs corresponding to each sub-fitting operation in at least one sub-fitting operation, generate the fitting curve corresponding to the original curve mentioned above.

[0068] As one embodiment, in this embodiment of the invention, the fitting arcs corresponding to the above-mentioned sub-fitting operations can be spliced ​​together according to the generation order of the fitting arcs corresponding to each of the above-mentioned sub-fitting operations to obtain the fitting curve corresponding to the above-mentioned original curve; that is, if five sub-fitting operations are performed in the above-mentioned step S102, and the first fitting arc, the second fitting arc, and the third fitting arc are generated in sequence according to the generation order of the fitting arcs, then the splicing result of the first fitting arc, the second fitting arc, and the third fitting arc can be directly determined as the fitting curve corresponding to the above-mentioned original curve.

[0069] The following description of the embodiment of the present invention further explains the i-th sub-fitting operation in at least one sub-fitting operation in step S102:

[0070] In this embodiment of the invention, when the curve fitting termination condition is met, multiple sub-fitting operations may be performed. The above-mentioned at least one sub-fitting operation includes at least two sub-fitting operations. When i equals 1, the arc starting point corresponding to the first sub-fitting operation is the starting point of the original curve. When i is greater than 1, the arc starting point corresponding to the i-th sub-fitting operation is the ending point of the fitting arc corresponding to the (i-1)-th sub-fitting operation.

[0071] Please see Figure 4 The i-th subfitting operation mentioned above includes the following steps S401 to S405:

[0072] S401, Generate the first tangent arc within the fitting region; the first tangent arc is the arc with the largest radius that passes through the starting point of the i-th sub-fitting operation and is tangent to the original curve.

[0073] Please see Figure 5 Here is an example diagram of the first tangent arc, where Figure 5 This is an enlarged version of the image.

[0074] S402, the point on the first tangent arc that is closest to the boundary line of the fitted region is determined as the first tangent point.

[0075] Please see Figure 6 A schematic diagram of the first tangent point is given, in which Figure 6 This is an enlarged version of the image.

[0076] S403, Generate a second tangent arc in the above-mentioned fitting region based on the test endpoint; the second tangent arc is the arc with the largest radius among the arcs that are tangent to the first tangent arc at the above-mentioned test endpoint, and the test endpoint is the point between the first tangent point on the first tangent arc and the endpoint of the first tangent arc.

[0077] As one embodiment, a point can be randomly or arbitrarily selected between the first tangent point and the end point of the first tangent arc as the test endpoint, or a point at a specified location between the first tangent point and the end point of the first tangent arc can be determined as the test endpoint. The specified location is not limited, and those skilled in the art can set it according to actual needs. For example, the midpoint, 1 / 3 position, or 2 / 3 position between the first tangent point and the end point of the first tangent arc can be determined as the specified location.

[0078] Please see Figure 7 An example diagram of a test endpoint and a second tangent arc is given.

[0079] S404, determine the endpoint of the arc corresponding to the i-th subfitting operation on the second tangent arc;

[0080] As one embodiment, step S404 may include, but is not limited to, the following step S4041.

[0081] S4041, the point on the second tangent arc that is closest to the boundary line of the fitted region is determined as the second tangent point.

[0082] S4042, select N reference points between the second tangent point and the end point of the second tangent arc on the above-mentioned second tangent arc.

[0083] As one embodiment, in step S4043, N reference points can be selected between the second tangent point and the end point of the second tangent arc on the second tangent arc by means of proportional division;

[0084] As one embodiment, N reference points can be randomly selected between the second tangent point and the end point of the second tangent arc.

[0085] S4043, create spare tangent arcs corresponding to each of the N reference points in the fitting region; wherein, in the direction from the second tangent point to the end point of the second tangent arc, the spare tangent arc corresponding to the first reference point is the arc with the largest radius among the arcs tangent between the first reference point and the second tangent arc, and the spare tangent arc corresponding to the kth reference point is the arc with the largest radius among the arcs tangent between the kth reference point and the spare fitting arc corresponding to the (k-1)th reference point, where k is an integer less than N and greater than 1.

[0086] S4044: The reference point corresponding to the backup tangent arc with the largest radius among the created backup tangent arcs is determined as the endpoint of the arc corresponding to the i-th subfitting operation.

[0087] S405, the curve between the starting point and the ending point of the first tangent arc is determined as the fitting arc corresponding to the i-th sub-fitting operation.

[0088] Specifically, please see Figure 8 The first tangent arc can be cut from the arc endpoint, and the first tangent arc between the arc start point and the arc endpoint is determined as the fitting arc corresponding to the i-th sub-fitting operation. In the following content of this article, the fitting arc corresponding to the i-th sub-fitting operation is referred to as the i-th fitting arc.

[0089] As one example, please refer to Figure 9 When i is 1, the first fitting arc can be extracted through steps S401 to S405 above. Then, using the first fitting arc as the tangent baseline, and the end point of the first fitting arc as the starting point of the arc corresponding to the second sub-fitting operation (i.e., the starting point of the second fitting arc), the process of steps S401 to S405 above is repeated to obtain the second fitting arc. The process of steps S401 to S405 above is repeated until the curve fitting termination condition is met, and then step S103 is performed to obtain the fitting curve. Please refer to [link to relevant documentation]. Figure 10 A schematic diagram of the fitted curve is provided.

[0090] As an example, to further facilitate understanding of the curve fitting method based on a drafting tool provided in this embodiment of the invention, the following uses CAD as an example of a drafting tool to give two application scenarios of this method:

[0091] Application Scenario 1:

[0092] When designing wheel hub products, the back cavity surface is usually designed using splines in a sketch, and then the sketch is rotated into a curved surface. Since machine tools can only recognize straight lines and arcs, this type of curved surface cannot be machined by programming. Therefore, before the wheel hub drawings are issued, the sketch curve needs to be fitted using the method described above, so that the spline (i.e., the original curve mentioned above) is fitted into a curve composed of straight lines and arcs, ultimately obtaining the fitted curve corresponding to the spline. A schematic diagram of the fitted curve can be found above. Figure 10 This will not be repeated here.

[0093] Application Scenario 2:

[0094] When designing wheel hubs, the design must be based on the A-side model provided by the customer. This model primarily determines the wheel hub's style. A section of the A-side has precision-machined surfaces, which require machining using a machine tool. Since the machine tool can only recognize straight lines and arcs, this precision-machined surface needs to be extracted. Then, the sketch curve corresponding to this surface is obtained, and finally, this sketch curve (corresponding to the original curve mentioned above) is fitted. Please refer to [link to relevant documentation]. Figure 11 This paper provides a schematic diagram of a fitted curve (i.e., the fitted finish line shown in the figure) obtained by fitting the above-mentioned sketch curve (i.e., the original finish line shown in the figure) as the original curve.

[0095] The method provided by the embodiments of the present invention fits the original curve, which has the following advantages: firstly, the fitted curve has a high matching accuracy with the original curve; secondly, the generated fitted curve is guaranteed to be within the accurate range and the number of fitted arcs is minimized; and thirdly, the method provided by the embodiments of the present invention can be quickly deployed and implemented through program development, which is highly efficient.

[0096] Please refer to Figure 12 Based on the same inventive concept, embodiments of the present invention provide a curve fitting device 1200 based on a plotting tool, comprising:

[0097] The fitting region determination unit 1201 is configured to determine the fitting region based on the original curve, wherein the fitting region is the region that includes the original curve.

[0098] The first fitting unit 1202 is configured to perform at least one sub-fitting operation on the original curve in the fitting region until the curve fitting termination condition is met; wherein, the i-th sub-fitting operation of the at least one sub-fitting operation includes: generating a fitting arc corresponding to the i-th sub-fitting operation in the fitting region based on a first tangent arc that passes through the arc starting point corresponding to the i-th sub-fitting operation and is tangent to the original curve, where i is an integer greater than 0.

[0099] The second fitting unit 1203 is configured to generate a fitting curve corresponding to the original curve based on the fitting arcs corresponding to each sub-fitting operation in at least one sub-fitting operation.

[0100] As one embodiment, the at least one sub-fitting operation includes at least two sub-fitting operations. When i equals 1, the arc starting point corresponding to the first sub-fitting operation is the starting point of the original curve. When i is greater than 1, the arc starting point corresponding to the i-th sub-fitting operation is the ending point of the fitting arc corresponding to the (i-1)-th sub-fitting operation. Or, the at least one sub-fitting operation includes one sub-fitting operation. When i equals 1, the arc starting point corresponding to the first sub-fitting operation is the starting point of the original curve.

[0101] As one embodiment, the first fitting unit 1202 is specifically configured to perform the i-th sub-fitting operation in the following manner:

[0102] A first tangent arc is generated within the aforementioned fitting region; the first tangent arc is the arc with the largest radius among the arcs that pass through the starting point corresponding to the i-th sub-fitting operation and are tangent to the original curve.

[0103] The point on the first tangent arc that is closest to the boundary line of the fitted region is determined as the first tangent point;

[0104] A second tangent arc is generated in the above-mentioned fitting region based on the test endpoint; the second tangent arc is the arc with the largest radius among the arcs that are tangent to the first tangent arc at the test endpoint, and the test endpoint is the point between the first tangent point on the first tangent arc and the endpoint of the first tangent arc.

[0105] The endpoint of the i-th subfitting operation is determined on the second tangent arc described above.

[0106] The curve between the starting point and the ending point of the first tangent arc is determined as the fitting arc corresponding to the i-th sub-fitting operation.

[0107] As one embodiment, the first fitting unit 1202 is specifically configured to perform:

[0108] The point on the second tangent arc that is closest to the boundary line of the fitted region is determined as the second tangent point;

[0109] Between the second tangent point and the endpoint of the second tangent arc, N reference points are selected.

[0110] In the above-mentioned fitting region, create spare tangent arcs corresponding to each of the above N reference points; wherein, in the direction from the above-mentioned second tangent point to the end point of the above-mentioned second tangent arc, the spare tangent arc corresponding to the first reference point is the arc with the largest radius among the arcs tangent between the above-mentioned first reference point and the above-mentioned second tangent arc, and the spare tangent arc corresponding to the k-th reference point is the arc with the largest radius among the arcs tangent between the above-mentioned k-th reference point and the spare fitting arc corresponding to the (k-1)-th reference point, where k is an integer less than N and greater than 1;

[0111] The reference point corresponding to the backup tangent arc with the largest radius among the created backup tangent arcs is determined as the arc endpoint corresponding to the i-th sub-fitting operation mentioned above.

[0112] As one embodiment, the first fitting unit 1202 is specifically configured to perform:

[0113] Using a proportional division method, N reference points are selected between the second tangent point and the endpoint of the second tangent arc on the second tangent arc; or N reference points are randomly selected between the second tangent point and the endpoint of the second tangent arc on the second tangent arc.

[0114] As one embodiment, the fitting region determination unit 1201 is specifically configured to perform:

[0115] On both sides of the original curve, two boundary lines are generated that are less than the corresponding distance threshold from the original curve; the region enclosed by the two boundary lines is defined as the fitting region.

[0116] As one embodiment, the curve fitting termination condition includes: the distance between the current arc endpoint and the endpoint of the original curve is less than a third distance threshold; wherein, the current arc endpoint is the endpoint of the fitting arc corresponding to the last sub-fitting operation in the at least one sub-fitting operation.

[0117] As one embodiment, the above-mentioned at least one sub-fitting operation includes at least two sub-fitting operations, and the second fitting unit 1203 is specifically configured to perform: according to the generation order of the fitting arcs corresponding to the above-mentioned sub-fitting operations, splicing the fitting arcs corresponding to the above-mentioned sub-fitting operations to obtain the fitting curve corresponding to the above-mentioned original curve.

[0118] As one example, Figure 12 The device described above can be used to implement any of the curve fitting methods based on plotting tools discussed earlier.

[0119] The curve fitting device 1200 is an example of a hardware entity. Figure 13 The computer device shown includes a processor 1301, a storage medium 1302, and at least one external communication interface 1303; the processor 1301, the storage medium 1302, and the external communication interface 1303 are all connected via a bus 1304.

[0120] The storage medium 1302 stores a computer program;

[0121] When processor 1301 executes the computer program, it implements the location fingerprinting method described above.

[0122] Figure 13 The example used is a single processor 1301, but the number of processors 1301 is not actually limited.

[0123] The storage medium 1302 may be a volatile memory, such as random-access memory (RAM); it may also be a non-volatile memory, such as read-only memory, flash memory, hard disk drive (HDD), or solid-state drive (SSD); or it may be any other medium capable of carrying or storing desired program code in the form of instructions or data structures that can be accessed by a computer, but is not limited thereto. The storage medium 1302 may be a combination of the above-mentioned storage media.

[0124] Based on the same technical concept, embodiments of the present invention also provide a computer-readable storage medium storing computer instructions that, when executed on a computer, cause the computer to perform the location fingerprinting method as described above.

[0125] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0126] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.

Claims

1. A curve fitting method based on a plotting tool, characterized in that, The drafting tool is CAD, which includes: The fitting region is determined based on the original curve, which is the region containing the original curve, wherein the original curve is a sketch curve of the wheel hub product design; In the fitting region, at least one sub-fitting operation is performed on the original curve until the curve fitting termination condition is met; wherein, the i-th sub-fitting operation of the at least one sub-fitting operation includes: generating a fitting arc corresponding to the i-th sub-fitting operation in the fitting region based on a first tangent arc that is tangent to the original curve, the first tangent arc passing through the arc starting point corresponding to the i-th sub-fitting operation, where i is an integer greater than 0; Based on the fitting arcs corresponding to each sub-fitting operation in at least one sub-fitting operation, a fitting curve corresponding to the original curve is generated, and the fitting curve is used for CNC machining of wheel hub products. The i-th subfitting operation includes: A first tangent arc is generated within the fitting region; the first tangent arc is the arc with the largest radius among the arcs that pass through the arc starting point corresponding to the i-th sub-fitting operation and are tangent to the original curve; The point on the first tangent arc that is closest to the boundary line of the fitted region is determined as the first tangent point; A second tangent arc is generated in the fitting region based on the test endpoint; the second tangent arc is the arc with the largest radius among the arcs that are tangent to the first tangent arc at the test endpoint, and the test endpoint is the point between the first tangent point and the endpoint of the first tangent arc on the first tangent arc, wherein a point is randomly or arbitrarily selected between the first tangent point and the endpoint of the first tangent arc on the first tangent arc as the test endpoint, or a point at a specified position between the first tangent point and the endpoint of the first tangent arc on the first tangent arc is determined as the test endpoint; The endpoint of the i-th subfitting operation is determined on the second tangent arc; The curve between the starting point and the ending point of the first tangent arc is determined as the fitting arc corresponding to the i-th sub-fitting operation.

2. The method as described in claim 1, characterized in that, The at least one sub-fitting operation includes at least two sub-fitting operations, and when i equals 1, the arc starting point corresponding to the first sub-fitting operation is the starting point of the original curve; When i is greater than 1, the starting point of the arc corresponding to the i-th sub-fitting operation is the ending point of the fitting arc corresponding to the (i-1)-th sub-fitting operation; or The at least one subfitting operation includes a subfitting operation, where when i equals 1, the arc starting point corresponding to the first subfitting operation is the starting point of the original curve.

3. The method as described in claim 1, characterized in that, The step of determining the endpoint of the arc corresponding to the i-th sub-fitting operation on the second tangent arc includes: The point on the second tangent arc that is closest to the boundary line of the fitted region is determined as the second tangent point; Between the second tangent point and the endpoint of the second tangent arc, N reference points are selected; In the fitting region, create alternative tangent arcs corresponding to each of the N reference points; wherein, in the direction from the second tangent point to the end point of the second tangent arc, the alternative tangent arc corresponding to the first reference point is the arc with the largest radius among the arcs tangent between the first reference point and the second tangent arc, and the alternative tangent arc corresponding to the kth reference point is the arc with the largest radius among the arcs tangent between the kth reference point and the alternative fitting arcs corresponding to the (k-1)th reference point, where k is an integer less than N and greater than 1; The reference point corresponding to the backup tangent arc with the largest radius among the created backup tangent arcs is determined as the arc endpoint corresponding to the i-th sub-fitting operation.

4. The method as described in claim 3, characterized in that, The step of selecting N reference points between the second tangent point and the endpoint of the second tangent arc includes: Following a proportional division method, N reference points are selected between the second tangent point and the endpoint of the second tangent arc; or Between the second tangent point and the endpoint of the second tangent arc, N reference points are randomly selected.

5. The method as described in any one of claims 1 or 2, characterized in that, The process of determining the fitting region based on the original curve includes: On both sides of the original curve, two boundary lines are generated that are less than the corresponding distance threshold from the original curve; The region enclosed by the two boundary lines is defined as the fitting region.

6. The method as described in claim 1 or 2, characterized in that, The curve fitting termination conditions include: The distance between the current arc endpoint and the endpoint of the original curve is less than a third distance threshold; wherein, the current arc endpoint is the endpoint of the fitting arc corresponding to the last sub-fitting operation in the at least one sub-fitting operation.

7. The method as described in claim 2, characterized in that, The at least one sub-fitting operation includes at least two sub-fitting operations. Based on the fitting arcs corresponding to each sub-fitting operation in the at least one sub-fitting operation, a fitting curve corresponding to the original curve is generated, including: According to the generation order of the fitting arcs corresponding to each sub-fitting operation, the fitting arcs corresponding to each sub-fitting operation are spliced ​​together to obtain the fitting curve corresponding to the original curve.

8. A curve fitting device based on a plotting tool, used to implement the method as described in any one of claims 1-7, characterized in that, include: The fitting region determination unit is configured to determine a fitting region based on the original curve, wherein the fitting region is a region that includes the original curve. The first fitting unit is configured to perform at least one sub-fitting operation on the original curve in the fitting region until the curve fitting termination condition is met; wherein, the i-th sub-fitting operation of the at least one sub-fitting operation includes: generating a fitting arc corresponding to the i-th sub-fitting operation in the fitting region based on a first tangent arc that is tangent to the original curve, the first tangent arc passing through the arc starting point corresponding to the i-th sub-fitting operation, where i is an integer greater than 0; The second fitting unit is configured to generate a fitting curve corresponding to the original curve based on the fitting arcs corresponding to each sub-fitting operation in at least one sub-fitting operation.

9. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps of the method according to any one of claims 1-7.