3D printing filling path planning method based on level set

文档序号:1839775 发布日期:2021-11-16 浏览:14次 中文

阅读说明:本技术 一种基于水平集的3d打印填充路径规划方法 (3D printing filling path planning method based on level set ) 是由 吴婷 张礼兵 于 2021-08-02 设计创作,主要内容包括:本发明公开了一种基于水平集的3D打印填充路径规划方法,其包括以下步骤:步骤一、导入三维模型,获取三维模型的各层切片轮廓,并对切片轮廓形成的封闭区域进行三角网格剖分;步骤二、根据打印物体填充路径的形状要求,构建填充路径隐函数F(x,y),并计算填充路径水平集曲线相对于填充路径隐函数的水平集高度;步骤三、获取在各个水平集高度下的填充路径水平集曲线的各点坐标;步骤四、根据三角剖分网格三角片的邻接拓扑关系,将水平集曲线上的各点连接成有序轮廓。本发明通过将填充路径图案映射为隐函数,利用水平集强大的拓扑变化处理能力提取出适合物体使用要求的复杂填充路径轮廓,不仅能够很好地处理填充路径的分裂和合并问题,而且可以避免仅依靠切片轮廓而进行的复杂几何计算,能够有效提高3D打印填充路径的多样性和灵活性。(The invention discloses a level set-based 3D printing filling path planning method, which comprises the following steps: step one, importing a three-dimensional model, obtaining slice outlines of all layers of the three-dimensional model, and performing triangulation on a closed area formed by the slice outlines; step two, constructing a filling path implicit function F (x, y) according to the shape requirement of a filling path of the printing object, and calculating the level set height of a filling path level set curve relative to the filling path implicit function; acquiring coordinates of each point of a filling path level set curve under each level set height; and step four, connecting points on the level set curve into an ordered contour according to the adjacent topological relation of the triangulation grid triangular plate. According to the invention, the filling path pattern is mapped into the implicit function, and the complex filling path outline which is suitable for the use requirement of the object is extracted by utilizing the strong topological change processing capability of the level set, so that the splitting and merging problems of the filling path can be well processed, the complex geometric calculation which is carried out only by relying on the slice outline can be avoided, and the diversity and flexibility of the 3D printing filling path can be effectively improved.)

1. A3D printing filling path planning method based on a level set is characterized in that: which comprises the following steps:

step one, importing a three-dimensional model, obtaining slice outlines of all layers of the three-dimensional model, and performing triangulation on a closed area formed by the slice outlines;

step two, constructing a filling path implicit function F (x, y) according to the shape requirement of a filling path of the printing object, and calculating the level set height of a filling path level set curve relative to the filling path implicit function;

acquiring coordinates of each point of a filling path level set curve under each level set height;

and fourthly, sequencing the points on the level set curve into an ordered contour path according to the adjacent topological relation of the triangulation grid triangular plate.

2. The level-set based 3D printing fill path planning method according to claim 1, wherein: the first step comprises the following steps:

1) importing a three-dimensional model, calculating the slice outlines of all layers of the three-dimensional model along the direction vertical to the Z axis, and acquiring a closed communication area constructed by the slice outlines of all layers;

2) for each closed communication region omega, nodes are arranged in the region omega and on the boundary according to a given step length, Delaunay triangulation is carried out by using the arranged nodes, and triangular plates outside the region omega are deleted;

3) and optimizing the nodes in the triangulation to obtain the final triangulation Mesh.

3. The level-set-based 3D printing fill path planning method according to claim 2, wherein: in step 3), the optimization method replaces the original node with the coordinate mean value of the adjacent node of any node, and the iterative formula is as follows:

wherein Q isjIs QiS is the number of adjacent nodes.

4. The level-set based 3D printing fill path planning method according to claim 1, wherein: the second step comprises the following steps:

1) constructing a filling path implicit function F (x, y) according to the filling path shape requirement of the object;

