Movatterモバイル変換


[0]ホーム

URL:


CN113793352B - Laser filling method and device for single-layer outline pattern based on contour lines - Google Patents

Laser filling method and device for single-layer outline pattern based on contour lines
Download PDF

Info

Publication number
CN113793352B
CN113793352BCN202111166070.0ACN202111166070ACN113793352BCN 113793352 BCN113793352 BCN 113793352BCN 202111166070 ACN202111166070 ACN 202111166070ACN 113793352 BCN113793352 BCN 113793352B
Authority
CN
China
Prior art keywords
grid
filled
pattern
shortest path
contour
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202111166070.0A
Other languages
Chinese (zh)
Other versions
CN113793352A (en
Inventor
周鋆
王敏
杨昊
张伟康
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
National University of Defense Technology
Original Assignee
National University of Defense Technology
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by National University of Defense TechnologyfiledCriticalNational University of Defense Technology
Priority to CN202111166070.0ApriorityCriticalpatent/CN113793352B/en
Publication of CN113793352ApublicationCriticalpatent/CN113793352A/en
Application grantedgrantedCritical
Publication of CN113793352BpublicationCriticalpatent/CN113793352B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Images

Classifications

Landscapes

Abstract

The application relates to a laser filling method, a laser filling device, computer equipment and a storage medium of a single-layer contour pattern based on contour lines. The method comprises the following steps: performing outer contour inner offset operation on the pattern to be filled according to an equidistant offset algorithm to obtain a contour offset pattern; performing grid method environment modeling on the outline bias pattern to obtain a preprocessed grid pattern; constructing a shortest path problem set aiming at the grid pattern; and solving the shortest path problem set by using an A-algorithm to obtain an optimal filling path of the grid pattern. The method can improve the laser filling efficiency of the pattern.

Description

Translated fromChinese
基于等高线的单层轮廓图案的激光填充方法及装置Laser filling method and device for single-layer contour pattern based on contour line

技术领域Technical Field

本申请涉及数据处理领域,特别是涉及一种基于等高线的单层轮廓图案的激光填充方法、装置、计算机设备和存储介质。The present application relates to the field of data processing, and in particular to a laser filling method, device, computer equipment and storage medium for a single-layer contour pattern based on contour lines.

背景技术Background Art

近年来,随着激光器性能和可靠性的提高,加上计算机技术的飞速发展和光学器件的进步,激光打标技术发展非常迅速,随着计算机和电子技术的发展,目前,激光打标技术与计算机技术相结合可以修改计算机中标签的内容,进而被广泛应用于图案填充领域。In recent years, with the improvement of laser performance and reliability, coupled with the rapid development of computer technology and the advancement of optical devices, laser marking technology has developed very rapidly. With the development of computer and electronic technology, at present, laser marking technology combined with computer technology can modify the content of labels in the computer, and then is widely used in the field of pattern filling.

然而,目前的激光填充技术与计算机技术相结合进行图案填充时,存在效率低下、准确性低、浪费激光能量资源等问题。However, when the current laser filling technology is combined with computer technology for pattern filling, there are problems such as low efficiency, low accuracy, and waste of laser energy resources.

发明内容Summary of the invention

基于此,有必要针对上述技术问题,提供一种能够提高图案的激光填充效率的基于等高线的单层轮廓图案的激光填充方法、装置、计算机设备和存储介质。Based on this, it is necessary to provide a laser filling method, device, computer equipment and storage medium for a single-layer contour pattern based on contour lines that can improve the laser filling efficiency of the pattern in order to address the above technical problems.

一种基于等高线的单层轮廓图案的激光填充方法,所述方法包括:A laser filling method for a single-layer contour pattern based on contour lines, the method comprising:

获取用于进行轮廓填充的坐标点数据集,根据坐标点数据集,在预设坐标系中得到单层散点图;Obtaining a coordinate point data set for contour filling, and obtaining a single-layer scatter plot in a preset coordinate system according to the coordinate point data set;

根据散点图,逐个连接散点得到待填充图案;According to the scatter plot, the scattered points are connected one by one to obtain the pattern to be filled;

根据等距偏置算法,对待填充图案进行外轮廓内偏移操作,得到轮廓偏置图案;According to the equidistant offset algorithm, the outer contour inner offset operation is performed on the fill pattern to obtain the contour offset pattern;

对轮廓偏置图案进行网格法环境建模,得到预处理后的网格图案;Performing grid method environment modeling on the contour offset pattern to obtain a preprocessed grid pattern;

针对网格图案,设置每个网格和轮廓偏置图案之间距离的阈值,根据阈值和网格图案,得到待填充网格集;待填充网格集包含多个待填充网格;For the grid pattern, a threshold value of the distance between each grid and the contour offset pattern is set, and a grid set to be filled is obtained according to the threshold value and the grid pattern; the grid set to be filled includes multiple grids to be filled;

根据待填充网格集内部的最短路径规划问题,构建最短路径问题集合;According to the shortest path planning problem inside the grid set to be filled, a shortest path problem set is constructed;

利用A*算法对最短路径问题集合进行求解,得到待填充网格集的最优填充路径;根据待填充网格集的最优填充路径,得到网格图案的最优填充路径。The A* algorithm is used to solve the shortest path problem set to obtain the optimal filling path of the grid set to be filled; based on the optimal filling path of the grid set to be filled, the optimal filling path of the grid pattern is obtained.

在其中一个实施例中,根据等距偏置算法,对待填充图案进行外轮廓内偏移操作,得到轮廓偏置图案,包括:采用等距偏置算法对待填充图案中的不规则的外轮廓进行分割,得到轮廓线段;根据轮廓线段和预先设置的偏移距离,将轮廓线段的平行线进行偏移,得到偏移平行线;将轮廓线段与偏移平行线进行相交,得到轮廓偏置图案。In one of the embodiments, an outer contour inner offset operation is performed on a pattern to be filled according to an equidistant offset algorithm to obtain a contour offset pattern, including: using an equidistant offset algorithm to segment an irregular outer contour in the pattern to be filled to obtain contour line segments; according to the contour line segments and a preset offset distance, the parallel lines of the contour line segments are offset to obtain offset parallel lines; and the contour line segments are intersected with the offset parallel lines to obtain a contour offset pattern.

在其中一个实施例中,对轮廓偏置图案进行网格法环境建模,得到预处理后的网格图案,包括:获取轮廓偏置图案中所有坐标点组成的偏置坐标点集为A{(x1,y1).....(xi,yi)},其中,(xi,yi)表示偏置坐标点集中第i个坐标点;在进行激光填充前,对偏置坐标点集中坐标点进行赋值,得到预处理后的网格图案;其中,对偏置坐标点集中坐标点进行赋值为:In one embodiment, a grid method environment modeling is performed on a contour offset pattern to obtain a preprocessed grid pattern, including: obtaining a bias coordinate point set consisting of all coordinate points in the contour offset pattern as A{(x1 , y1 ).....(xi ,yi )}, wherein (xi ,yi ) represents the i-th coordinate point in the bias coordinate point set; before laser filling, assigning values to the coordinate points in the bias coordinate point set to obtain a preprocessed grid pattern; wherein the coordinate points in the bias coordinate point set are assigned values as:

Figure BDA0003291303450000021
Figure BDA0003291303450000021

ocup(xi,yi)=1表示激光可以到达的区域,ocup(xi,yi)=0表示激光不可以到达的区域。ocup(xi ,yi ) = 1 indicates an area that the laser can reach, and ocup(xi ,yi ) = 0 indicates an area that the laser cannot reach.

在其中一个实施例中,根据所述阈值和所述网格图案,得到待填充网格集,包括:从所述网格图案中提取与所述网格图案的轮廓之间的距离不大于所述阈值的所有网格,得到待填充网格集。In one of the embodiments, obtaining a set of grids to be filled based on the threshold and the grid pattern includes: extracting from the grid pattern all grids whose distances to the contour of the grid pattern are not greater than the threshold to obtain the set of grids to be filled.

在其中一个实施例中,根据所述待填充网格集内部的最短路径规划问题,构建最短路径问题集合,包括:从根据待填充网格集中提取第一待填充网格;将第一待填充网格分为第一左半边网格集合和第一右半边网格集合,以第一待填充网格的最内层网格的最高点为第一起点,以第一待填充网格的最内层网格的最低点为第一终点,遍历第一左半边网格集合,得到第一起点和第一终点之间的第一左半边最短路径,遍历第一右半边网格集合,得到第一起点和第一终点之间的第一右半边最短路径;根据第一左半边最短路径和第一右半边最短路径,得到第一待填充网格的最短路径规划问题;In one of the embodiments, according to the shortest path planning problem within the set of grids to be filled, a set of shortest path problems is constructed, including: extracting a first grid to be filled from the set of grids to be filled; dividing the first grid to be filled into a first left half grid set and a first right half grid set, taking the highest point of the innermost grid of the first grid to be filled as the first starting point, taking the lowest point of the innermost grid of the first grid to be filled as the first end point, traversing the first left half grid set to obtain the first left half shortest path between the first starting point and the first end point, traversing the first right half grid set to obtain the first right half shortest path between the first starting point and the first end point; according to the first left half shortest path and the first right half shortest path, obtaining the shortest path planning problem of the first grid to be filled;

将第一左半边最短路径和第一右半边最短路径连接得到第一路径轮廓;从网格图案中提取与第一路径轮廓之间的距离不大于阈值的所有网格,得到第二待填充网格;将第二待填充网格分为第二左半边网格集合和第二右半边网格集合,以第二待填充网格的最内层网格的最高点为第二起点,以第二待填充网格的最内层网格的最低点为第二终点,遍历第二左半边网格集合,得到第二起点和第二终点之间的第二左半边最短路径,遍历第二右半边网格集合,得到第二起点和第二终点之间的第二右半边最短路径;根据第二左半边最短路径和第二右半边最短路径,得到第二待填充网格的最短路径规划问题;The first left half shortest path and the first right half shortest path are connected to obtain a first path outline; all grids whose distances from the first path outline are not greater than a threshold are extracted from the grid pattern to obtain a second grid to be filled; the second grid to be filled is divided into a second left half grid set and a second right half grid set, the highest point of the innermost grid of the second grid to be filled is taken as the second starting point, the lowest point of the innermost grid of the second grid to be filled is taken as the second end point, the second left half grid set is traversed to obtain the second left half shortest path between the second starting point and the second end point, the second right half grid set is traversed to obtain the second right half shortest path between the second starting point and the second end point; according to the second left half shortest path and the second right half shortest path, the shortest path planning problem of the second grid to be filled is obtained;

直至待填充网格集内最内层的最高点和最内层的最低点之间的距离小于阈值的两倍;根据待填充网格集内部的最短路径规划问题,构建最短路径问题集合。Until the distance between the highest point in the innermost layer and the lowest point in the innermost layer in the grid set to be filled is less than twice the threshold; according to the shortest path planning problem inside the grid set to be filled, a shortest path problem set is constructed.

在其中一个实施例中,利用A*算法对最短路径问题集合进行求解,得到待填充网格集的最优填充路径,包括:根据最短路径问题集合,构建A*算法的评价函数;通过评价函数对待填充网格中的点的位置进行评价,得到待填充网格中的最佳位置;根据最佳位置,得到待填充网格的最优填充路径;根据待填充网格的最优填充路径,得到待填充网格集的最优填充路径。In one of the embodiments, an A* algorithm is used to solve a set of shortest path problems to obtain an optimal filling path for a set of grids to be filled, including: constructing an evaluation function of the A* algorithm based on the set of shortest path problems; evaluating the positions of points in the grid to be filled by the evaluation function to obtain the optimal positions in the grid to be filled; obtaining an optimal filling path for the grid to be filled based on the optimal positions; and obtaining an optimal filling path for the set of grids to be filled based on the optimal filling path for the grid to be filled.

一种基于等高线的单层轮廓图案的激光填充装置,所述装置包括:A laser filling device for a single-layer contour pattern based on contour lines, the device comprising:

获取待填充图案模块,用于获取用于进行轮廓填充的坐标点数据集,根据坐标点数据集,在预设坐标系中得到单层散点图;根据散点图,逐个连接散点得到待填充图案;A module for obtaining a pattern to be filled is used to obtain a coordinate point data set for contour filling, and obtain a single-layer scatter plot in a preset coordinate system according to the coordinate point data set; and according to the scatter plot, the scatter points are connected one by one to obtain a pattern to be filled;

轮廓偏置模块,用于根据等距偏置算法,对待填充图案进行外轮廓内偏移操作,得到轮廓偏置图案;A contour offset module is used to perform an outer contour inner offset operation on a pattern to be filled according to an equidistant offset algorithm to obtain a contour offset pattern;

网格法环境建模模块,用于对轮廓偏置图案进行网格法环境建模,得到预处理后的网格图案;A grid method environment modeling module is used to perform grid method environment modeling on the contour offset pattern to obtain a preprocessed grid pattern;

构建最短路径问题集合模块,用于针对网格图案,设置每个网络和轮廓偏置图案之间距离的阈值,根据阈值和网格图案,得到待填充网格集;待填充网格集包含多个待填充网格;根据待填充网格集内部的最短路径规划问题,构建最短路径问题集合;A shortest path problem set building module is used to set a threshold value of the distance between each network and the contour offset pattern for the grid pattern, and obtain a grid set to be filled according to the threshold value and the grid pattern; the grid set to be filled includes multiple grids to be filled; and a shortest path problem set is built according to the shortest path planning problem within the grid set to be filled;

最短路径问题集合求解模块,用于利用A*算法对最短路径问题集合进行求解,得到待填充网格集的最优填充路径;根据待填充网格集的最优填充路径,得到网格图案的最优填充路径。The shortest path problem set solving module is used to solve the shortest path problem set using the A* algorithm to obtain the optimal filling path of the grid set to be filled; based on the optimal filling path of the grid set to be filled, the optimal filling path of the grid pattern is obtained.

一种计算机设备,包括存储器和处理器,所述存储器存储有计算机程序,所述处理器执行所述计算机程序时实现以下步骤:A computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

获取用于进行轮廓填充的坐标点数据集,根据坐标点数据集,在预设坐标系中得到单层散点图;Obtaining a coordinate point data set for contour filling, and obtaining a single-layer scatter plot in a preset coordinate system according to the coordinate point data set;

根据散点图,逐个连接散点得到待填充图案;According to the scatter plot, the scattered points are connected one by one to obtain the pattern to be filled;

根据等距偏置算法,对待填充图案进行外轮廓内偏移操作,得到轮廓偏置图案;According to the equidistant offset algorithm, the outer contour inner offset operation is performed on the fill pattern to obtain the contour offset pattern;

对轮廓偏置图案进行网格法环境建模,得到预处理后的网格图案;Performing grid method environment modeling on the contour offset pattern to obtain a preprocessed grid pattern;

针对网格图案,设置每个网格和轮廓偏置图案之间距离的阈值,根据阈值和网格图案,得到待填充网格集;待填充网格集包含多个待填充网格;For the grid pattern, a threshold value of the distance between each grid and the contour offset pattern is set, and a grid set to be filled is obtained according to the threshold value and the grid pattern; the grid set to be filled includes multiple grids to be filled;

根据待填充网格集内部的最短路径规划问题,构建最短路径问题集合;According to the shortest path planning problem inside the grid set to be filled, a shortest path problem set is constructed;

利用A*算法对最短路径问题集合进行求解,得到待填充网格集的最优填充路径;根据待填充网格集的最优填充路径,得到网格图案的最优填充路径。The A* algorithm is used to solve the shortest path problem set to obtain the optimal filling path of the grid set to be filled; based on the optimal filling path of the grid set to be filled, the optimal filling path of the grid pattern is obtained.

一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现以下步骤:A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the following steps:

获取用于进行轮廓填充的坐标点数据集,根据坐标点数据集,在预设坐标系中得到单层散点图;Obtaining a coordinate point data set for contour filling, and obtaining a single-layer scatter plot in a preset coordinate system according to the coordinate point data set;

根据散点图,逐个连接散点得到待填充图案;According to the scatter plot, the scattered points are connected one by one to obtain the pattern to be filled;

根据等距偏置算法,对待填充图案进行外轮廓内偏移操作,得到轮廓偏置图案;According to the equidistant offset algorithm, the outer contour inner offset operation is performed on the pattern to be filled to obtain the contour offset pattern;

对轮廓偏置图案进行网格法环境建模,得到预处理后的网格图案;Performing grid method environment modeling on the contour offset pattern to obtain a preprocessed grid pattern;

针对网格图案,设置每个网格和轮廓偏置图案之间距离的阈值,根据阈值和网格图案,得到待填充网格集;待填充网格集包含多个待填充网格;For the grid pattern, a threshold value of the distance between each grid and the contour offset pattern is set, and a grid set to be filled is obtained according to the threshold value and the grid pattern; the grid set to be filled includes multiple grids to be filled;

根据待填充网格集内部的最短路径规划问题,构建最短路径问题集合;According to the shortest path planning problem inside the grid set to be filled, a shortest path problem set is constructed;

利用A*算法对最短路径问题集合进行求解,得到待填充网格集的最优填充路径;根据待填充网格集的最优填充路径,得到网格图案的最优填充路径。The A* algorithm is used to solve the shortest path problem set to obtain the optimal filling path of the grid set to be filled; based on the optimal filling path of the grid set to be filled, the optimal filling path of the grid pattern is obtained.

上述基于等高线的单层轮廓图案的激光填充方法、装置、计算机设备和存储介质,首先获取用于进行轮廓填充的坐标点数据集,根据坐标点数据集,在预设坐标系中得到单层散点图;根据散点图,逐个连接散点得到待填充图案,使得该待填充图案为闭合曲线,根据等距偏置算法,对待填充图案进行外轮廓内偏移操作,得到轮廓偏置图案;通过外轮廓内偏移操作使得待填充图案的边界距离可以满足激光填充的要求,保证了图案外轮廓的几何特征,对轮廓偏置图案进行网格法环境建模,得到预处理后的网格图案;合理的环境可以减少路径规划的搜索量,降低空间和时间成本;针对网格图案,设置每个网格和轮廓偏置图案之间距离的阈值,根据阈值和网格图案,得到待填充网格集;根据待填充网格集内部的最短路径规划问题,构建最短路径问题集合;利用A*算法对最短路径问题集合进行求解,得到待填充网格集的最优填充路径;根据待填充网格集的最优填充路径,得到网格图案的最优填充路径,根据网格图案的最优填充路径进行激光填充时可以快速并且准确的完成图案的填充,提高图案的激光填充效率。The above-mentioned laser filling method, device, computer equipment and storage medium of a single-layer contour pattern based on contour lines first obtain a coordinate point data set for contour filling, and obtain a single-layer scatter plot in a preset coordinate system according to the coordinate point data set; according to the scatter plot, the scattered points are connected one by one to obtain a pattern to be filled, so that the pattern to be filled is a closed curve, and according to the equidistant offset algorithm, an outer contour inner offset operation is performed on the pattern to be filled to obtain a contour offset pattern; the outer contour inner offset operation is performed so that the boundary distance of the pattern to be filled can meet the requirements of laser filling, thereby ensuring the geometric characteristics of the outer contour of the pattern, and the contour offset pattern is modeled by a grid method environment to obtain a preprocessed grid Pattern; a reasonable environment can reduce the search volume of path planning and reduce space and time costs; for the grid pattern, a threshold value of the distance between each grid and the contour offset pattern is set, and a set of grids to be filled is obtained according to the threshold value and the grid pattern; according to the shortest path planning problem within the grid set to be filled, a set of shortest path problems is constructed; the A* algorithm is used to solve the shortest path problem set to obtain the optimal filling path of the grid set to be filled; according to the optimal filling path of the grid set to be filled, the optimal filling path of the grid pattern is obtained, and when laser filling is performed according to the optimal filling path of the grid pattern, the pattern can be filled quickly and accurately, thereby improving the laser filling efficiency of the pattern.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

图1为一个实施例中基于等高线的单层轮廓图案的激光填充方法的流程示意图;FIG1 is a schematic flow chart of a method for laser filling a single-layer contour pattern based on contour lines in one embodiment;

图2为一个实施例中轮廓偏置的过程示意图;FIG2 is a schematic diagram of a process of contour offset in one embodiment;

图3为一个实施例中最短路径规划问题的路径搜索的过程示意图;FIG3 is a schematic diagram of a process of path search for a shortest path planning problem in one embodiment;

图4为一个实施例中“等高线”轮廓平行填充单层轮廓图案的结果的示意图;FIG4 is a schematic diagram of the result of a “contour line” profile parallel filling of a single-layer profile pattern in one embodiment;

图5为一个实施例中基于等高线的单层轮廓图案的激光填充装置的结构框图;FIG5 is a structural block diagram of a laser filling device for a single-layer contour pattern based on contour lines in one embodiment;

图6为一个实施例中计算机设备的内部结构图。FIG. 6 is a diagram showing the internal structure of a computer device in one embodiment.

具体实施方式DETAILED DESCRIPTION

为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

在一个实施例中,如图1所示,提供了一种基于等高线的单层轮廓图案的激光填充方法,包括以下步骤:In one embodiment, as shown in FIG1 , a laser filling method for a single-layer contour pattern based on contour lines is provided, comprising the following steps:

步骤102,获取用于进行轮廓填充的坐标点数据集,根据坐标点数据集,在预设坐标系中得到单层散点图;根据散点图,逐个连接散点得到待填充图案。Step 102, obtaining a coordinate point data set for contour filling, obtaining a single-layer scatter plot in a preset coordinate system according to the coordinate point data set; and obtaining a pattern to be filled by connecting the scattered points one by one according to the scatter plot.

在预设的坐标系中标记坐标点数据集,使得该坐标点数据集成为单层散点图,图案填充必须是闭合曲线多边形,在本步骤中逐个连接散点以形成闭合曲线,得到待填充图案。The coordinate point data set is marked in a preset coordinate system so that the coordinate point data set becomes a single-layer scatter plot. The pattern filling must be a closed curve polygon. In this step, the scattered points are connected one by one to form a closed curve to obtain the pattern to be filled.

步骤104,根据等距偏置算法,对待填充图案进行外轮廓内偏移操作,得到轮廓偏置图案。Step 104 , according to the equidistant offset algorithm, an outer contour inner offset operation is performed on the pattern to be filled to obtain a contour offset pattern.

等距偏置算法是基于极限的思想将不规则的外轮廓分割成轮廓线段,要求每条轮廓线段的平行线内部偏移固定距离,然后与偏移平行线相交得到新的等距轮廓。该方法能有效保证模型外轮廓的几何特征。轮廓偏移实际上是区域轮廓线沿不同方向的平行偏移。在进行图案填充时对轮廓边界距离有一定的要求,在对待填充图案进行外轮廓内偏移操作后,使得到的轮廓偏置图案可以进行激光填充。The equidistant offset algorithm divides the irregular outer contour into contour segments based on the idea of limit, and requires the parallel lines of each contour segment to be offset internally by a fixed distance, and then intersect with the offset parallel lines to obtain a new equidistant contour. This method can effectively ensure the geometric characteristics of the model's outer contour. Contour offset is actually the parallel offset of the regional contour line in different directions. When performing pattern filling, there are certain requirements for the contour boundary distance. After the outer contour of the pattern to be filled is offset internally, the obtained contour offset pattern can be laser filled.

步骤106,对轮廓偏置图案进行网格法环境建模,得到预处理后的网格图案。Step 106 , performing grid method environment modeling on the contour offset pattern to obtain a preprocessed grid pattern.

环境建模是对运动目标活动空间的有效描述,是障碍物和轮廓的有效表示。只有合理的环境表示才能减少规划中的搜索量。具体来说,网格图模型就是用一定的数学模型来表示激光器的工作区域。地图栅格化是将激光执行舱口扫描任务的区域划分为一系列相同大小的栅格正方形结构。可以准确定位光栅坐标系的位置,便于环境建模和算法规划。本申请研究的激光具有良好的指向性,可以集中成小光点。将激光形成的小光斑近似为一个小网格,并进一步选择合适的网格尺寸,利用网格法进行环境建模,降低了激光填充时空间和时间成本。Environmental modeling is an effective description of the activity space of moving targets and an effective representation of obstacles and contours. Only a reasonable environmental representation can reduce the amount of search in planning. Specifically, the grid map model uses a certain mathematical model to represent the working area of the laser. Map rasterization is to divide the area where the laser performs the hatch scanning task into a series of grid square structures of the same size. The position of the grating coordinate system can be accurately located, which is convenient for environmental modeling and algorithm planning. The laser studied in this application has good directivity and can be concentrated into small light spots. The small light spot formed by the laser is approximated as a small grid, and the appropriate grid size is further selected. The grid method is used for environmental modeling, which reduces the space and time costs of laser filling.

步骤108,针对网格图案,设置每个网络和轮廓偏置图案之间距离的阈值,根据阈值和网格图案,得到待填充网格集;待填充网格集包含多个待填充网格;根据待填充网格集内部的最短路径规划问题,构建最短路径问题集合;Step 108, for the grid pattern, a threshold value of the distance between each network and the contour offset pattern is set, and a grid set to be filled is obtained according to the threshold value and the grid pattern; the grid set to be filled includes multiple grids to be filled; and a shortest path problem set is constructed according to the shortest path planning problem within the grid set to be filled;

每个网格和轮廓偏置图案之间距离是指网格图案的网格与网格图案的轮廓之间的距离,设置距离的阈值可以将网格图案中需要进行激光填充的部分分离出来形成多个待填充网格,对每个待填充网格进行路径规划,找到最短路径,完整的网格图案的遍历路径规划可以分为多个待填充网格的路径规划,多个待填充网格的路径规划按照一定的顺序构成完整的网格图案的遍历路径规划。The distance between each grid and the contour offset pattern refers to the distance between the grid of the grid pattern and the contour of the grid pattern. Setting the distance threshold can separate the part of the grid pattern that needs to be laser filled to form multiple grids to be filled. Path planning is performed for each grid to be filled to find the shortest path. The traversal path planning of the complete grid pattern can be divided into the path planning of multiple grids to be filled. The path planning of multiple grids to be filled constitutes the traversal path planning of the complete grid pattern in a certain order.

步骤110,利用A*算法对最短路径问题集合进行求解,得到待填充网格集的最优填充路径;根据待填充网格集的最优填充路径,得到网格图案的最优填充路径。Step 110, using the A* algorithm to solve the shortest path problem set to obtain the optimal filling path of the grid set to be filled; according to the optimal filling path of the grid set to be filled, the optimal filling path of the grid pattern is obtained.

A*算法是一种启发式算法,通过设置评价函数对网格的每个节点进行综合评价。每个节点都是机器人到达的位置,对每个位置点进行智能评估,找到最佳位置,最终找到目标位置。通过A*算法对最短路径问题集合进行求解,可以找到待填充网格集的最优填充路径。The A* algorithm is a heuristic algorithm that comprehensively evaluates each node of the grid by setting an evaluation function. Each node is the location reached by the robot. Each location point is intelligently evaluated to find the best location and finally the target location. By solving the shortest path problem set through the A* algorithm, the optimal filling path of the grid set to be filled can be found.

上述基于等高线的单层轮廓图案的激光填充方法、装置、计算机设备和存储介质,首先获取用于进行轮廓填充的坐标点数据集,根据坐标点数据集,在预设坐标系中得到单层散点图;根据散点图,逐个连接散点得到待填充图案,使得该待填充图案为闭合曲线,根据等距偏置算法,对待填充图案进行外轮廓内偏移操作,得到轮廓偏置图案;通过外轮廓内偏移操作使得待填充图案的边界距离可以满足激光填充的要求,保证了图案外轮廓的几何特征,对轮廓偏置图案进行网格法环境建模,得到预处理后的网格图案;合理的环境可以减少路径规划的搜索量,降低空间和时间成本;针对网格图案,设置每个网格和轮廓偏置图案之间距离的阈值,根据阈值和网格图案,得到待填充网格集;根据待填充网格集内部的最短路径规划问题,构建最短路径问题集合;利用A*算法对最短路径问题集合进行求解,得到待填充网格集的最优填充路径;根据待填充网格集的最优填充路径,得到网格图案的最优填充路径,根据网格图案的最优填充路径进行激光填充时可以快速并且准确的完成图案的填充,提高图案的激光填充效率。The above-mentioned laser filling method, device, computer equipment and storage medium of a single-layer contour pattern based on contour lines first obtain a coordinate point data set for contour filling, and obtain a single-layer scatter plot in a preset coordinate system according to the coordinate point data set; according to the scatter plot, the scattered points are connected one by one to obtain a pattern to be filled, so that the pattern to be filled is a closed curve, and according to the equidistant offset algorithm, an outer contour inner offset operation is performed on the pattern to be filled to obtain a contour offset pattern; the outer contour inner offset operation is performed so that the boundary distance of the pattern to be filled can meet the requirements of laser filling, thereby ensuring the geometric characteristics of the outer contour of the pattern, and the contour offset pattern is modeled by a grid method environment to obtain a preprocessed grid Pattern; a reasonable environment can reduce the search volume of path planning and reduce space and time costs; for the grid pattern, a threshold value of the distance between each grid and the contour offset pattern is set, and a set of grids to be filled is obtained according to the threshold value and the grid pattern; according to the shortest path planning problem within the grid set to be filled, a set of shortest path problems is constructed; the A* algorithm is used to solve the shortest path problem set to obtain the optimal filling path of the grid set to be filled; according to the optimal filling path of the grid set to be filled, the optimal filling path of the grid pattern is obtained, and when laser filling is performed according to the optimal filling path of the grid pattern, the pattern can be filled quickly and accurately, thereby improving the laser filling efficiency of the pattern.

在其中一个实施例中,根据等距偏置算法,对待填充图案进行外轮廓内偏移操作,得到轮廓偏置图案,包括:采用等距偏置算法对待填充图案中的不规则的外轮廓进行分割,得到轮廓线段;根据轮廓线段和预先设置的偏移距离,将轮廓线段的平行线进行偏移,得到偏移平行线;将轮廓线段与偏移平行线进行相交,得到轮廓偏置图案。In one of the embodiments, an outer contour inner offset operation is performed on a pattern to be filled according to an equidistant offset algorithm to obtain a contour offset pattern, including: using an equidistant offset algorithm to segment an irregular outer contour in the pattern to be filled to obtain contour line segments; according to the contour line segments and a preset offset distance, the parallel lines of the contour line segments are offset to obtain offset parallel lines; and the contour line segments are intersected with the offset parallel lines to obtain a contour offset pattern.

外轮廓内偏移过程如下:假设轮廓线可以被分成无数个相交的线段。在偏置过程中,可以取任意两条线段来观察偏置过程。如图2所示,将Q1Q2和Q1Q2向内偏置距离d,得到两条与原线段平行的线。其中Q1Q2和Q1Q2为待填充图案中的任意两条段。The process of offsetting the outer contour inward is as follows: Assume that the contour line can be divided into countless intersecting line segments. During the offset process, any two line segments can be taken to observe the offset process. As shown in Figure 2, Q1 Q2 and Q1 Q2 are offset inward by a distance d to obtain two lines parallel to the original line segments. Among them, Q1 Q2 and Q1 Q2 are any two segments in the pattern to be filled.

设置任意两条段的七个点的坐标为Q1(x1,y1),Q2(x2,y2),Q3(x3,y3),Q1′(x1′,y1′),Q2′(x2′,y2′),Q3′(x3′,y3′),Q″1(x″1,y″1)。Set the coordinates of the seven points of any two segments toQ1 (x1 ,y1 ),Q2 (x2 ,y2 ),Q3 (x3 ,y3 ),Q1 ′(x1 ′,y1′), Q2′(x2′,y2),Q3 ′(x3 ′,y3 ′), Q″1 (x″1 ,y″1 ).

根据平行的条件,可以得到下式(1):According to the parallel conditions, the following formula (1) can be obtained:

Figure BDA0003291303450000081
Figure BDA0003291303450000081

将坐标带入(1)式中,得到:Substituting the coordinates into formula (1), we obtain:

Figure BDA0003291303450000082
Figure BDA0003291303450000082

根据式(2),可以算出Q2′(x2′,y2′),类似地,可以算出Q1′(x1′,y1′),故得到了偏置后的线段Q1′Q′2。用同样的方式,算出Q″1(x″1,y″1)和Q3′(x3′,y3′),相应的得到了偏置后的线段Q″1Q3′。According to formula (2), Q2 ′(x2 ′, y2 ′) can be calculated. Similarly, Q1 ′(x1 ′, y1 ′) can be calculated, so the offset line segment Q1 ′Q′2 is obtained. In the same way, Q″1 (x″1 , y″1 ) and Q3 ′(x3 ′, y3 ′) are calculated, and the offset line segment Q″1 Q3 ′ is obtained accordingly.

根据上面的公式求线段两端的端点,下一步求偏置后直线的交点。Use the above formula to find the endpoints of the line segment, and the next step is to find the intersection of the offset straight lines.

设了轮廓偏置之后,新的直线Q1′Q′2方程为After setting the contour offset, the equation of the new straight line Q1 ′Q′2 is

Figure BDA0003291303450000083
Figure BDA0003291303450000083

其中,

Figure BDA0003291303450000084
k表示直线Q1′Q′2方程的系数,L1表示直线Q1′Q′2;in,
Figure BDA0003291303450000084
k represents the coefficient of the equation of the straight line Q1 ′Q′2 , L1 represents the straight line Q1 ′Q′2 ;

将某一点坐标代入直线方程可得:

Figure BDA0003291303450000085
b表示直线Q1′Q′2方程的常数;Substituting the coordinates of a point into the equation of the line gives:
Figure BDA0003291303450000085
b represents the constant of the equation of the straight line Q1 ′Q′2 ;

偏置后的直线Q1′Q′2方程如下:The equation of the offset straight line Q1 ′Q ′2 is as follows:

Figure BDA0003291303450000091
Figure BDA0003291303450000091

同理可得到直线Q″1Q3′的方程:Similarly, we can get the equation of the straight line Q″1 Q3 ′:

Figure BDA0003291303450000092
Figure BDA0003291303450000092

其中,L2表示直线Q″1Q3′;Wherein, L2 represents the straight line Q″1 Q3 ′;

根据两条新轮廓偏置的方程,求出交点坐标。同样,对于一条光滑的轮廓线,可以进行多次分割,通过该方法找到相交的偏置线的交点,并将得到的交点按照顺序连接起来,得到轮廓偏置的曲线,根据轮廓偏置的曲线,得到轮廓偏置图案。According to the equations of the two new contour offsets, the coordinates of the intersection are calculated. Similarly, for a smooth contour line, multiple segmentation can be performed. Through this method, the intersection of the intersecting offset lines is found, and the obtained intersections are connected in sequence to obtain the contour offset curve. According to the contour offset curve, the contour offset pattern is obtained.

在其中一个实施例中,对轮廓偏置图案进行网格法环境建模,得到预处理后的网格图案,包括:获取轮廓偏置图案中所有坐标点组成的偏置坐标点集为A{(x1,y1).....(xi,yi)},其中,(xi,yi)表示偏置坐标点集中第i个坐标点;在进行激光填充前,对偏置坐标点集中坐标点进行赋值,得到预处理后的网格图案;其中,对偏置坐标点集中坐标点进行赋值为:In one embodiment, a grid method environment modeling is performed on a contour offset pattern to obtain a preprocessed grid pattern, including: obtaining a bias coordinate point set consisting of all coordinate points in the contour offset pattern as A{(x1 , y1 ).....(xi ,yi )}, wherein (xi ,yi ) represents the i-th coordinate point in the bias coordinate point set; before laser filling, assigning values to the coordinate points in the bias coordinate point set to obtain a preprocessed grid pattern; wherein the coordinate points in the bias coordinate point set are assigned values as:

Figure BDA0003291303450000093
Figure BDA0003291303450000093

ocup(xi,yi)=1表示激光可以到达的区域,ocup(xi,yi)=0表示激光不可以到达的区域。ocup(xi ,yi ) = 1 indicates an area that the laser can reach, and ocup(xi ,yi ) = 0 indicates an area that the laser cannot reach.

对轮廓偏置图案进行网格法环境建模可以减少后续最短路径规划的搜索量,降低空间和时间成本,提高图案进行激光填充的效率。Grid environment modeling of contour offset patterns can reduce the amount of search for subsequent shortest path planning, reduce space and time costs, and improve the efficiency of laser filling of patterns.

在其中一个实施例中,根据所述阈值和所述网格图案,得到待填充网格集,包括:从所述网格图案中提取与所述网格图案的轮廓之间的距离不大于所述阈值的所有网格,得到待填充网格集。In one of the embodiments, obtaining a set of grids to be filled based on the threshold and the grid pattern includes: extracting from the grid pattern all grids whose distances to the contour of the grid pattern are not greater than the threshold to obtain the set of grids to be filled.

在另一个实施例中,根据所述待填充网格集内部的最短路径规划问题,构建最短路径问题集合,包括:从根据待填充网格集中提取第一待填充网格;将第一待填充网格分为第一左半边网格集合和第一右半边网格集合,以第一待填充网格的最内层网格的最高点为第一起点,以第一待填充网格的最内层网格的最低点为第一终点,遍历第一左半边网格集合,得到第一起点和第一终点之间的第一左半边最短路径,遍历第一右半边网格集合,得到第一起点和第一终点之间的第一右半边最短路径;根据第一左半边最短路径和第一右半边最短路径,得到第一待填充网格的最短路径规划问题;In another embodiment, according to the shortest path planning problem within the set of grids to be filled, a set of shortest path problems is constructed, including: extracting a first grid to be filled from the set of grids to be filled; dividing the first grid to be filled into a first left half grid set and a first right half grid set, taking the highest point of the innermost grid of the first grid to be filled as the first starting point, taking the lowest point of the innermost grid of the first grid to be filled as the first end point, traversing the first left half grid set to obtain the first left half shortest path between the first starting point and the first end point, traversing the first right half grid set to obtain the first right half shortest path between the first starting point and the first end point; according to the first left half shortest path and the first right half shortest path, obtaining the shortest path planning problem of the first grid to be filled;

将第一左半边最短路径和第一右半边最短路径连接得到第一路径轮廓;从网格图案中提取与第一路径轮廓之间的距离不大于阈值的所有网格,得到第二待填充网格;将第二待填充网格分为第二左半边网格集合和第二右半边网格集合,以第二待填充网格的最内层网格的最高点为第二起点,以第二待填充网格的最内层网格的最低点为第二终点,遍历第二左半边网格集合,得到第二起点和第二终点之间的第二左半边最短路径,遍历第二右半边网格集合,得到第二起点和第二终点之间的第二右半边最短路径;根据第二左半边最短路径和第二右半边最短路径,得到第二待填充网格的最短路径规划问题;The first left half shortest path and the first right half shortest path are connected to obtain a first path outline; all grids whose distances from the first path outline are not greater than a threshold are extracted from the grid pattern to obtain a second grid to be filled; the second grid to be filled is divided into a second left half grid set and a second right half grid set, the highest point of the innermost grid of the second grid to be filled is taken as the second starting point, the lowest point of the innermost grid of the second grid to be filled is taken as the second end point, the second left half grid set is traversed to obtain the second left half shortest path between the second starting point and the second end point, the second right half grid set is traversed to obtain the second right half shortest path between the second starting point and the second end point; according to the second left half shortest path and the second right half shortest path, the shortest path planning problem of the second grid to be filled is obtained;

直至待填充网格集内最内层的最高点和最内层的最低点之间的距离小于阈值的两倍;根据待填充网格集内部的最短路径规划问题,构建最短路径问题集合。Until the distance between the highest point in the innermost layer and the lowest point in the innermost layer in the grid set to be filled is less than twice the threshold; according to the shortest path planning problem inside the grid set to be filled, a shortest path problem set is constructed.

应该理解的是,本实施例中的第一,第二是用来对限定的对象进行区分,并没有特定的含义,比如优先级和数量。It should be understood that the first and the second in this embodiment are used to distinguish limited objects and do not have specific meanings, such as priority and quantity.

构建最短路径问题集合的过程如图3所示,待填充网格的轮廓表示为Ω,预先设置网格与轮廓之间距离的阈值,将阈值表示为d,该阈值是轮廓偏置时的偏移距离。The process of constructing the shortest path problem set is shown in FIG3 . The contour of the grid to be filled is represented as Ω. The threshold of the distance between the grid and the contour is pre-set. The threshold is represented as d, which is the offset distance when the contour is biased.

步骤1:每个网格和轮廓Ω之间的距离为di,当di≤d时,选出符合该条件的网格为集合C,左半边网格集合为C1,右半边网格集合为C2,如图3(a)所示。Step 1: The distance between each grid and the contour Ω is di . When di ≤ d, the grids that meet the condition are selected as a set C. The left half grid set is C1 , and the right half grid set is C2 , as shown in FIG3( a ).

步骤2:以集合C最内层网格的最高点Pi为起点,以集合C最内层网格的最低点Pj为终点。遍历C1中所有的网格,找到Pi和Pj两点之间的最短路径,如图3(b)所示。Step 2: Take the highest pointPi of the innermost grid of set C as the starting point and the lowest pointPj of the innermost grid of set C as the end point. Traverse all grids inC1 and find the shortest path betweenPi andPj , as shown in Figure 3(b).

步骤3:以集合C最内层网格的最低点Pj为起点,以集合C最内层网格的最高点Pi为终点。遍历C2中所有的网格,找到Pi和Pj两点之间的最短路径,如图3(b)所示。Step 3: Take the lowest pointPj of the innermost grid of set C as the starting point and the highest pointPi of the innermost grid of set C as the end point. Traverse all grids inC2 and find the shortest path betweenPi andPj , as shown in Figure 3(b).

步骤4:将步骤2和步骤3中得到的最小路径形成轮廓Ωx,每个网格与轮廓Ωx之间的距离为dj。当dj≤d时,选出符合该条件的网格为集合D,左半边网格集合为D1,右半边网格集合为D2,如图3(c)所示。Step 4: The minimum paths obtained in steps 2 and 3 are used to form a contour Ωx , and the distance between each grid and the contour Ωx is dj . When dj ≤ d, the grids that meet this condition are selected as a set D, the left half grid set is D1 , and the right half grid set is D2 , as shown in Figure 3(c).

步骤5:以集合D最内层网格的最高点Pi+1为起点,以集合D最内层网格的最低点Pj+1为终点。遍历D1中所有的网格,找到Pi+1和Pj+1两点之间的最短路径,如图3(d)所示。Step 5: Take the highest pointPi+1 of the innermost grid of set D as the starting point and the lowest point Pj+1 of the innermost grid of set D as the end point. Traverse all grids inD1 and find the shortest path between Pi+1 and Pj+1 , as shown in Figure 3(d).

步骤6:以集合D最内层网格的最低点Pj+1为起点,以集合D最内层网格的最高点Pi+1为终点。遍历D2中所有的网格,找到Pi+1和Pj+1两点之间的最短路径,如图3(d)所示。Step 6: Take the lowest point Pj+1 of the innermost grid of set D as the starting point and the highest point Pi+1 of the innermost grid of set D as the end point. Traverse all grids in D2 and find the shortest path between points Pi+1 and Pj+1 , as shown in Figure 3(d).

步骤7:重复步骤2,3,4,5,6直到最内层的最高点Pi+n和最内层的最低点Pj+n的距离lPi+nPj+n≤2d。Step 7: Repeat steps 2, 3, 4, 5, and 6 until the distance between the highest pointPi+n of the innermost layer and the lowest point Pj+n of the innermost layer is lPi+nPj+ n≤2d.

根据上述步骤可以得到待填充网格的最短路径规划问题。According to the above steps, the shortest path planning problem of the grid to be filled can be obtained.

在其中一个实施例中,利用A*算法对最短路径问题集合进行求解,得到待填充网格集的最优填充路径,包括:根据最短路径问题集合,构建A*算法的评价函数;通过评价函数对待填充网格中的点的位置进行评价,得到待填充网格中的最佳位置;根据最佳位置,得到待填充网格的最优填充路径;根据待填充网格的最优填充路径,得到待填充网格集的最优填充路径。In one of the embodiments, an A* algorithm is used to solve a set of shortest path problems to obtain an optimal filling path for a set of grids to be filled, including: constructing an evaluation function of the A* algorithm based on the set of shortest path problems; evaluating the positions of points in the grid to be filled by the evaluation function to obtain the optimal positions in the grid to be filled; obtaining an optimal filling path for the grid to be filled based on the optimal positions; and obtaining an optimal filling path for the set of grids to be filled based on the optimal filling path for the grid to be filled.

A*算法的评价函数如下:The evaluation function of the A* algorithm is as follows:

F(n)=G(n)+H(n)F(n) =G(n) +H(n)

其中,F(n)总过程中的相交点的评价函数,表示从最高点到最低点的总估计成本,G(n)是从起始点到特定状态空间中的下一个点的实际开销,H(n)是起始点到达目标点所需开销的当前估计值。根据评价函数对待填充网格的所有点的评价结果,得到待填充网格的点的最佳位置,从该最佳位置出发对待填充网格进行最短路径规划,得到待填充网格的最优填充路径,根据待填充网格的最优填充路径,得到待填充网格集的最优填充路径,根据最优路径进行激光填充的结果如图4所示。Among them, F(n) is the evaluation function of the intersection points in the total process, which represents the total estimated cost from the highest point to the lowest point, G(n) is the actual cost from the starting point to the next point in a specific state space, and H(n) is the current estimated value of the cost required for the starting point to reach the target point. According to the evaluation results of all points of the grid to be filled by the evaluation function, the optimal position of the points of the grid to be filled is obtained, and the shortest path planning is performed on the grid to be filled from the optimal position to obtain the optimal filling path of the grid to be filled. According to the optimal filling path of the grid to be filled, the optimal filling path of the grid set to be filled is obtained. The result of laser filling according to the optimal path is shown in Figure 4.

应该理解的是,虽然图1的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,图1中的至少一部分步骤可以包括多个子步骤或者多个阶段,这些子步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些子步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤的子步骤或者阶段的至少一部分轮流或者交替地执行。It should be understood that, although the various steps in the flowchart of FIG. 1 are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in FIG. 1 may include a plurality of sub-steps or a plurality of stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these sub-steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.

在一个实施例中,如图5所示,提供了一种基于等高线的单层轮廓图案的激光填充装置,包括:获取待填充图案模块501、轮廓偏置模块502、网格法环境建模模块503、构建最短路径问题集合模块504和最短路径问题集合求解模块505,其中:In one embodiment, as shown in FIG5 , a laser filling device for a single-layer contour pattern based on contour lines is provided, comprising: amodule 501 for obtaining a pattern to be filled, a contour offsetmodule 502, a grid methodenvironment modeling module 503, amodule 504 for constructing a shortest path problem set, and amodule 505 for solving a shortest path problem set, wherein:

获取待填充图案模块501,用于获取用于进行轮廓填充的坐标点数据集,根据坐标点数据集,在预设坐标系中得到单层散点图;根据散点图,逐个连接散点得到待填充图案;Themodule 501 for obtaining the pattern to be filled is used to obtain a coordinate point data set for contour filling, obtain a single-layer scatter plot in a preset coordinate system according to the coordinate point data set, and obtain the pattern to be filled by connecting the scattered points one by one according to the scatter plot;

轮廓偏置模块502,用于根据等距偏置算法,对待填充图案进行外轮廓内偏移操作,得到轮廓偏置图案;The contour offsetmodule 502 is used to perform an outer contour inner offset operation on the pattern to be filled according to an equidistant offset algorithm to obtain a contour offset pattern;

网格法环境建模模块503,用于对轮廓偏置图案进行网格法环境建模,得到预处理后的网格图案;A grid methodenvironment modeling module 503 is used to perform grid method environment modeling on the contour offset pattern to obtain a pre-processed grid pattern;

构建最短路径问题集合模块504,用于针对网格图案,设置每个网络和轮廓偏置图案之间距离的阈值,根据阈值和网格图案,得到待填充网格集;待填充网格集包含多个待填充网格;根据待填充网格集内部的最短路径规划问题,构建最短路径问题集合;The shortest path problem setbuilding module 504 is used to set a threshold value of the distance between each network and the contour offset pattern for the grid pattern, and obtain a grid set to be filled according to the threshold value and the grid pattern; the grid set to be filled includes multiple grids to be filled; and a shortest path problem set is built according to the shortest path planning problem within the grid set to be filled;

最短路径问题集合求解模块505,用于利用A*算法对最短路径问题集合进行求解,得到待填充网格集的最优填充路径;根据待填充网格集的最优填充路径,得到网格图案的最优填充路径。The shortest path problem set solvingmodule 505 is used to solve the shortest path problem set using the A* algorithm to obtain the optimal filling path of the grid set to be filled; and obtain the optimal filling path of the grid pattern according to the optimal filling path of the grid set to be filled.

在其中一个实施例中,轮廓偏置模块502还用于采用等距偏置算法对待填充图案中的不规则的外轮廓进行分割,得到轮廓线段;根据轮廓线段和预先设置的偏移距离,将轮廓线段的平行线进行偏移,得到偏移平行线;将轮廓线段与偏移平行线进行相交,得到轮廓偏置图案。In one of the embodiments, the contour offsetmodule 502 is also used to use an equidistant offset algorithm to segment the irregular outer contour in the fill pattern to obtain contour line segments; according to the contour line segments and a preset offset distance, the parallel lines of the contour line segments are offset to obtain offset parallel lines; the contour line segments are intersected with the offset parallel lines to obtain a contour offset pattern.

在其中一个实施例中,网格法环境建模模块503还用于获取轮廓偏置图案中所有坐标点组成的偏置坐标点集为A{(x1,y1).....(xi,yi)},其中,(xi,yi)表示偏置坐标点集中第i个坐标点;在进行激光填充前,对偏置坐标点集中坐标点进行赋值,得到预处理后的网格图案;其中,对偏置坐标点集中坐标点进行赋值为:In one embodiment, the grid methodenvironment modeling module 503 is further used to obtain a biased coordinate point set consisting of all coordinate points in the contour bias pattern as A{(x1 , y1 ).....(xi ,yi )}, wherein (xi ,yi ) represents the i-th coordinate point in the biased coordinate point set; before laser filling, the coordinate points in the biased coordinate point set are assigned values to obtain a preprocessed grid pattern; wherein the coordinate points in the biased coordinate point set are assigned values as follows:

Figure BDA0003291303450000131
Figure BDA0003291303450000131

ocup(xi,yi)=1表示激光可以到达的区域,ocup(xi,yi)=0表示激光不可以到达的区域。ocup(xi ,yi ) = 1 indicates an area that the laser can reach, and ocup(xi ,yi ) = 0 indicates an area that the laser cannot reach.

在其中一个实施例中,构建最短路径问题集合模块504还用于从所述网格图案中提取与所述网格图案的轮廓之间的距离不大于所述阈值的所有网格,得到待填充网格集。In one embodiment, the shortest path problem setbuilding module 504 is further used to extract from the grid pattern all grids whose distances to the outline of the grid pattern are not greater than the threshold value, to obtain a grid set to be filled.

在其中一个实施例中,构建最短路径问题集合模块504还用于从根据待填充网格集中提取第一待填充网格;将第一待填充网格分为第一左半边网格集合和第一右半边网格集合,以第一待填充网格的最内层网格的最高点为第一起点,以第一待填充网格的最内层网格的最低点为第一终点,遍历第一左半边网格集合,得到第一起点和第一终点之间的第一左半边最短路径,遍历第一右半边网格集合,得到第一起点和第一终点之间的第一右半边最短路径;根据第一左半边最短路径和第一右半边最短路径,得到第一待填充网格的最短路径规划问题;In one embodiment, the shortest path problem setbuilding module 504 is further used to extract a first grid to be filled from the grid set to be filled; divide the first grid to be filled into a first left half grid set and a first right half grid set, take the highest point of the innermost grid of the first grid to be filled as the first starting point, take the lowest point of the innermost grid of the first grid to be filled as the first end point, traverse the first left half grid set to obtain the first left half shortest path between the first starting point and the first end point, traverse the first right half grid set to obtain the first right half shortest path between the first starting point and the first end point; obtain the shortest path planning problem of the first grid to be filled according to the first left half shortest path and the first right half shortest path;

将第一左半边最短路径和第一右半边最短路径连接得到第一路径轮廓;从网格图案中提取与第一路径轮廓之间的距离不大于阈值的所有网格,得到第二待填充网格;将第二待填充网格分为第二左半边网格集合和第二右半边网格集合,以第二待填充网格的最内层网格的最高点为第二起点,以第二待填充网格的最内层网格的最低点为第二终点,遍历第二左半边网格集合,得到第二起点和第二终点之间的第二左半边最短路径,遍历第二右半边网格集合,得到第二起点和第二终点之间的第二右半边最短路径;根据第二左半边最短路径和第二右半边最短路径,得到第二待填充网格的最短路径规划问题;The first left half shortest path and the first right half shortest path are connected to obtain a first path outline; all grids whose distances from the first path outline are not greater than a threshold are extracted from the grid pattern to obtain a second grid to be filled; the second grid to be filled is divided into a second left half grid set and a second right half grid set, the highest point of the innermost grid of the second grid to be filled is taken as the second starting point, the lowest point of the innermost grid of the second grid to be filled is taken as the second end point, the second left half grid set is traversed to obtain the second left half shortest path between the second starting point and the second end point, the second right half grid set is traversed to obtain the second right half shortest path between the second starting point and the second end point; according to the second left half shortest path and the second right half shortest path, the shortest path planning problem of the second grid to be filled is obtained;

直至待填充网格集内最内层的最高点和最内层的最低点之间的距离小于阈值的两倍;根据待填充网格集内部的最短路径规划问题,构建最短路径问题集合。Until the distance between the highest point in the innermost layer and the lowest point in the innermost layer in the grid set to be filled is less than twice the threshold; according to the shortest path planning problem inside the grid set to be filled, a shortest path problem set is constructed.

在其中一个实施例中,最短路径问题集合求解模块505还用于根据最短路径问题集合,构建A*算法的评价函数;通过评价函数对待填充网格中的点的位置进行评价,得到待填充网格中的最佳位置;根据最佳位置,得到待填充网格的最优填充路径;根据待填充网格的最优填充路径,得到待填充网格集的最优填充路径。In one embodiment, the shortest path problem set solvingmodule 505 is also used to construct an evaluation function of the A* algorithm based on the shortest path problem set; evaluate the position of the point in the grid to be filled by the evaluation function to obtain the optimal position in the grid to be filled; based on the optimal position, obtain the optimal filling path of the grid to be filled; based on the optimal filling path of the grid to be filled, obtain the optimal filling path of the grid set to be filled.

关于基于等高线的单层轮廓图案的激光填充装置的具体限定可以参见上文中对于基于等高线的单层轮廓图案的激光填充方法的限定,在此不再赘述。上述基于等高线的单层轮廓图案的激光填充装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。The specific definition of the laser filling device of the single-layer contour pattern based on the contour line can be found in the definition of the laser filling method of the single-layer contour pattern based on the contour line above, which will not be repeated here. Each module in the above-mentioned laser filling device of the single-layer contour pattern based on the contour line can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

在一个实施例中,提供了一种计算机设备,该计算机设备可以是终端,其内部结构图可以如图6所示。该计算机设备包括通过系统总线连接的处理器、存储器、网络接口、显示屏和输入装置。其中,该计算机设备的处理器用于提供计算和控制能力。该计算机设备的存储器包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作系统和计算机程序。该内存储器为非易失性存储介质中的操作系统和计算机程序的运行提供环境。该计算机设备的网络接口用于与外部的终端通过网络连接通信。该计算机程序被处理器执行时以实现一种基于等高线的单层轮廓图案的激光填充方法。该计算机设备的显示屏可以是液晶显示屏或者电子墨水显示屏,该计算机设备的输入装置可以是显示屏上覆盖的触摸层,也可以是计算机设备外壳上设置的按键、轨迹球或触控板,还可以是外接的键盘、触控板或鼠标等。In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be shown in FIG6. The computer device includes a processor, a memory, a network interface, a display screen, and an input device connected via a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a laser filling method of a single-layer contour pattern based on contour lines is implemented. The display screen of the computer device may be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device may be a touch layer covered on the display screen, or a key, trackball or touchpad provided on the housing of the computer device, or an external keyboard, touchpad or mouse, etc.

本领域技术人员可以理解,图6中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定,具体的计算机设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。Those skilled in the art will understand that the structure shown in FIG. 6 is merely a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.

在一个实施例中,提供了一种计算机设备,包括存储器和处理器,该存储器存储有计算机程序,该处理器执行计算机程序时实现上述实施例中方法的步骤。In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the method in the above embodiment when executing the computer program.

在一个实施例中,提供了一种计算机可读存储介质,其上存储有计算机程序,计算机程序被处理器执行时实现上述实施例中方法的步骤。In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method in the above embodiment are implemented.

本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一非易失性计算机可读取存储介质中,该计算机程序在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM)或者外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDRSDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)等。Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and/or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

