A non-standard contour equidistance transformation method of three-dimensional five-axis laser cutting program
By parsing and drawing trajectories from G-code and calculating equidistant directions, a rapid equidistant transformation of non-standard contours in a 3D five-axis laser cutting program was achieved. This solved the problems of complex operation and insufficient stability in existing technologies, and improved modification efficiency and stability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- WUHAN FARLEY PLASMA CUTTING SYS CO LTD
- Filing Date
- 2023-10-11
- Publication Date
- 2026-07-21
AI Technical Summary
Existing 3D five-axis laser cutting technology is complex, time-consuming, and prone to accidental modification of other trajectories when dealing with non-standard contours caused by manufacturing errors in sheet metal parts, resulting in low stability.
By parsing the G-code, reading the instructions line by line, drawing the cutting trajectory, selecting the non-standard contours that need to be equidistantly transformed, calculating the equidistant direction, and rewriting the G-code, the equidistant transformation of straight lines and circular arc trajectories is realized, ensuring that local modifications do not affect other trajectories.
It simplifies the operation process, improves modification efficiency, ensures the stability of local modifications without affecting other G-code, and improves production efficiency and stability.
Smart Images

Figure CN117452874B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of laser cutting, and in particular to a method for non-standard contour isometric transformation in a three-dimensional five-axis laser cutting program. Background Technology
[0002] Most sheet metal parts in automobiles are cut using 3D five-axis laser cutting machines. Nesting software generates G-code files for 3D five-axis laser cutting based on a standard digital model. Due to manufacturing errors in the sheet metal parts themselves, some local contours or trajectories need rapid fine-tuning during actual cutting. For example, certain non-standard contours in 3D space require isometric transformation. The workshop must be able to respond quickly to modification requests to ensure production efficiency. Furthermore, modifications can only be made to the parts that require them and cannot affect other trajectories.
[0003] Existing methods involve processing the relevant contours on the digital model and then regenerating new G-codes using nesting software; or modifying the extracted trajectory in the nesting software without changing the digital model, and then regenerating new G-codes. These existing methods are complex due to the need for re-nesting, require highly skilled operators, and are time-consuming. They cannot quickly respond to modification requests. Furthermore, the numerous steps involved in re-nesting increase the risk of accidentally modifying other unaffected trajectories, resulting in low stability. Summary of the Invention
[0004] In view of the above problems, the present invention is proposed to provide a non-standard contour isometric transformation method for a three-dimensional five-axis laser cutting program that overcomes or at least partially solves the above problems.
[0005] To address the aforementioned technical problems, the embodiments of this application disclose the following technical solutions:
[0006] A method for isometric transformation of non-standard contours in a three-dimensional five-axis laser cutting program, comprising:
[0007] S100. Parse the G code; read each line of instruction in the G code line by line, analyze the execution category of the current code line based on the identifier in the G code, and record the relevant trajectory category, feature point coordinate information and its line number information;
[0008] S200. Draw and pick the trajectory; Based on the coordinate information of the feature points of the cutting trajectory obtained in S100, use OpenGL drawing functions to draw the cutting trajectory corresponding to the G code; When a non-standard contour request that requires isometric transformation is obtained, select the trajectory that intersects with it by the distance between the request point and all drawn trajectories, and record its row number;
[0009] S300. Extract the contour; based on the row number information obtained in S200, index forward to the start marker of the contour and index backward to the end marker of the contour, record the start and end rows of the contour, and obtain all the trajectory information and their respective row numbers in the contour based on the information in S100.
[0010] S400. Calculate the equidistant direction of the contour; based on the information of all trajectories in the contour obtained from S300, first project all cutting trajectories in the contour onto the plane, then calculate the rotation direction of the contour, and then determine the equidistant direction.
[0011] S500. Perform equidistant calculations on straight lines and circular arc trajectories; wherein, based on the coordinate information of the start and end points of the current straight line trajectory and the corresponding normal information, calculate the equidistant straight line after spatial straight line, and record the new coordinate information of the start and end points; based on the coordinate information of the start point, intermediate point, end point, and center of the current circular arc trajectory, and the normal information when cutting each point, calculate the equidistant circular arc after spatial circular arc, and record the new coordinate information of the start point, intermediate point, and end point;
[0012] S600. Process the equidistant connections between straight lines and calculate the equidistant contour leader lines; where, when two adjacent trajectory segments are both straight lines, perform continuity processing on the equidistant lines of the two lines, remove the redundant line segments when the two lines intersect, and extend and fill in the line segments when the two lines are separate; calculate the distance and direction of the equidistant movement of the starting point of the first trajectory segment of the contour, and translate the leader line in the same way to obtain a new leader line;
[0013] S700. Rewrite G-code; After all trajectories in the contour have undergone isometric transformation to obtain new trajectory information, generate new G-code according to the rules of G-code, and write the new G-code to the original G-code file according to the line number of the trajectory obtained in S400, overwriting the original G-code.
[0014] Furthermore, in S100, the G code is parsed using the following methods:
[0015] S101. Traverse the G-codes line by line. According to the standard CNC code format, when a G-code contains the G00 field, it is recorded as an empty line; when it contains the G01 field, it is recorded as a straight line; when it contains the CIP field, it is recorded as an arc; when it contains the CIRC field, it is recorded as a standard full circle contour; when it contains the HLOT field, it is recorded as a standard oval contour; when it contains the RECT field, it is recorded as a standard rectangular contour. Other types of G-codes are non-trajectory types.
[0016] S102. In each type of G-code instruction, coordinate information is parsed from keywords such as X, Y, Z, A, and C. Among them, the straight line records the coordinates of the starting point and the ending point; the CIP arc records the information of the starting point, the ending point, and the intermediate point, and calculates the coordinates of the center of the circle based on the three points; the standard contour records the relevant size and position parameters according to its own size definition rules.
[0017] S103. After recording the type and coordinate information of each line of G code, it is also necessary to record the line number of the current G code in the file, and finally form a list of G code information.
[0018] Furthermore, in S200, the trajectory is drawn and picked up, and the specific methods include:
[0019] S201. Based on the contour and trajectory information obtained in S100, programmatically use the drawing library in OpenGL to draw the trajectory. The straight line trajectory is directly drawn using the straight line drawing function based on the coordinates of the start and end points of the straight line. The CIP arc is first discretized into several small line segments according to the relevant coordinate information of the arc and the arc length of 0.1mm. The arc information to which the small line segments belong is recorded. Then, the small line segments are drawn using the straight line drawing function, and finally, an approximate arc is drawn. The standard contour is first decomposed into straight lines and CIP arcs, and then drawn according to the drawing methods of straight lines and arcs respectively.
[0020] S202. When a non-standard contour request requiring equidistant transformation is obtained, the coordinates of the requested point are first converted into coordinates in the actual drawing space. Then, the distance from the point to all trajectories is calculated, that is, the distance between the point and all line segments is calculated. For straight trajectories, the distance from the point to the straight line segment is calculated directly. For circular arc trajectories, the distance from the point to each small line segment is calculated separately, and the minimum distance is taken as the distance from the point to the arc. When the distance from the point to the trajectory is less than 0.1, the trajectory is selected, and the row number to which the trajectory belongs is recorded.
[0021] Furthermore, in S300, the contour is cropped, specifically through the following methods:
[0022] S301. Based on the line number obtained in S200, traverse the G code with the line number as the reference. Traverse each line of the G code backward. When the "BLOCK_START" field appears for the first time in the G code, it indicates the starting line of the currently selected contour, and record the line number N_Sta. Traverse each line of the G code backward. When the "BLOCK_END" field appears for the first time in the G code, it indicates the ending line of the currently selected contour, and record the line number N_End.
[0023] S302. Extract G-code information from the G-code information table established in S100 with row numbers between N_Sta and N_End. Iterate through the G-code information one by one. When the BEAMON field appears in the G-code, it indicates that the following is cutting contour information and the next straight line trajectory is the leader line. Record the leader line information and its row number. Continue to traverse and record all cutting trajectory information contained in the contour and their respective row numbers until the BEAMOFF field appears.
[0024] Furthermore, in S400, the equidistant directions of the contour are calculated, specifically using the following methods:
[0025] S401. Based on the information of all cutting trajectories in the contour obtained in S300, take the first two trajectories, and take the starting point P1 and ending point P2 of the first trajectories and the ending point P3 of the second trajectories respectively. Calculate vector Dir1 = vector P1P3 × vector P1P2; calculate vector Dir2 = vector Dir1 × vector P1P2; define P1 as the origin, vector P1P2 as the X-axis direction, vector Dir2 as the Y-axis direction, and vector Dir1 as the Z-axis direction, and re-establish the coordinate system.
[0026] S402. Transform the coordinate information of all cutting trajectories in the contour to a new coordinate system, and take their projection on the XOY plane to establish a planar closed contour; then calculate the rotation direction of the closed contour according to Green's formula.
[0027] S403. Determine the equidistant direction of the spatial trajectory according to the principle of clockwise left-side offset and counterclockwise right-side offset; the current trajectory cutting normal is Dir_Nor, the trajectory tangent is Dir_Tan, the left-side offset direction is Dir_left = Dir_Nor × Dir_Tan; the right-side offset is Dir_Right = Dir_Tan × Dir_Nor.
[0028] Furthermore, in S403, the cutting normal of the trajectory can be calculated using the following method:
[0029] Record the cutting information of a certain point as (X,Y,Z,A,C).
[0030] tempX = X;
[0031] tempY = Y*cos(A) - Z*sin(A);
[0032] tempZ = Y*sin(A) + Z*cos(A;)
[0033] result_X=tempX*cos(C)-tempY*sin(C);
[0034] result_Y=tempX*sin(C)-tempY*cos(C);
[0035] result_Z = tempZ;
[0036] Dir_Nor is (result_X-X,result_Y-Y,result_Z-Z).
[0037] Furthermore, in S500, equidistant calculations are performed on straight lines and circular arc trajectories. When performing equidistant calculations on straight line trajectories, the specific methods include:
[0038] S501. Let the starting point of the line be L_Sta(X1,Y1,Z1,A1,C1), the ending point be L_End(X2,Y2,Z2,A2,C2), and the tangent of the line be L_Tan(X2-X1,Y2-Y1,Z2-Z1).
[0039] S502. The cutting normals of the line at the starting point and the ending point are obtained according to the method in S400, and are denoted as Nor_Sta and Nor_End respectively;
[0040] S503. Calculate the tool compensation direction of the contour according to the method in S400, and then calculate the direction vector Offset(X3,Y3,Z3) after equidistant normalization. Assuming the set equidistant length is L, then the starting point after equidistant normalization is L_Sta_new(X4,Y4,Z4).
[0041] The calculation method is as follows:
[0042] X4 = X1 + X3 * L; Y4 = Y1 + L * Y3; Z4 = Z1 + L * Z3; The formula for calculating the endpoint after equal intervals is the same.
[0043] Furthermore, in S500, equidistant calculations are performed on straight lines and circular arc trajectories. When performing equidistant calculations on circular arc trajectories, the specific methods include:
[0044] S501'. Let CIP_Sta(X5,Y5,Z5,A5,C5), CIP_Mid(X6,Y6,Z6,A6,C6), CIP_End(X7,Y7,Z7,A7,C7), and CIP_Cen(X8,Y8,Z8) be the starting point of the CIP arc.
[0045] The method for calculating the tangent direction of the arc at the above three points is as follows:
[0046] Taking the starting point as an example, first calculate the vector from the center of the circle to the starting point, Dir_Cen_Sta(X5-X8,Y5-Y8,Z5-Z8), and the vector from the center of the circle to the middle point, Dir_Cen_Mid(X6-X8,Y6-Y8,Z6-Z8); calculate Dir_Temp = Dir_Cen_Sta × Dir_Cen_Mid; finally, calculate the tangential vector at the starting point, CIP_Tan_Sta = Dir_Temp × Dir_Cen_Sta.
[0047] Calculate the vector Dir_Sta_Mid(X6-X5,Y6-Y5,Z6-Z5) from the starting point to the intermediate point, and calculate F = CIP_Tan_Sta * Dir_Sta_Mid. When F < 0, CIP_Tan_Sta = -CIP_Tan_Sta.
[0048] The tangential vector CIP_Tan_Mid at the midpoint and the tangential vector CIP_Tan_End at the end point are calculated in the same way as the tangential vectors at the starting point.
[0049] S502'. The cutting normals of the arc at the start point, midpoint, and end point are obtained according to the method in section 5, and are denoted as Nor_CIP_Sta, Nor_CIP_Mid, and Nor_CIP_End, respectively.
[0050] S503'. Calculate the tool offset direction of the contour according to the method in S400, and then calculate the direction vector CIP_Offset(X9,Y9,Z9) after equidistant normalization. Assuming the set equidistant length is L, the calculation method of the equidistant starting point CIP_Sta_new(X10,Y10,Z10) is as follows:
[0051] X10 = X6 + X9 * L; Y10 = Y6 + L * Y9; Z10 = Z6 + L * Z9; The formulas for calculating the midpoint and endpoint after equidistant distance are similar.
[0052] Furthermore, in S600, after equidistant processing of intersecting lines, when the trajectory in the contour connects a line and an arc, they are all tangent, so no processing is needed; when lines connect but are not collinear, after equidistant transformation, they may intersect or separate, so continuous processing is required. Specific methods include:
[0053] S601. First, calculate the intersection point of the two new line segments formed by equidistant two adjacent line segments in space, as follows:
[0054] When two straight lines are connected, they must be coplanar. The normals of the lines cutting each other at the same point are also the same. Therefore, after being equidistant, the two straight lines will also intersect and be coplanar.
[0055] a. Take the starting point P1 and ending point P2 of the first equidistant line segment, and the ending point P4 of the second equidistant line segment. Calculate vector Dir1 = vector P1P4 × vector P1P2; calculate vector Dir2 = vector Dir1 × vector P1P2; define P1 as the origin, vector P1P2 as the X-axis direction, vector Dir2 as the Y-axis direction, and vector Dir1 as the Z-axis direction. Re-establish the coordinate system, transform the starting point and ending point of the two equidistant line segments to the new coordinate system, and project them onto the XOY plane to obtain two line segments on the 2D plane. The starting point and ending point of the two line segments are denoted as P1_2D, P2_2D, P3_2D, and P4_2D, respectively.
[0056] b. Calculate the intersection point P5_2D of the lines containing the two line segments on the 2D plane;
[0057] c. Take points P1 and P2 in the original coordinate system and P1_2D and P2_2D in the new coordinate system, and calculate the transformation matrix H_Trans between the two coordinate systems using the two sets of corresponding points.
[0058] d. The coordinates of the intersection point of the two new line segments formed after equidistant spacing in the original coordinate system are P5 = H_Trans * P5_2D;
[0059] S602. If the current trajectory is a straight line, and the previous trajectory is also a straight line, calculate the intersection point of the two equidistant straight line segments using the above method, and use it as the starting point of the equidistant current straight line.
[0060] S603. If the current trajectory is a straight line, and the next trajectory is also a straight line, calculate the intersection point of the two equidistant straight line segments using the above method, and use it as the endpoint of the current straight line after equidistant distance.
[0061] Furthermore, in S600, the position of the equidistant contour leader is calculated, and the position change of the leader will also change accordingly. The position change of the leader is consistent with the position change of the starting point of the cutting trajectory; the specific method includes:
[0062] S604. Obtain the first cutting trajectory of the non-standard contour according to the method mentioned in S300, and calculate the result of the first trajectory after equidistant distance using the methods mentioned in S400-S600; calculate the position change of the starting point before and after equidistant distance of the first trajectory Offset_Lead(Of_X,Of_Y,Of_Z);
[0063] S605. Obtain relevant information about the non-standard contour lead wire according to the method provided in S300, and then shift the entire lead wire by Offset_Lead to obtain the new position of the lead wire.
[0064] The beneficial effects of the above-described technical solutions provided in the embodiments of the present invention include at least the following:
[0065] This invention discloses a method for isometric transformation of non-standard contours in a three-dimensional five-axis laser cutting program, comprising: S100. Parsing the G-code; reading each line of instruction in the G-code line by line, analyzing the execution category of the current line of code based on the identifier in the G-code, and recording the relevant trajectory category, feature point coordinate information and its line number information; S200. Drawing and picking the trajectory; drawing the cutting trajectory corresponding to the G-code using OpenGL drawing functions based on the feature point coordinate information of the cutting trajectory obtained in S100; when a request for isometric transformation of a non-standard contour is obtained, through... The distance between the request point and all drawn trajectories is used to select the intersecting trajectory and record its row number; S300. The contour is cut; based on the row number information obtained in S200, the contour start marker is indexed forward and the contour end marker is indexed backward, the start and end rows of the contour are recorded, and the information of all trajectories in the contour and their row numbers are obtained based on the information in S100; S400. The contour equidistant direction is calculated; based on the information of all trajectories in the contour obtained in S300, all cutting trajectories in the contour are first projected onto the plane, and then the rotation direction of the contour is calculated. And determine the equidistant direction; S500. Perform equidistant calculation on the straight line and arc trajectory; wherein, based on the starting point and ending point coordinate information and the corresponding normal information of the current straight line trajectory, calculate the spatial straight line after equidistant, and record the new coordinate information of the starting point and ending point; based on the starting point, intermediate point, ending point, and center coordinate information of the current arc trajectory, and the normal information when cutting each point, calculate the spatial arc after equidistant, and record the new starting point, intermediate point, and ending point coordinate information; S600. Perform equidistant post-processing on the connection of straight lines, and calculate the equidistant contour leader line; wherein, when When two adjacent trajectory segments are both straight lines, the two straight lines are connected after being equidistant from each other. If the two straight lines intersect, the redundant line segments are removed. If the two straight lines are separate, the line segments are extended and supplemented. Calculate the distance and direction of the equidistant movement of the starting point of the first trajectory segment of the contour. Translate the leader line in the same way to obtain a new leader line. S700. Rewrite G code. After all trajectories in the contour have completed the equidistant transformation and obtained new trajectory information, generate new G code according to the rules of G code. According to the line number of the trajectory obtained in S400, write the new G code into the original G code file, overwriting the original G code.
[0066] The non-standard contour isometric transformation method for a three-dimensional five-axis laser cutting program proposed in this invention can directly modify G-code files. It is simple to operate and highly efficient; it only modifies local parts without affecting other G-code, and has good stability.
[0067] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description
[0068] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings:
[0069] Figure 1 This is a flowchart of a non-standard contour isometric transformation method for a three-dimensional five-axis laser cutting program, as described in Embodiment 1 of the present invention. Detailed Implementation
[0070] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
[0071] To address the problems existing in the prior art, this invention provides a method for non-standard contour isometric transformation in a three-dimensional five-axis laser cutting program.
[0072] Example 1
[0073] This embodiment discloses a method for isometric transformation of non-standard contours in a three-dimensional five-axis laser cutting program, such as... Figure 1 ,include:
[0074] S100. Parse the G code; read each line of instruction in the G code line by line, analyze the execution category of the current code line based on the identifier in the G code, and record the relevant trajectory category, feature point coordinate information and its line number information;
[0075] In S100 of this embodiment, the G code is parsed, and the specific method includes:
[0076] S101. Traverse the G-codes line by line. According to the standard CNC code format, when a G-code contains the G00 field, it is recorded as an empty line; when it contains the G01 field, it is recorded as a straight line; when it contains the CIP field, it is recorded as an arc; when it contains the CIRC field, it is recorded as a standard full circle contour; when it contains the HLOT field, it is recorded as a standard oval contour; when it contains the RECT field, it is recorded as a standard rectangular contour. Other types of G-codes are non-trajectory types.
[0077] S102. In each type of G-code instruction, coordinate information is parsed from keywords such as X, Y, Z, A, and C. Among them, the straight line records the coordinates of the starting point and the ending point; the CIP arc records the information of the starting point, the ending point, and the intermediate point, and calculates the coordinates of the center of the circle based on the three points; the standard contour records the relevant size and position parameters according to its own size definition rules.
[0078] S103. After recording the type and coordinate information of each line of G code, it is also necessary to record the line number of the current G code in the file, and finally form a list of G code information.
[0079] S200. Draw and pick the trajectory; Based on the coordinate information of the feature points of the cutting trajectory obtained in S100, use OpenGL drawing functions to draw the cutting trajectory corresponding to the G code; When a non-standard contour request that requires isometric transformation is obtained, select the trajectory that intersects with it by the distance between the request point and all drawn trajectories, and record its row number;
[0080] In S200 of this embodiment, the trajectory is drawn and picked up, and the specific method includes:
[0081] S201. Based on the contour and trajectory information obtained in S100, programmatically use the drawing library in OpenGL to draw the trajectory. The straight line trajectory is directly drawn using the straight line drawing function based on the coordinates of the start and end points of the straight line. The CIP arc is first discretized into several small line segments according to the relevant coordinate information of the arc and the arc length of 0.1mm. The arc information to which the small line segments belong is recorded. Then, the small line segments are drawn using the straight line drawing function, and finally, an approximate arc is drawn. The standard contour is first decomposed into straight lines and CIP arcs, and then drawn according to the drawing methods of straight lines and arcs respectively.
[0082] S202. When a non-standard contour request requiring equidistant transformation is obtained, the coordinates of the requested point are first converted into coordinates in the actual drawing space. Then, the distance from the point to all trajectories is calculated, that is, the distance between the point and all line segments is calculated. For straight trajectories, the distance from the point to the straight line segment is calculated directly. For circular arc trajectories, the distance from the point to each small line segment is calculated separately, and the minimum distance is taken as the distance from the point to the arc. When the distance from the point to the trajectory is less than 0.1, the trajectory is selected, and the row number to which the trajectory belongs is recorded.
[0083] S300. Extract the contour; based on the row number information obtained in S200, index forward to the start marker of the contour and index backward to the end marker of the contour, record the start and end rows of the contour, and obtain all the trajectory information and their respective row numbers in the contour based on the information in S100.
[0084] In S300 of this embodiment, the contour is cropped, and the specific method includes:
[0085] S301. Based on the line number obtained in S200, traverse the G code with the line number as the reference. Traverse each line of the G code backward. When the "BLOCK_START" field appears for the first time in the G code, it indicates the starting line of the currently selected contour, and record the line number N_Sta. Traverse each line of the G code backward. When the "BLOCK_END" field appears for the first time in the G code, it indicates the ending line of the currently selected contour, and record the line number N_End.
[0086] S302. Extract G-code information from the G-code information table established in S100 with row numbers between N_Sta and N_End. Iterate through the G-code information one by one. When the BEAMON field appears in the G-code, it indicates that the following is cutting contour information and the next straight line trajectory is the leader line. Record the leader line information and its row number. Continue to traverse and record all cutting trajectory information contained in the contour and their respective row numbers until the BEAMOFF field appears.
[0087] S400. Calculate the equidistant direction of the contour; based on the information of all trajectories in the contour obtained from S300, first project all cutting trajectories in the contour onto the plane, then calculate the rotation direction of the contour, and then determine the equidistant direction.
[0088] Specifically, in S400, the equidistant direction of the profile is calculated, and the specific methods include:
[0089] S401. Based on the information of all cutting trajectories in the contour obtained in S300, take the first two trajectories, and take the starting point P1 and ending point P2 of the first trajectories and the ending point P3 of the second trajectories respectively. Calculate vector Dir1 = vector P1P3 × vector P1P2; calculate vector Dir2 = vector Dir1 × vector P1P2; define P1 as the origin, vector P1P2 as the X-axis direction, vector Dir2 as the Y-axis direction, and vector Dir1 as the Z-axis direction, and re-establish the coordinate system.
[0090] S402. Transform the coordinate information of all cutting trajectories in the contour to a new coordinate system, and take their projection on the XOY plane to establish a planar closed contour; then calculate the rotation direction of the closed contour according to Green's formula.
[0091] S403. Determine the equidistant direction of the spatial trajectory according to the principle of clockwise left-side offset and counterclockwise right-side offset; the current trajectory cutting normal is Dir_Nor, the trajectory tangent is Dir_Tan, the left-side offset direction is Dir_left = Dir_Nor × Dir_Tan; the right-side offset is Dir_Right = Dir_Tan × Dir_Nor.
[0092] The cutting normal of the trajectory can be calculated using the following method:
[0093] Record the cutting information of a certain point as (X,Y,Z,A,C).
[0094] tempX = X;
[0095] tempY = Y*cos(A) - Z*sin(A);
[0096] tempZ = Y*sin(A) + Z*cos(A;)
[0097] result_X=tempX*cos(C)-tempY*sin(C);
[0098] result_Y=tempX*sin(C)-tempY*cos(C);
[0099] result_Z = tempZ;
[0100] Dir_Nor is (result_X-X,result_Y-Y,result_Z-Z).
[0101] S500. Perform equidistant calculations on straight lines and circular arc trajectories; wherein, based on the coordinate information of the start and end points of the current straight line trajectory and the corresponding normal information, calculate the equidistant straight line after spatial straight line, and record the new coordinate information of the start and end points; based on the coordinate information of the start point, intermediate point, end point, and center of the current circular arc trajectory, and the normal information when cutting each point, calculate the equidistant circular arc after spatial circular arc, and record the new coordinate information of the start point, intermediate point, and end point;
[0102] In S500 of this embodiment, the equidistant calculation is performed on the straight line and the circular arc trajectory. When performing the equidistant calculation on the straight line trajectory, the specific method includes:
[0103] S501. Let the starting point of the line be L_Sta(X1,Y1,Z1,A1,C1), the ending point be L_End(X2,Y2,Z2,A2,C2), and the tangent of the line be L_Tan(X2-X1,Y2-Y1,Z2-Z1).
[0104] S502. The cutting normals of the line at the starting point and the ending point are obtained according to the method in S400, and are denoted as Nor_Sta and Nor_End respectively;
[0105] S503. Calculate the tool compensation direction of the contour according to the method in S400, and then calculate the direction vector Offset(X3,Y3,Z3) after equidistant normalization. Assuming the set equidistant length is L, then the starting point after equidistant normalization is L_Sta_new(X4,Y4,Z4).
[0106] The calculation method is as follows:
[0107] X4 = X1 + X3 * L; Y4 = Y1 + L * Y3; Z4 = Z1 + L * Z3; The formula for calculating the endpoint after equal intervals is the same.
[0108] In S500 of this embodiment, the equidistant calculation is performed on the straight line and the circular arc trajectory. When performing the equidistant calculation on the circular arc trajectory, the specific method includes:
[0109] S501'. Let CIP_Sta(X5,Y5,Z5,A5,C5), CIP_Mid(X6,Y6,Z6,A6,C6), CIP_End(X7,Y7,Z7,A7,C7), and CIP_Cen(X8,Y8,Z8) be the starting point of the CIP arc.
[0110] The method for calculating the tangent direction of the arc at the above three points is as follows:
[0111] Taking the starting point as an example, first calculate the vector from the center of the circle to the starting point, Dir_Cen_Sta(X5-X8,Y5-Y8,Z5-Z8), and the vector from the center of the circle to the middle point, Dir_Cen_Mid(X6-X8,Y6-Y8,Z6-Z8); calculate Dir_Temp = Dir_Cen_Sta × Dir_Cen_Mid; finally, calculate the tangential vector at the starting point, CIP_Tan_Sta = Dir_Temp × Dir_Cen_Sta.
[0112] Calculate the vector Dir_Sta_Mid(X6-X5,Y6-Y5,Z6-Z5) from the starting point to the intermediate point, and calculate F = CIP_Tan_Sta * Dir_Sta_Mid. When F < 0, CIP_Tan_Sta = -CIP_Tan_Sta.
[0113] The tangential vector CIP_Tan_Mid at the midpoint and the tangential vector CIP_Tan_End at the end point are calculated in the same way as the tangential vectors at the starting point.
[0114] S502'. The cutting normals of the arc at the start point, midpoint, and end point are obtained according to the method in section 5, and are denoted as Nor_CIP_Sta, Nor_CIP_Mid, and Nor_CIP_End, respectively.
[0115] S503'. Calculate the tool offset direction of the contour according to the method in S400, and then calculate the direction vector CIP_Offset(X9,Y9,Z9) after equidistant normalization. Assuming the set equidistant length is L, the calculation method of the equidistant starting point CIP_Sta_new(X10,Y10,Z10) is as follows:
[0116] X10 = X6 + X9 * L; Y10 = Y6 + L * Y9; Z10 = Z6 + L * Z9; The formulas for calculating the midpoint and endpoint after equidistant distance are similar.
[0117] S600. Process the equidistant connections between straight lines and calculate the equidistant contour leader lines; where, when two adjacent trajectory segments are both straight lines, perform continuity processing on the equidistant lines of the two lines, remove the redundant line segments when the two lines intersect, and extend and fill in the line segments when the two lines are separate; calculate the distance and direction of the equidistant movement of the starting point of the first trajectory segment of the contour, and translate the leader line in the same way to obtain a new leader line;
[0118] In S600 of this embodiment, after processing the equidistant connections of straight lines, when the trajectory in the contour connects a straight line and an arc, they are all tangent, so no processing is needed; when straight lines connect but are not collinear, they may intersect or separate after the equidistant transformation, so continuous processing is required. The specific methods include:
[0119] S601. First, calculate the intersection point of the two new line segments formed by equidistant two adjacent line segments in space, as follows:
[0120] When two straight lines are connected, they must be coplanar. The normals of the lines cutting each other at the same point are also the same. Therefore, after being equidistant, the two straight lines will also intersect and be coplanar.
[0121] a. Take the starting point P1 and ending point P2 of the first equidistant line segment, and the ending point P4 of the second equidistant line segment. Calculate vector Dir1 = vector P1P4 × vector P1P2; calculate vector Dir2 = vector Dir1 × vector P1P2; define P1 as the origin, vector P1P2 as the X-axis direction, vector Dir2 as the Y-axis direction, and vector Dir1 as the Z-axis direction. Re-establish the coordinate system, transform the starting point and ending point of the two equidistant line segments to the new coordinate system, and project them onto the XOY plane to obtain two line segments on the 2D plane. The starting point and ending point of the two line segments are denoted as P1_2D, P2_2D, P3_2D, and P4_2D, respectively.
[0122] b. Calculate the intersection point P5_2D of the lines containing the two line segments on the 2D plane;
[0123] c. Take points P1 and P2 in the original coordinate system and P1_2D and P2_2D in the new coordinate system, and calculate the transformation matrix H_Trans between the two coordinate systems using the two sets of corresponding points.
[0124] d. The coordinates of the intersection point of the two new line segments formed after equidistant spacing in the original coordinate system are P5 = H_Trans * P5_2D;
[0125] S602. If the current trajectory is a straight line, and the previous trajectory is also a straight line, calculate the intersection point of the two equidistant straight line segments using the above method, and use it as the starting point of the equidistant current straight line.
[0126] S603. If the current trajectory is a straight line, and the next trajectory is also a straight line, calculate the intersection point of the two equidistant straight line segments using the above method, and use it as the endpoint of the current straight line after equidistant distance.
[0127] In this embodiment, the equidistant contour leader lines are calculated, and the position of the equidistant contour leader lines will change accordingly. The change in the position of the leader lines is consistent with the change in the position of the starting point of the cutting trajectory. The specific method includes:
[0128] S604. Obtain the first cutting trajectory of the non-standard contour according to the method mentioned in S300, and calculate the result of the first trajectory after equidistant distance using the methods mentioned in S400-S600; calculate the position change of the starting point before and after equidistant distance of the first trajectory Offset_Lead(Of_X,Of_Y,Of_Z);
[0129] S605. Obtain relevant information about the non-standard contour lead wire according to the method provided in S300, and then shift the entire lead wire by Offset_Lead to obtain the new position of the lead wire.
[0130] S700. Rewrite G-code; After all trajectories in the contour have undergone isometric transformation to obtain new trajectory information, generate new G-code according to the rules of G-code, and write the new G-code to the original G-code file according to the line number of the trajectory obtained in S400, overwriting the original G-code.
[0131] This embodiment discloses a non-standard contour isometric transformation method for a three-dimensional five-axis laser cutting program, including: S100. Parsing the G-code; reading each line of the G-code instruction line by line, analyzing the execution category of the current code line based on the identifier in the G-code, and recording the relevant trajectory category, feature point coordinate information and its line number information; S200. Drawing and picking the trajectory; S300. Cutting the contour; S400. Calculating the contour isometric direction; based on the information of all trajectories in the contour obtained in S300, first projecting all cutting trajectories in the contour onto a plane, then calculating the rotation direction of the contour, and thus determining the isometric direction; S500. Performing isometric calculation on straight lines and arc trajectories; S600. Performing isometric post-processing on the intersection of straight lines, and calculating the contour leader line after isometric transformation; S700. Rewriting the G-code; This invention can directly modify the G-code file, is simple to operate, and has high modification efficiency; it only modifies local parts and does not affect other G-code, thus having good stability.
[0132] It should be understood that the specific order or hierarchy of steps in the disclosed process is an example of an exemplary method. Based on design preferences, it should be understood that the specific order or hierarchy of steps in the process may be rearranged without departing from the scope of this disclosure. The appended method claims provide elements of various steps in an exemplary order and are not intended to limit one to the specific order or hierarchy described.
[0133] In the detailed description above, various features are combined together in a single embodiment to simplify this disclosure. This approach to disclosure should not be construed as reflecting an intention that embodiments of the claimed subject matter require more features than are explicitly stated in each claim. Rather, as reflected in the appended claims, the invention is presented with fewer features than all of the features in a single disclosed embodiment. Therefore, the appended claims are hereby explicitly incorporated into the detailed description, with each claim representing a separate preferred embodiment of the invention.
[0134] Those skilled in the art will also understand that the various illustrative logic blocks, modules, circuits, and algorithm steps described in conjunction with the embodiments herein are implemented as electronic hardware, computer software, or a combination thereof. To clearly illustrate the interchangeability between hardware and software, the various illustrative components, blocks, modules, circuits, and steps described above are generally described in terms of their functionality. Whether such functionality is implemented as hardware or software depends on the specific application and the design constraints imposed on the overall system. Those skilled in the art will implement the described functionality in alternative ways for each specific application; however, such implementation decisions should not be construed as departing from the scope of this disclosure.
[0135] The steps of the methods or algorithms described in conjunction with the embodiments herein can be directly embodied in hardware, software modules executed by a processor, or a combination thereof. The software modules reside in RAM memory, flash memory, ROM memory, EPROM memory, EEPROM memory, registers, hard disks, removable disks, CD-ROMs, or any other form of storage medium well known in the art. An exemplary storage medium is connected to the processor, enabling the processor to read information from and write information to the storage medium. Of course, the storage medium is also a component of the processor. The processor and storage medium reside in an ASIC. This ASIC resides in the user terminal. Alternatively, the processor and storage medium may also exist as discrete components in the user terminal.
[0136] For software implementation, the techniques described in this application can be implemented using modules (e.g., procedures, functions, etc.) that perform the functions described in this application. This software code is stored in memory units and executed by a processor. Memory units can be implemented within the processor or off-processor; in the latter case, they are communicatively coupled to the processor via various means, as is well known in the art.
[0137] The foregoing description includes examples of one or more embodiments. It is certainly impossible to describe all possible combinations of components or methods in order to describe the above embodiments, but those skilled in the art will recognize that further combinations and arrangements of the various embodiments are possible. Therefore, the embodiments described herein are intended to cover all such changes, modifications, and variations that fall within the scope of the appended claims. Furthermore, the term "comprising" as used in the specification or claims is interpreted in a manner similar to the term "including," as interpreted when used as a conjunction in the claims. Additionally, the use of any term "or" in the specification of the claims is intended to mean "non-exclusive or."
Claims
1. A method for isometric transformation of non-standard contours in a three-dimensional five-axis laser cutting program, characterized in that, include: S100. Parse the G code; read each line of instruction in the G code line by line, analyze the execution category of the current code line based on the identifier in the G code, and record the relevant trajectory category, feature point coordinate information and its line number information; S200. Draw and pick the trajectory; Based on the coordinate information of the feature points of the cutting trajectory obtained in S100, use OpenGL drawing functions to draw the cutting trajectory corresponding to the G code; When a non-standard contour request that requires isometric transformation is obtained, select the trajectory that intersects with it by the distance between the request point and all drawn trajectories, and record its row number; S300. Extract the contour; based on the row number information obtained in S200, index forward to the start marker of the contour and index backward to the end marker of the contour, record the start and end rows of the contour, and obtain all the trajectory information and their respective row numbers in the contour based on the information in S100. S400. Calculate the equidistant direction of the contour; based on the information of all trajectories in the contour obtained from S300, first project all cutting trajectories in the contour onto the plane, then calculate the rotation direction of the contour, and then determine the equidistant direction. S500. Perform equidistant calculations on straight lines and circular arc trajectories; wherein, based on the coordinate information of the start and end points of the current straight line trajectory and the corresponding normal information, calculate the equidistant straight line after spatial straight line, and record the new coordinate information of the start and end points; based on the coordinate information of the start point, intermediate point, end point, and center of the current circular arc trajectory, and the normal information when cutting each point, calculate the equidistant circular arc after spatial circular arc, and record the new coordinate information of the start point, intermediate point, and end point; S600. Process the equidistant connections between straight lines and calculate the equidistant contour leader lines; where, when two adjacent trajectory segments are both straight lines, perform continuity processing on the equidistant lines of the two lines, remove the redundant line segments when the two lines intersect, and extend and fill in the line segments when the two lines are separate; calculate the distance and direction of the equidistant movement of the starting point of the first trajectory segment of the contour, and translate the leader line in the same way to obtain a new leader line; S700. Rewrite G-code; After all trajectories in the contour have undergone isometric transformation to obtain new trajectory information, generate new G-code according to the rules of G-code, and write the new G-code to the original G-code file according to the line number of the trajectory obtained in S400, overwriting the original G-code.
2. The non-standard contour isometric transformation method for a three-dimensional five-axis laser cutting program as described in claim 1, characterized in that, In S100, the G code is parsed using the following methods: S101. Traverse the G-codes line by line. According to the standard CNC code format, when a G-code contains the G00 field, it is recorded as an empty line; when it contains the G01 field, it is recorded as a straight line; when it contains the CIP field, it is recorded as an arc; when it contains the CIRC field, it is recorded as a standard full circle contour; when it contains the HLOT field, it is recorded as a standard oval contour; when it contains the RECT field, it is recorded as a standard rectangular contour. Other types of G-codes are non-trajectory types. S102. In each type of G-code instruction, coordinate information is parsed from keywords such as X, Y, Z, A, and C. Among them, the straight line records the coordinates of the starting point and the ending point; the CIP arc records the information of the starting point, the ending point, and the intermediate point, and calculates the coordinates of the center of the circle based on the three points; the standard contour records the relevant size and position parameters according to its own size definition rules. S103. After recording the type and coordinate information of each line of G code, it is also necessary to record the line number of the current G code in the file, and finally form a list of G code information.
3. The non-standard contour isometric transformation method for a three-dimensional five-axis laser cutting program as described in claim 1, characterized in that, In S200, the trajectory is drawn and picked up, and the specific methods include: S201. Based on the contour and trajectory information obtained in S100, programmatically use the drawing library in OpenGL to draw the trajectory. The straight line trajectory is directly drawn using the straight line drawing function based on the coordinates of the start and end points of the straight line. The CIP arc is first discretized into several small line segments according to the relevant coordinate information of the arc and the arc length of 0.1mm. The arc information to which the small line segments belong is recorded. Then, the small line segments are drawn using the straight line drawing function, and finally, an approximate arc is drawn. The standard contour is first decomposed into straight lines and CIP arcs, and then drawn according to the drawing methods of straight lines and arcs respectively. S202. When a non-standard contour request requiring equidistant transformation is obtained, the coordinates of the requested point are first converted into coordinates in the actual drawing space. Then, the distance from the point to all trajectories is calculated, that is, the distance between the point and all line segments is calculated. For straight trajectories, the distance from the point to the straight line segment is calculated directly. For circular arc trajectories, the distance from the point to each small line segment is calculated separately, and the minimum distance is taken as the distance from the point to the arc. When the distance from the point to the trajectory is less than 0.1, the trajectory is selected, and the row number to which the trajectory belongs is recorded.
4. The non-standard contour isometric transformation method for a three-dimensional five-axis laser cutting program as described in claim 1, characterized in that, In S300, the contour is cropped using the following methods: S301. Based on the line number obtained in S200, traverse the G code with the line number as the reference. Traverse each line of the G code backward. When the "BLOCK_START" field appears for the first time in the G code, it indicates the starting line of the currently selected contour, and record the line number N_Sta. Traverse each line of the G code backward. When the "BLOCK_END" field appears for the first time in the G code, it indicates the ending line of the currently selected contour, and record the line number N_End. S302. Extract G-code information from the G-code information table established in S100 with row numbers between N_Sta and N_End. Iterate through the G-code information one by one. When the BEAMON field appears in the G-code, it indicates that the following is cutting contour information and the next straight line trajectory is the leader line. Record the leader line information and its row number. Continue to traverse and record all cutting trajectory information contained in the contour and their respective row numbers until the BEAMOFF field appears.
5. The non-standard contour isometric transformation method for a three-dimensional five-axis laser cutting program as described in claim 1, characterized in that, In S400, the calculation of the equidistant direction of the profile includes the following methods: S401. Based on the information of all cutting trajectories in the contour obtained in S300, take the first two trajectories, and take the starting point P1 and ending point P2 of the first trajectories and the ending point P3 of the second trajectories respectively. Calculate vector Dir1 = vector P1P3 × vector P1P2; calculate vector Dir2 = vector Dir1 × vector P1P2; define P1 as the origin, vector P1P2 as the X-axis direction, vector Dir2 as the Y-axis direction, and vector Dir1 as the Z-axis direction, and re-establish the coordinate system. S402. Transform the coordinate information of all cutting trajectories in the contour to a new coordinate system, and take their projection on the XOY plane to establish a planar closed contour; then calculate the rotation direction of the closed contour according to Green's formula. S403. Determine the equidistant direction of the spatial trajectory according to the principle of clockwise left-side offset and counterclockwise right-side offset; the current trajectory cutting normal is Dir_Nor, the trajectory tangent is Dir_Tan, the left-side offset direction is Dir_left = Dir_Nor × Dir_Tan; the right-side offset is Dir_Right = Dir_Tan × Dir_Nor.
6. The non-standard contour isometric transformation method for a three-dimensional five-axis laser cutting program as described in claim 1, characterized in that, In S403, the cutting normal of the trajectory can be calculated using the following method: Record the cutting information of a certain point as (X,Y,Z,A,C). tempX = X; tempY = Y*cos(A) - Z*sin(A); tempZ = Y*sin(A) + Z*cos(A;) result_X=tempX*cos(C)-tempY*sin(C); result_Y=tempX*sin(C)-tempY*cos(C); result_Z = tempZ; Dir_Nor is (result_X-X,result_Y-Y,result_Z-Z).
7. The non-standard contour isometric transformation method for a three-dimensional five-axis laser cutting program as described in claim 1, characterized in that, In S500, equidistant calculations are performed on straight lines and circular arc trajectories. When performing equidistant calculations on straight line trajectories, the specific methods include: S501. Let the starting point of the line be L_Sta(X1,Y1,Z1,A1,C1), the ending point be L_End(X2,Y2,Z2,A2,C2), and the tangent of the line be L_Tan(X2-X1,Y2-Y1,Z2-Z1). S502. The cutting normals of the line at the starting point and the ending point are obtained according to the method in S400, and are denoted as Nor_Sta and Nor_End respectively; S503. Calculate the tool compensation direction of the contour according to the method in S400, and then calculate the direction vector Offset(X3,Y3,Z3) after equidistant normalization. Assuming the set equidistant length is L, then the starting point after equidistant normalization is L_Sta_new(X4,Y4,Z4). The calculation method is as follows: X4 = X1 + X3 * L; Y4 = Y1 + L * Y3; Z4 = Z1 + L * Z3; The formula for calculating the endpoint after equal intervals is the same.
8. The non-standard contour isometric transformation method for a three-dimensional five-axis laser cutting program as described in claim 1, characterized in that, In S500, equidistant calculations are performed on straight lines and circular arc trajectories. When performing equidistant calculations on circular arc trajectories, the specific methods include: S501'. Let CIP_Sta(X5,Y5,Z5,A5,C5), CIP_Mid(X6,Y6,Z6,A6,C6), CIP_End(X7,Y7,Z7,A7,C7), and CIP_Cen(X8,Y8,Z8) be the starting point of the CIP arc. The method for calculating the tangent direction of the arc at the above three points is as follows: Taking the starting point as an example, first calculate the vector from the center of the circle to the starting point, Dir_Cen_Sta(X5-X8,Y5-Y8,Z5-Z8), and the vector from the center of the circle to the middle point, Dir_Cen_Mid(X6-X8,Y6-Y8,Z6-Z8); calculate Dir_Temp = Dir_Cen_Sta × Dir_Cen_Mid; finally, calculate the tangential vector at the starting point, CIP_Tan_Sta = Dir_Temp × Dir_Cen_Sta. Calculate the vector Dir_Sta_Mid(X6-X5,Y6-Y5,Z6-Z5) from the starting point to the intermediate point, and calculate F = CIP_Tan_Sta * Dir_Sta_Mid. When F < 0, CIP_Tan_Sta = -CIP_Tan_Sta. The tangential vector CIP_Tan_Mid at the midpoint and the tangential vector CIP_Tan_End at the end point are calculated in the same way as the tangential vectors at the starting point. S502'. The cutting normals of the arc at the start point, midpoint, and end point are obtained according to the method in section 5, and are denoted as Nor_CIP_Sta, Nor_CIP_Mid, and Nor_CIP_End, respectively. S503'. Calculate the tool offset direction of the contour according to the method in S400, and then calculate the direction vector CIP_Offset(X9,Y9,Z9) after equidistant normalization. Assuming the set equidistant length is L, the calculation method of the equidistant starting point CIP_Sta_new(X10,Y10,Z10) is as follows: X10 = X6 + X9 * L; Y10 = Y6 + L * Y9; Z10 = Z6 + L * Z9; The formulas for calculating the midpoint and endpoint after equidistant distance are similar.
9. The non-standard contour isometric transformation method for a three-dimensional five-axis laser cutting program as described in claim 1, characterized in that, In S600, after equidistant processing of intersecting lines, when the trajectory in the contour connects a line and an arc, they are all tangent, so no processing is needed. However, when lines connect but are not collinear, after equidistant transformation, they may intersect or separate, thus requiring continuity processing. Specific methods include: S601. First, calculate the intersection point of the two new line segments formed by equidistant two adjacent line segments in space, as follows: When two straight lines are connected, they must be coplanar. The normals of the lines cutting each other at the same point are also the same. Therefore, after being equidistant, the two straight lines will also intersect and be coplanar. a. Take the starting point P1 and ending point P2 of the first equidistant line segment, and the ending point P4 of the second equidistant line segment. Calculate vector Dir1 = vector P1P4 × vector P1P2; calculate vector Dir2 = vector Dir1 × vector P1P2; define P1 as the origin, vector P1P2 as the X-axis direction, vector Dir2 as the Y-axis direction, and vector Dir1 as the Z-axis direction. Re-establish the coordinate system, transform the starting point and ending point of the two equidistant line segments to the new coordinate system, and project them onto the XOY plane to obtain two line segments on the 2D plane. The starting point and ending point of the two line segments are denoted as P1_2D, P2_2D, P3_2D, and P4_2D, respectively. b. Calculate the intersection point P5_2D of the lines containing the two line segments on the 2D plane; c. Take points P1 and P2 in the original coordinate system and P1_2D and P2_2D in the new coordinate system, and calculate the transformation matrix H_Trans between the two coordinate systems using the two sets of corresponding points. d. The coordinates of the intersection point of the two new line segments formed after equidistant spacing in the original coordinate system are P5 = H_Trans * P5_2D; S602. If the current trajectory is a straight line, and the previous trajectory is also a straight line, calculate the intersection point of the two equidistant straight line segments using the above method, and use it as the starting point of the equidistant current straight line. S603. If the current trajectory is a straight line, and the next trajectory is also a straight line, calculate the intersection point of the two equidistant straight line segments using the above method, and use it as the endpoint of the current straight line after equidistant distance.
10. The non-standard contour isometric transformation method for a three-dimensional five-axis laser cutting program as described in claim 1, characterized in that, In S600, the equidistant profile leader lines are calculated, and their positions change accordingly. The positional change of the leader lines is consistent with the positional change of the cutting trajectory starting point. Specific methods include: S604. Obtain the first cutting trajectory of the non-standard contour according to the method mentioned in S300, and calculate the result of the first trajectory after equidistant distance using the methods mentioned in S400-S600; calculate the position change of the starting point before and after equidistant distance of the first trajectory Offset_Lead(Of_X,Of_Y,Of_Z); S605. Obtain relevant information about the non-standard contour lead wire according to the method provided in S300, and then shift the entire lead wire by Offset_Lead to obtain the new position of the lead wire.