2) substituting the x and y coordinates of each node in the triangulation Mesh into the hidden function of the filling path, taking the obtained function value as the z coordinate of the node, and further converting the triangulation Mesh into a three-dimensional Mesh3Then obtaining a three-dimensional Mesh3Maximum value z of z-coordinate of node(s) in (2)maxAnd minimum value zmin

3) Calculate per fill path level set curve Ci={(x,y)|F(x,y)=LiLevel set height relative to fill-path implicit function F (x, y):

Li=zmin+(i-1)d,i=1,2,…,N

wherein N ═ zmax-zmin) And d is the number of the filling path level set curves, and d is the filling path interval.

5. The level-set based 3D printing fill path planning method according to claim 1, wherein: the third step comprises the following steps:

1) sequentially traversing three-dimensional Mesh3The vertex coordinate size of each triangular plate in the table records the existence of a horizontal set point v ∈ CiThe triangular plate of (1);

2) subdividing the recorded triangular plate, updating the z coordinate of the subdivided vertex by using a filling path implicit function F (x, y), then continuously judging the size of the vertex coordinate, and continuously subdividing until the side length of the triangular plate is less than a given threshold value;

3) calculating the level set point on each subdivision triangular plate by using a binary search method to obtain a filling path level set curve CiAll level set points set above:

wherein, every two horizontal set points in the set V belong to the same triangle, and m is the total number of the triangle with the horizontal set points.

6. The level-set based 3D printing fill path planning method according to claim 5, wherein: in step 1), the rule for judging the existence of the horizontal set point on the triangle sheet is as follows: for two vertices P of any one triangle1(x1,y1,z1),P2(x2,y2,z2) If (z)1-Li)*(z2-Li) When the ratio is less than or equal to 0, the side P is1P2Upper existence of a level set curve C belonging to the fill pathiPoint v above, satisfies v ∈ Ci

7. The level-set based 3D printing fill path planning method according to claim 1, wherein: the fourth step comprises the following steps:

1) mapping the topological adjacency relation between every two nodes in the level set point set V into an edge set E, forming an undirected graph G by the level set point set V and the edge set E, simplifying the nodes V and the edges E in the undirected graph G, and deleting repeated nodes and edges;

2) calculating a connected component G of a graph GjJ is 1,2, …, g, g is the number of connected components;

3) calculating each connected component GjDegree of middle node DjAnd according to the node degree DjTo the magnitude of the connected component GjThe nodes in (1) are ordered to obtain an ordered fill path level set curve.

8. The level-set based 3D printing fill path planning method according to claim 7, wherein: the ordering rule of step 3) is as follows:

when Dj2, i.e. GjWhen the degree of each node in the network is equal to 2, the slave GjStarting from any node in the level set curve, and sequencing the level set curve by using a depth-first search algorithm;

when Dj<2, i.e. GjWhen the node with the degree less than 2 is in the tree, the node with the degree 1 is selected as a starting point, and the node is ranked by using a depth-first search algorithmSequence level set curves;

③ when Dj>2, i.e. GjWhen the node with the degree larger than 2 is contained, the node with the degree larger than 2 is selected as a starting point, the adjacent point which is adjacent to the node and is not visited is searched as a next path point, traversal is sequentially carried out, the sorting is finished until all the adjacent points are visited, a horizontal set curve is sorted, then the next horizontal set curve is sorted continuously according to the rule until the connected component G is connectedjAll the nodes in the system are accessed.

Technical Field

The invention relates to the technical field of 3D printing, in particular to a level set-based 3D printing filling path planning method.

Background

3D printing, also known as additive manufacturing, is a technique for manufacturing objects by printing material layer by layer, which is increasingly used in all industries because it changes the traditional subtractive manufacturing model, enabling the forming of objects of arbitrary shape.

