A fairing continuous B-spline fitting method for complex discrete trajectory points
By segmenting and independently fitting and reconstructing complex discrete trajectory points, the problems of low efficiency and insufficient accuracy in the CNC machining of complex parts in the existing technology are solved, realizing efficient and accurate B-spline curve fitting, which is suitable for CNC machining of complex parts.
Patent Information
- Application Number
- CN202511203300.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-27
- Publication Date
- 2025-11-04
- Estimated Expiration
- 2045-08-27
AI Technical Summary
In the CNC machining of complex parts, existing technologies directly use discrete tool trajectory points, resulting in low machining efficiency and increased machine tool vibration. It is difficult to find a balance between accuracy and efficiency, and traditional methods are difficult to meet the requirements of high accuracy and high efficiency when fitting complex trajectories.
A smooth, continuous B-spline fitting method for complex discrete trajectory points is adopted. Through the steps of densifying trajectory points, segmented independent fitting, combination and reconstruction, a high-order continuous B-spline curve is obtained, avoiding curvature abrupt changes caused by local fitting, reducing computational load and improving computational efficiency.
It achieves improved computational efficiency while meeting accuracy requirements, reduces the computational load on the CNC system, allows for higher feed speeds, avoids vibrations caused by local fitting in traditional methods, and is suitable for high-precision and high-efficiency machining of complex trajectories.
Smart Images

