A robust fast bridging algorithm for laser cutting

Bridging the different parts together is considered a simple but effective strategy to reduce the number of piercing operations during laser cutting. However, fast bridging is never an easy task. In this paper, we present a near-linear bridging algorithm for the input parts with the shortest total bridge length. At first, the input part contours are discretized into a point cloud, then the point cloud is triangulated with the Delaunay standard. The shortest line segments between any two adjacent parts are found in the triangles connecting the two parts. These segments are finally extended into bridges. To solve the problem of the damages to the contour characteristics caused by the bridges, some restrictions are set on the screening of the discrete point cloud and the Delaunay triangles. This algorithm not only ensures the minimum total distance of all bridges, but also avoids the problem of generating bridge loops. Computational experiments show that the proposed bridging algorithm is much faster than that in existing commercial software. The feasibility and superiority of the algorithm are verified by actual lasering cutting experiments.


Introduction
Laser cutting is one of the main modern technologies in sheet metal product manufacturing industry. The use of laser cutting brings many benefits, such as minimizing the cutting width and reducing thermal deformation [1]. A typical production process consists of designing parts, nesting the parts on metal sheets, and cutting the parts from the sheets [2]. Although it seems pretty neat, there are many cutting processes to consider between nesting parts and cutting plan, like piercing, bridging, and common cut. In recent years, many researches in the field of laser cutting have considered the influence of cutting processes. Huang et al. [3] studied the layout and path planning of rectangular parts with the influence of piercing. Rao et al. [4] designed a system on parts layout and path planning for irregular shape parts.
Raggenbass et al. [5] and Pan et al. [6] also studied on layout and path planning system for irregular shape parts. Figure 1 illustrates an example of nesting parts on a metal sheet. As shown in Fig. 1, a part is defined as an outer contour with possibly a set of inner contours forming holes in the part. A contour itself is composed of a set of geometry elements which can be line segments, polylines, circles, arcs, ellipses, B-spline curves etc. Each element is defined by its end nodes and can be cut in both directions (unless explicitly specified otherwise). To minimize the material used on the metal sheet, nesting algorithms attempt nesting parts within parts. Most researches on laser cutting focus on cutting path planning after nesting, while few consider the influences of piercing, bridging, and common cut [7].
Piercings are operations where the laser penetrates the metal sheet. This is required when the laser starts to cut in an area of the metal sheet where it has not cut before. To ensure the quality of the processed parts, piercings should be arranged in the position on metal sheet where no parts have been arranged [7]. Figure 2 shows an example of cutting path with piercing. The complete cutting path for part in Fig. 2 can be represented as τ (P 1 , P 2 , P 3 , P 4 , P 5 , P 6 , P 2 , P 7, P 8 ). P 1 is the piercing point as well as the start point of this cutting path. The distance from P 2 to P 7 is the excessive cutting segment to make sure this cutting path been cut completely. The time of piercing is related to the thickness of the metal sheet and laser power. For thicker metal sheet, piercing usually takes more time and causes damage to the surface of the sheet, as Fig. 3 shows. Since laser cutting process is a thermal processing technique, piercing also brings the bad influence of heat accumulation [8]. In order to reduce piercing operations and processing time, two approaches, common cut and bridging, are often used, as shown in Fig. 4.
Suppose part 1 and part 2 are the two parts on the metal sheet that need to be cut, as shown in Fig. 4. Figure 4a shows the conventional approach. The laser beam begins to cut from point P 1 , goes around the shape contour, and ends at point P 2 . Then, the beam jumps to the piercing point P 3 , goes around part 2 , and ends at point P 4 . The second approach in Fig. 4b adopts common cut. Unlike the first approach, the laser beam does not need to pierce again after it reaches point P 2 . Instead, it takes advantage of a common edge shared by part 1 and part 2 (p 3 -p 4 ) and cuts only three rectangular edges of part 2 . Figure 4c shows another approach which completes two parts in one cutting path by a bridge. Although common cut and bridging can reduce piercing, these two methods are still inadequate.
For the common cut approach, on the one hand, it limits the positions of the jump points (only P 3 or P 4 is allowed in Fig. 4b); on the other hand, it also limits the cutting sequence between parts (complete contour with pierce must be cut first and residual detached contour later). These two limitations make the jump distance of the common cut longer than that of other cutting approaches and also make the cutting path planning task more difficult.
For the bridging approach, it is realized by connecting adjacent separatecutting paths to reduce the piercing operations, as well as the number of jumps and the air move. Rather than adding restriction like common cut, bridging will simplify the cutting path planning. However, as shown in Fig. 5, bridging may damage the contour characteristics of the parts. Figure 5a, b demonstrates the situations on how bridge can be harmful to the geometry precision of the parts when it is connected to the corner or curve of the part  contour. Fortunately, the problem can be solved by optimizing the location of bridges [9]. In addition, for small parts, bridging can prevent the parts from falling after cutting, as Fig. 6 shows. Although piercings are very expensive, air moves are considerably cheaper than cut moves. It follows that a bridge cannot be longer than a certain length before a combination of piercing and air move becomes cheaper [7]. Generally, in order to reduce the processing time and the part stress caused by the bridge, the bridge should better be short. Based on this, finding the location to build bridge between parts is similar to calculate the shortest distance between contours. Manber et al. [10] used bridge to minimize the number of pierce point for contour groups connected through common cuts. Dewil et al. [11][12][13][14] made a lot of contributions in laser cutting field and proposed that a bridge can be used to connect two sub-regions to reduce the number of piercing. Although the bridging concept is popular in laser cutting, the bridging algorithm itself is seldom researched. To the best of our knowledge, no public literature can be found on this aspect.
In this work, an efficient bridging algorithm based on Delaunay triangulation is proposed and implemented in the laser cutting application. Specifically, the part contours that have been previously nested are discretized into a point cloud. With the help of Delaunay triangulation, the point cloud is triangulated into multiple triangles, then some invalid triangles are screened out to decrease computational complexity, and the shortest distance between adjacent parts are calculated by the remaining triangles. Eventually, the target bridge is built from selected shortest distance segments. The whole bridging algorithm proceeds quickly since the time complexity of Delaunay triangulation is near linear. It can bridge all parts in O (n log n) time, in which n is the size of the discretized point. Consider that bridging may damage the contour characteristics of the parts, some limitations are set during discretizing part contours and screening out invalid triangles. Besides, the problem of bridging into a ring (bridge loop) is solved while calculating the shortest length of all bridges.
The remainder of this paper is organized as follows. In Sect. 2, the structure of the bridge and the algorithm input are introduced. Section 3 introduces the method of discretizing nested parts into a point cloud. In Sect. 4, constructing triangles and building bridges by selected triangles are presented. Comparison of bridge effect with commercial software and actual cutting experiments are given in Sect. 5. The last section concludes this paper.