3D printing Prior to fabrication of an object, it is first necessary to slice a model layer by layer to obtain closed contours of slices of each layer, and then to path fill the interior of these contours. The quality of the filling path is decisive for whether an object with a good structure can be formed. The proper filling path not only can improve the manufacturing efficiency and prolong the service life of equipment, but also can greatly improve the forming quality of parts, reduce the buckling deformation and reduce the shrinkage stress, so that the parts can better meet the use requirements of objects.

Currently, the commonly used filling path methods are: parallel line paths, bias paths, etc. The filling paths do not consider the stress and material characteristics of the object, only depend on the slice profile information, and adopt a geometric calculation mode to generate the printing paths, so that the requirements of increasingly complex structures and multiple materials cannot be met. Therefore, the method for planning the complex filling path suitable for the functions and material requirements of the object is researched, and the method has important significance for improving the stability and the quality of the formed object.

Disclosure of Invention

Aiming at the defects in the prior art, the invention aims to provide a level set-based 3D printing filling path planning method.

In order to achieve the purpose, the invention provides the following technical scheme:

a level set-based 3D printing filling path planning method comprises the following steps:

step one, importing a three-dimensional model, obtaining slice outlines of all layers of the three-dimensional model, and performing triangulation on a closed area formed by the slice outlines;

step two, constructing a filling path implicit function F (x, y) according to the shape requirement of a filling path of the printing object, and calculating the level set height of a filling path level set curve relative to the filling path implicit function;

acquiring coordinates of each point of a filling path level set curve under each level set height;

and fourthly, sequencing the points on the level set curve into an ordered contour path according to the adjacent topological relation of the triangulation grid triangular plate.

The first step comprises the following steps:

1) importing a three-dimensional model, calculating the slice outlines of all layers of the three-dimensional model along the direction vertical to the Z axis, and acquiring a closed communication area constructed by the slice outlines of all layers;

2) for each closed communication region omega, nodes are arranged in the region omega and on the boundary according to a given step length, Delaunay triangulation is carried out by using the arranged nodes, and triangular plates outside the region omega are deleted;

3) and optimizing the nodes in the triangulation to obtain the final triangulation Mesh.

In step 3), the optimization method replaces the original node with the coordinate mean value of the adjacent node of any node, and the iterative formula is as follows:

wherein Q isjIs QiS is the number of adjacent nodes.

The second step comprises the following steps:

1) constructing a filling path implicit function F (x, y) according to the filling path shape requirement of the object;

2) substituting the x and y coordinates of each node in the triangulation Mesh into the hidden function of the filling path, and taking the obtained function value as the z coordinate of the nodeThe object is further to convert the triangulation Mesh into a three-dimensional Mesh3Then obtaining a three-dimensional Mesh3Maximum value z of z-coordinate of node(s) in (2)maxAnd minimum value zmin

3) Calculate per fill path level set curve Ci={(x,y)|F(x,y)=LiLevel set height relative to fill-path implicit function F (x, y):

Li=zmin+(i-1)d,i=1,2,…,N

wherein N ═ zmax-zmin) And d is the number of the filling path level set curves, and d is the filling path interval.

The third step comprises the following steps:

1) sequentially traversing three-dimensional Mesh3The vertex coordinate size of each triangular plate in the table records the existence of a horizontal set point v ∈ CiThe triangular plate of (1);

2) subdividing the recorded triangular plate, updating the z coordinate of the subdivided vertex by using a filling path implicit function F (x, y), then continuously judging the size of the vertex coordinate, and continuously subdividing until the side length of the triangular plate is less than a given threshold value;

3) calculating the level set point on each subdivision triangular plate by using a binary search method to obtain a filling path level set curve CiAll level set points set above:wherein, every two horizontal set points in the set V belong to the same triangle, and m is the total number of the triangle with the horizontal set points.

In step 1), the rule for judging the existence of the horizontal set point on the triangle sheet is as follows: for two vertices P of any one triangle1(x1,y1,z1),P2(x2,y2,z2) If (z)1-Li)*(z2-Li) When the ratio is less than or equal to 0, the side P is1P2Upper existence of a level set curve C belonging to the fill pathiPoint v above, satisfies v ∈ Ci

