An optimized laser processing pattern scanning line filling method

By dividing the contour of the laser 3D processing graphic into filling units, calculating the tilt angle, and rotating the filling units for scanning, the problem of frequent laser reversal is solved, improving the efficiency of laser 3D processing and reducing the number of laser switching operations.

CN115222861BActive Publication Date: 2026-07-31EZHOU INST OF IND TECH HUAZHONG UNIV OF SCI & TECH +1
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
EZHOU INST OF IND TECH HUAZHONG UNIV OF SCI & TECH
Filing Date
2022-06-20
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

In existing laser 3D processing technology, the frequent laser reversal in the filling algorithm leads to high time costs and reduced laser lifespan, as well as large computational load and low efficiency.

Method used

The processing graphic contour is divided into filling units, the tilt angle of the OBB bounding box is calculated, the filling units are rotated and the scan line filling algorithm is used for tilt scanning, which reduces the number of laser reversals and improves the calculation speed.

Benefits of technology

By reducing the number of laser commutations and optimizing calculations, the efficiency of laser 3D processing was improved and the number of laser switching operations was reduced, thus increasing processing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115222861B_ABST
    Figure CN115222861B_ABST
Patent Text Reader

Abstract

This invention discloses an optimized laser processing graphic scan line filling method, comprising: S1 dividing the contour information of the processing graphic into filling units; S2 calculating the OBB bounding box of the filling unit and obtaining a recommended tilt angle; S3 rotating the filling unit according to the recommended tilt angle; S4 filling the filling unit in S3 using a scan line filling algorithm to obtain first filling data; S5 rotating the first filling data in S4 in reverse to obtain second filling data; S6 traversing the filling units, repeating steps S2-S5, and saving all second filling data. This application uses an outer contour and all its corresponding inner contours as a filling unit, calculates the recommended tilt angle using the OBB bounding box, rotates the filling unit, fills it using the scan line filling algorithm, and finally rotates the first filling data in reverse to achieve tilted scan line filling at the recommended angle. This method is faster than the direct horizontal intersection method and can effectively reduce the number of laser switching operations, thus improving processing efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of laser three-dimensional processing, and more specifically, relates to an optimized method for filling scan lines in laser processing graphics. Background Technology

[0002] In laser 3D manufacturing, a layer-by-layer processing design is generally adopted. The 3D model is divided into layers based on the laser processing depth. Then, processing is performed layer by layer, either from top to bottom or bottom to top, according to actual processing needs, ultimately obtaining the processed workpiece. The layering operation of the 3D model is called the slicing algorithm, which involves using a set of parallel planes spaced at laser processing depths to find the intersection with the 3D model, obtaining several layers of processing graphic data. Next, processing lines with width are used to fill the processing area enclosed by the contours in the processing graphic; this step is called the filling algorithm. During processing, the laser processes along the processing lines. When the current processing line is completed, the light is turned off, and the process moves to the starting point of the next processing line, then is switched on again to continue processing. Since frequent switching not only increases time costs but also reduces the lifespan of the laser, the filling algorithm can consider filling along the long side of the filling unit, thereby reducing the number of processing lines and the number of laser switching operations.

[0003] In existing technologies, horizontal machining lines are often used for filling, lacking analysis of the contour shape. Some technologies use inclined machining lines for filling, but this is mostly used for inter-layer orientation changes, with each layer's filling area filled using inclined machining lines in the same direction. When calculating machining lines, a series of scan lines are often used to directly intersect the contour edges to obtain the intersection points. This method is computationally intensive and inefficient. Summary of the Invention

[0004] In view of the above-mentioned defects or improvement needs of the existing technology, the present invention provides an optimized laser processing graphic scanning line filling method, which aims to solve the technical problem of frequent laser reversal in the filling algorithm. The present invention can also be used for two-dimensional graphic filling.

[0005] To achieve the above objectives, according to one aspect of the present invention, an optimized laser processing pattern scanning line filling method includes the following steps:

[0006] S1, divide the contour information of the processed graphic according to the filling unit. A filling unit is an outer contour and all its corresponding inner contours. A filling unit contains an outer contour and zero or more inner contours.

[0007] S2, calculate the OBB bounding box of the filling unit and obtain the recommended tilt angle;

[0008] S3, rotate the fill unit according to the recommended tilt angle;