Figure CN120724719B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of numerical control machining, and particularly relates to a smoothing continuous B-spline fitting method for complex discrete trajectory points. BACKGROUND
[0002] In the field of numerical control machining of complex parts, if the discrete tool trajectory points are directly used to guide the machining operation, a series of adverse effects will be caused, such as low machining efficiency and intensified machine tool vibration. These problems not only reduce the machining quality, but also cause damage to the machine tool equipment, thereby affecting the stability and reliability of the entire machining system. The smoothing continuous B-spline curve fitting technology can effectively optimize the tool trajectory and significantly improve the dynamic behavior of the machining system, thereby providing strong support for improving the machining performance, due to its unique mathematical characteristics.
[0003] From the mathematical essence, the B-spline curve is determined by the node vector and the control point matrix. Therefore, in the process of implementing the B-spline fitting, the core task is to accurately determine the node vector and the control point matrix of the B-spline according to the given discrete trajectory data. At present, the commonly used methods for this core task mainly include two types: one is the alternating method of optimizing the control points and the nodes, which follows the alternating optimization process of the node vector, the control point matrix, and the node vector, and gradually approaches the optimal solution. However, since the problem is essentially a non-convex optimization problem, it is easy to fall into the dilemma of local optimum in the optimization process, thereby affecting the fitting effect. The other is the node arrangement method of optimizing only the nodes, which adjusts the B-spline node vector and calculates the corresponding control points, and finally fits the trajectory into a B-spline curve. However, for complex trajectories, the existing node arrangement method often has difficulty in finding a proper balance point between fitting accuracy and computational efficiency, and it is difficult to meet the high-precision and high-efficiency requirements of actual machining.
[0004] In addition, some existing B-spline fitting methods only fit the corners in order to improve the computational efficiency when fitting complex trajectories, and the fitting result is a mixed machining trajectory of B-spline curve and straight line. This planning result is difficult to apply in high-speed machining.
[0005] In summary, it is necessary to design and develop a B-spline fitting method for complex discrete trajectory points, which can completely fit the trajectory and comprehensively balance the fitting accuracy and computational efficiency. SUMMARY
[0006] The present application aims to provide a smoothing continuous B-spline fitting method for complex discrete trajectory points, which can completely fit the tool trajectory based on the fitting method, and the fitted B-spline has high computational efficiency on the basis of meeting the accuracy requirements.
[0007] To achieve the above object, the application adopts the following technical scheme:
[0008] The application provides a fairing continuous B-spline fitting method for complex discrete trajectory points, comprising:
[0009] The trajectory points in the tool trajectory to be fitted are densified according to a distance threshold to obtain a tool initial trajectory;
[0010] The tool initial trajectory is segmented based on a plurality of determined segmentation reference points to obtain a plurality of trajectory segments;
[0011] The plurality of trajectory segments are sequentially subjected to independent B-spline fitting to obtain a final B-spline curve of each trajectory segment;
[0012] The final B-spline curves of the trajectory segments are combined to obtain a B-spline curve of the tool initial trajectory;
[0013] The nodes in the B-spline curve of the tool initial trajectory are reconstructed, and the control points are correspondingly modified to obtain a target B-spline curve.
[0014] Optionally, the tool initial trajectory is segmented based on the plurality of determined segmentation reference points to obtain the plurality of trajectory segments, comprising:
[0015] All the trajectory points in the tool initial trajectory are screened by using a segmentation reference point determination rule to obtain the plurality of determined segmentation reference points;
[0016] The tool initial trajectory is sequentially subjected to segmentation processing based on the plurality of determined segmentation reference points to obtain the plurality of trajectory segments;
[0017] The segmentation processing comprises:
[0018] The set B-spline number J is obtained, and a segmentation threshold m is obtained based on the fitting number J; wherein m=J-1;
[0019] The number of trajectory points between the current segmentation reference point and its adjacent segmentation reference point is calculated; the adjacent segmentation reference point is the previous or next segmentation reference point of the current segmentation reference point in the tool initial trajectory;
[0020] If the number of trajectory points between the current segmentation reference point and the adjacent segmentation reference point is not less than 4m+1, the tool initial trajectory is segmented at the mth trajectory point from the current segmentation reference point to the adjacent segmentation reference point.
[0021] Optionally, the segmentation reference point determination rule comprises:
[0022] For the first and last trajectory points in the initial tool trajectory, the first and last trajectory points in the initial tool trajectory are both taken as the segmentation reference points;
[0023] For the trajectory points other than the first and last trajectory points in the initial tool trajectory, if an included angle generated by a line connecting the current trajectory point and its two adjacent trajectory points is less than an included angle threshold, the current trajectory point is taken as the segmentation reference point, otherwise, the current trajectory point is not taken as the segmentation reference point.
[0024] Optionally, before the step of sequentially performing independent B-spline fitting on the plurality of trajectory segments to obtain the final B-spline curve of each trajectory segment, the method further comprises:
[0025] parameterizing the initial tool trajectory by chord length to obtain a parameter corresponding to each trajectory point in the initial tool trajectory;
[0026] calculating a first derivative of each trajectory point in the initial tool trajectory with respect to the parameter.
[0027] Optionally, the process of the independent B-spline fitting comprises:
[0028] S1: obtaining a parameter interval of the trajectory segment in combination with the parameter corresponding to each trajectory point in the initial tool trajectory and the position of the trajectory segment relative to the initial tool trajectory;
[0029] S2: obtaining a first derivative of the first and last trajectory points of the trajectory segment with respect to the parameter based on the first derivative of each trajectory point in the initial tool trajectory with respect to the parameter;
[0030] S3: obtaining an initial node vector of the trajectory segment based on the parameter interval of the trajectory segment;
[0031] S4: setting a repetition degree of the first and last nodes in the initial node vector of the trajectory segment to J+1 based on the set B-spline degree J to obtain a node vector of the trajectory segment;
[0032] S5: obtaining coordinates of the first and last trajectory points of the trajectory segment, and calculating coordinates of the first and last control points, the second and penultimate control points of the B-spline curve of the trajectory segment according to the coordinates of the first and last trajectory points of the trajectory segment, the first derivative of the first and last trajectory points of the trajectory segment with respect to the parameter, and the node vector of the trajectory segment;
[0033] S6: calculating the remaining control point coordinates of the B-spline curve of the trajectory segment based on the node vector of the trajectory segment, the coordinates of the first and last control points, the second and penultimate control points of the B-spline curve of the trajectory segment by using the least square method, so as to obtain a control point matrix;
[0034] S7: obtaining the B-spline curve of the trajectory segment based on the control point matrix and the node vector;
[0035] S8: calculating fitting errors of each trajectory point in the B-spline curve of the trajectory segment, to obtain a fitting error set;
[0036] S9: screening out a maximum fitting error in the fitting error set, and obtaining a parameter position corresponding to the maximum fitting error, and a node interval corresponding to the parameter position;
[0037] S10: if the maximum fitting error is not greater than a fitting threshold, performing a node deletion process to obtain a final B-spline curve of the trajectory segment;
[0038] S11: if the maximum fitting error is greater than the fitting threshold, inserting a new node in a node interval corresponding to the parameter position, to obtain a first node vector, and replacing the node vector with the first node vector to execute steps S5-S11 until a final B-spline curve of the trajectory segment is obtained; a size of the new node is an average value of adjacent nodes on two sides of the new node.
[0039] Optionally, the node deletion process comprises:
[0040] S01: deleting a node numbered i* in the node vector except first and last repeated nodes, to obtain a second node vector;
[0041] S02: executing steps S5-S9 by replacing the node vector with the second node vector, to obtain an updated B-spline curve of the trajectory segment and an updated maximum fitting error;
[0042] S03: judging the updated maximum fitting error, if the updated maximum fitting error is not greater than the fitting threshold, replacing the updated B-spline curve with the original B-spline curve, otherwise, not replacing;
[0043] S04: letting , executing steps S01-S03 until ; taking the finally generated B-spline curve as a final B-spline curve of the trajectory segment; wherein .
[0044] Optionally, the combining the final B-spline curves of the trajectory segments to obtain the B-spline curve of the tool initial trajectory comprises:
[0045] connecting node vectors of the final B-spline curves of the trajectory segments according to orders of the trajectory segments on the tool initial trajectory, to obtain an initial total node vector;
[0046] connecting control point matrices of the final B-spline curves of the trajectory segments according to the orders of the trajectory segments on the tool initial trajectory, to obtain an initial total control point matrix;
[0047] Partially delete the repeated nodes in the initial total node vector to obtain a total node vector; the number of each group of repeated nodes in the total node vector is J;
[0048] Partially delete the repeated control points in the initial total control point matrix to obtain a total control point matrix; the total control point matrix has no repeated control points;
[0049] Obtain the B-spline curve of the initial tool path based on the total control point matrix and the total node vector.
[0050] Optionally, the nodes in the B-spline curve of the initial tool path are reconstructed, and the control points are correspondingly modified to obtain a target B-spline curve, comprising:
[0051] S51: Obtain a total node vector and a total control point matrix according to the B-spline curve of the initial tool path;
[0052] S52: Delete the first group of repeated nodes in the total node vector so that only one node is retained in the first group of repeated nodes to obtain a temporary node vector;
[0053] S53: Adjust the total control point matrix according to the temporary node vector to obtain a temporary control point matrix;
[0054] S54: Obtain a temporary B-spline curve based on the temporary node vector and the temporary control point matrix, and calculate the maximum fitting error of the temporary B-spline curve;
[0055] S55: If the maximum fitting error of the temporary B-spline curve is not greater than a fitting threshold, the temporary node vector is taken as the total node vector, the temporary control point matrix is taken as the total control point matrix, and steps S51-S55 are executed until there is no repeated node in the total node vector;
[0056] If the maximum fitting error of the temporary B-spline curve is greater than the fitting threshold, two new nodes are respectively inserted to the left and right of the first group of repeated nodes to obtain a third node vector; adjust the temporary control point matrix according to the third node vector to obtain a third control point matrix; take the third node vector as the total node vector, and take the third control point matrix as the total control point matrix, and execute steps S51-S55 until there is no repeated node in the total node vector;
[0057] S56: Obtain a target B-spline curve based on the total node vector without repeated nodes and the corresponding total control point matrix.
[0058] Optionally, the total control point matrix is adjusted according to the temporary node vector to obtain a temporary control point matrix; wherein the adjustment formula is represented as:
[0059]
[0060]
[0061]
[0062]
[0063]
[0064] in, This represents the adjusted control point, corresponding to the first repeated node in the temporary control node vector. ; Represents the temporary control point matrix; Represents a temporary node vector, where the total node vector contains... arrive J-1 nodes have been deleted; This represents the first set of repeating nodes in the temporary node vector. ; This represents the (e+J+1)th control point, where J represents the degree of the B-spline and e is the sequence number. Control points on both sides and The nodes on both sides correspond one-to-one.
[0065] Optionally, two new nodes are inserted to the left and right of the repeated nodes in the first group to obtain the third node vector, as expressed by the formula:
[0066]
[0067]
[0068] in, Represents the vector of the third node. and express Two new nodes are inserted on the left and right sides respectively.
[0069] Compared with the prior art, the beneficial effects achieved by the present invention are as follows:
[0070] The application provides a fairing continuous B-spline fitting method for complex discrete trajectory points, the tool trajectory after densification is segmented to obtain multiple trajectory segments, and independent B-spline fitting is respectively performed on each segment, and then the independent B-spline fitting results of the multiple trajectory segments are combined and reconstructed to obtain a target B-spline curve of the tool trajectory; the B-spline fitting method of segment independent fitting + combination + reconstruction can completely fit the tool trajectory, and improve the calculation efficiency under the condition of meeting the accuracy constraint; in the process of independent fitting, different degrees of optimization can be performed according to whether the accuracy requirement is met (whether the maximum fitting error is not greater than the fitting threshold), to further improve the calculation efficiency; the combination and reconstruction steps can fuse and adjust the independent B-spline fitting results (the final B-spline curve of each trajectory segment) of each trajectory segment, to obtain a high-order continuous (greater than or equal to C 2 continuous) B-spline curve without repeated nodes, and improve the continuity of the curve.
[0071] The application provides a fairing continuous B-spline fitting method for complex discrete trajectory points, and the fitting result obtained based on the method is a whole B-spline, which can avoid the curvature mutation caused by local fitting in the traditional method, eliminate unnecessary vibration, and the complete spline curve can reduce the calculation load of the numerical control system during machine tool machining, and allow a higher feed speed.
[0072] The application provides a fairing continuous B-spline fitting method for complex discrete trajectory points, and the fitting result obtained based on the method is a whole B-spline, which can avoid the curvature mutation caused by local fitting in the traditional method, eliminate unnecessary vibration, and the complete spline curve can reduce the calculation load of the numerical control system during machine tool machining, and allow a higher feed speed.
[0073] The application provides a fairing continuous B-spline fitting method for complex discrete trajectory points, and the fitting result obtained based on the method is a whole B-spline, which can avoid the curvature mutation caused by local fitting in the traditional method, eliminate unnecessary vibration, and the complete spline curve can reduce the calculation load of the numerical control system during machine tool machining, and allow a higher feed speed.
[0074] The application provides a fairing continuous B-spline fitting method for complex discrete trajectory points, and the fitting result obtained based on the method is a whole B-spline, which can avoid the curvature mutation caused by local fitting in the traditional method, eliminate unnecessary vibration, and the complete spline curve can reduce the calculation load of the numerical control system during machine tool machining, and allow a higher feed speed.
[0075] The application provides a fairing continuous B-spline fitting method for complex discrete trajectory points, and the fitting result obtained based on the method is a whole B-spline, which can avoid the curvature mutation caused by local fitting in the traditional method, eliminate unnecessary vibration, and the complete spline curve can reduce the calculation load of the numerical control system during machine tool machining, and allow a higher feed speed. The application provides a fairing continuous B-spline fitting method for complex discrete trajectory points, and the fitting result obtained based on the method is a whole B-spline, which can avoid the curvature mutation caused by local fitting in the traditional method, eliminate unnecessary vibration, and the complete spline curve can reduce the calculation load of the numerical control system during machine tool machining, and allow a higher feed speed.
[0076] The application provides a fairing continuous B-spline fitting method for complex discrete trajectory points, reconstructs the B-spline curve of the combined tool initial trajectory, and correspondingly modifies the control points, so that the final output target B-spline curve does not contain repeated nodes and meets the accuracy requirement, is convenient for subsequent processing, and is more conducive to the motion planning of high-speed processing.
[0077] The application provides a fairing continuous B-spline fitting method for complex discrete trajectory points, based on piecewise fitting and multiple node insertion and deletion, can jump out of the local optimum of the existing curve optimization calculation method, greatly improves the calculation efficiency on the basis of not affecting the calculation result, and reduces the calculation cost. BRIEF DESCRIPTION OF DRAWINGS
[0078] Figure 1 Fig. 1 shows a flow chart of the fairing continuous B-spline fitting method for complex discrete trajectory points in an embodiment of the application;
[0079] Figure 2 Fig. 2 shows a process flow chart of independent B-spline fitting in an embodiment of the application;
[0080] Figure 3 Fig. 3 shows a process flow chart of node deletion processing in an embodiment of the application;
[0081] Figure 4 Fig. 4 shows a process schematic diagram of reconstructing the nodes in the B-spline curve of the tool initial trajectory in an embodiment of the application;
[0082] Figure 5 Fig. 5 shows a tool trajectory to be fitted in an embodiment of the application;
[0083] Figure 6 Fig. 6 shows a comparison diagram of the B-spline curve of the tool initial trajectory and the tool trajectory to be fitted in an embodiment of the application;
[0084] Figure 7 Fig. 7 shows the error of each position of the B-spline curve of the tool initial trajectory in three axial directions corresponding to the tool trajectory to be fitted in an embodiment of the application;
[0085] Figure 8 Fig. 8 shows the total error of the B-spline curve of the tool initial trajectory corresponding to the tool trajectory to be fitted in an embodiment of the application;
[0086] Figure 9 Fig. 9 shows a comparison diagram of the reconstructed target B-spline curve and the B-spline curve of the tool initial trajectory in an embodiment of the application;
[0087] Figure 10The figure shows the error of each position of the reconstructed target B-spline curve in an embodiment of the present application in three axial directions corresponding to the error before reconstruction;
[0088] Figure 11 The figure shows the total error of each position of the reconstructed target B-spline curve in an embodiment of the present application corresponding to the nodes before reconstruction;
[0089] Figure 12 The figure shows the error of each position of the reconstructed target B-spline curve in an embodiment of the present application in three axial directions corresponding to the error of the tool path to be fitted;
[0090] Figure 13 The figure shows the total error of each position of the reconstructed target B-spline curve in an embodiment of the present application corresponding to the tool path to be fitted. DETAILED DESCRIPTION
[0091] The technical solutions in the embodiments of the present application will be clearly and completely described with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments of the present application. The description of the at least one exemplary embodiment is actually only illustrative in nature and by no means as any limitation to the present application and its application or use. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative work fall within the scope of protection of the present application.
[0092] Embodiment 1
[0093] The embodiments of the present application introduce a fairing continuous B-spline fitting method for complex discrete trajectory points, as shown in the figure, and the specific steps are as follows: Figure 1 The figure shows the error of each position of the reconstructed target B-spline curve in an embodiment of the present application in three axial directions corresponding to the error before reconstruction;
[0094] S001: The trajectory points in the tool path to be fitted are densified according to the distance threshold to obtain the initial tool path;
[0095] S002: The initial tool path is segmented based on the determined several segmented reference points to obtain multiple trajectory segments;
[0096] S003: The multiple trajectory segments are sequentially subjected to independent B-spline fitting to obtain the final B-spline curve of each trajectory segment;
[0097] S004: The final B-spline curves of each trajectory segment are combined to obtain the B-spline curve of the initial tool path;
[0098] S005: The nodes in the B-spline curve of the initial tool path are reconstructed, and the control points are correspondingly modified to obtain the target B-spline curve.
[0099] The application provides a fairing continuous B-spline fitting method for complex discrete trajectory points, which can improve the calculation efficiency under the condition of meeting the accuracy constraint, and can further improve the calculation efficiency in the process of independent fitting according to whether the accuracy requirement is met (whether the maximum fitting error is not greater than the fitting threshold). The steps of combination and reconstruction can fuse and adjust the independent B-spline fitting results of each trajectory segment (the final B-spline curve of each trajectory segment) to obtain a high-order continuous (greater than or equal to C 2 The continuity of the curve is improved.
[0100] In the embodiment, the tool initial trajectory is segmented based on the determined plurality of segmentation reference points in step S002 to obtain a plurality of trajectory segments, including:
[0101] S21: filtering all trajectory points in the tool initial trajectory to obtain a plurality of determined segmentation reference points by using a segmentation reference point determination rule;
[0102] The segmentation reference point determination rule is as follows:
[0103] For the first and last two trajectory points in the tool initial trajectory, the first and last two trajectory points in the tool initial trajectory are both taken as segmentation reference points.
[0104] For the trajectory points other than the first and last two trajectory points in the tool initial trajectory, if the included angle generated by the connection line of the current trajectory point and its two adjacent trajectory points is less than an included angle threshold, the current trajectory point is taken as a segmentation reference point, otherwise, the current trajectory point is not taken as a segmentation reference point.
[0105] Specifically, the included angle generated by the connection line of the trajectory point other than the first and last two trajectory points and its two adjacent trajectory points is calculated, and the formula is as follows:
[0106]
[0107] Wherein, α o represents the included angle of the oth trajectory point and the connection line of the adjacent two discrete points, the oth trajectory point is a non-first and last trajectory point; v o is a vector with the (o-1)th trajectory point as the starting point and the oth trajectory point as the terminal point, and v o+1 is a vector with the oth trajectory point as the starting point and the (o+1)th trajectory point as the terminal point.
[0108] S22: based on the plurality of determined segmentation reference points, the tool initial trajectory is sequentially segmented to obtain a plurality of trajectory segments.
[0109] The segmentation processing includes:
[0110] S211: Obtain the set B-spline degree J, and obtain the segmentation threshold m based on the fitting degree J; where m = J-1;
[0111] S212: Calculate the number of trajectory points between the current segment reference point and its adjacent segment reference points; the adjacent segment reference point is the previous or next segment reference point in the initial tool trajectory of the current segment reference point.
[0112] S213: If the number of trajectory points between the current segment reference point and the adjacent segment reference point is not less than 4m+1, then the initial tool trajectory is segmented at the m-th trajectory point between the current segment reference point and the adjacent segment reference point.
[0113] Specifically, in this embodiment, the target B-spline curve to be fitted is a fourth-order curve, so the degree of the B-spline is set to J=3, and the segmentation threshold is m=J-1=2; the initial tool trajectory P is set as follows:
[0114]
[0115] In the above formula, p o Let 'o' be the trajectory point, which serves as the segmentation reference point for the current segmentation operation.
[0116] (1) Assume p o If the requirements of S212 are met, then P will be placed in p. o-m Divide the data into segments to obtain a single segment:
[0117]
[0118] in, This is the O*th trajectory point, and also the last trajectory point of the previous segment; s This is the trajectory point matrix for the s-th segment, where the size of s depends on the number of segments already obtained. ;
[0119] (2) Assume p o If the requirements of S213 are met, then P will be placed in p. o+m Divide the data into segments to obtain:
[0120]
[0121] in, This is the O#th trajectory point, and also the first trajectory point of the next segment; s This is the trajectory point matrix for the s-th segment, where the size of s depends on the number of segments already obtained. ;
[0122] (3) Assume p oIf the requirements of S212 and S213 are met at the same time, the P is broken at p o-m and p o+m , obtaining:
[0123]
[0124]
[0125]
[0126] In this embodiment, before the independent B-spline fitting of the plurality of trajectory segments in step S003 is sequentially performed to obtain the final B-spline curve of each trajectory segment, the following steps are further included:
[0127] S31: parameterizing the tool initial trajectory by chord length to obtain a parameter corresponding to each trajectory point in the tool initial trajectory;
[0128] S32: calculating the first derivative of the parameter at each trajectory point of the tool initial trajectory.
[0129] Specifically, the central difference method is used to solve the first derivative for the position of the non-first and last trajectory points in the tool initial trajectory:
[0130]
[0131] where d o is the first derivative of the parameter corresponding to the oth trajectory point p o , and u o is the parameter corresponding to the oth trajectory point p o .
[0132] For the position of the first and last trajectory points in the tool initial trajectory:
[0133]
[0134] where n is the total number of trajectory points in the tool initial trajectory.
[0135] Based on the data obtained in steps S31-S32, each trajectory segment is independently B-spline fitted, as shown in Figure 2 , the process is as follows:
[0136] S1: combining the parameter corresponding to each trajectory point in the tool initial trajectory and the position of the trajectory segment relative to the tool initial trajectory, obtaining the parameter interval of the trajectory segment;
[0137] Specifically, assuming that a certain trajectory segment is:
[0138]
[0139] The parameter interval to which the segment belongs is u o-m to u o+m
[0140] wherein u 0-m is the parameter corresponding to the trajectory point p 0-m is the parameter corresponding to the trajectory point p 0+m is the parameter corresponding to the trajectory point p 0+m ;
[0141] S2: Obtain the first-order derivative of the first and last trajectory points of the trajectory segment with respect to the parameter based on the first-order derivative of each trajectory point of the initial trajectory of the tool with respect to the parameter.
[0142] S3: Obtain the initial node vector of the trajectory segment based on the parameter interval of the trajectory segment.
[0143] Specifically:
[0144]
[0145] wherein, is the initial node vector of the i-th trajectory segment; the size of k1 is equal to the parameter corresponding to the first trajectory point segment i of the i-th trajectory segment. end The size of k2 is equal to the parameter corresponding to the last trajectory point segment i (end) of the i-th trajectory segment. The intermediate nodes are initially generated uniformly between k1 and k end .
[0146] S4: Set the repetition degree of the first and last nodes in the initial node vector of the trajectory segment to J+1 based on the set B-spline degree J, and obtain the node vector of the trajectory segment.
[0147] Specifically, the node vector of the i-th trajectory segment is represented as:
[0148]
[0149] S5: Obtain the first and last trajectory point coordinates of the trajectory segment, and calculate the first and last control point coordinates, the second and the second-to-last control point coordinates of the B-spline curve of the trajectory segment according to the first and last trajectory point coordinates of the trajectory segment, the first and last trajectory point coordinates of the trajectory segment, and the node vector of the trajectory segment.
[0150] Specifically, in order to ensure the continuity and smoothness of each trajectory segment after fitting, it is necessary to ensure that the coordinates and first-order derivatives at the connection between adjacent two segments are the same, i.e., the coordinates and first-order derivatives at the end of B i must be equal to the coordinates and first-order derivatives at the start of B i+1 , wherein Bi denotes the fitting result of the i-th trajectory segment;
[0151] Wherein, in order to ensure continuity and smoothness while meeting the accuracy requirements, it is necessary to adjust the B i The coordinates of both ends are fixed as segment i The coordinates of the trajectory points at both ends;
[0152] The method for adjusting the coordinates of both ends of the B-spline curve, in addition to raising the degree of the nodes at both ends of the B-spline to J+1, also needs to coincide the coordinates of the control points at both ends with the target positions, which is specifically expressed as follows:
[0153]
[0154]
[0155] Wherein, C i (1) is the first control point coordinate of the control point matrix of the B-spline curve of the i-th trajectory segment, C i (end) is the last control point coordinate of the control point matrix of the B-spline curve of the i-th trajectory segment; segment i (1) is the first trajectory point coordinate of the i-th trajectory segment, segment i (end) is the last trajectory point coordinate of the i-th trajectory segment;
[0156] Wherein, in order to ensure the first derivative continuity at the connection of adjacent B-splines, the control points of each B-spline segment are adjusted; first, the second and the second-to-last control point coordinates are adjusted based on the first and last control point coordinates:
[0157]
[0158] Wherein, is the derivative of the trajectory with respect to the parameter at segment i (1), and the value of order is the order of the fitted B-spline, which is related to the degree of the B-spline, and in this embodiment:
[0159]
[0160] Similarly, the second-to-last control point is also adjusted accordingly:
[0161]
[0162] Since K i will be adjusted later, C i (2) and C i (end-1) need to be adjusted in real time following K i adjustment;
[0163] S6: calculating the rest of the control point coordinates of the B-spline curve of the trajectory segment according to the node vector of the trajectory segment, the first and last control point coordinates of the B-spline curve of the trajectory segment, the second and the second-to-last control point coordinates by using the least square method, so as to obtain the control point matrix;
[0164] S7: obtaining the B-spline curve of the trajectory segment based on the control point matrix and the node vector;
[0165] S8: calculating the fitting error of each trajectory point in the B-spline curve of the trajectory segment to obtain a fitting error set; the calculation of the fitting error is known to those skilled in the art, and will not be described here;
[0166] S9: screening out the maximum fitting error in the fitting error set, and obtaining the parameter position corresponding to the maximum fitting error and the node interval corresponding to the parameter position;
[0167] S10: if the maximum fitting error is not greater than the fitting threshold, performing node deletion processing to obtain the final B-spline curve of the trajectory segment;
[0168] S11: if the maximum fitting error is greater than the fitting threshold, inserting a new node in the node interval corresponding to the parameter position, obtaining a first node vector, and replacing the node vector with the first node vector to execute steps S5-S11 until the final B-spline curve of the trajectory segment is obtained; the size of the new node is the average of the adjacent nodes on both sides of the new node.
[0169] Specifically, since the maximum fitting error belongs to the segment between k end and k i , an interval can be found in K
[0170]
[0171] , wherein:
[0172]
[0173] , wherein, represents the parameter position corresponding to the maximum fitting error;
[0174] At this time, a new node k x-x+1 is inserted between k x and k x+1 in K i , and the size of the new node is the average of k x and k x+1 , so that:
[0175]
[0176] wherein, as shown in Figure 3 the node deletion process in step S10 includes:
[0177] S01: deleting the node numbered i* in the node vector except the first and last repeated nodes, to obtain a second node vector;
[0178] S02: executing steps S5-S9 with the second node vector instead of the node vector, to obtain the updated B-spline curve of the trajectory segment and the updated maximum fitting error;
[0179] S03: judging the updated maximum fitting error, if the updated maximum fitting error is not greater than the fitting threshold, replacing the updated B-spline curve with the original B-spline curve, otherwise, not replacing;
[0180] S04: setting , executing steps S01-S03 until ; the finally generated B-spline curve is taken as the final B-spline curve of the trajectory segment; wherein .
[0181] Specifically, in combination with Figure 2 Figure 3 and the above steps S31-S32, steps S1-S11, and steps S01-S04, it can be seen that in this embodiment, for the steps of independent B-spline fitting of the trajectory segment, the repetition degree of the first and last nodes of the node vector is J+1, and the adjustment of the first and last two control points, so that the fitted B-spline curve satisfies the accuracy constraint and the first and last end point constraint; wherein the accuracy constraint and the first and last end point constraint are that the first and last end points of the B-spline curves of adjacent trajectory segments coincide, and their corresponding first derivatives are also the same;
[0182] In addition, whether the maximum fitting error meets the accuracy requirement (whether it is not greater than the fitting threshold) is used to judge whether it can directly enter the node deletion step S01-S04 to obtain the final B-spline curve of the trajectory segment;
[0183] If it meets, it directly enters the node deletion step S01-S04 to obtain the final B-spline curve of the trajectory segment; if it does not meet, it still needs to perform step S11 to first insert the node vector to change it, and then perform the node deletion step S01-S04 to obtain the final B-spline curve of the trajectory segment under the condition that the accuracy is met later;
[0184] Based on the steps of independent B-spline fitting in this embodiment, the node position is dynamically adjusted according to the current fitting effect, and the optimal node configuration is obtained after multiple rounds of circulation, so as to obtain the final B-spline curve of the trajectory segment.
[0185] In the embodiment, step S004 combines the final B-spline curve of each trajectory segment to obtain the B-spline curve of the tool initial trajectory, including:
[0186] S41: connecting the node vectors of the final B-spline curve of each trajectory segment in the order of the trajectory segments on the tool initial trajectory to obtain an initial total node vector;
[0187] S42: connecting the control point matrices of the final B-spline curve of each trajectory segment in the order of the trajectory segments on the tool initial trajectory to obtain an initial total control point matrix;
[0188] S43: partially deleting the repeated nodes in the initial total node vector to obtain a total node vector; the number of each group of repeated nodes in the total node vector is J;
[0189] Specifically, since the repetition degree of the first and last positions in the node vector of each trajectory segment is J+1, and the value of the last position in the first node vector of the node vectors of the adjacent two trajectory segments is equal to the value of the first position in the second node vector, the repetition degree of the node vector obtained by direct combination at the combination position is equal to 2J+2, and the number of repeated nodes at these positions is deleted to only J;
[0190] S44: partially deleting the repeated control points in the initial total control point matrix to obtain a total control point matrix; the total control point matrix has no repeated control points;
[0191] Specifically, since the control point coordinates of the last position in the control point matrix of the first segment are equal to the control point coordinates of the first position in the control point matrix of the second segment in the adjacent trajectory segments, there will be two repeated control points at the connection position in the combination result, and only one of the repeated control points is deleted;
[0192] S45: obtaining the B-spline curve of the tool initial trajectory based on the total control point matrix and the total node vector.
[0193] In the embodiment, as shown in Figure 4 , step S005 reconstructs the nodes in the B-spline curve of the tool initial trajectory and correspondingly modifies the control points to obtain a target B-spline curve, including:
[0194] S51: obtaining a total node vector and a total control point matrix according to the B-spline curve of the tool initial trajectory;
[0195] S52: deleting the first group of repeated nodes of the total node vector so that only one of the first group of repeated nodes is reserved to obtain a temporary node vector;
[0196] Specifically, assuming that the total node vector
[0197] wherein, is the total node vector is the first group of repeated nodes, i.e.:
[0198]
[0199] then directly delete J-1 items in it, to obtain:
[0200]
[0201] wherein, represents the temporary node vector.
[0202] S53: According to the temporary node vector, adjust the total control point matrix to obtain a temporary control point matrix;
[0203] Specifically, since the nodes in the total node vector are deleted, the control points at the corresponding positions need to be adjusted to The formula for adjusting the total control point matrix is:
[0204]
[0205]
[0206]
[0207]
[0208] wherein, represents the adjusted control point, corresponding to the first group of repeated nodes in the temporary node vector ; represents the temporary control point matrix; represents the temporary node vector, wherein the J-1 nodes from to in the total node vector have been deleted; represents the first group of repeated nodes in the temporary node vector ; represents the e+J+1th control point, J represents the B-spline degree, and e is the sequence number; The control points on both sides correspond one-to-one with the nodes on both sides.
[0209] S54: Based on the temporary node vector and the temporary control point matrix, obtain a temporary B-spline curve, and calculate the maximum fitting error of the temporary B-spline curve;
[0210] S55: If the maximum fitting error of the temporary B-spline curve is not greater than the fitting threshold, the temporary node vector is taken as the total node vector, the temporary control point matrix is taken as the total control point matrix, and steps S51-S55 are executed until the total node vector has no repeated nodes;
[0211] If the maximum fitting error of the temporary B-spline curve is greater than the fitting threshold, two new nodes are respectively inserted to the left and right of the repeated node in the first group to obtain a third node vector; the temporary control point matrix is adjusted according to the third node vector to obtain a third control point matrix; the third node vector is taken as the total node vector, and the third control point matrix is taken as the total control point matrix, and steps S51-S55 are executed until the total node vector has no repeated nodes;
[0212] Specifically, the third node vector is expressed by a formula as follows:
[0213]
[0214]
[0215] wherein, represents the third node vector, and represents two new nodes respectively inserted to the left and right.
[0216] Specifically, each time two new nodes are respectively inserted to the left and right of the repeated node in the first group, the control points in a certain region need to be adjusted accordingly to avoid curve deformation, that is, the temporary control point matrix is adjusted according to the third node vector to obtain a third control point matrix.
[0217] For example, k new1 is taken as an example:
[0218]
[0219] wherein, is the jth control point in the third control point matrix; is the jth control point in the temporary control point matrix; is an intermediate variable;
[0220]
[0221] S56: Based on the total node vector without repeated nodes and the corresponding total control point matrix, a target B-spline curve is obtained.
[0222] In this embodiment, for the reconstructed B-spline curve (target B-spline curve), the curve can be input into a multi-axis numerical control machine tool as a machining trajectory curve, and after speed planning, high-speed and high-precision machining can be realized.
[0223] Example 2
[0224] Based on the complex discrete trajectory point fairing continuous B-spline fitting method introduced in Example 1 of the present application, a B-spline fitting experiment is performed on a tool trajectory to be fitted in this example:
[0225] First, the tool trajectory to be fitted, i.e., the target trajectory, is as shown in Figure 5 The target trajectory is a three-dimensional ellipsoid, and it can be seen that the trajectory contains a large number of corner regions. Based on the densification and segmentation steps proposed in Example 1, the trajectory can be segmented into circular arc regions and corner regions, and the corner regions are arranged to contain an equal number of trajectory points (m trajectory points) on both sides of the corner. This greatly improves the accuracy of the B-spline fitting result.
[0226] Second, each trajectory segment of the tool trajectory to be fitted is independently fitted, and the sharp corners of the trajectory segments are smoothly transitioned on the basis of meeting the accuracy requirement to obtain a segmented fitting result. This can effectively improve the lower limit of the speed in machining the region and improve the machining efficiency. Based on the combination steps mentioned in the example, the B-spline curve of the tool initial trajectory is obtained; as shown in Figure 6 The comparison chart of the B-spline curve of the tool initial trajectory and the tool trajectory to be fitted is shown in Figure 6 From the top view of the edge region and the center region corner region, it can be seen that the fitting result is close to the original curve in the segmented region (i.e., on both sides of the corner point), and the error is extremely low. It can be seen from
[0227] Based on the B-spline curve of the tool initial trajectory shown in Figure 7 and Figure 8 The error of each position in the three axial directions corresponding to the tool trajectory to be fitted, and the total error of the B-spline curve of the tool initial trajectory corresponding to the tool trajectory to be fitted; from Figure 7 and Figure 8 It can be seen that the three axial errors and the total error of the B-spline curve of the tool initial trajectory formed after combining the segmented fitting results are not greater than the error upper limit;
[0228] Then, the B-spline curve of the tool initial trajectory obtained by combining the segmented fitting results is subjected to the reconstruction step in Example 1 to obtain the reconstructed target B-spline curve; as shown in Figure 9 The comparison chart of the reconstructed target B-spline curve and the B-spline curve of the tool initial trajectory is shown in Figure 9In the figure, the curve before node recombination corresponds to the reconstructed target B-spline curve, and the curve before node recombination corresponds to the B-spline curve of the initial tool trajectory. As can be seen from the local top view and front view in FIG. 9, the curve after node recombination overlaps with the curve before node recombination, and it can be seen that the node recombination has little effect on the accuracy of the curve;
[0229] Based on the Matlab output Figure 10 and Figure 11 The error of each position of the reconstructed target B-spline curve in the three axial directions corresponds to the error before reconstruction, and the total error of the reconstructed target B-spline curve corresponds to the total error before reconstruction. As can be seen from Figure 10 and Figure 11 The three axial errors and the total error of the reconstructed target B-spline curve are much smaller than the error upper limit (0.1), and the effect of node recombination on the accuracy of the curve can be ignored;
[0230] Based on the Matlab output Figure 12 and Figure 13 The error of each position of the reconstructed target B-spline curve in the three axial directions corresponds to the error of the tool trajectory to be fitted, and the total error of the reconstructed target B-spline curve corresponds to the total error of the tool trajectory to be fitted. As can be seen from Figure 12 and Figure 13 The three axial errors and the total error of the final result (the reconstructed target B-spline curve) are also smaller than the error upper limit.
[0231] In this embodiment, the original trajectory is divided into 273 small segments in the segmentation process, and after 273 independent fittings and node reconstructions, only 11.26 seconds are consumed.
[0232] In summary, the fitting method of this embodiment proves that the complete B-spline curve obtained by fitting the tool trajectory can have high calculation efficiency on the basis of meeting the accuracy requirements.
[0233] Embodiment 3
[0234] The embodiment provides a fairing continuous B-spline fitting system for complex discrete trajectory points, comprising:
[0235] The densification module is configured to densify the trajectory points in the tool trajectory to be fitted according to a distance threshold to obtain an initial tool trajectory;
[0236] The segmentation module is configured to segment the initial tool trajectory based on a plurality of determined segmentation reference points to obtain a plurality of trajectory segments;
[0237] The independent fitting module is configured to sequentially perform independent B-spline fitting on the plurality of trajectory segments to obtain a final B-spline curve of each trajectory segment;
[0238] a combination module, configured to combine the final B-spline curves of the individual trajectory segments to obtain a B-spline curve of the initial tool path;
[0239] a reconstruction module, configured to reconstruct the nodes in the B-spline curve of the initial tool path and modify the control points accordingly to obtain a target B-spline curve.
[0240] Embodiment 4
[0241] The embodiment provides a computer readable storage medium storing a computer program, the computer program being executed to implement the fairing and continuous B-spline fitting method for complex discrete trajectory points according to the embodiment 1.
[0242] Those skilled in the art will understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROMs, optical storage media, etc.) containing computer-usable program code.
[0243] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of the flows and / or blocks in the flowcharts and / or block diagrams can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing apparatus to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing apparatus generate a means for implementing the functions specified in the flowcharts and / or block diagrams. Figure 1 one or more flows and / or blocks Figure 1 an apparatus for performing the functions specified in the flowcharts and / or block diagrams.
[0244] These computer program instructions can also be stored in a computer readable memory that can direct the computer or other programmable data processing apparatus to work in a specific manner, so that the instructions stored in the computer readable memory produce a manufactured product including instruction apparatus, which implements the functions specified in the flowcharts and / or block diagrams. Figure 1 one or more flows and / or blocks Figure 1 an apparatus for performing the functions specified in the flowcharts and / or block diagrams.
[0245] The embodiments of the present application are described above with reference to the accompanying drawings, but the present application is not limited to the above-described specific embodiments, and the above-described specific embodiments are merely illustrative, but not restrictive, and a person of ordinary skill in the art can make many forms under the inspiration of the present application without departing from the purpose of the present application and the scope protected by the claims, and these all belong to the protection of the present application.
Claims
1. A fairing continuous B-spline fitting method for complex discrete trajectory points, characterized in that, The application relates to a method for fitting a tool trajectory, comprising the following steps: The trajectory points in the tool trajectory to be fitted are densified according to a distance threshold to obtain a tool initial trajectory; The tool initial trajectory is segmented based on a plurality of determined segmentation reference points to obtain a plurality of trajectory segments; The plurality of trajectory segments are sequentially subjected to independent B-spline fitting to obtain a final B-spline curve of each trajectory segment; The final B-spline curves of the trajectory segments are combined to obtain a B-spline curve of the tool initial trajectory; The nodes in the B-spline curve of the tool initial trajectory are reconstructed, and the control points are correspondingly modified to obtain a target B-spline curve; The process of the independent B-spline fitting comprises the following steps: S1: obtaining a parameter interval of the trajectory segment by combining the parameters corresponding to each trajectory point in the tool initial trajectory and the position of the trajectory segment relative to the tool initial trajectory; S2: obtaining the first-order derivative of the trajectory segment at the first and last trajectory points with respect to the parameters based on the first-order derivative of the tool initial trajectory at each trajectory point with respect to the parameters; S3: obtaining an initial node vector of the trajectory segment based on the parameter interval of the trajectory segment; S4: setting the repetition degree of the first and last nodes in the initial node vector of the trajectory segment to J+1 based on the set B-spline number J to obtain a node vector of the trajectory segment; S5: obtaining the coordinates of the first and last trajectory points of the trajectory segment, and calculating the coordinates of the first and last control points, the second and penultimate control points of the B-spline curve of the trajectory segment according to the coordinates of the first and last trajectory points of the trajectory segment, the first-order derivative of the first and last trajectory points of the trajectory segment with respect to the parameters and the node vector of the trajectory segment; S6: calculating the coordinates of the remaining control points of the B-spline curve of the trajectory segment by using the least square method according to the node vector of the trajectory segment, the coordinates of the first and last control points, the second and penultimate control points of the B-spline curve of the trajectory segment to obtain a control point matrix; S7: obtaining the B-spline curve of the trajectory segment based on the control point matrix and the node vector; S8: calculating the fitting error of each trajectory point in the B-spline curve of the trajectory segment to obtain a fitting error set; S9: screening out the maximum fitting error in the fitting error set, and obtaining the parameter position corresponding to the maximum fitting error and the node interval corresponding to the parameter position; S10: if the maximum fitting error is not greater than a fitting threshold, performing node deletion processing to obtain the final B-spline curve of the trajectory segment; S11: if the maximum fitting error is greater than the fitting threshold, inserting a new node in the node interval corresponding to the parameter position to obtain a first node vector, and replacing the node vector with the first node vector to execute steps S5-S11 until the final B-spline curve of the trajectory segment is obtained; the size of the new node is the average value of the adjacent nodes on both sides of the new node; The process of reconstructing the nodes in the B-spline curve of the tool initial trajectory and correspondingly modifying the control points to obtain the target B-spline curve comprises the following steps: S51: obtaining a total node vector and a total control point matrix according to the B-spline curve of the tool initial trajectory; S52: deleting the first set of repeated nodes in the total node vector so that only one node is reserved in the first set of repeated nodes to obtain a temporary node vector; S53: adjusting the total control point matrix according to the temporary node vector to obtain a temporary control point matrix; S54: obtaining a temporary B-spline curve based on the temporary node vector and the temporary control point matrix, and calculating a maximum fitting error of the temporary B-spline curve; S55: if the maximum fitting error of the temporary B-spline curve is not greater than the fitting threshold, taking the temporary node vector as the total node vector and the temporary control point matrix as the total control point matrix, and performing steps S51-S55 until the total node vector has no repeated nodes; if the maximum fitting error of the temporary B-spline curve is greater than the fitting threshold, inserting two new nodes on the left and right of the repeated node in the first group to obtain a third node vector, adjusting the temporary control point matrix according to the third node vector to obtain a third control point matrix, taking the third node vector as the total node vector and the third control point matrix as the total control point matrix, and performing steps S51-S55 until the total node vector has no repeated nodes; S56: obtaining a target B-spline curve based on the total node vector without repeated nodes and the corresponding total control point matrix; the adjusting formula is: ; ; ; ; ; in, This represents the adjusted control point, corresponding to the first repeated node in the temporary control node vector. ; Represents the temporary control point matrix; Represents a temporary node vector, where the total node vector contains... arrive J-1 nodes have been deleted; This represents the first set of repeated nodes in the temporary node vector. ; This represents the (e+J+1)th control point, where J represents the degree of the B-spline and e is the sequence number. Control points on both sides and The nodes on both sides correspond one-to-one.
2. The fair continuous B-spline fitting method for complex discrete trajectory points according to claim 1, characterized in that, the segmenting the tool initial trajectory based on the determined several segment reference points to obtain the plurality of trajectory segments comprises: screening all trajectory points in the tool initial trajectory to obtain the determined several segment reference points by using a segment reference point determination rule; segmenting the tool initial trajectory in sequence based on the determined several segment reference points to obtain the plurality of trajectory segments; the segmenting processing comprises: obtaining a set B-spline number J and obtaining a segment threshold m based on the B-spline number J; wherein m = J-1; calculating the number of trajectory points between the current segment reference point and the adjacent segment reference point; the adjacent segment reference point is the previous or next segment reference point of the current segment reference point in the tool initial trajectory; if the number of trajectory points between the current segment reference point and the adjacent segment reference point is not less than 4m+1, segmenting the tool initial trajectory at the mth trajectory point between the current segment reference point and the adjacent segment reference point.
3. The fair continuous B-spline fitting method for complex discrete trajectory points according to claim 2, characterized in that, the segment reference point determination rule comprises: for the first and last two trajectory points in the tool initial trajectory, taking the first and last two trajectory points in the tool initial trajectory as segment reference points; for the trajectory points other than the first and last two trajectory points in the tool initial trajectory, if the angle between the current trajectory point and the connecting line of the two adjacent trajectory points is less than an angle threshold, taking the current trajectory point as a segment reference point, otherwise not taking the current trajectory point as a segment reference point.
4. The fair continuous B-spline fitting method for complex discrete trajectory points according to claim 3, characterized in that, before the independently B-spline fitting of the plurality of trajectory segments in sequence to obtain the final B-spline curve of each trajectory segment, further comprising: parameterizing the tool initial trajectory by chord length to obtain a parameter corresponding to each trajectory point in the tool initial trajectory; calculating the first derivative of each trajectory point in the tool initial trajectory with respect to the parameter.
5. The fair continuous B-spline fitting method for complex discrete trajectory points according to claim 4, characterized in that, the node deletion processing comprises: S01: deleting the node numbered i* in the node vector except the first and last repeated nodes to obtain a second node vector; S02: performing steps S5-S9 on the second node vector instead of the node vector to obtain an updated B-spline curve of the trajectory segment and an updated maximum fitting error; S03: judging the updated maximum fitting error, if the updated maximum fitting error is not greater than the fitting threshold, replacing the updated B-spline curve with the original B-spline curve, otherwise, not replacing; S04: Let perform steps S01-S03 until ; the last generated B-spline curve as the final B-spline curve of the trajectory segment; wherein .
6. The fair continuous B-spline fitting method for complex discrete trajectory points according to claim 5, characterized in that, The combining the final B-spline curves of the trajectory segments to obtain the B-spline curve of the tool initial trajectory comprises: connecting the node vectors of the final B-spline curves of the trajectory segments according to the sequence of the trajectory segments on the tool initial trajectory to obtain an initial total node vector; connecting the control point matrices of the final B-spline curves of the trajectory segments according to the sequence of the trajectory segments on the tool initial trajectory to obtain an initial total control point matrix; partially deleting the repeated nodes in the initial total node vector to obtain a total node vector, wherein the number of each group of repeated nodes in the total node vector is J; partially deleting the repeated control points in the initial total control point matrix to obtain a total control point matrix, wherein there is no repeated control point in the total control point matrix; obtaining the B-spline curve of the tool initial trajectory based on the total control point matrix and the total node vector.
7. The fair continuous B-spline fitting method for complex discrete trajectory points according to claim 6, characterized in that, The third node vector is obtained by respectively inserting two new nodes to the left and right of the repeated nodes in the first group, and is expressed by a formula as follows: ; ; wherein, denotes a third node vector, and denotes two new nodes inserted left and right, respectively.
Citation Information
Patent Citations
B-spline fitting method for five-axis cutter path
CN108958161A
Cutter path fairing method and system based on curvature maximum value optimization
CN115857432A