The fourth step comprises the following steps:

1) mapping the topological adjacency relation between every two nodes in the level set point set V into an edge set E, forming an undirected graph G by the level set point set V and the edge set E, simplifying the nodes V and the edges E in the undirected graph G, and deleting repeated nodes and edges;

2) calculating a connected component G of a graph GjJ is 1,2, …, g, g is the number of connected components;

3) calculating each connected component GjDegree of middle node DjAnd according to the node degree DjTo the magnitude of the connected component GjThe nodes in (1) are ordered to obtain an ordered fill path level set curve.

The ordering rule in step 3) is as follows:

when Dj2, i.e. GjWhen the degree of each node in the network is equal to 2, the slave GjStarting from any node in the level set curve, and sequencing the level set curve by using a depth-first search algorithm;

when Dj<2, i.e. GjWhen the node with the degree smaller than 2 is in the level set, selecting the node with the degree of 1 as a starting point, and sequencing the level set curve by using a depth-first search algorithm;

③ when Dj>2, i.e. GjWhen the node with the degree larger than 2 is contained, the node with the degree larger than 2 is selected as a starting point, the adjacent point which is adjacent to the node and is not visited is searched as a next path point, traversal is sequentially carried out, the sorting is finished until all the adjacent points are visited, a horizontal set curve is sorted, then the next horizontal set curve is sorted continuously according to the rule until the connected component G is connectedjAll the nodes in the system are accessed.

The invention has the beneficial effects that: the invention extracts the complex filling path outline which is suitable for the use requirement of the object by mapping the filling path pattern into the implicit function and utilizing the strong topological change processing capability of the level set. The method not only can well solve the problems of splitting and merging of the filling paths, but also can avoid complex geometric calculation which is carried out only by depending on the slice outline, and can effectively improve the diversity and flexibility of the 3D printing filling paths.

Drawings

Fig. 1 is a schematic view of a slice profile.

FIG. 2 is a schematic view of a closed connected region constructed using slice profiles.

Fig. 3 is a schematic diagram of a triangulation mesh constructed for a closed area.

Fig. 4 is a schematic diagram of a filling path generated by implicit function F (x, y) ═ x-y.

FIG. 5 is a latent functionResulting in a schematic fill path.

Fig. 6 is a schematic diagram of a filling path generated by the implicit function F (x, y) ═ sin (3x) + cos (3 y).

Detailed Description

The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.

The invention provides a level set-based 3D printing filling path planning method, which comprises the following steps:

step one, importing a three-dimensional model, obtaining slice outlines of all layers of the three-dimensional model, and performing triangulation on a closed area formed by the slice outlines, wherein the specific steps are as follows:

1) importing a three-dimensional model, calculating the slice outlines of all layers of the three-dimensional model along the direction vertical to the Z axis, and acquiring a closed communication area constructed by the slice outlines of all layers;

2) for each closed communication region omega, nodes are arranged in the region omega and on the boundary according to a given step length, Delaunay triangulation is carried out by using the arranged nodes, and triangular plates outside the region omega are deleted;

3) and optimizing the nodes in the triangulation to obtain the final triangulation Mesh. The optimization method replaces the original node with the coordinate mean value of the adjacent node of a certain node, and the iterative formula is as follows:

wherein Q isjIs QiS is the number of adjacent nodes.

Step two, according to the shape requirement of the filling path of the printing object, constructing a filling path implicit function F (x, y), and acquiring the level set height of a filling path level set curve relative to the filling path implicit function, wherein the specific steps are as follows:

1) constructing a filling path implicit function F (x, y) according to the filling path shape requirement of the object;