以上实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims (4)

Translated fromChinese
1.一种基于等高线的单层轮廓图案的激光填充方法,其特征在于,所述方法包括:1. A laser filling method for a single-layer contour pattern based on contour lines, characterized in that the method comprises:获取用于进行轮廓填充的坐标点数据集,根据所述坐标点数据集,在预设坐标系中得到单层散点图;Acquire a coordinate point data set for contour filling, and obtain a single-layer scatter plot in a preset coordinate system according to the coordinate point data set;根据所述散点图,逐个连接散点得到待填充图案;According to the scatter diagram, connecting the scattered points one by one to obtain a pattern to be filled;根据等距偏置算法,对所述待填充图案进行外轮廓内偏移操作,得到轮廓偏置图案;According to the equidistant offset algorithm, an outer contour inner offset operation is performed on the pattern to be filled to obtain a contour offset pattern;对所述轮廓偏置图案进行网格法环境建模,得到预处理后的网格图案;Performing grid method environment modeling on the contour offset pattern to obtain a preprocessed grid pattern;针对所述网格图案,设置每个网格和所述轮廓偏置图案之间距离的阈值,根据所述阈值和所述网格图案,得到待填充网格集;所述待填充网格集包含多个待填充网格;For the grid pattern, a threshold value of the distance between each grid and the contour offset pattern is set, and a grid set to be filled is obtained according to the threshold value and the grid pattern; the grid set to be filled includes a plurality of grids to be filled;根据所述待填充网格集内部的最短路径规划问题,构建最短路径问题集合;Constructing a shortest path problem set according to the shortest path planning problem within the grid set to be filled;利用A*算法对所述最短路径问题集合进行求解,得到所述待填充网格集的最优填充路径;根据所述待填充网格集的最优填充路径,得到所述网格图案的最优填充路径;Solving the shortest path problem set using the A* algorithm to obtain an optimal filling path for the set of grids to be filled; obtaining an optimal filling path for the grid pattern based on the optimal filling path for the set of grids to be filled;根据等距偏置算法,对所述待填充图案进行外轮廓内偏移操作,得到轮廓偏置图案,包括:According to the equidistant offset algorithm, the outer contour inner offset operation is performed on the pattern to be filled to obtain a contour offset pattern, including:采用等距偏置算法对所述待填充图案中的不规则的外轮廓进行分割,得到轮廓线段;Using an equidistant offset algorithm to segment the irregular outer contour of the pattern to be filled to obtain contour line segments;根据所述轮廓线段和预先设置的偏移距离,将所述轮廓线段的平行线进行偏移,得到偏移平行线;According to the contour line segment and a preset offset distance, the parallel lines of the contour line segment are offset to obtain offset parallel lines;将所述轮廓线段与所述偏移平行线进行相交,得到轮廓偏置图案;Intersecting the contour line segment with the offset parallel line to obtain a contour offset pattern;对所述轮廓偏置图案进行网格法环境建模,得到预处理后的网格图案,包括:Performing grid method environment modeling on the contour offset pattern to obtain a preprocessed grid pattern includes:获取所述轮廓偏置图案中所有坐标点组成的偏置坐标点集为
Figure QLYQS_1
,其中,
Figure QLYQS_2
表示偏置坐标点集中第i个坐标点;Obtain the offset coordinate point set consisting of all coordinate points in the contour offset pattern as
Figure QLYQS_1
,in,
Figure QLYQS_2
Represents the i-th coordinate point in the offset coordinate point set;在进行激光填充前,对所述偏置坐标点集中坐标点进行赋值,得到预处理后的网格图案;Before laser filling, assigning values to the coordinate points in the offset coordinate point set to obtain a preprocessed grid pattern;其中,对所述偏置坐标点集中坐标点进行赋值为:Wherein, the coordinate points in the offset coordinate point set are assigned as follows:
Figure QLYQS_3
Figure QLYQS_3
,
Figure QLYQS_4
表示激光能够到达的区域,
Figure QLYQS_5
表示激光不能够到达的区域;
Figure QLYQS_4
Indicates the area that the laser can reach.
Figure QLYQS_5
Indicates the area that the laser cannot reach;
根据所述阈值和所述网格图案,得到待填充网格集,包括:According to the threshold and the grid pattern, a grid set to be filled is obtained, including:从所述网格图案中提取与所述网格图案的轮廓之间的距离不大于所述阈值的所有网格,得到待填充网格集;Extracting from the grid pattern all grids whose distances from the outline of the grid pattern are not greater than the threshold value, to obtain a grid set to be filled;根据所述待填充网格集内部的最短路径规划问题,构建最短路径问题集合,包括:According to the shortest path planning problem within the grid set to be filled, a shortest path problem set is constructed, including:步骤1:从根据所述待填充网格集中提取第一待填充网格;将所述第一待填充网格分为第一左半边网格集合和第一右半边网格集合;Step 1: extracting a first grid to be filled from the grid set to be filled; dividing the first grid to be filled into a first left half grid set and a first right half grid set;步骤2:以所述第一待填充网格的最内层网格的最高点为第一起点,以所述第一待填充网格的最内层网格的最低点为第一终点,遍历所述第一左半边网格集合,得到所述第一起点和所述第一终点之间的第一左半边最短路径,遍历所述第一右半边网格集合,得到所述第一起点和所述第一终点之间的第一右半边最短路径;根据所述第一左半边最短路径和所述第一右半边最短路径,得到第一待填充网格的最短路径规划问题;Step 2: Taking the highest point of the innermost grid of the first grid to be filled as the first starting point and the lowest point of the innermost grid of the first grid to be filled as the first end point, traverse the first left half grid set to obtain the first left half shortest path between the first starting point and the first end point, and traverse the first right half grid set to obtain the first right half shortest path between the first starting point and the first end point; according to the first left half shortest path and the first right half shortest path, obtain the shortest path planning problem of the first grid to be filled;步骤3:将所述第一左半边最短路径和所述第一右半边最短路径连接得到第一路径轮廓;从所述网格图案中提取与所述第一路径轮廓之间的距离不大于所述阈值的所有网格,得到第二待填充网格;将所述第二待填充网格分为第二左半边网格集合和第二右半边网格集合,以所述第二待填充网格的最内层网格的最高点为第二起点,以所述第二待填充网格的最内层网格的最低点为第二终点,遍历所述第二左半边网格集合,得到所述第二起点和所述第二终点之间的第二左半边最短路径,遍历所述第二右半边网格集合,得到所述第二起点和所述第二终点之间的第二右半边最短路径;根据所述第二左半边最短路径和所述第二右半边最短路径,得到第二待填充网格的最短路径规划问题;Step 3: Connect the first left half shortest path and the first right half shortest path to obtain a first path outline; extract all grids whose distance from the first path outline is not greater than the threshold from the grid pattern to obtain a second grid to be filled; divide the second grid to be filled into a second left half grid set and a second right half grid set, take the highest point of the innermost grid of the second grid to be filled as the second starting point, take the lowest point of the innermost grid of the second grid to be filled as the second end point, traverse the second left half grid set to obtain the second left half shortest path between the second starting point and the second end point, traverse the second right half grid set to obtain the second right half shortest path between the second starting point and the second end point; according to the second left half shortest path and the second right half shortest path, obtain the shortest path planning problem of the second grid to be filled;重复步骤2和3,直至所述待填充网格集内最内层的最高点和最内层的最低点之间的距离小于所述阈值的两倍;Repeat steps 2 and 3 until the distance between the highest point in the innermost layer and the lowest point in the innermost layer in the grid set to be filled is less than twice the threshold;根据所述待填充网格集内部的最短路径规划问题,构建最短路径问题集合;Constructing a shortest path problem set according to the shortest path planning problem within the set of grids to be filled;利用A*算法对所述最短路径问题集合进行求解,得到所述待填充网格集的最优填充路径,包括:The A* algorithm is used to solve the shortest path problem set to obtain the optimal filling path of the grid set to be filled, including:根据所述最短路径问题集合,构建A*算法的评价函数;According to the shortest path problem set, construct an evaluation function of the A* algorithm;通过所述评价函数对所述待填充网格中的点的位置进行评价,得到待填充网格中的最佳位置;Evaluate the positions of the points in the grid to be filled by using the evaluation function to obtain the best position in the grid to be filled;根据所述最佳位置,得到所述待填充网格的最优填充路径;According to the optimal position, an optimal filling path of the grid to be filled is obtained;根据所述待填充网格的最优填充路径,得到所述待填充网格集的最优填充路径。According to the optimal filling path of the grids to be filled, an optimal filling path of the set of grids to be filled is obtained.2.一种基于等高线的单层轮廓图案的激光填充装置,其特征在于,所述装置包括:2. A laser filling device for a single-layer contour pattern based on contour lines, characterized in that the device comprises:获取待填充图案模块,用于获取用于进行轮廓填充的坐标点数据集,根据所述坐标点数据集,在预设坐标系中得到单层散点图;根据所述散点图,逐个连接散点得到待填充图案;A module for obtaining a pattern to be filled is used to obtain a coordinate point data set for contour filling, and obtain a single-layer scatter plot in a preset coordinate system according to the coordinate point data set; and obtain a pattern to be filled by connecting scattered points one by one according to the scatter plot;轮廓偏置模块,用于根据等距偏置算法,对所述待填充图案进行外轮廓内偏移操作,得到轮廓偏置图案;A contour offset module, used for performing an outer contour inner offset operation on the pattern to be filled according to an equidistant offset algorithm to obtain a contour offset pattern;网格法环境建模模块,用于对所述轮廓偏置图案进行网格法环境建模,得到预处理后的网格图案;A grid method environment modeling module is used to perform grid method environment modeling on the contour offset pattern to obtain a preprocessed grid pattern;构建最短路径问题集合模块,用于针对所述网格图案,设置每个网络和所述轮廓偏置图案之间距离的阈值,根据所述阈值和所述网格图案,得到待填充网格集;所述待填充网格集包含多个待填充网格;根据所述待填充网格集内部的最短路径规划问题,构建最短路径问题集合;A module for constructing a shortest path problem set is used to set a threshold value of the distance between each network and the contour offset pattern for the grid pattern, and obtain a grid set to be filled according to the threshold value and the grid pattern; the grid set to be filled includes a plurality of grids to be filled; and a shortest path problem set is constructed according to the shortest path planning problem within the grid set to be filled;最短路径问题集合求解模块,用于利用A*算法对所述最短路径问题集合进行求解,得到所述待填充网格集的最优填充路径;根据所述待填充网格集的最优填充路径,得到所述网格图案的最优填充路径;A shortest path problem set solving module, used to solve the shortest path problem set using an A* algorithm to obtain an optimal filling path for the grid set to be filled; and to obtain an optimal filling path for the grid pattern according to the optimal filling path for the grid set to be filled;轮廓偏置模块还用于根据等距偏置算法,对所述待填充图案进行外轮廓内偏移操作,得到轮廓偏置图案,包括:采用等距偏置算法对所述待填充图案中的不规则的外轮廓进行分割,得到轮廓线段;根据所述轮廓线段和预先设置的偏移距离,将所述轮廓线段的平行线进行偏移,得到偏移平行线;将所述轮廓线段与所述偏移平行线进行相交,得到轮廓偏置图案;The contour offset module is also used to perform an outer contour inner offset operation on the pattern to be filled according to the equidistant offset algorithm to obtain a contour offset pattern, including: using the equidistant offset algorithm to segment the irregular outer contour in the pattern to be filled to obtain contour segments; according to the contour segments and a preset offset distance, offsetting the parallel lines of the contour segments to obtain offset parallel lines; intersecting the contour segments with the offset parallel lines to obtain a contour offset pattern;网格法环境建模模块还用于对所述轮廓偏置图案进行网格法环境建模,得到预处理后的网格图案,包括:获取所述轮廓偏置图案中所有坐标点组成的偏置坐标点集为
Figure QLYQS_6
,其中,
Figure QLYQS_7
表示偏置坐标点集中第i个坐标点;在进行激光填充前,对所述偏置坐标点集中坐标点进行赋值,得到预处理后的网格图案;其中,对所述偏置坐标点集中坐标点进行赋值为:
The grid method environment modeling module is also used to perform grid method environment modeling on the contour offset pattern to obtain a preprocessed grid pattern, including: obtaining a bias coordinate point set composed of all coordinate points in the contour offset pattern as
Figure QLYQS_6
,in,
Figure QLYQS_7
represents the i-th coordinate point in the offset coordinate point set; before laser filling, the coordinate points in the offset coordinate point set are assigned values to obtain a preprocessed grid pattern; wherein the coordinate points in the offset coordinate point set are assigned values as follows:
Figure QLYQS_8
Figure QLYQS_8
,
Figure QLYQS_9
表示激光能够到达的区域,
Figure QLYQS_10
表示激光不能够到达的区域;
Figure QLYQS_9
Indicates the area that the laser can reach.
Figure QLYQS_10
Indicates the area that the laser cannot reach;
构建最短路径问题集合模块还用于从所述网格图案中提取与所述网格图案的轮廓之间的距离不大于所述阈值的所有网格,得到待填充网格集;The shortest path problem set building module is also used to extract from the grid pattern all grids whose distances to the outline of the grid pattern are not greater than the threshold value, to obtain a grid set to be filled;最短路径问题集合求解模块还用于利用A*算法对所述最短路径问题集合进行求解,得到所述待填充网格集的最优填充路径,包括:The shortest path problem set solving module is also used to solve the shortest path problem set using the A* algorithm to obtain the optimal filling path of the grid set to be filled, including:根据所述最短路径问题集合,构建A*算法的评价函数;According to the shortest path problem set, construct an evaluation function of the A* algorithm;通过所述评价函数对所述待填充网格中的点的位置进行评价,得到待填充网格中的最佳位置;Evaluate the positions of the points in the grid to be filled by using the evaluation function to obtain the best position in the grid to be filled;根据所述最佳位置,得到所述待填充网格的最优填充路径;According to the optimal position, an optimal filling path of the grid to be filled is obtained;根据所述待填充网格的最优填充路径,得到所述待填充网格集的最优填充路径;Obtaining an optimal filling path of the set of grids to be filled according to the optimal filling path of the grids to be filled;构建最短路径问题集合模块还用于步骤1:从根据所述待填充网格集中提取第一待填充网格;将所述第一待填充网格分为第一左半边网格集合和第一右半边网格集合;The module for constructing a shortest path problem set is also used for step 1: extracting a first grid to be filled from the grid set to be filled; dividing the first grid to be filled into a first left half grid set and a first right half grid set;步骤2:以所述第一待填充网格的最内层网格的最高点为第一起点,以所述第一待填充网格的最内层网格的最低点为第一终点,遍历所述第一左半边网格集合,得到所述第一起点和所述第一终点之间的第一左半边最短路径,遍历所述第一右半边网格集合,得到所述第一起点和所述第一终点之间的第一右半边最短路径;根据所述第一左半边最短路径和所述第一右半边最短路径,得到第一待填充网格的最短路径规划问题;Step 2: Taking the highest point of the innermost grid of the first grid to be filled as the first starting point and the lowest point of the innermost grid of the first grid to be filled as the first end point, traverse the first left half grid set to obtain the first left half shortest path between the first starting point and the first end point, and traverse the first right half grid set to obtain the first right half shortest path between the first starting point and the first end point; according to the first left half shortest path and the first right half shortest path, obtain the shortest path planning problem of the first grid to be filled;步骤3:将所述第一左半边最短路径和所述第一右半边最短路径连接得到第一路径轮廓;从所述网格图案中提取与所述第一路径轮廓之间的距离不大于所述阈值的所有网格,得到第二待填充网格;将所述第二待填充网格分为第二左半边网格集合和第二右半边网格集合,以所述第二待填充网格的最内层网格的最高点为第二起点,以所述第二待填充网格的最内层网格的最低点为第二终点,遍历所述第二左半边网格集合,得到所述第二起点和所述第二终点之间的第二左半边最短路径,遍历所述第二右半边网格集合,得到所述第二起点和所述第二终点之间的第二右半边最短路径;根据所述第二左半边最短路径和所述第二右半边最短路径,得到第二待填充网格的最短路径规划问题;Step 3: Connect the first left half shortest path and the first right half shortest path to obtain a first path outline; extract all grids whose distance from the first path outline is not greater than the threshold from the grid pattern to obtain a second grid to be filled; divide the second grid to be filled into a second left half grid set and a second right half grid set, take the highest point of the innermost grid of the second grid to be filled as the second starting point, take the lowest point of the innermost grid of the second grid to be filled as the second end point, traverse the second left half grid set to obtain the second left half shortest path between the second starting point and the second end point, traverse the second right half grid set to obtain the second right half shortest path between the second starting point and the second end point; obtain the shortest path planning problem of the second grid to be filled according to the second left half shortest path and the second right half shortest path;重复步骤2和3,直至所述待填充网格集内最内层的最高点和最内层的最低点之间的距离小于所述阈值的两倍;Repeat steps 2 and 3 until the distance between the highest point in the innermost layer and the lowest point in the innermost layer in the grid set to be filled is less than twice the threshold;根据所述待填充网格集内部的最短路径规划问题,构建最短路径问题集合。According to the shortest path planning problem within the set of grids to be filled, a shortest path problem set is constructed.
3.一种计算机设备,包括存储器和处理器,所述存储器存储有计算机程序,其特征在于,所述处理器执行所述计算机程序时实现权利要求1所述方法的步骤。3. A computer device comprising a memory and a processor, wherein the memory stores a computer program, and wherein the processor implements the steps of the method according to claim 1 when executing the computer program.4.一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现权利要求1所述的方法的步骤。4. A computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the steps of the method according to claim 1 are implemented.
CN202111166070.0A2021-09-302021-09-30Laser filling method and device for single-layer outline pattern based on contour linesActiveCN113793352B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202111166070.0ACN113793352B (en)2021-09-302021-09-30Laser filling method and device for single-layer outline pattern based on contour lines

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202111166070.0ACN113793352B (en)2021-09-302021-09-30Laser filling method and device for single-layer outline pattern based on contour lines