Bridge construction and the algorithm input
Before illustrating our algorithm, the structure of the bridge and the algorithm input will be introduced in this section. As shown in Fig. 7, part 1 and part 2 are connected by a bridge, which can be represented as υ (V 1 , V 2 , V 3 , V 4 ). There are two vertexes on each connected part (V 1 , V 2 on part 1 and V 3 , V 4 on part 2 ). The distance between V 1 and V 2 or V 3 and V 4 is called the bridge width (D W ). D W will affect the stress of the connection and is usually set according to the size of parts. Generally speaking, D W will not exceed the length of the shortest edge of parts. In this paper, D W is an appropriate input value. Apart from D W , the maximum length of the bridge (D L ) is also an input value used in our algorithm.
As mentioned in Sect. 1, the bridge should be as short as possible, and D L will help screen out the overlong bridges.
According to the definition of parts in Sect. 1, each contour of a part is represented by a series of endpoints. But the contours of parts may include curves like circles, arcs, B-spline curves, and even elliptic arcs, which means that they cannot be replaced by points as accurate as line segments or polylines. And these curves need to be subdivided into many points by angle (as shown in Fig. 8a) or parameter (as shown in Fig. 8b) to participate in the calculation. In order to ensure the cutting accuracy of these curves, the distance between lines composed of these discrete points should be very short, which is an essential guarantee to filter out specific line segments in our algorithm.  Overall, part contours may contain curves when designed, which will be replaced by series of points in nesting and bridging calculations, as shown in Fig. 8. The relationship of all parts participate in bridging is shown in Fig. 9. All parts are in a part set (S p ), and each part is also a contour set (S c ). Each contour is an endpoint set (S e ), and two adjacent endpoints form an edge.
As shown in Fig. 10a, the cutting paths for Part 1 and Part 2 are connected by a bridge, which makes the two parts also connected after cutting, as shown in Fig. 10b. Through post-processing, two required parts can be obtained after the bridge is removed during post-processing, as shown in Fig. 10c. As mentioned in Sect. 1, if the bridge is built on the corner of the part or on the curve contour (replaced by many points), it will inevitably destroy the contour characteristics of the part when the bridge is removed, as shown in Fig. 11. Figure 11a shows the two parts needed, while Fig. 11b shows how the normal bridging algorithm when connected leads to a damaged shape of the hexagonal part, making it difficult to restore the original part shape in the subsequent removal of the bridge.

Part edge decertation
Finding the shortest distance between parts is fundamental to bridge all parts. To realize that, in this work, the Delaunay triangulation method is applied, which will be presented in Sect. 4. Before that, all nested parts defined in Sect. 2 need to discrete into a point cloud as the input of Delaunay triangulation.
There are two problems to be noticed in the construction of bridges. One is that, naturally, the bridge should be as short as possible. The other problem is that, if the bridge is adjacent to any curves or endpoints of the contour, the bridge will inevitably damage the contour characteristics, as shown in Fig. 5. As shown in Fig. 12, if the contour is made up of both curves and line segments, priority should be given to bridging the line segments, even if the length of the bridge is longer than that of the curve.
In order to solve the above two problems, a distance value D m is set when all parts are discretized into a point   Fig. 13, D m is the minimum allowed distance between two adjacent discrete points on each edge, which is a mathematical tool to determine how many points can be produced at most for a given edge. D m is set to screening and discretizing these part edges if the edge length is larger than twice D m . Figure 13 shows the relationship between D m and edge length. In Fig. 13, if the length of edge is shorter than twice D m , the distance between the generated discrete point and the endpoint of the edge will be less than D m (like L 1 in Fig. 13), and that may affect the bridge when extending segments into bridges. Therefore, only edges longer than twice D m will be discretized and endpoints are not added to the point cloud to avoid the bridge adjacent to endpoints. For the edge larger than twice D m , attention should be paid to starting from the middle of the edge to ensure that the distance between the discrete point and the endpoint is not less than D m (like L 3 in Fig. 13).
As described in Sect. 2, curves in parts are discretized by angles or parameters into multiple points. In order to approximately replace the curve, the length of each line segment made up of these points must be short enough (shorter than D m ). Therefore, the discrete points of the curve can be identified and excluded from the discrete point cloud by D m . As a result, if the entire contour is made up of curves and all edges of this contour do not meet the requirements, this contour will no longer bridge with other parts.
To determine the value of D m , we need to consider the value of D W and the effect on Delaunay triangulation. To be specific, a smaller D m will help find more discrete points and make it easier to find a shorter distance between parts. However, if the D m is too small, the width of the generated bridge will be affected when widening lines into bridges, which will be presented in Sect. 4.
All discrete points will be stored in the set of points S d . To make it easier to understand, the point structure which is used throughout the paper is defined first.
In this structure, the real numbers x and y are the coordinates of the point in Euclidean space; the integer partIndex is the index of S p ; the integer polyIndex is the index of S c ; and the integer edgeIndex is the index of S e . After all the discrete points have been saved, the next step is Delaunay triangulate.