2) substituting the x and y coordinates of each node in the triangulation Mesh into the hidden function of the filling path, taking the obtained function value as the z coordinate of the node, and further converting the triangulation Mesh into a three-dimensional Mesh3Then obtaining a three-dimensional Mesh3Maximum value z of z-coordinate of node(s) in (2)maxAnd minimum value zmin

3) Calculate per fill path level set curve Ci={(x,y)|F(x,y)=LiLevel set height relative to fill-path implicit function F (x, y):

Li=zmin+(i-1)d,i=1,2,…,N

wherein N ═ zmax-zmin) And d is the number of the filling path level set curves, and d is the filling path interval.

Step three, obtaining coordinates of each point of the filling path level set curve under each level set height, and the specific steps are as follows:

1) sequentially traversing three-dimensional Mesh3And recording the triangular plate with the horizontal set point according to the vertex coordinate size of each triangular plate. The rule for judging the existence of the horizontal set points on the triangular plate is as follows: for two vertices P of any one triangle1(x1,y1,z1),P2(x2,y2,z2) If (z)1-Li)*(z2-Li) When the ratio is less than or equal to 0, the side P is1P2Upper existence of a level set curve C belonging to the fill pathiPoint v above, satisfies v ∈ Ci

2) Subdividing the recorded triangular plate, updating the z coordinate of the subdivided vertex by using a filling path implicit function F (x, y), then continuously judging the size of the vertex coordinate, and continuously subdividing until the side length of the triangular plate is less than a given threshold value;

3) calculating the level set point on each subdivision triangular plate by using a binary search method to obtain a filling path level set curve CiAll level set points set above:

wherein, every two horizontal set points in the set V belong to the same triangle, and m is the total number of the triangle with the horizontal set points.

Connecting points on the level set curve into an ordered contour according to the adjacent topological relation of the triangulation grid triangular plate, and specifically comprising the following steps of:

1) mapping the topological adjacency relation between every two nodes in the level set point set V into an edge set E, forming an undirected graph G by the level set point set V and the edge set E, simplifying the nodes V and the edges E in the undirected graph G, and deleting repeated nodes and edges;

2) calculating a connected component G of a graph GjJ is 1,2, …, g, g is the number of connected components;

3) calculating each connected component GjDegree of middle node DjAnd according to the node degree DjTo the magnitude of the connected component GjThe nodes in (1) are ordered to obtain an ordered fill path level set curve.

The ordering rule is as follows:

when Dj2, i.e. GjWhen the degree of each node in the network is equal to 2, the slave GjStarting from any node in the level set curve, and sequencing the level set curve by using a depth-first search algorithm;

when Dj<2, i.e. GjWhen the node with the degree smaller than 2 is in the level set, selecting the node with the degree of 1 as a starting point, and sequencing the level set curve by using a depth-first search algorithm;

③ when Dj>2, i.e. GjWhen the node with the degree larger than 2 is contained, the node with the degree larger than 2 is selected as a starting point, the adjacent point which is adjacent to the node and is not visited is searched as a next path point, traversal is sequentially carried out, the sorting is finished until all the adjacent points are visited, a horizontal set curve is sorted, then the next horizontal set curve is sorted continuously according to the rule until the connected component G is connectedjAll the nodes in the system are accessed.

Taking the slice profile shown in fig. 1 as an example, according to the method, a closed connected region is first constructed using the profile, as shown in fig. 2. Then, a triangulation mesh is constructed for the closed region, as shown in fig. 3. Finally, filling path level set outlines of various patterns are extracted by establishing different implicit functions F (x, y). Fig. 4 shows a filling path generated by implicit function F (x, y) ═ x-y, and fig. 5 shows an implicit function F (x, y) ═ x-y Fig. 6 shows a filling path generated by an implicit function F (x, y) ═ sin (3x) + cos (3 y).

The examples should not be construed as limiting the present invention, but any modifications made based on the spirit of the present invention should be within the scope of protection of the present invention.

10页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:3D打印保温仓的图像监测系统

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!