Publications (2)

Publication NumberPublication Date
CN113793352A CN113793352A (en)2021-12-14
CN113793352Btrue CN113793352B (en)2023-04-28

Family

ID=78877706

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202111166070.0AActiveCN113793352B (en)2021-09-302021-09-30Laser filling method and device for single-layer outline pattern based on contour lines

Country Status (1)

CountryLink
CN (1)CN113793352B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN108961359A (en)*2018-05-172018-12-07长沙八思量信息技术有限公司Laser marking system and its filling algorithm of closed figures, storage medium
CN112017262A (en)*2020-08-102020-12-01当家移动绿色互联网技术集团有限公司Pavement marker generation method and device, storage medium and electronic equipment
CN112731961A (en)*2020-12-082021-04-30深圳供电局有限公司Path planning method, device, equipment and storage medium
CN113096147A (en)*2021-04-082021-07-09中国人民解放军国防科技大学MATLAB-based automatic laser marking shadow generation method
CN113165408A (en)*2018-12-142021-07-23马克姆-伊马杰公司Method and apparatus for enabling patterns to be marked on a substrate

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN108961359A (en)*2018-05-172018-12-07长沙八思量信息技术有限公司Laser marking system and its filling algorithm of closed figures, storage medium
CN113165408A (en)*2018-12-142021-07-23马克姆-伊马杰公司Method and apparatus for enabling patterns to be marked on a substrate
CN112017262A (en)*2020-08-102020-12-01当家移动绿色互联网技术集团有限公司Pavement marker generation method and device, storage medium and electronic equipment
CN112731961A (en)*2020-12-082021-04-30深圳供电局有限公司Path planning method, device, equipment and storage medium
CN113096147A (en)*2021-04-082021-07-09中国人民解放军国防科技大学MATLAB-based automatic laser marking shadow generation method