Building bridges by Delaunay triangulation
Triangles constructed by Delaunay triangulation have good properties such as empty circle [15] and are often used to solve the shortest distance between contours [16][17][18].
In this paper, we use this method to triangulate all discrete points in S d . The incremental algorithm proposed by Berget al. [19] is employed. The time complexity of their algorithm is O (n log n), in which n is the size of the point set. Figure 14 shows a result of Delaunay triangulation for discrete points. In our previous research, the shortest distance between contours is found by screening triangles and sorting them in sequence [20]. But in this paper, the shortest distance between adjacent parts is the target. To reduce the number of triangles that need to be sorted in sequence, two rules are set to eliminate triangles. Firstly, if all three points of a triangle are on the same part or on three different parts, this triangle is not helpful for us to find the distance between two parts. Secondly, for parts with multiple contours, if two points in a triangle are on different contours of the part, the triangle should be eliminated, too. Triangles mentioned above can be easily filtered by partIndex and polyIndex of triangle points, that is why we need these two parameters in point structures. Figure 15 shows the result of deleting triangles through these two steps.
All the remaining triangles are two points (E 1 , E 2 ) on the same contour of one part, while the third point (E 3 ) on another part. But there are still some triangles that contain or cross endpoints of parts that need to be eliminated. If the shortest distance is taken on these triangles, the bridges will either damage the contour characteristics of the parts or make bridging mistakes as shown in Fig. 16. Such triangles can be deleted by judging whether E 1 and E 2 are on the same edge, which can be implemented by edgeIndex parameter of triangle points.
In summary, through the three-step screening of the Delaunay triangles, all the remaining triangles satisfy that E 1 and E 2 are on the same edge of one part and E 3 is on another part. Next, all remaining triangles are sorted to find the shortest distance between adjacent parts. Figure 17 shows the method of finding the shortest distance from a triangle. If the height (E 3 -H) from E 3 to edge E 1 -E 2 is in the triangle, the height is used as the shortest edge. If not, the shorter edge is selected as the shortest line between E 1 -E 3 and E 2 -E 3 . The shortest line structure is defined as: The structure of the shortest line needs two points, and the structure of points is introduced in Sect. 3. If the shortest line contains point H, the properties partIndex, polyIndex and edgeIndex will be the same as E 1 or E 2 . All shortest lines are saved in a set denoted as S L .
The shortest distance between adjacent parts calculated by Delaunay triangles is shown in Fig. 18, and these lines in S L need to be extended to bridges with width. Before that, some lines need to be deleted to avoid bridge loops. As we have mentioned in Sect. 1, the purpose of bridging is to reduce the number of piercings. However, if the bridging produces loops, each loop will need a new piercing point, which goes against the original intention. To eliminate these loops, all lines in S L need to be sorted by length and selectively deleted according to the D L that we set initially. The shortest one in S L is used to connect parts firstly, and the connected parts will be composed into one part. Subsequently, each time the remained shortest line in S L is used to connect the parts until all parts are connected to a part or all lines in S L are used. All the lines used will be transformed into bridges. Because we avoid selecting points close to the endpoints of the parts, all used lines can be widened to bridges without exceeding the border, as shown in Fig. 19.

Experiment
In this section, two experiments are presented. One is to compare the effect and running time of proposed bridging algorithm with the existing commercial software; the other is the actual processing experiment. We use the proposed algorithm to implement the actual laser cutting to verify the feasibility and superiority of this algorithm.

Computational examples and comparisons
The proposed bridging algorithm has been programmed in the C++ language and run on a personal computer with a dual-core CPU @2.70GHZ and 8GB RAM. The proposed algorithm succeeds in many examples that have been tested.
It has been mentioned that we did not find a detailed study on the laser cutting bridging algorithm in the existing research, so we compare the method with the existing commercial software. However, this means that we have to implement their own nesting function in laser cutting. But the nesting results are different from commercial software because of the difference of the nesting algorithm, which makes the amount and location of bridging parts somewhat different (The calculation amount is of the same order of magnitude). While this may have some slight impact on the nesting results, it turns out that the running time of the two bridging algorithms is significantly different. Moreover, the bridge algorithm in this paper avoids the damage to the contour characteristics of the bridged parts, while there is no corresponding setting in the commercial software. Therefore, in order to reduce the difference in calculation amount and make the results relatively objective, only one curve part in experiments is selected to place. Figure 20 shows an example of the result of bridging algorithm introduced in this paper. It can be found from Fig. 20 that the bridge algorithm proposed in this paper can bridge all the parts with the global shortest distance without damaging the contour characteristics of the parts, unless the part is not suitable to bridge like the circular part. In contrast, Fig. 21 shows the bridging results of commercial software. The bridge algorithm of commercial software does not consider the contour characteristics of parts, and some parts are not bridged for some unknown reasons. In addition, the proposed algorithm also gains an edge on the calculation speed, as shown in Table 1. It can be seen from the difference in running time in Table 1 that the proposed algorithm is able to quickly complete the bridge of a large number of parts, while the bridge of all parts is a time-consuming operation for commercial software.