[0009] S4, use the scan line filling algorithm to fill the rotated filling units to obtain the first filling data;

[0010] S5, based on the recommended tilt angle, rotate the first filling data in S4 in the opposite direction to obtain the second filling data;

[0011] S6, traverse the filled cells, repeat steps S2-S5, and save the second filling data in all filled cells.

[0012] Through the above technical solution, in the filling data of this application, an outer contour and all its corresponding inner contours are taken as a filling unit. The filling unit is used as the unit, and the long side direction of its OBB bounding box is taken as the straight filling direction. This can greatly reduce the number of laser reversals and improve the calculation speed. By rotating the contour, scanning line filling at any tilt angle can be achieved, thereby realizing the operation of filling according to the long side direction.

[0013] Preferably, the specific operation for obtaining the recommended tilt angle in S2 is as follows: calculate the angle α between the long side of the OBB bounding box and the horizontal line, where 0°≤α<180°, and this angle α is used as the recommended tilt angle.

[0014] Preferably, in S3, the filling unit is rotated clockwise at a recommended tilt angle.

[0015] Preferably, the rotation angle of the filling unit in S3 is -α, and the specific rotation operation is as follows:

[0016] S301, calculate the sin and cos values ​​of the rotation angle of the filling element;

[0017] S302: Based on the sin and cos values ​​in S301, set the rotation matrix and apply the rotation matrix to the filling unit.

[0018] Preferably, the scan lines in S4 are horizontal scan lines with equal spacing.

[0019] Preferably, in S4, the first filling data is the coordinates of the intersection points between the scan line and the rotated filling unit after sorting and pairing. The specific operation of filling the rotated filling unit using the scan line filling algorithm is as follows: preprocess all contour edges in the filling unit, convert them into edge structure variables, put all edges into a new edge table structure, then establish an active edge table according to the new edge table, process the scan line one by one, calculate the intersection point between the current scan line and the filling unit, and sort and pair the intersection points.

[0020] Preferably, the edge structure in S4 includes the index of the furthest reachable scan line of that edge. The x-coordinate of the intersection point of the edge and the current scan line, the difference dx between the x-coordinate of the intersection point of the next scan line and the current scan line and the intersection point of the edge, and the pointer Edge* to the next edge, where dx is a constant.

[0021] Preferably, the ordinate value of each scan line is different. In S4, the scan lines are processed one by one, and the intersection point of the current scan line and the fill unit is calculated. Specifically, the scan lines are processed one by one in ascending order of ordinate value. For the current scan line, the corresponding linked list is found in the new edge list, and all edges in this linked list are added to the active edge list. Then, all edges in the active edge list are traversed. The x value in the edge structure represents the x-coordinate of the intersection point of the current edge and the scan line. This x value is saved, and the dx value in the edge structure is added to the original x value to update the x value. If the edge's ordinate value is not specified, the x-coordinate is calculated. If the index of the current scan line is less than or equal to the index of the current scan line, the edge is deleted from the active edge list. If the index of the current scan line is greater than the index of the current scan line, the edge is ignored and the next edge is added to the active edge list.

[0022] Preferably, the specific operation of reversing the first filling data in S4 in S5 is as follows: set a reverse rotation matrix to perform reverse rotation, and the reverse rotation matrix is ​​the inverse matrix of the rotation matrix in S302.

[0023] Preferably, saving the padding data in all padding cells in S6 includes serializing the second padding data obtained in S5 and saving it to disk. Attached Figure Description

[0024] Figure 1 This is a flowchart illustrating the method.

[0025] Figure 2 This is a schematic diagram illustrating the calculation of the recommended tilt angle in this method;

[0026] Figure 3 This is a schematic diagram of the edge structure in this method. Detailed Implementation

[0027] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention. Furthermore, the technical features involved in the various embodiments of this invention described below can be combined with each other as long as they do not conflict with each other.

[0028] like Figure 1 As shown, this invention proposes an optimized method for filling scan lines in laser processing patterns, comprising the following steps:

[0029] S1, divide the contour information of the processed graphic according to the filling unit. A filling unit is an outer contour and all its corresponding inner contours. A filling unit contains an outer contour and zero or more inner contours.

[0030] S2, calculate the OBB bounding box of the filling unit and obtain the recommended tilt angle;

[0031] S3, rotate the fill unit according to the recommended tilt angle;