Also Published As

Publication numberPublication date
CN113793352A (en)2021-12-14

Similar Documents

PublicationPublication DateTitle
CN113793351B (en)Laser filling method and device for multilayer outline pattern based on contour lines
CN113609815B (en) A circuit simulation optimization method, device, computer equipment and storage medium
CN110221600B (en)Path planning method and device, computer equipment and storage medium
CN112434448A (en)Proxy model constraint optimization method and device based on multipoint adding
CN110253579B (en)Robot positioning method, device, equipment and medium based on arc feature extraction
CN113085895B (en)Vehicle lane change track planning method, device, equipment, storage medium and vehicle
CN113793352B (en)Laser filling method and device for single-layer outline pattern based on contour lines
CN112287430A (en)Building wall generation method and device, computer equipment and storage medium
CN116523155A (en)Convex relaxation-based full-coverage path planning method
CN113894428A (en) Laser filling method and device for single-layer contour pattern based on zigzag
CN109448120B (en)Processing method and device for three-dimensional building model and computer equipment
CN113902755B (en)Laser filling method and device for zigzag-based multilayer outline pattern
CN112765871B (en) A parallel particle tracking method and device based on curve coordinates
CN112711012B (en)Global position initialization method and system of laser radar positioning system
CN110688695B (en) Method and device for generating ALC wall joints of light steel structure
CN109360215B (en)Method, device and equipment for searching outer contour of three-dimensional model and storage medium
CN104240232B (en)A kind of road damage inspection optimization method based on image procossing
CN112836263B (en)Axle network generation method and device, computer equipment and storage medium
CN110765509B (en)Method and device for generating main roof hole-opening reinforcing node
CN115249303A (en) Layout drawing method, device, equipment and storage medium based on drawing division
CN114612609A (en) Curved surface reflection line calculation method, device, computer equipment and storage medium
CN110704900B (en)Method for placing connection node between keel column model and wall keel model and product
CN110765513A (en)Method for placing connecting node of wall keel model and L-shaped top guide beam model and product
CN120045594B (en) A distance range connection query visualization method, device, equipment and medium
Trevelyan et al.Interactive re-analysis in mechanical design evolution. Part I. Background and implementation

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp