Three-dimensional diagram searching and continuous path planning method and system
By using an improved Hierholzer algorithm and a maximum turning angle priority strategy, an Euler graph is constructed to generate continuous printing paths, solving the problem of path discontinuity in additive manufacturing and improving printing quality and efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- WUHAN UNIV OF TECH
- Filing Date
- 2026-01-16
- Publication Date
- 2026-04-21
AI Technical Summary
Existing technologies struggle to generate continuous paths in additive manufacturing, resulting in poor printing quality and efficiency. This is especially true in printing complex structures, where issues such as skipping points, path intersections, and insufficient forming accuracy arise.
An improved Hierholzer algorithm combined with a maximum turning angle priority strategy is adopted. By constructing an undirected graph and optimizing it into an Eulerian graph, a continuous printing path is generated, ensuring the continuity and smoothness of the path and avoiding sharp turns and material waste.
It improves the performance and manufacturing efficiency of printed structures, ensures that the path covers all edges and only once, avoids repetitive movements, and improves the forming accuracy and quality of complex structures.
Smart Images

Figure CN121893544A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of additive manufacturing path planning technology, and in particular to a three-dimensional graph search and continuous path planning method and system. Background Technology
[0002] With the rapid development of additive manufacturing technology, continuous fiber-reinforced thermoplastic composites (CFRTPCs) have demonstrated enormous application potential in numerous fields such as aerospace and transportation due to their superior properties, including high strength, long lifespan, corrosion resistance, and green recyclability. They are gradually becoming an ideal alternative to traditional thermosetting plastics and metal materials. Additive manufacturing technology, through layer-by-layer material accumulation, enables the rapid manufacturing of complex structural parts without molds, providing strong technical support for the application of CFRTCs materials. This allows innovative structural designs to be efficiently transformed into actual products. When printing complex models such as lightweight, thin-walled, porous structures, path planning technology becomes a key factor affecting printing quality and efficiency.
[0003] Currently, patent CN116834286A discloses an optimal path automatic generation method and system for additive manufacturing of grid-like parts. By inputting the path to be printed into a computer, it directly calculates and outputs a one-stroke path design scheme for the grid-like structure. For structures that cannot be drawn in one stroke, it adds the minimum number of auxiliary lines to the original structure to obtain a path that can be completed in one stroke, ultimately achieving a seamless additive manufacturing process. However, adding auxiliary lines can cause jump points in the path, requiring the cutting of the filament, which severely affects the continuity of printing. The literature "Energy absorption properties of non-convex multi-corner thin-walled..." further supports this approach. The journal *columns.* proposed a continuous path generation algorithm, the key of which is to construct an Eulerian circuit. By traversing all the edges in a thin-walled porous structure, the Eulerian circuit is solved to obtain a continuous path. However, in order to construct the Eulerian circuit, this method adds some extra vertices and edges, resulting in the printed component not being exactly the same as the shape of the target model. This causes the planned path to deviate from the original model, making it impossible to accurately reproduce the design structure and meet the requirements of high-precision printing. In addition, the path intersection problem can lead to filament accumulation, reducing the forming accuracy, thereby reducing the performance of the printed structure and the forming and manufacturing efficiency. Summary of the Invention
[0004] In view of this, the present invention proposes a three-dimensional graph search and continuous path planning method and system, which is based on the improved Hierholzer algorithm and obtains continuous paths by solving undirected Eulerian graphs, thereby improving the performance of printed structures and molding manufacturing efficiency.
[0005] The technical solution of this invention is implemented as follows: In a first aspect, this invention provides a three-dimensional graph search and continuous path planning method, comprising the following steps: S1, Obtain the slice cross-sectional image of the 3D model, extract the skeleton from the slice cross-sectional image, and construct an undirected graph; S2, determine whether the undirected graph is an Eulerian graph. If the undirected graph is not an Eulerian graph, copy all the edges in the undirected graph and construct the corresponding Eulerian graph. S3 employs an improved Hierholzer algorithm to search for an Eulerian path in the Eulerian graph that passes through every edge exactly once, serving as the continuous printing path. During the search process, a maximum turning angle priority strategy is used to select the next vertex, thereby optimizing the turning angle of the continuous printing path.
[0006] Based on the above technical solutions, preferably, step S1 includes the following sub-steps: S11, obtain the slice cross-sectional image of the 3D model of the printed additive manufacturing product, and traverse all contour pixels in the slice cross-sectional image using a preset neighborhood window. S12, based on preset deletion conditions, determine and mark the deletable contour pixels; S13, iteratively mark the deletable contour pixels, and delete all marked pixels after each iteration until there are no pixels left to delete, and stop the iteration to obtain a skeleton with a single pixel width; S14. Construct an undirected graph based on the pixels of the skeleton and their connections. g ( v , ε ),in, v For the set of vertices, ε Let be the set of edges.
[0007] Based on the above technical solutions, preferably, the deletion conditions in step S12 must simultaneously satisfy: the current pixel is a contour point; the number of adjacent contour points of the current pixel in the neighborhood window is within a preset range; and the number of times the pixel value of the current pixel changes from 0 to 1 in the neighborhood window is 1.
[0008] Based on the above technical solutions, preferably, step S2 includes the following sub-steps: S21, traverse all edges in the undirected graph, count the number of edges connected to each vertex, and obtain the degree of each vertex; S22, determined based on degree: If the degree of all vertices is even, then the undirected graph is determined to have an Eulerian circuit and is identified as an Eulerian graph. If the number of vertices with odd degree is 2, then the undirected graph is determined to have an Eulerian circuit and is identified as an Eulerian graph. If the number of vertices with odd degree is greater than 2, then the undirected graph is not an Eulerian graph. S23. If the undirected graph is not an Eulerian graph, then copy all the edges in the undirected graph to make the degree of each vertex even, and construct the corresponding Eulerian graph.
[0009] Based on the above technical solutions, preferably, step S3 includes the following sub-steps: S31. Select any vertex from the Eulerian graph as the starting point and initialize the backtracking stack. S32, determine whether there is an unvisited adjacent edge of the current vertex. If there is, select an unvisited adjacent edge to go to the next vertex according to the preset maximum turning angle priority strategy, mark the passed edge as visited, update the next vertex to the current vertex, and return to execute step S32. If there is no edge, execute step S43. S33, push the current vertex onto the backtracking stack, pop the top vertex from the backtracking stack, and update it to the current vertex; S34, repeat steps S32 to S33 until the backtracking stack is empty, and obtain the Euler sub-circuit; S35: Check if there are any unvisited edges in the Eulerian graph. If so, take one endpoint of any unvisited edge as the current vertex and repeat steps S31 to S35 until all edges in the Eulerian graph have been visited. Integrate all the obtained Eulerian sub-circuits and output the final Eulerian path as a continuous printing path.
[0010] Based on the above technical solutions, preferably, the maximum turning angle priority strategy in step S32 includes a no-intersection strategy and an intersection strategy; The no-intersection strategy is as follows: when selecting the next vertex to visit from the current vertex, traverse all candidate edges that can start from the current vertex, calculate the angle between the direction of each candidate edge and the direction of entering the current vertex, and select the vertex corresponding to the candidate edge with the smallest angle as the next vertex to visit. The cross-cutting strategy is as follows: when selecting the next vertex to visit from the current vertex, traverse all candidate edges that can start from the current vertex, calculate the angle between the direction of each candidate edge and the direction of entering the current vertex, and select the vertex corresponding to the candidate edge with the angle closest to 180 degrees as the next vertex to visit.
[0011] Based on the above technical solutions, preferably, when printing additive manufacturing multi-layer structures, a non-intersecting strategy and an intersecting strategy are used alternately to generate corresponding continuous printing paths.
[0012] Secondly, the present invention also provides a three-dimensional graph search and continuous path planning system, implemented using a three-dimensional graph search and continuous path planning method, comprising: The undirected graph extraction module is used to obtain slice cross-sectional images of the 3D model, extract the skeleton from the slice cross-sectional images, and construct an undirected graph. The Eulerian graph construction module is used to determine whether an undirected graph is an Eulerian graph. If the undirected graph is not an Eulerian graph, all edges in the undirected graph are copied to construct the corresponding Eulerian graph. The path search module uses an improved Hierholzer algorithm to search for an Eulerian path in the Eulerian graph that passes through every edge exactly once, as the continuous printing path. During the search process, a maximum turning angle priority strategy is used to select the next vertex to optimize the turning angle of the continuous printing path.
[0013] Thirdly, the present invention also provides an electronic device, including at least one processor, at least one memory, a communication interface, and a bus; wherein the processor, memory, and communication interface communicate with each other through the bus; the memory stores a program for a three-dimensional graph search and continuous path planning method that can be executed by the processor, the program being configured to implement a three-dimensional graph search and continuous path planning method.
[0014] Fourthly, the present invention also provides a computer-readable storage medium storing a program for a three-dimensional graph search and continuous path planning method, wherein the program, when executed, implements the three-dimensional graph search and continuous path planning method.
[0015] The three-dimensional graph search and continuous path planning method and system of the present invention have the following advantages over the prior art: (1) By constructing an undirected graph and optimizing it into an Eulerian graph, the feasibility of continuous printing paths is ensured. Combined with the improved Hierholzer algorithm and the maximum turning angle priority strategy, the print head turning is dynamically optimized, sharp turns are reduced, mechanical stress and wear are reduced, and the performance of printed structures and molding manufacturing efficiency are improved. (2) By constructing an Eulerian graph through edge copying, the continuity problem of non-Eulerian graphs in path planning is solved. Without changing the original model topology, the degree of the vertices is adjusted by increasing the number of edges, so that all edges can be continuously traversed without jumping during path planning, thereby improving the continuity and efficiency of the printing process. (3) When printing additive manufacturing multi-layer structures, the non-crossing strategy and the crossing strategy are used alternately at the same time. This ensures the smoothness of the odd-numbered layer paths and improves the filling density and structural strength through the cross paths of even-numbered layers. While avoiding path cross interference, the forming accuracy and quality of complex structures are improved. The final continuous printing path covers all edges and only once, avoiding repeated movement and material waste. Attached Figure Description
[0016] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0017] Figure 1 This is a flowchart of the three-dimensional graph search and continuous path planning method of the present invention; Figure 2 This is a schematic diagram of the adjacent points of the selection point in the three-dimensional graph search and continuous path planning method of the present invention; Figure 3 This is a schematic diagram of the Euler path found by the improved Hierholzer algorithm using the 3D graph search and continuous path planning method of the present invention. Figure 4 This diagram illustrates the variation of the average turning angle of paths obtained using the improved Hierholzer algorithm and the original Hierholzer algorithm for honeycomb and truss structures with the number of traversed vertices, as presented by the 3D graph search and continuous path planning method of this invention. Detailed Implementation
[0018] The technical solutions of the present invention will be clearly and completely described below with reference to the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.
[0019] like Figure 1-4 As shown, in a first aspect, the present invention provides a three-dimensional graph search and continuous path planning method, comprising the following steps: S1. Obtain the slice cross-sectional image of the 3D model, extract the skeleton from the slice cross-sectional image, and construct an undirected graph.
[0020] Step S1 includes the following sub-steps: S11: Obtain a slice cross-sectional image of the 3D model of the printed additive manufacturing product, and traverse all contour pixels in the slice cross-sectional image using a preset neighborhood window.
[0021] It should be noted that, using CAD 3D modeling software to design or obtain a 3D model of the additive manufacturing product to be printed, slicing software is used to slice the 3D model along the direction perpendicular to the printing direction, generating a series of 2D slice cross-sectional images. These images represent the cross-section of the model at the height of each layer. A 3×3 neighborhood window is used to traverse each slice cross-sectional image. This window is centered on the current pixel and covers the eight neighboring pixels around it, used to determine the relationship between the current pixel and its neighboring pixels. Starting from the top left corner of the image, the neighborhood window is moved row by row and column by column to cover all pixels in the image. For each window, it is checked whether the center pixel is a contour pixel.
[0022] S12, based on preset deletion conditions, determine and mark the deletable contour pixels.
[0023] In step S12, the deletion conditions must be met simultaneously: the current pixel is a contour point; the number of adjacent contour points of the current pixel in the neighborhood window is within a preset range; and the number of times the pixel value of the current pixel changes from 0 to 1 in the neighborhood window is 1.
[0024] It should be noted that the center pixel must be a contour point, i.e., its value is 1 (in a binary image, contour points are usually represented by white, with a value of 1; the background is black, with a value of 1 for black). The center pixel must have at least 2 and no more than 6 adjacent contour points to ensure the continuity of the skeleton and the width of a single pixel. The number of changes from 0 to 1 in the neighborhood must be 1 to ensure the connectivity of the skeleton and avoid breakage. In addition, several preset structural template conditions must be met to avoid disrupting the continuity of the skeleton. For each contour pixel that meets the deletion conditions, it is marked but not deleted immediately. It is processed uniformly in subsequent iterations to avoid affecting the judgment of neighborhood information during the iteration process.
[0025] S13, iteratively mark the deletable contour pixels, and delete all marked pixels after each iteration until there are no pixels left to delete, and stop the iteration to obtain a skeleton with a single pixel width.
[0026] It should be noted that the process involves traversing all contour pixels and marking deletable pixels according to preset deletion conditions. After the first iteration, all marked pixels are deleted, and the neighborhood information of the remaining pixels is updated. This process is repeated for multiple iterations, with each iteration re-judging and marking deletable pixels based on the updated neighborhood information. When no pixels can be deleted, the iteration stops, and at this point, only a single-pixel-wide skeleton is retained in the image.
[0027] S14. Construct an undirected graph based on the pixels of the skeleton and their connections. g ( v , ε),in, v For the set of vertices, ε Let be the set of edges.
[0028] It should be noted that each single pixel in the skeleton is treated as a vertex in the undirected graph, and these vertices represent key feature points of the model's cross-section. Based on the connectivity between the skeleton pixels, corresponding edges are added to the undirected graph. If two vertices are adjacent in the skeleton, an edge is added to connect them, ultimately resulting in the undirected graph. g ( v , ε This accurately represents the topology and connectivity of the model cross-section, providing fundamental data for subsequent path planning.
[0029] S2: Determine if the undirected graph is an Eulerian graph. If the undirected graph is not an Eulerian graph, copy all the edges in the undirected graph and construct the corresponding Eulerian graph.
[0030] Step S2 includes the following sub-steps: S21: Traverse all edges in the undirected graph, count the number of edges connected to each vertex, and obtain the degree of each vertex.
[0031] It should be noted that, starting from any vertex in the undirected graph, a depth-first search (DFS) is used to traverse all edges and vertices in the graph. During the traversal, for each visited vertex, the number of edges directly connected to it is counted, which is the degree of that vertex. The degree reflects the connectivity of the vertex in the graph and is a key indicator for determining whether an Eulerian graph is valid.
[0032] S22, determined based on degree: If the degree of all vertices is even, then the undirected graph is determined to have an Eulerian circuit and is identified as an Eulerian graph. If the number of vertices with odd degree is 2, then the undirected graph is determined to have an Eulerian circuit and is identified as an Eulerian graph. If the number of vertices with odd degree is greater than 2, then the undirected graph is not an Eulerian graph.
[0033] It should be noted that if all vertices in an undirected graph have an even degree, then according to the definition of an Eulerian graph, the graph has an Eulerian circuit, meaning that you can start from any point, traverse every edge of the graph exactly once, and eventually return to the starting point; in this case, the undirected graph is determined to be an Eulerian graph. If the number of vertices with odd degree in an undirected graph is exactly 2, then the graph also has an Eulerian circuit, but the starting and ending points must be these two vertices with odd degree; similarly, the undirected graph is determined to be an Eulerian graph. If the number of vertices with odd degree in an undirected graph is greater than 2, then according to the properties of Eulerian graphs, the graph does not have an Eulerian circuit, and the undirected graph is determined not to be an Eulerian graph.
[0034] S23. If the undirected graph is not an Eulerian graph, then copy all the edges in the undirected graph to make the degree of each vertex even, and construct the corresponding Eulerian graph.
[0035] It should be noted that for non-Eulerian graphs, the degree of vertices is increased by copying all edges in the graph. Specifically, for each edge in the graph, an identical edge is created, connecting the same two vertices. Each copy of an edge increases the degree of the two connected vertices by 1. By copying edges, it is ensured that the degree of each vertex in the graph eventually becomes even, because the number of vertices with odd degrees in the original graph is greater than 2. After copying all edges, the degree of these vertices will increase even times, thus becoming even. After edge copying, the resulting graph satisfies the conditions of an Eulerian graph, and therefore can be identified as an Eulerian graph. This Eulerian graph is similar to the original graph in topological structure, but each edge appears twice, ensuring that all edges can be traversed continuously without jumps during path planning.
[0036] In this embodiment, an Eulerian graph is constructed using the edge copying method, which effectively solves the continuity problem in path planning for non-Eulerian graphs. Without changing the original model topology, the degree of the vertices is adjusted by increasing the number of edges, so that the path planning can continuously traverse all edges without jumping, thereby improving the continuity and efficiency of the printing process. In the 3D printing scenario of continuous fiber reinforced composite materials, continuous fiber paths can improve the mechanical properties and molding accuracy of the printed structure.
[0037] S3 employs an improved Hierholzer algorithm to search for an Eulerian path in the Eulerian graph that passes through every edge exactly once, serving as the continuous printing path. During the search process, a maximum turning angle priority strategy is used to select the next vertex, thereby optimizing the turning angle of the continuous printing path.
[0038] Step S3 includes the following sub-steps: S31. Select any vertex from the Eulerian graph as the starting point and initialize the backtracking stack. It should be noted that, from the constructed Eulerian graph, any vertex can be selected as the starting point of the path, and an empty stack is initialized to store the vertices that need to be backtracked during the path search process.
[0039] S32, determine whether there is an unvisited adjacent edge of the current vertex. If there is, select an unvisited adjacent edge to go to the next vertex according to the preset maximum turning angle priority strategy, mark the passed edge as visited, update the next vertex to the current vertex, and return to execute step S32. If there is no edge, execute step S43. S33, push the current vertex onto the backtracking stack, pop the top vertex from the backtracking stack, and update it to the current vertex; S34, repeat steps S32 to S33 until the backtracking stack is empty, and obtain the Euler sub-circuit; S35: Check if there are any unvisited edges in the Eulerian graph. If so, take one endpoint of any unvisited edge as the current vertex and repeat steps S31 to S35 until all edges in the Eulerian graph have been visited. Integrate all the obtained Eulerian sub-circuits and output the final Eulerian path as a continuous printing path.
[0040] It should be noted that when visiting adjacent vertices, there are two methods for selecting the next vertex: non-intersecting and intersecting. The intersecting strategy has a smaller turning angle than the non-intersecting strategy, but it will cause excess material to accumulate at the path intersection during actual printing. The non-intersecting strategy can avoid accumulation at the path intersection, but the lack of path intersection may affect the lateral mechanical properties of the component. When printing additive manufacturing multi-layer structures, the non-intersecting and intersecting strategies are used alternately to generate corresponding continuous printing paths in order to balance path smoothness and infill efficiency.
[0041] The maximum turning angle priority strategy mentioned in step S32 includes a no-intersection strategy and an intersection strategy; The no-intersection strategy is as follows: when selecting the next vertex to be visited from the current vertex, all candidate edges that can start from the current vertex are traversed, the angle between the direction of each candidate edge and the direction of entering the current vertex is calculated, and the vertex corresponding to the candidate edge with the smallest angle is selected as the next vertex to be visited. This is used to reduce sharp turns in the path, make the print head movement smoother, and reduce mechanical stress. The angle between a candidate edge and the direction of entry into the current vertex in the no-crossing strategy is expressed as: ; In the formula, θ i For the first i The angles between each candidate edge and the direction entering the current vertex range from [0, 2π]. e s The direction vector for entering the current vertex describes the direction from the previous vertex to the current vertex. e i The candidate edge direction vector originating from the current vertex represents the direction vector pointing from the current vertex to one of its adjacent vertices. Through this calculation method, the angle between each candidate edge and the direction entering the current vertex can be accurately calculated. Then, in the no-intersection strategy, the vertex corresponding to the candidate edge with the smallest angle is selected as the next visited vertex to reduce sharp turns in the path, make the print head movement smoother, and reduce mechanical stress.
[0042] The cross-path strategy involves traversing all candidate edges that can start from the current vertex when selecting the next vertex to visit. It calculates the angle between the direction of each candidate edge and the direction of entering the current vertex, and selects the vertex corresponding to the candidate edge with the angle closest to 180 degrees as the next vertex to visit. This allows path crossings and may generate more compact loops, making it suitable for scenarios that need to fill complex regions.
[0043] It should be noted that by combining the improved Hierholzer algorithm with the maximum turning angle priority strategy, this method dynamically optimizes the movement direction of the print head when searching for Euler paths, reducing the number of sharp turns in the continuous printing process. By alternately using non-crossing and crossing strategies, it ensures the smoothness of the odd-numbered layer paths and improves the infill density and structural strength through the crossing paths of even-numbered layers. The resulting continuous printing path covers all edges and is executed only once, avoiding repetitive movements and material waste. At the same time, the turning angle optimization extends the equipment life and improves printing efficiency and product quality, making it suitable for additive manufacturing scenarios with complex structures or high precision requirements.
[0044] like Figure 4 As shown, path generation was performed on honeycomb and truss structures. The average turning angles of the optimized and unoptimized Hierholer algorithms were statistically analyzed. The optimized Hierholer algorithm was tested on the honeycomb structure, with an average turning angle of 66.85°, while the unoptimized Hierholer algorithm calculated an average turning angle of 75.81°, a reduction of 8.96%. The optimized Hierholer algorithm was verified in the truss structure, showing a 20.88% reduction in average turning angle compared to the unoptimized Hierholer algorithm.
[0045] Secondly, the present invention also provides a three-dimensional graph search and continuous path planning system, implemented using a three-dimensional graph search and continuous path planning method, comprising: The undirected graph extraction module is used to obtain slice cross-sectional images of the 3D model, extract the skeleton from the slice cross-sectional images, and construct an undirected graph. The Eulerian graph construction module is used to determine whether an undirected graph is an Eulerian graph. If the undirected graph is not an Eulerian graph, all edges in the undirected graph are copied to construct the corresponding Eulerian graph. The path search module uses an improved Hierholzer algorithm to search for an Eulerian path in the Eulerian graph that passes through every edge exactly once, as the continuous printing path. During the search process, a maximum turning angle priority strategy is used to select the next vertex to optimize the turning angle of the continuous printing path.
[0046] It should be noted that this system corresponds to the aforementioned three-dimensional graph search and continuous path planning method. All implementation methods in the above method embodiments are applicable to the embodiments of this system and can achieve the same technical effect.
[0047] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0048] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working process of the system and modules described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0049] In the embodiments provided by this invention, it should be understood that the disclosed systems and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0050] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0051] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0052] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, ROM, RAM, magnetic disks, or optical disks.
[0053] Furthermore, it should be noted that in the system and method of the present invention, it is obvious that the components or steps can be decomposed and / or recombined. These decompositions and / or recombinations should be considered equivalent solutions of the present invention. Moreover, the steps performing the above series of processes can naturally be executed in the order described, but are not necessarily required to be executed in chronological order; some steps can be executed in parallel or independently of each other. Those skilled in the art will understand that all or any step or component of the method and apparatus of the present invention can be implemented in any computing device (including processors, storage media, etc.) or network of computing devices, in hardware, firmware, software, or a combination thereof. This is something that those skilled in the art can achieve by using their basic programming skills after reading the description of the present invention.
[0054] Therefore, the object of the present invention can also be achieved by running a program or a set of programs on any computing system. The computing system can be a known general-purpose system. Therefore, the object of the present invention can also be achieved simply by providing a program product containing program code implementing the method or apparatus. That is, such a program product also constitutes the present invention, and the storage medium storing such a program product also constitutes the present invention. Obviously, the storage medium can be any known storage medium or any storage medium developed in the future. It should also be noted that in the apparatus and method of the present invention, it is obvious that the components or steps can be decomposed and / or recombined. These decompositions and / or recombinations should be considered equivalent to the present invention. Furthermore, the steps performing the above series of processes can naturally be performed in the order described, but are not necessarily required to be performed in chronological order. Some steps can be performed in parallel or independently of each other.
[0055] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for three-dimensional graph search and continuous path planning, characterized in that, Includes the following steps: S1, Obtain the slice cross-sectional image of the 3D model, extract the skeleton from the slice cross-sectional image, and construct an undirected graph; S2, determine whether the undirected graph is an Eulerian graph. If the undirected graph is not an Eulerian graph, copy all the edges in the undirected graph and construct the corresponding Eulerian graph. S3 employs an improved Hierholzer algorithm to search for an Eulerian path in the Eulerian graph that passes through every edge exactly once, serving as the continuous printing path. During the search process, a maximum turning angle priority strategy is used to select the next vertex, thereby optimizing the turning angle of the continuous printing path.
2. The three-dimensional graph search and continuous path planning method as described in claim 1, characterized in that, Step S1 includes the following sub-steps: S11, obtain the slice cross-sectional image of the 3D model of the printed additive manufacturing product, and traverse all contour pixels in the slice cross-sectional image using a preset neighborhood window. S12, based on preset deletion conditions, determine and mark the deletable contour pixels; S13, iteratively mark the deletable contour pixels, and delete all marked pixels after each iteration until there are no pixels left to delete, and stop the iteration to obtain a skeleton with a single pixel width; S14. Construct an undirected graph based on the pixels of the skeleton and their connections. g ( v , ε ),in, v For the set of vertices, ε Let be the set of edges.
3. The three-dimensional graph search and continuous path planning method as described in claim 2, characterized in that, The deletion conditions in step S12 must be met simultaneously: the current pixel is a contour point; the number of adjacent contour points of the current pixel in the neighborhood window is within a preset range; and the number of times the pixel value of the current pixel changes from 0 to 1 in the neighborhood window is 1.
4. The three-dimensional graph search and continuous path planning method as described in claim 3, characterized in that, Step S2 includes the following sub-steps: S21, traverse all edges in the undirected graph, count the number of edges connected to each vertex, and obtain the degree of each vertex; S22, determined based on degree: If the degree of all vertices is even, then the undirected graph is determined to have an Eulerian circuit and is identified as an Eulerian graph. If the number of vertices with odd degree is 2, then the undirected graph is determined to have an Eulerian circuit and is identified as an Eulerian graph. If the number of vertices with odd degree is greater than 2, then the undirected graph is not an Eulerian graph. S23. If the undirected graph is not an Eulerian graph, then copy all the edges in the undirected graph to make the degree of each vertex even, and construct the corresponding Eulerian graph.
5. The three-dimensional graph search and continuous path planning method as described in claim 1, characterized in that, Step S3 includes the following sub-steps: S31. Select any vertex from the Eulerian graph as the starting point and initialize the backtracking stack. S32, determine whether there is an unvisited adjacent edge of the current vertex. If there is, select an unvisited adjacent edge to go to the next vertex according to the preset maximum turning angle priority strategy, mark the passed edge as visited, update the next vertex to the current vertex, and return to execute step S32. If there is no edge, execute step S43. S33, push the current vertex onto the backtracking stack, pop the top vertex from the backtracking stack, and update it to the current vertex; S34, repeat steps S32 to S33 until the backtracking stack is empty, and obtain the Euler sub-circuit; S35: Check if there are any unvisited edges in the Eulerian graph. If so, take one endpoint of any unvisited edge as the current vertex and repeat steps S31 to S35 until all edges in the Eulerian graph have been visited. Integrate all the obtained Eulerian sub-circuits and output the final Eulerian path as a continuous printing path.
6. The three-dimensional graph search and continuous path planning method as described in claim 5, characterized in that, The maximum turning angle priority strategy mentioned in step S32 includes a no-intersection strategy and an intersection strategy; The no-intersection strategy is as follows: when selecting the next vertex to visit from the current vertex, traverse all candidate edges that can start from the current vertex, calculate the angle between the direction of each candidate edge and the direction of entering the current vertex, and select the vertex corresponding to the candidate edge with the smallest angle as the next vertex to visit. The cross-cutting strategy is as follows: when selecting the next vertex to visit from the current vertex, traverse all candidate edges that can start from the current vertex, calculate the angle between the direction of each candidate edge and the direction of entering the current vertex, and select the vertex corresponding to the candidate edge with the angle closest to 180 degrees as the next vertex to visit.
7. The three-dimensional graph search and continuous path planning method as described in claim 6, characterized in that, When printing additive manufacturing multi-layer structures, the non-crossing strategy and the crossing strategy are used alternately to generate corresponding continuous printing paths.
8. A three-dimensional graph search and continuous path planning system, implemented using the three-dimensional graph search and continuous path planning method as described in any one of claims 1-7, characterized in that, include: The undirected graph extraction module is used to obtain slice cross-sectional images of the 3D model, extract the skeleton from the slice cross-sectional images, and construct an undirected graph. The Eulerian graph construction module is used to determine whether an undirected graph is an Eulerian graph. If the undirected graph is not an Eulerian graph, all edges in the undirected graph are copied to construct the corresponding Eulerian graph. The path search module uses an improved Hierholzer algorithm to search for an Eulerian path in the Eulerian graph that passes through every edge exactly once, as the continuous printing path. During the search process, a maximum turning angle priority strategy is used to select the next vertex to optimize the turning angle of the continuous printing path.
9. An electronic device, characterized in that, It includes at least one processor, at least one memory, a communication interface, and a bus; wherein the processor, memory, and communication interface communicate with each other through the bus; the memory stores a program for a three-dimensional graph search and continuous path planning method that can be executed by the processor, the program being configured to implement the three-dimensional graph search and continuous path planning method as claimed in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The storage medium stores a program for a three-dimensional graph search and continuous path planning method, which, when executed, implements the three-dimensional graph search and continuous path planning method as described in any one of claims 1-7.
Citation Information
Patent Citations
Optimal path automatic generation method and system for additive manufacturing of grid parts
CN116834286A