Actual cutting experiment
The actual cutting experiment uses a 1000-W desktop laser cutting machine with 1-mm-diameter laser beam, and cutting metal sheet is 3-mm thickness of 304 steel. Fig. 19 The shortest bridge to connect these parts First, the parts group in the previous case is cut and verified. In this case, there are five parts with six contours. After the proposed algorithm finishes bridging, the number of contours decreases to two. The overall cutting length is 2.84 m with two piercing points. Figure 22 shows the finished cutting product and the total process costs 5 min and 58 s with 8 mm/s cutting speed. Bridge details of parts are shown in Fig. 23. Figure 23a shows the parts after cutting; all parts are connected together by the bridge. Figure 23b shows the detail of the bridge, and Fig. 23c shows the detail of the interface of the parts after the bridge is removed by post-processing. The gas pressure and cutting speed had pronounced effect on the interface of parts [21].
Considering that this example is too simple to highlight the feasibility and superiority of the proposed algorithm, a more complex part group is selected for the second actual machining experiment. Figure 24 shows the nesting results for this part group. There are 24 parts with 28 contours, among which there is a circular part. The cutting speed is the same as the previous experiment, set at 8 mm/s, and the total processing time is 11 min and 46 s. The finished product is shown in Fig. 25. Parts in this experiment are complex in shape and large in number, but the algorithm proposed in this paper avoids the damage to the contour characteristics of the parts caused by bridge successfully. At the same time, the proposed algorithm finds the global shortest bridge position in a very short time.
The feasibility and superiority of the proposed algorithm have been verified by two actual cutting experiments in this section. When the shape of parts is complex and the number is large, the algorithm can still avoid the damage to the contour characteristics of the parts caused by bridge and ensure that all parts are bridged at the shortest global distance.

Conclusions
In laser cutting processing, cutting parts needs piercing, which is usually a time-consuming operation for thicker metal sheet. Bridging is an effective method to reduce the number of piercing points but usually damage the contour characteristics of parts. To solve this problem, a new bridging algorithm for laser cutting is proposed in this paper. This algorithm can calculate the shortest distance of all bridged parts without damaging the contour characteristics of the parts, with a considerable calculation speed. The input of the algorithm is all the parts that need to be bridged and some necessary parameters (minimum distance D m , bridge width D W and the longest bridge length D L ). Firstly, all the parts to be bridged are discretized into a point cloud by D m . In order to ensure that the bridge generated later will not damage the contour characteristics of the parts, some points need to be screened out. Next, all discrete points are constructed into a series of triangles by Delaunay triangulation. To reduce the amount of calculation, some restrictions are set to filter out invalid triangles. The remaining triangles are sorted to calculate the shortest distance between adjacent parts. In order to avoid the bridging loop problem, all the calculated line segments obtained are sorted by length from short to long and bridge parts from the shortest one. So far, the global shortest distance to bridge all parts has been found. Finally, all lines are extended into bridges according to D W . The output of the algorithm are all bridges and the time complexity of the proposed algorithm is O (n log n), in which n is the total point number of the input point cloud. Comparison between proposed algorithm and the existing commercial software proves that the proposed algorithm can complete the required functions in a much shorter time. Two actual cutting experiments verify the feasibility and superiority of the proposed algorithm.