[0032] S4, use the scan line filling algorithm to fill the rotated filling units to obtain the first filling data;

[0033] S5, based on the recommended tilt angle, rotate the first filling data in S4 in the opposite direction to obtain the second filling data;

[0034] S6, traverse the filled cells, repeat steps S2-S5, and save the second filling data in all filled cells.

[0035] In the above technical solution, the processing graphic contours are grouped, with an outer contour and all its corresponding inner contours forming a filling unit. An OBB bounding box is used to obtain the recommended tilt angle of a filling unit. After rotating the filling unit, a scanline filling algorithm is used to fill the rotated unit, obtaining the first filling data. Finally, the first filling data is rotated in the opposite direction to achieve tilted scanline filling at the recommended angle. This processing method is faster than the direct horizontal intersection method and can effectively reduce the number of laser switching operations, improving processing efficiency. After the 3D model is processed by the slicing algorithm, multi-layer processing graphic data is obtained. Each layer of data can be processed separately using S1-S6, thus completing the processing of the entire 3D model.

[0036] Specifically, in S1, the contour information of the processed graphic is divided into fill units. The contour is divided into fill units, and a fill unit consists of an outer contour and all its corresponding inner contours. Therefore, a fill unit must include an outer contour, and the number of inner contours corresponding to that outer contour may be zero or more. For example, a processed graphic has four contours: contour 1, contour 2, contour 3, and contour 4. Contour 1 and contour 2 are both outer contours, while contour 3 and contour 4 are inner contours of contour 1. Contour 2 has no corresponding inner contours. In this case, the processed graphic has two fill units: contour 1, contour 3, and contour 4 are divided into one fill unit, which includes one outer contour and two inner contours; contour 2 is divided into one fill unit, which includes one outer contour and zero inner contours.

[0037] During software implementation, the processing graphic that needs to be filled is extracted, its contour information is extracted, and the contours are grouped and divided into filling units. In some embodiments, contours can be directly grouped based on topological information. In other embodiments, the contour information is a scattered closed loop, and there is no topological information that can be used for grouping. The contours can be numbered first, and then for each contour, all surrounding contours are found and saved to the contour's surrounding contour list. All contours are sorted in ascending order according to the length of the surrounding contour list. Then, all sorted contours are traversed. For each contour, if the length of the current contour's surrounding contour list is even, the current contour is the outer contour. The search is then performed on contours whose surrounding contour list length is one greater than that of the current contour. If the surrounding contour list of a contour contains the current contour, then that contour is marked as the inner contour of the current contour. If the length of the current contour's surrounding contour list is odd, it is skipped.

[0038] Furthermore, the specific operation for obtaining the recommended tilt angle in S2 is as follows: For the current filled cell, calculate the angle α between the long side of its OBB bounding box and the horizontal line. Since α represents the numerical value of the angle between two lines, 0°≤α<180°, and this angle α is used as the recommended tilt angle. The OBB bounding box is rectangular in shape, and the direction vector of its long side is obtained, as shown below. Figure 2 As shown, the direction vector of the longest side is The angle between the OBB bounding box and the OX direction vector is α. In this step, calculating the OBB bounding box of the filling unit is an existing technology, which can be performed using methods such as Open CASCADE Technology. The angle α between the long side of the OBB bounding box and the horizontal line is used as the recommended tilt angle to process the filling unit in S3-S5. This can realize scanning and filling from the long side of the processed image, thereby reducing the number of switching operations during laser processing.

[0039] In S3, the fill cell is rotated clockwise by the recommended tilt angle. Since α represents the numerical value of the recommended tilt angle, which is an angle with magnitude but no direction, and the rotation angle of the fill cell by the recommended tilt angle is a vector value (counter-clockwise is positive), then the rotation angle of the fill cell by the recommended tilt angle is -α. The specific rotation operation is as follows:

[0040] S301, Calculate the sin and cos values ​​of the rotation angle of the filling element:

[0041] Since the long side of the OBB bounding box is determined, a and b are known quantities; in this embodiment, it is only necessary to obtain the sin and cos values ​​of the rotation angle of the filling unit for subsequent calculations.

[0042] S302 uses a geometric transformation matrix for rotation, that is: based on the sin and cos values ​​in S301, a rotation matrix is ​​set and applied to the filling unit.

