A laser marking method for automatically generating printing paths

By automatically generating the printing path, the problem of insufficient pattern generation speed and quality in the prior art is solved, and the effect of fast path generation speed, high quality and obvious pattern profile is achieved, which is suitable for laser marking technology.

CN115302092BActive Publication Date: 2024-11-19NINGBO XINRUIDA SPORTS GOODS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210921728.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-02
Publication Date
2024-11-19
Estimated Expiration
2042-08-02

AI Technical Summary

Technical Problem

The existing laser marking technology has shortcomings in pattern generation speed and quality, and the connection length is short when planning the path, so it is impossible to effectively utilize the laser continuous irradiation time, and the pattern edge portraying is poor.

Method used

The method of automatically generating the printing path is adopted, and the path generation is optimized through the steps of point set preprocessing, inner and outer ring distinction, jagged parallel marking, etc., to ensure that the path is as long and continuous as possible, and to optimize the path generation using mathematical methods to improve calculation efficiency and pattern filling. Effect.

Benefits of technology

It has achieved an improvement in path generation speed and an improvement in generation quality, a distinct pattern profile and clear filling effect, and can make full use of the laser opening time, which is suitable for different patterns.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115302092B_ABST
    Figure CN115302092B_ABST
Patent Text Reader

Abstract

The present invention discloses a laser marking method for automatically generating a printing path, including: obtaining an image point set to be processed, defining a related data structure; using an odd-even intersection method to determine whether a ring is an inner ring or an outer ring, and using a midpoint vertical extension method to determine the extended contours of the corresponding directions of the inner and outer rings; generating equally spaced straight lines and cutting them into parallel line segments using the order of the odd and even numbers of the intersection points; using the minimum distance between endpoints in the same direction and a threshold method to determine whether two line segments are connected. Compared with the prior art, the present invention uses mathematical methods to optimize the path generation method as much as possible to ensure that the amount of calculation is controllable; the path generation speed is fast and the generation quality is high; the adaptability to different patterns is strong and the versatility is high; the average single distance of the path is long, and the laser opening time can be fully utilized; the pattern outline is obvious, and the pattern filling effect is clear and discernible.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the field of laser marking, and in particular to a laser marking method for automatically generating a printing path. Background Art

[0002] A laser marking machine is a device that uses a laser beam to mark patterns on the surfaces of various materials. For laser marking, the pattern filling method and the hatching of the filling path are also crucial. Although the existing path hatching algorithm can meet actual needs, there is still a lot of room for optimization in terms of speed and generation effect.

[0003] For example, the simplest algorithm is to use a cluster of parallel line segments to fill the pattern without connecting the first and last segments to hatch the pattern path. However, this algorithm will cause the entire laser irradiation point to run idle for a long distance, and the boundary of the pattern will not be obvious and will be fuzzy.

[0004] Existing similar methods have poor control over the pattern generation speed and quality, and the maximum connection length is short when planning the path. They cannot effectively utilize the continuous laser irradiation time, and the depiction of the pattern edge is poor. Summary of the invention

[0005] The present invention provides a laser marking method for automatically generating a printing path, which is used to optimize the generation speed of the marking path and ensure that each marking path is as long and continuous as possible.

[0006] In order to achieve the above tasks, the present invention adopts the following technical solutions:

[0007] A laser marking method for automatically generating a printing path, comprising:

[0008] 1. Preprocessing steps

[0009] Step 1.1, point set preprocessing

[0010] Step 1.1.1, the input graphic symbol point set to be printed is divided into different point sets according to whether it belongs to a closed loop, forming a point set structure array orgs; the point sets of all loops in orgs constitute the image to be drawn;

[0011] Among them, the attribute segments of the point set structure array include:

[0012] orgs(i).data, represents the coordinate set of the point set, uses the structure M as an element and is stored in order; orgs(i).mod, indicates whether the point belongs to the inner ring or the outer ring; orgs(i).layer indicates the layer of the ring, and i represents the array index;

[0013] The coordinate point of each point set data is defined as a structure M, and the properties of the structure M include:

[0014] M.data, indicates the coordinates of the point; M.dataPro, the coordinates of the previous point in the same ring; M.dataNext, the coordinates of the next point in the same ring; M.layer, indicates which layer of the ring the point belongs to; M.mod, indicates whether the point belongs to the inner ring or the outer ring; M.index, indicates which ring the point belongs to; M.ii, indicates which point of a certain ring the point belongs to;

[0015] Step 1.1.2, divide the points in orgs into a grid and store them in a two-dimensional structure dotsSplit, where the row and column indexes i and j of the structure dotsSplit correspond to the nearest integers of ten times the x and y coordinates of the point respectively;

[0016] Step 1.2: Distinguish between inner and outer rings

[0017] Step 1.2.1, traverse the point sets of all rings in all orgs, take any four points in each ring and get the average of their y coordinates and store them in the array ys;

[0018] Step 1.2.2, for each y coordinate in ys, draw a straight line through the y coordinate and across the image to be drawn, and at the same time get the two upper and lower grid rows upGrids and downGrids corresponding to the line from dotsSplit;

[0019] Step 1.2.3, traverse upGrids and downGrids to find the points corresponding to all line segments intersecting with line y, and sort them according to the size of x;

[0020] Step 1.2.4, check from left to right in order. If the point is in an odd position, the ring to which the point belongs is the inner ring, otherwise it is the outer ring. At the same time, if a ring has been determined to be finished, it will be skipped directly if another point is found on this ring later.

[0021] Step 1.3, obtain the inner and outer ring extension contours

[0022] Step 1.3.1, traverse the point set of the ring in the point set structure array orgs, and use the midpoint vertical extension method. If it is an inner ring, expand it inward to obtain the extended contour; if it is an outer ring, expand it outward to obtain the extended contour;

[0023] Step 1.3.2, store the points of the contour line of the extended contour into the point set structure arrays orgs and dotsSplit; according to the number of extensions, set the attribute M.layer of the point in the structure M at the same time;

[0024] 2. Parallel sawtooth marking

[0025] Step 2.1, generate parallel line segments

[0026] Step 2.1.1, obtain the maximum and minimum y coordinates of all coordinate points in the point set structure array orgs, generate multiple straight lines with an interval of L between the maximum y coordinate and the minimum y coordinate, and for each straight line, obtain the two upper and lower grid rows upGrids and downGrids closest to the straight line from dotsSplit;

[0027] Step 2.1.2, traverse upGrids and downGrids to find the coordinate points with layer number 1 and intersecting with line y, and form the intersection coordinate set dotCros; and sort the intersection points in dotCros according to the size of their x coordinates;

[0028] Step 2.1.3, traverse the intersection coordinate set dotCros, where the index i of the intersection point is accumulated from 1, and as long as i is an even number, the point with index i-1 and the point with index i are combined into a line segment and saved in segLines;

[0029] Step 2.1.4, for each upGrids and downGrids obtained in step 2.1.1, repeat 2.1.2 and 2.1.3 to get a segLines, and put all segLines into segLinesList in order;

[0030] Step 2.2: Connect line segments to form a path

[0031] Step 2.2.1, traverse segLinesList, for each segLines, get the right endpoint proR of its first line segment and store its corresponding line segment in roads, then delete the line segment to which proR belongs from this segLines;

[0032] Step 2.2.2, get the next segLines, check all the line segments therein and find the points whose right endpoints belong to the same ring as the previous line segment's right endpoint to form a point set nextRs, traverse nextRs, find all nextRs where nextR.ii>proR.ii and proR.ii-nextR.ii is greater than a preset threshold; where:

[0033] proR.ii and nextR.ii indicate the number of points proR and nextR belong to a certain ring, and nextR is a point in nextRs;

[0034] Step 2.2.3, select the nextR with the smallest proR.ii-nextR.ii from all the nextR selected in step 2.2.2 as the connection point, store the line segment corresponding to nextR and all arc points between proR.ii and nextR.ii in roads, then delete the line segment corresponding to nextR from this segLines. If there is no point that meets the conditions, traverse segLinesList again;

[0035] Step 2.2.4, loop step 2.2.1 to step 2.2.3 until segLinesList is all empty to obtain multiple complete paths to completely fill the pattern; after sending the path to the laser marking machine, marking can be performed according to the path.

[0036] Furthermore, after the coordinate point of each point set data is defined by the structure M, the structure M records three coordinate points, namely, the point M.data, the previous point coordinate M.dataPro, and the next point coordinate M.dataNext. These three coordinate points are connected in sequence to form two line segments.

[0037] Furthermore, the coordinates of the intersection point and the properties of the intersection point are also defined by the structure M; wherein the two properties M.dataPro and M.dataNext are set to the two endpoints before and after the line segment where the intersection point is located.

[0038] Furthermore, the arc point is a point constituting the part of the arc between proR and nextR; the connection point is a turning point, which is used to connect the line segment where nextR is located with the line segment where proR is located.

[0039] Compared with the prior art, the present invention has the following technical features:

[0040] 1. Use mathematical methods to optimize the path generation method as much as possible to ensure that the amount of calculation is controllable.

[0041] 2. The path generation speed is fast and the generation quality is high.

[0042] 3. Strong adaptability to different patterns and high versatility.

[0043] 4. The average single distance of the path is longer, which can make full use of the laser opening time.

[0044] 5. The pattern outline is clear and the pattern filling effect is clearly discernible. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] Figure 1 It is a schematic diagram of the process of the present invention;

[0046] Figure 2Schematic diagram of parallel marking of saw teeth;

[0047] Figure 3 A schematic diagram of finding points corresponding to all line segments intersecting with straight line y in an embodiment of the present invention;

[0048] Figure 4 A schematic diagram of the extended outlines of the inner and outer rings;

[0049] Figure 5 Schematic diagram of geometry for contour expansion;

[0050] Figure 6 A schematic diagram showing the intersection of inner and outer rings and line segments;

[0051] Figure 7 The middle is a schematic diagram of the possible super-long arc connection that may occur if the threshold is not set;

[0052] Figure 8 Schematic diagram of filtering connection points from nextR. DETAILED DESCRIPTION

[0053] Referring to the accompanying drawings, a laser marking method for automatically generating a printing path provided by the present invention comprises the following steps:

[0054] 1. Preprocessing steps

[0055] Step 1.1, point set preprocessing: obtain the image point set to be processed and define the relevant data structure

[0056] Step 1.1.1, divide the input graphic symbol point set to be printed into different point sets according to whether they belong to a closed loop, forming a point set structure array orgs with the following attributes, where the point set data should be continuous points and connected end to end, and i represents the array index; the point sets of all loops in orgs constitute the image to be drawn.

[0057] orgs(i).data: point set coordinate set (using structure M as elements, stored in order);

[0058] orgs(i).mod: inner and outer rings (1 for inner ring, 0 for outer ring);

[0059] orgs(i).layer: the ring’s layer number (0 refers to the initial ring, 1 refers to the first expanded contour ring next to 0).

[0060] The coordinate point of each point set data is defined as a structure M, which contains the following parts:

[0061] M.data: point coordinates;

[0062] M.dataPro: coordinates of the previous point in the same ring (used to connect as line segments for intersection detection);

[0063] M.dataNext: coordinates of the next point in the same ring;

[0064] M.layer: the layer of ring to which the point belongs;

[0065] M.mod: inner and outer rings (1 for inner ring, 0 for outer ring);

[0066] M.index: belongs to a certain ring (the i index in the above orgs);

[0067] M.ii: The nth point belonging to a certain ring (in order).

[0068] Step 1.1.2, divide the points in orgs into a grid and store them in a two-dimensional structure dotsSplit, where the row and column indexes i and j of the dotsSplit structure correspond to the nearest integer (rounded) of ten times the x and y coordinates of the point, respectively. They are represented by the structure M described in step 1.2 and stored in dotsSplit. For example, for a point A(0.26,0.09) and B(2.31,1.09), first expand their coordinates by ten times to A(2.6,0.9) and B(23.1,10.9), and then round them to A(3,1) and B(23,11). At this point, we know that the coordinate of A needs to be stored in dptsSplit[3][1] and the coordinate of B needs to be stored in dptsSplit

[23]

[11] . The purpose of expanding by ten times is to improve the accuracy of coordinate search. Otherwise, if A is in [0][0] and B is in [2][1], many coordinates will be crowded together.

[0069] The grid segmentation in this step is actually to find the index based on the nearest x, y coordinates, so as to obtain the data segmented according to the grid, which can greatly speed up the subsequent search speed (it is worth noting that each sub-contour generated by the subsequent processing must be segmented and stored separately), and the structure definition of each point well preserves the information of the point itself and its surroundings, which is very convenient for the subsequent intersection judgment and inner and outer ring judgment, and overcomes the disadvantage of difficult encoding when point information is insufficient.

[0070] Step 1.2, distinguishing inner and outer rings: Use the odd-even intersection method to determine whether the ring is an inner ring or an outer ring, such as Figure 3 shown.

[0071] Step 1.2.1, traverse the point sets of all rings in all orgs, take any four points in each ring and get the average of their y coordinates and store them in the array ys.

[0072] Step 1.2.2, for each y coordinate in ys, draw a straight line through the y coordinate and across the image to be drawn, and at the same time get the two upper and lower grid rows upGridsdownGrids corresponding to the line from dotsSplit.

[0073] Step 1.2.3, traverse upGrids and downGrids to find the points corresponding to all line segments that intersect with line y, and sort them according to the size of x, according to Figure 3 Then it is ABCDEF. Since the coordinate point of each point set data is defined by the structure M, the structure M records three coordinate points, namely the point M.data, the previous point coordinate M.dataPro, and the next point coordinate M.dataNext. These three coordinate points are connected in sequence to form two line segments, which may intersect with the line y.

[0074] See also Figure 3 The ring where point A is located is the inner ring, and the ring where points B and D are located is the outer ring (the small circle below is also the outer ring). The entire area that needs to be filled is the gray area between the outer ring and the inner ring.

[0075] Step 1.2.4, check from left to right in order. If the point is in an odd position (A is 1), then the ring to which the point belongs is an inner ring, otherwise it is an outer ring. At the same time, if a ring has been determined to be finished, then other points on this ring will be skipped directly. For example, if B can be judged to be an outer ring, then C will be skipped directly and D will be judged to be an outer ring. Figure 3 As shown, after the determination is completed, all points obtained in the point set preprocessing module are marked with corresponding inner and outer ring marks, and the points are sorted in a clockwise direction in the inner ring and in a counterclockwise direction in the outer ring.

[0076] In this step, the present invention designs an algorithm to determine the closing direction of the ring by the odd-even order of intersection points. In this way, the present invention can quickly obtain the direction in which the contour of each closed loop should be expanded, making the subsequent generation of contour parallel path results more reliable and overcoming the problem of incorrect contour expansion direction.

[0077] Step 1.3, obtain the extended contours of the inner and outer rings: Use the midpoint vertical extension method to determine the extended contours of the inner and outer rings in the corresponding directions, such as Figure 4 and Figure 5 shown.

[0078] Step 1.3.1, traverse all the rings in the point set structure array orgs in step 1.1. If it is an inner ring, expand it inward; if it is an outer ring, expand it outward. The way to obtain it is as follows Figure 5 As shown, there are two adjacent points AC, with M as the midpoint of AC, and a perpendicular line extended to A'. It is worth noting that if it is an outer ring, A' should be on the left side of the line segment direction, otherwise on the right side.

[0079] Figure 4 For this solution, we need to obtain another contour that has the same contour as the ring and is parallel to it. If B is the inner ring, then the contour required by this solution is A. If A is the outer ring, then the contour required by this solution is B (inside and outside refer to the inner or outer side as the area to be filled).

[0080] Step 1.3.2, store the points of the obtained contour line into orgs and dotsSplit. For the storage method, refer to steps 1.1.1 and 1.1.2 in "I. Preprocessing Steps". At the same time, do not forget to set layer to 1 (indicating that it is the contour line formed by the first expansion).

[0081] In this step, the contour line obtained is mainly used to define the boundary and obtain the connection direction during sawtooth parallel marking, and the direction of the generated ring is the same as the parent ring. The advantage of this method is that it is simple and easy to implement, and the generation effect is good, and the contour line parallelism is high.

[0082] 2. Parallel sawtooth marking

[0083] Step 2.1, Generate parallel line segments: Generate equally spaced straight lines and cut them into parallel line segments in the order of even and odd numbers of intersection points.

[0084] Step 2.1.1, obtain the maximum and minimum y coordinates of all coordinate points in the point set structure array orgs, start generating multiple straight lines with an interval of L between the maximum y coordinate and the minimum y coordinate, and for each straight line, obtain the two upper and lower grid rows upGrids downGrids closest to the straight line from dotsSplit.

[0085] Step 2.1.2, traverse upGrids downGrids to find the coordinate points whose layer number (M.layer) is 1 and intersects with the line y, and form the intersection coordinate set dotCros; the intersection coordinates and the properties of the intersection are also defined by the structure M; the two properties M.dataPro and M.dataNext are set to the two endpoints before and after the line segment where the intersection is located, and the intersection points in dotCros are sorted according to their x coordinate size.

[0086] Step 2.1.3, traverse dotCros, where the index i of the intersection point is accumulated from 1. As long as mod(i,2)==0, that is, i is an even number, the point with index i-1 and the point with index i form a line segment and save it to segLines (this process obtains which line segments should be retained in a straight line), such as Figure 6 There are four intersection points ABCD with the ring of layer 1, of which AB and CD can be retained and the rest can be discarded; Figure 6In the above example, layer indicates the contour layer from the outside to the inside.

[0087] The original ring represents the contour data given at the beginning, and the inner expansion ring represents a ring that expands inward.

[0088] Step 2.1.4: For each upGrids and downGrids obtained in step 2.1.1, repeat 2.1.2 and 2.1.3 to obtain a segLines. Put all segLines into segLinesList in order.

[0089] In this step, a straight line is generated starting from the maximum y coordinate, and the points are segmented using the odd-even intersection order of the endpoints and the judgment of the closed loop layer, with excellent segmentation results. At the same time, thanks to the good preservation of the spatial information around the point, the line segment generation speed is also very fast, which effectively improves the overall path generation speed.

[0090] Step 2.2, connect line segments to form a path: use the minimum distance between endpoints in the same direction and the threshold method to determine whether two line segments are connected

[0091] Step 2.2.1, traverse segLinesList: for each segLines, get the right endpoint proR of its first line segment and store its corresponding line segment in roads, then delete the line segment to which proR belongs from this segLines, and get the ring corresponding to this point in orgs and the point index on the corresponding ring.

[0092] Step 2.2.2, get the next segLines, check all the line segments and find the points whose right endpoints belong to the same ring as the previous line segment to form a point set nextRs, traverse nextRs, find all nextRs where nextR.ii>proR.ii and proR.ii-nextR.ii is greater than a certain threshold (the threshold is set to prevent lines from flying around), such as Figure 7 As shown. There is an index attribute in the point structure M, which indicates that this ring is the index in orgs. Each ring is different. You only need to determine whether the index is the same to determine whether two points belong to the same ring. Among them, proR.ii indicates the number of points in a certain ring that point proR belongs to (that is, the M.ii attribute in the structure M), and nextR is an element in nextRs, that is, the element object that needs to be operated in each loop when traversing nextRs.

[0093] The storage order of the outer ring points is counterclockwise, and the inner ring storage data is clockwise. For the outer ring, nextR.ii>proR.ii means that the next point is located in the counterclockwise direction of the previous point, and for the inner ring, nextR.ii>proR.ii means that the next point is located in the clockwise direction of the previous point. It can be imagined that the right endpoint is located on the right side of the inner ring and on the left side of the outer ring, so the nextR obtained according to this rule should be below proR. This judgment is for verification; proR.ii-nextR.ii can be understood as the distance between the upper and lower points. The distance cannot be too large. The threshold here is set as the parameter specified by the user.

[0094] Step 2.2.3, select the nextR with the smallest proR.ii-nextR.ii from all nextR selected in step 2.2.2 as the connection point, and store the line segment corresponding to nextR and all arc points between proR.ii and nextR.ii in roads, then delete the line segment corresponding to nextR from this segLines. If there is no point that meets the conditions, re-traverse segLinesList, such as Figure 8 shown.

[0095] Among them, the arc point is a part of the circle. Because it is not a straight line, it is called a point that constitutes the arc, specifically the point that constitutes the part of the arc between proR and nextR.

[0096] The connection point is the turning point, which can be understood as connecting the line segment where nextR is located with the line segment where proR is located, and the connection method is to add all the points between proR and nextR (i.e. a small part of the circle) to form a continuous path. Therefore, the two connection points literally mean proR and nextR. Since proR is already determined, nextR is called the next connection point (see Figure 8 The connection between the two points on the right end of the two line segments on the left is described as this, and nextR is selected between nextR and nextR2 as the next connection point of proR).

[0097] Step 2.2.4, loop step 2.2.1 to step 2.2.3 until segLinesList is empty, then you can get multiple complete paths to fill the pattern completely; after sending the path to the laser marking machine, you can mark according to the path. After looping the right endpoint, you need to go back to the left endpoint of the next line segment to finally get all the paths.

[0098] In this step, the scheme connects the generated parallel line segment clusters using the minimum distance between endpoints in the same direction and the threshold method to generate the longest possible path, which effectively avoids the confusion of the connecting lines and improves the stability of the path generation results.

[0099] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A laser marking method for automatically generating a printing path, characterized in that: include:

1. Preprocessing steps Step 1.1, point set preprocessing Step 1.1.1, dividing the input graphic symbol point set to be printed into different point sets according to whether they belong to a closed loop, forming a point set structure array orgs; The point set of all rings in orgs constitutes the image to be drawn; Among them, the attribute segments of the point set structure array include: orgs(i).data, represents the coordinate set of the point set, uses the structure M as an element and is stored in order; orgs(i).mod, indicates whether the point belongs to the inner ring or the outer ring; orgs(i).layer indicates the layer of the ring, and i represents the array index; The coordinate point of each point set data is defined as a structure M, and the properties of the structure M include: M.data, indicates the coordinates of the point; M.dataPro, the coordinates of the previous point in the same ring; M.dataNext, the coordinates of the next point in the same ring; M.layer, indicates which layer of the ring the point belongs to; M.mod, indicates whether the point belongs to the inner ring or the outer ring; M.index, indicates which ring the point belongs to; M.ii, indicates which point of a certain ring the point belongs to; Step 1.1.2, divide the points in orgs into a grid and store them in a two-dimensional structure dotsSplit, where the row and column indices i and j of the structure dotsSplit correspond to the nearest integer of ten times the x and y coordinates of the point respectively; Step 1.2: Distinguish between inner and outer rings Step 1.2.1, traverse the point sets of all rings in all orgs, take any four points in each ring and get the average of their y coordinates and store them in the array ys; Step 1.2.2, for each y coordinate in ys, draw a straight line through the y coordinate and across the image to be drawn, and at the same time get the two upper and lower grid rows upGrids and downGrids corresponding to the line from dotsSplit; Step 1.2.3, traverse upGrids and downGrids to find the points corresponding to all line segments intersecting with line y, and sort them according to the size of x; Step 1.2.4, check from left to right in order. If the point is in an odd position, the ring to which the point belongs is the inner ring, otherwise it is the outer ring. At the same time, if a ring has been determined to be finished, it will be skipped directly if another point is found on this ring later. Step 1.3, obtain the inner and outer ring extension contours Step 1.3.1, traverse the point set of the ring in the point set structure array orgs, and use the midpoint vertical extension method. If it is an inner ring, expand it inward to obtain the extended contour; if it is an outer ring, expand it outward to obtain the extended contour; Step 1.3.2, store the points of the contour line of the extended contour into the point set structure arrays orgs and dotsSplit; according to the number of extensions, set the attribute M.layer of the point in the structure M at the same time; 2. Parallel sawtooth marking Step 2.1, generate parallel line segments Step 2.1.1, get the maximum and minimum y coordinates of all coordinate points in the point set structure array orgs, generate multiple straight lines with an interval of L between the maximum y coordinate and the minimum y coordinate, and for each straight line, get the two grid rows upGrids and downGrids closest to the line from dotsSplit; Step 2.1.2, traverse upGrids and downGrids to find the coordinate points with layer number 1 and intersecting with line y, and form the intersection coordinate set dotCros; and sort the intersection points in dotCros according to the size of their x coordinates; Step 2.1.3, traverse the intersection coordinate set dotCros, where the index i of the intersection point is accumulated from 1, and as long as i is an even number, the point with index i-1 and the point with index i are combined into a line segment and saved in segLines; Step 2.1.4, for each upGrids and downGrids obtained in step 2.1.1, repeat 2.1.2 and 2.1.3 to get a segLines, and put all segLines into segLinesList in order; Step 2.2: Connect line segments to form a path Step 2.2.1, traverse segLinesList, for each segLines, get the right endpoint proR of its first line segment and store its corresponding line segment in roads, then delete the line segment to which proR belongs from this segLines; Step 2.2.2, get the next segLines, check all the line segments and find the points whose right endpoints belong to the same ring as the previous line segment's right endpoint to form a point set nextRs, traverse nextRs, find all nextRs where nextR.ii>proR.ii and proR.ii - nextR.ii is greater than the preset threshold; where: proR.ii and nextR.ii indicate the points proR and nextR belong to a certain ring, and nextR is a point in nextRs; Step 2.2.3, select the nextR with the smallest proR.ii - nextR.ii from all the nextR selected in step 2.2.2 as the connection point, and store the line segment corresponding to nextR and all arc points between proR.ii and nextR.ii in roads, then delete the line segment corresponding to nextR from this segLines. If there is no point that meets the conditions, traverse segLinesList again; Step 2.2.4, loop step 2.2.1 to step 2.2.3 until segLinesList is empty to obtain multiple complete paths to completely fill the pattern; after sending the path to the laser marking machine, marking can be performed according to the path.

2. The laser marking method for automatically generating a printing path according to claim 1, characterized in that: After the coordinate point of each point set data is defined by the structure M, the structure M records three coordinate points, namely, the point M.data, the previous point coordinate M.dataPro, and the next point coordinate M.dataNext. These three coordinate points are connected in sequence to form two line segments.

3. The laser marking method for automatically generating a printing path according to claim 1, characterized in that: The arc point is a point that constitutes the part of the arc between proR and nextR; the connection point is a turning point, which is used to connect the line segment where nextR is located with the line segment where proR is located.