Exploration of Human Cognition using Artificial Intelligence in HealthcareView this Special Issue
Exploration of Laser Marking Path and Algorithm Based on Intelligent Computing and Internet of Things
Nowadays, laser processing technology is being used more and more in various fields, and the requirements for laser control procedures are getting higher and higher. This paper aims to study the path generation problem of laser marking technology in order to improve the efficiency of laser marking as well as the protection of the marking material. Therefore, we creatively propose two-path generation methods, namely, sawtooth parallel and contour parallel, and design the boundary curve offset algorithm and domain partition intersection algorithm for the computer simulation of the two marking paths, respectively. Through the simulation, we discussed the efficiency and marking quality of the two path generation methods and gave the conclusion that the efficiency of the sawtooth parallel path generation method is greater than that of the contour parallel path generation method under specific parameters.
The laser  is an important invention of the 20th century and has been called “the sharpest knife,” “the most accurate ruler,” and “the most unusual light.” Lasers have been increasingly used in industrial processes for a variety of machining operations such as marking, welding, drilling, cutting, heat treating, and painting. Laser marking  is the marking of logos, characters, symbols, and images with a laser on the product surface. It is a widely used processing method with the advantages of high processing efficiency, noncontact operation, no consumables, and low impact on product surface deformation  and solid marking content. The hatch tool of a laser marking machine can be used for hatch-specified 2D composite profile , but the setting of different hatch parameters has a great impact on the processing effect of different materials. Zigzag parallel  hatching and profile parallel  hatching are the two basic ways of marking road dynamics generation. And the design of different process processing and hatching algorithms has substantial significance on whether the operation efficiency and accuracy of laser marking machine  can be improved.
Nowadays, in the field of laser marking, more research lies in the combination selection and optimization of process parameters . Shivakoti  et al. investigated the selection of optimal laser beam micromarking process parameters using the fuzzy TOPSIS  method in the GaN laser beam  marking process and concluded that small pulse frequency , high current, and scanning speed lead to increased mark intensity. Some people have explored this area through Bessel curves . And a connected Fermat spiral area filling algorithm (CFS)  has also been proposed, but its study has not been deeply applied to laser marking technology and cannot be applied for complex graphics . Our research aims to fill this gap in the laser marking path generation algorithm.
To fill this gap, in order to fill this gap, we explore the laser marking path generation algorithm from the perspective of improving the efficiency of laser marking path generation, combining computer graphics  principles with the length of the laser marking path and the time of the generation algorithm as the main factors. Firstly, we propose two-path generation methods, namely direction-parallel hatching and contour-parallel hatching. Parallel directional shaded lines, also called “zigzag” shaded lines, have paths that move along line segments parallel to the initially selected reference direction. The two marking path forms are shown in Figure 1. Based on this strategy, connected paths are obtained by connecting these parallel line segments so that they either all cross from right to left (or left to right) or alternate between left to right and right to left. In contrast, contour-parallel shading uses offset line [17, 18] segments based on boundary curves as smooth shading paths similar to boundary curves. Thus, contour-parallel shadows can be generated in a spiral fashion along a curve at a constant distance from the curve boundary. Later, the domain partition intersection algorithm and boundary curve offset algorithm are proposed for both methods and verified the feasibility and generation efficiency of both algorithms by computer simulation .
In exploring the problem of laser marking path generation, we proposed the zigzag parallel and contour parallel  filling path approaches and used interpolation methods  to fit the original pattern at a high level to enhance the marking pattern.
Usually, the first function in an M-file is the main function, which can be followed by any number of subfunctions. The main function can be called by other functions outside that file, and the main function is called by the filename of the M file where the function is stored.
M files can include multiple functions, and functions other than the main function are called subfunctions. Subfunctions can only be called by the main function or by other subfunctions within that file. Each subfunction begins with a function definition statement and continues until the definition of the next function or the end of the file. The subfunctions appear in any order, but the main function must appear first.
2.1. Original Graph Curve Fitting
2.1.1. Definition of Curve Fitting
The spline curve  S(x) is a segmentally defined equation. Given (n + 1) data points and a total of n intervals, the cubic spline equation satisfies the following conditions:(A)In each segment interval [xi, xi + 1] (i = 0, 1, …, n − 1, x increasing), S(x) = Si(x) is a cubic polynomial(B)The following relationship is satisfied:(C)S(x), the derivative , and the second-order derivative are all continuous in the interval [a, b], that is, the S(x) curve is smooth. So n cubic polynomial segments can be written aswhere i = 0, 1, …, n−1, and ai, bi, ci, di represent the 4n unknown coefficients.
2.1.2. Request a Solution
Interpolation and continuity:where i = 0, 1, …, n − 1.
Differential continuity:where i = 0, 1, …, n − 2.
Differential equation of a spline curve:
Bring the following step size h into the conditions of the spline curve:
Thus, we can deduce
We assume that
Thus, we can deduce the following result:
It is equivalent to the following equation.
Thus, the following formula is derived as
We substitute ci, di intowe can derive the formula:
From the range of values of i, there are (n − 1) equations but (n + 1) unknowns m. To solve the system of equations, two additional equations are required. So some restrictions need to be placed on the differentiation of the two endpoints x0 and xn. Here, we use not-a-knot  to solve the problem.
Specify the cubic differential matching of the spline curve.
After that we can derive the following conclusions:
The new coefficient matrix of the system of equations can be written as
2.2. Introduction to Matlab Functions
The polyshape function  creates a polygon defined by two-dimensional vertices and returns an object with attributes describing its vertices, solid regions, and holes.
The polybuffer function implements the creation of a buffer around a point, line, or polyshape object. Its boundary will be input to the polyshape object buffer polyin a distance d. For positive values of d, the solid area boundary polyin expands by unit d and the hole boundary shrinks by unit d. The negative values of d shrink the solid boundary and expand the hole boundary.
The Intersect function is the intersection of a polyshape object. It can return the intersection of a closed curve and a line, and determine which parts of the line are inside and outside the closed curve.
2.3. Boundary Curve Offset Based on Contour Parallel Path
Decompose the original figure into n simple figures, denote the centroid  of each simple figure, GI represents the center point of each simple graph and the Si represents the area of each simple figure, yielding the central point coordinates of the original graph as
Thus, the maximum distance from any point (X, Y) on the road strength to the center of the path is obtained as:
For the contour parallel line hatching problem, we use the buffer function polybuffer for computer simulation.
Returns a polyshape object with a boundary that creates a buffer at distance d based on the input polyshape object polyin. For positive values of d, the solid area boundary of polyin is expanded by d units and the hole boundary is shrunk by d units. Negative values of d shrink the solid boundary and expand the hole boundary.
2.4. Domain-Distinct Intersection Algorithm for Self-Intersecting Graphs Based on Zigzag Parallel Paths
For the serrated parallel path, we propose a regionalized closed curve  and a straight-line intersection algorithm. Firstly the original graph is regionalized according to the concave and convex points. The original graphics and the zoning graphics are shown in Figures 2 and 3 respectively. Afterwards, using a straight line y = a from the top of the closed graph to the bottom in 1 mm steps in order to scan , using the intersect function to find the coordinates of the entry, and then according to the previous cycle can always find the coordinates of the intersection point of the line with the original graph each time y = a.
According to the above division, the region will be divided into many small blocks of all data points, each small block with an array to store the first (from left to right) of the intersection of the line, and then an array to store the second, because it is a sawtooth arrangement, so it must be the first from a small block to point to the second, and so on, the intersection of each small block will be the first from the small block of coordinates to point to the second coordinates.
The X and Y values of the coordinates of the intersection point, the next in each array position relationship will be the X and Y values of the coordinates of the intersection point of the next line and the intersection point of the line at the coordinates of the intersection point of that previous line and the graph. The scan intersection is shown in Figure 4.
We conducted two simulation experiments on the designed contour parallel path boundary offset algorithm using Matlab software. The first simulation experiment was set to the inner shrinkage boundary distance of 1 mm and the hatch line spacing of 1 mm, and the second simulation experiment was set to the inner shrinkage boundary  distance of 0.1 mm and the hatch line spacing of 0.1 mm. Under these two sets of parameters, the total length of the hatching lines of the serrated parallel and contour parallel hatching curves were calculated, and the number of horizontal lines of the serrated parallel hatching and the number of circles of the contour parallel hatching were also calculated. The average running time (in ms) was calculated based on multiple runs of the hatching program, and the running time ratio of the program runs under different conditions was also calculated. The simulation results for the two parameters are shown in Figures 4 and 5, respectively.
3.1. Simulation of Boundary Curve Offset Algorithm Based on Contour Parallel Path
3.1.1. Algorithm Analysis Results
We have performed an accurate analysis of the running time  of this algorithm and have derived the number of function calls and the time during the operation of the algorithm by running it several times. The results are shown in Tables 1 and 2.
3.1.2. Analysis Results
According to the simulation experiment results, we counted the running time, the number of laps of the path, and the total length of the path for each simulation experiment, respectively. The results are shown in Table 3.
3.2. Simulation Results of Domain Partitioning Algorithm Based on Sawtooth Parallel Paths without Self-Intersecting Graphs
3.2.1. Simulation Results
We generate the marking path according to the area division as follows. Figures 6 to 11 show each of the five areas of the division. The final results are shown in Figures 12 and 13, respectively.
3.2.2. Analysis of Domain Partitioning Intersection Algorithm Based on Sawtooth Parallel Paths
For this algorithm, we conducted two sets of simulation experiments with different parameters and performed statistical analysis on the number of calls and time of each function in the operation of the algorithm, and the following results are obtained in Tables 4 and 5, respectively.
3.2.3. Zigzag Parallel Path Analysis
We statistically analyze the average running time, path length, and number of path entries of the zigzag parallel path algorithm, and the following results are obtained in Tables 6.
4. Discussion and Conclusion
Through the simulation solution, we can know that the average operation time of the zigzag parallel pattern filling and contour parallel pattern filling algorithms is 1 mm and 0.1 mm. After the fitting algorithm in this paper, we can get a nearly parallel straight line, while the contour pattern can be filled in parallel. The K value of the fitting function of the algorithm is close to 10, that is, under the same magnification, the zigzag algorithm can approach the previous value in time.
The algorithm in this paper can establish the length of two paths, that is, the distance that the laser sweeps through the whole closed figure, and the two paths are not very different .
However, the results of the simulation marking pattern can be seen, the simulation pattern based on the marking algorithm of the contour parallel path is more accurate, and the simulation pattern obtained by the marking algorithm of the sawtooth parallel path algorithm is relatively rough. Of course, this is also related to the design of our algorithm, and we believe that the accuracy of the serrated parallel path marking will be improved after the algorithm is continuously iterated and optimized.
The datasets for this study can be found in the (official website of APMCM) (https://www.apmcm.org/detail/2403).
Conflicts of Interest
The authors declare that there are no conflicts of interest.
G. L. and Y. L. contributed to the conceptualization of the study; G. L., Y. L., and X. Y. contributed to the methodology; G. L. created the software; Y. L. and X. Y. validated the software; X. Y., C. J., and J. Y. contributed to formal analysis; G. L. contributed to the investigation; Y. L. helped to collect the resources; X. Y. contributed to data curation; G. L. prepared the draft for writing—original the study; G. L. and J. Y. contributed to writing—review and editing the study; Y. L. contributed to visualization; J. Y. contributed to supervision; Y. L. and C. J. contributed to project administration; Y. L contributed to funding acquisition. All authors have read and agreed to the published version of the manuscript.
The authors sincerely thank the editors and reviewers for their efforts. The authors sincerely thank Geng Xiaoyang for laying the foundation for our achievement. The authors are grateful to Yifan Liu for his help in making it possible for me to submit this paper.
R. D. Haun, “Laser applications,” IEEE Spectrum, vol. 5, no. 5, pp. 82–92, 1968.View at: Publisher Site | Google Scholar
E. A. Zakharenko, E. I. Pryakhin, V. V. Romanov, and N. N. Shchedrina, “Development of the technology of 0NBC code formation on a metal surface by laser marking,” Journal of Physics: Conference Series, vol. 1753, no. 1, Article ID 012003, 2021.View at: Publisher Site | Google Scholar
V. J. Logeeswaran, M.-L. Chan, Y. Bayam et al., “Ultra-smooth metal surfaces generated by pressure-induced surface deformation of thin metal films,” Applied Physics A, vol. 87, no. 2, pp. 187–192, 2007.View at: Publisher Site | Google Scholar
H.-C. Kim, S.-g. Lee, and M.-Y. Yang, “An optimized contour parallel tool path for 2D milling with flat endmill,” International Journal of Advanced Manufacturing Technology, vol. 31, no. 5-6, pp. 567–573, 2006.View at: Publisher Site | Google Scholar
K. F. A. Hussein, S. A. Mehdi, and S. A. Hussein, “Image Encryption based on parallel algorithm via zigzag Manner with a new Chaotic system,” Journal of Southwest Jiaotong University, vol. 54, no. 4, 2019.View at: Publisher Site | Google Scholar
H. Abdullah, R. Ramli, and D. A. Wahab, “Tool path length optimisation of contour parallel milling based on modified ant colony optimisation,” International Journal of Advanced Manufacturing Technology, vol. 92, no. 1-4, pp. 1263–1276, 2017.View at: Publisher Site | Google Scholar
M. Sheng, M. Zhou, and Y. Yang, “Design and implementation of laser marking machine control system,” Journal of Physics: Conference Series, vol. 1738, no. 1, Article ID 012128, 2021.View at: Publisher Site | Google Scholar
S. Vasanth and T. Muthuramalingam, “Multi Criteria Decision making of Power Diode based process parameters in laser beam machining using Taguchi dear methodology,” in Proceedings of the ATINER’S Conference Paper Series, Athens, Greece, May 2018.View at: Google Scholar
M. Priyadarshini, P. P. Tripathy, D. Mishra, and S. Panda, “Multi characteristics optimization of laser drilling process parameter using fuzzy-topsis method,” Materials Today: Proceedings, vol. 4, no. 8, pp. 8538–8547, 2017.View at: Publisher Site | Google Scholar
A. Çalık, “A novel Pythagorean fuzzy AHP and fuzzy TOPSIS methodology for green supplier selection in the Industry 4.0 era,” Soft Computing, vol. 25, no. 3, pp. 2253–2265, 2021.View at: Publisher Site | Google Scholar
A. K. Mauraya, D. Mahana, P. Tyagi et al., “Structural and ultraviolet photo-detection properties of laser molecular beam epitaxy grown GaN layers using solid GaN and liquid Ga targets,” Physica Scripta, vol. 96, no. 8, Article ID 085801, 2021.View at: Publisher Site | Google Scholar
A. Bandari, “Beam engineering strategies reduce heat accumulation effects in high power, ultrashort pulse laser machining,” Scilight, vol. 2020, no. 36, Article ID 361107, 2020.View at: Google Scholar
A. W. Lohmann, J. Ojeda-Castañeda, and A. Serrano-Heredia, “Bessel functions: parallel display and processing,” Optics letters, vol. 19, no. 1, p. 55, 1994.View at: Publisher Site | Google Scholar
Y. Zhang, H. Li, T. Wang, B. Liu, and G. Wang, “A hybrid tool-path with no pause generation algorithm for 3D printing,” Journal of Physics: Conference Series, vol. 1754, no. 1, Article ID 012222, 2021.View at: Publisher Site | Google Scholar
J. Wang, L. Qin, and W. Xu, “Flexible and high precision thermal metasurface,” Communications Materials, vol. 2, no. 1, p. 89, 2021.View at: Google Scholar
S. Mukherjee, S. Mukherjee, D. P. Mukherjee et al., “Computer vision, graphics, and image processing,” in Proceedings of the ICVGIP 2016 Satellite Workshops, WCVA, DAR, and MedImage, Springer Cham, Guwahati, India, December 2016, Lecture Notes in Computer Science.View at: Google Scholar
H. Luo, J. Luo, R. Li, and M. Yu, “Optimization algorithm design of laser marking contour Extraction and graphics hatching based on image processing technology,” Journal of Physics: Conference Series, vol. 2173, no. 1, Article ID 012078, 2022.View at: Publisher Site | Google Scholar
H. C. Kim, S. G. Lee, and M.-Y. Yang, “A new offset algorithm for closed 2D lines with Islands,” Transactions of the Korean Society of Mechanical Engineers A, vol. 30, no. 2, pp. 141–148, 2006.View at: Publisher Site | Google Scholar
L. Xia, Y. Hu, W. Chen, and X. Li, “Spot pattern separation in multi-beam laser pointing using a neural network,” Optics and Lasers in Engineering, vol. 140, 2021.View at: Google Scholar
X. Yang, “Filling algorithm of polygons and Embedded polygons,” Journal of Physics: Conference Series, vol. 1827, no. 1, p. 012144, 2021.View at: Publisher Site | Google Scholar
T. Briand and P. Monasse, “Theory and Practice of image B-spline interpolation,” Image Processing On Line, vol. 8, pp. 99–141, 2018.View at: Publisher Site | Google Scholar
G. Pham, S.-H. Lee, and K.-R. Kwon, “Interpolating spline curve-based Perceptual Encryption for 3D printing models,” Applied Sciences, vol. 8, no. 2, p. 242, 2018.View at: Publisher Site | Google Scholar
I. A. Blatov, A. I. Zadorin, and E. V. Kitaeva, “Cubic spline interpolation of functions with high gradients in boundary layers,” Computational Mathematics and Mathematical Physics, vol. 57, no. 1, pp. 7–25, 2017.View at: Publisher Site | Google Scholar
I. Hanhan and M. D. Sangid, “ModLayer: a matlab GUI Drawing Segmentation tool for visualizing and Classifying 3D data,” Integrating Materials and Manufacturing Innovation, vol. 8, no. 4, pp. 468–475, 2019.View at: Publisher Site | Google Scholar
A. Hadir, K. Zine-dine, M. Bakhouya, and A. I. Technologies, “Applications. Improvements of centroid Localization algorithm for Wireless Sensor Networks,” in Proceedings of the 2020 5th International Conference on Cloud Computing and Artificial Intelligence: Technologies and Applications (CloudTech), pp. 1–6, IEEE, Marrakesh, Morocco, November 2020.View at: Publisher Site | Google Scholar
Y. Yang, H. T. Loh, J. Y. H. Fuh, and Y. G. Wang, “Equidistant path generation for improving scanning efficiency in layered manufacturing,” Rapid Prototyping Journal, vol. 8, no. 1, pp. 30–37, 2002.View at: Publisher Site | Google Scholar
I. A. A. Al-Rawi, “Implementation of an efficient scan-line polygon fill algorithm,” Computer Engineering and Intelligent Systems, vol. 5, pp. 22–28, 2014.View at: Google Scholar
K. W. F. Wan, F. C. Xia, and H. Tu, “An interfere coincidence processing algorithm for two-dimensional curve offset,” in Proceedings of the The 2nd International Conference on Information Science and Engineering, pp. 4362–4365, IEEE, Hangzhou, China, December 2010.View at: Publisher Site | Google Scholar
P. Tirado and O. Valero, “The average running time of an algorithm as a midpoint between fuzzy sets,” Mathematical and Computer Modelling, vol. 49, no. 9-10, pp. 1852–1868, 2009.View at: Publisher Site | Google Scholar
A. Tharwat, M. Elhoseny, A. E. Hassanien, T. Gabel, and A. Kumar, “Intelligent Bézier curve-based path planning model using Chaotic Particle Swarm Optimization algorithm,” Cluster Computing, vol. 22, no. S2, pp. 4745–4766, 2018.View at: Publisher Site | Google Scholar