[0043] Furthermore, the scan lines in S4 are horizontal scan lines with equal spacing, which can be set according to the scan fill spacing.

[0044] In S4, the specific operation of filling the filling unit using the scan line filling algorithm is as follows: a set of horizontal scan lines are used to scan the filling unit from bottom to top. Each scan line intersects with the edge of the filling unit to generate an intersection point. These intersection points divide the scan line into line segments (or rays) outside the processing area and line segments inside the processing area. The line segments inside the processing area are the first filling data.

[0045] The implementation includes the following steps:

[0046] S401, preprocess all contour edges in the filled unit, convert them into edge structure variables, and put all edges into a new edge table structure.

[0047] Optionally, the edge structure diagram is as follows: Figure 3 As shown, this includes the furthest reachable scan line label of that edge. The x-coordinate of the intersection point of this edge and the current scan line, the difference dx between the x-coordinate of the intersection point of the next scan line and this edge and the x-coordinate of the intersection point of the current scan line and this edge, and the pointer Edge* pointing to the next edge, where dx is a constant. Let the equation of the line containing this edge be... The scan line spacing is ,but .

[0048] Specifically, the new edge table is an array of pointers, where each element is a pointer to edge data. The array length is equal to the number of scan lines. The new edge table consists of many linked lists, with one scan line corresponding to one linked list. Each element points to all starting scan lines with index . The linked list with edges. The starting scan line index is calculated as follows: , This represents the minimum value of the y-coordinate of the edge. This represents the lowest value of the ordinate of all contour points. Indicates the fill width.

[0049] When adding an edge to the corresponding linked list, the x-coordinate of the intersection point of this edge and the current scan line is set to... ,in express The corresponding x-coordinate value.

[0050] S402 establishes an active edge table based on the new edge table, processes each scan line one by one, calculates the intersection point of the current scan line with the fill cell, sorts and pairs the intersection points, and the coordinates of the paired intersection points are the first fill data. During filling, the fill is performed from one point to the next point according to the paired intersection point coordinates.

[0051] Specifically, the active edge table stores all edges in the fill cell that intersect with the current scan line, and is initially empty.

[0052] Since the scan lines are horizontal, they are parallel to each other. The x-coordinates of each point within each scan line are different, but the y-coordinates are the same; however, the y-coordinates of different scan lines are different.

[0053] In some embodiments, scan lines are processed one by one, and the intersection point of the current scan line and the fill unit is calculated. Specifically, the scan lines are processed one by one in ascending order of their ordinate values. For the current scan line, the corresponding linked list is found in the new edge list, and all edges in this linked list are added to the active edge list. In a special case, if the pointer in the corresponding index of the new edge list is null, the number of added edges is zero. Then, all edges in the active edge list are traversed. The x-value in the edge structure represents the x-coordinate of the intersection point of the current active edge and the scan line. This x-value is saved, and the dx in the edge structure is added to the original x-value to update the x-value. If the edge's x-value is zero, the x-value is updated. If the index of the current scan line is less than or equal to the index of the current scan line, the edge is deleted from the active edge list. If the index of the current scan line is greater than the index of the current scan line, the edge is ignored and the next edge is added to the active edge list.

[0054] In some embodiments, the specific operation of sorting the intersection points is as follows: the intersection points obtained by the current scan line are sorted in ascending order of their X-coordinates. In other embodiments, it can be selected that for scan lines with odd indices, the intersection points are sorted in ascending order of their X-coordinates, and for scan lines with even indices, the intersection points are sorted in descending order of their X-coordinates.

[0055] In some embodiments, the specific operation of pairing intersection points is as follows: intersection points are generally paired in pairs in sequence. When the current intersection point is exactly a contour point, if the previous contour point and the next contour point of the point are both above or below the current scan line, the intersection point is ignored; if the previous contour point and the next contour point of the point are on both sides of the current scan line, there will be two duplicate intersection points, which only need to be calculated once.

[0056] Furthermore, the specific operation of reversing the first filling data in S4 in S5 is as follows: set a reverse rotation matrix to perform a reverse rotation, and the reverse rotation matrix is ​​the inverse of the rotation matrix in S302.

[0057] Furthermore, in some embodiments, saving the second padding data in all padding units in S6 includes serializing the second padding data obtained in S5 and saving it to disk. In other embodiments, since steps S1-S6 are processed within software, the obtained second padding data is directly stored in software memory, or it can be saved to disk without serialization, and the second padding data within the software can be directly used for processing.

[0058] Those skilled in the art will readily understand that the above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. An optimized laser processing pattern scan line filling method, characterized in that, Includes the following steps: S1, divide the contour information of the processed graphic according to the filling unit. A filling unit is an outer contour and all its corresponding inner contours. A filling unit contains an outer contour and zero or more inner contours. S2, calculate the OBB bounding box of the filling unit and obtain the recommended tilt angle; wherein, the specific operation of obtaining the recommended tilt angle is: calculate the angle α between the long side of the OBB bounding box of the filling unit and the horizontal line, and use the angle α as the recommended tilt angle; wherein, 0°≤α<180°; S3, rotate the fill unit according to the recommended tilt angle; S4, use the scan line filling algorithm to fill the rotated filling unit to obtain the first filling data, including: using a set of horizontal scan lines to scan the filling unit from bottom to top, each scan line intersects with the edge of the filling unit to generate an intersection point, the intersection point divides the scan line into line segments outside the filling unit and line segments inside the filling unit, the line segments inside the filling unit are the first filling data. S5, based on the recommended tilt angle, rotate the first filling data in S4 in the opposite direction to obtain the second filling data; S6, traverse the filling units, repeat steps S2-S5, and save the second filling data in all filling units to achieve scanning and filling from the long side of the processed image, reducing the number of switching operations during laser processing.

2. The optimized laser processing pattern scan line filling method according to claim 1, wherein, In S3, the fill cells are rotated clockwise at the recommended tilt angle.

3. The optimized laser processing pattern scanning line filling method according to claim 2, characterized in that, The rotation angle of the filling unit in S3 is -α, and the specific rotation operation is as follows: S301, calculate the sin and cos values ​​of the rotation angle of the filling element; S302: Based on the sin and cos values ​​in S301, set the rotation matrix and apply the rotation matrix to the filling unit.

4. The optimized laser processing pattern scanning line filling method according to claim 1, characterized in that, The scan lines in S4 are horizontal scan lines with equal spacing.

5. The optimized laser processing pattern scanning line filling method according to claim 1, characterized in that, In S4, the first filling data is the coordinates of the intersection points between the scan line and the rotated filling unit after sorting and pairing. The specific operation of filling the rotated filling unit using the scan line filling algorithm is as follows: preprocess all contour edges in the filling unit, convert them into edge structure variables, put all edges into a new edge table structure, then build an active edge table according to the new edge table, process the scan line one by one, calculate the intersection point between the current scan line and the filling unit, and sort and pair the intersection points.

6. The optimized laser processing pattern scanning line filling method according to claim 5, characterized in that, The edge structure in S4 includes the index of the furthest reachable scan line of that edge. The x-coordinate of the intersection point of the edge and the current scan line, the difference dx between the x-coordinate of the intersection point of the next scan line and the current scan line and the intersection point of the edge, and the pointer Edge* to the next edge, where dx is a constant.

7. The optimized laser processing pattern scanning line filling method according to claim 6, characterized in that, Each scan line has a different ordinate value. In S4, scan lines are processed one by one, calculating the intersection point between the current scan line and the fill cell. Specifically, scan lines are processed one by one in ascending order of ordinate value. For the current scan line, the corresponding linked list is found in the new edge list, and all edges in this linked list are added to the active edge list. Then, all edges in the active edge list are traversed. The x-value in the edge structure represents the x-coordinate of the intersection point between the current edge and the scan line. This x-value is saved, and the dx value in the edge structure is added to the original x-value to update the x-value. If the edge's x-coordinate is not specified, the x-coordinate is updated. If the index of the current scan line is less than or equal to the index of the current scan line, the edge is deleted from the active edge list. If the index of the current scan line is greater than the index of the current scan line, the edge is ignored and the next edge is added to the active edge list.

8. The optimized laser processing pattern scanning line filling method according to claim 3, characterized in that, The specific operation of reversing the first filling data in S4 in S5 is as follows: set a reverse rotation matrix to perform a reverse rotation, and the reverse rotation matrix is ​​the inverse of the rotation matrix in S302.

9. The optimized laser processing pattern scanning line filling method according to claim 1, characterized in that, Saving the second padding data in all padding cells in S6 includes serializing the second padding data obtained in S5 and saving it to disk.