Dining car 3D printing path planning method and system based on improved HO algorithm

The improved HO algorithm-based method addresses inefficiencies in traditional 3D printing path planning for delivery vehicles by using balanced binary trees, adaptive layering, contour optimization, and vector offset strategies, resulting in improved printing efficiency and quality.

CN119718221APending Publication Date: 2025-03-28HUAIYIN INSTITUTE OF TECHNOLOGY
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411672289.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-21
Publication Date
2025-03-28

AI Technical Summary

Technical Problem

Traditional 3D printing path planning methods for delivery vehicles lack efficiency and accuracy, particularly in handling complex models, leading to issues like underfilling or overfilling, and insufficient optimization of print paths, which affects the quality and efficiency of the printing process.

Method used

An improved HO algorithm-based method that includes pre-processing with a balanced binary tree algorithm, adaptive layering, contour optimization through encryption and filtering, and a combination of vector offset and zig-zag filling strategies, along with an optimized river-HO optimization function to minimize empty travel paths.

Benefits of technology

This approach enhances the efficiency and uniformity of the printing process, reduces defects from under/overfilling, and improves the overall quality and speed of 3D printing for delivery vehicles by optimizing path planning and search capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119718221A_ABST
    Figure CN119718221A_ABST
Patent Text Reader

Abstract

The invention discloses a meal delivery car 3D printing path planning method and system based on an improved HO algorithm, and the method comprises the steps: designing a meal delivery car STL model, and carrying out the preprocessing of the design data of the model through a balanced binary tree algorithm; carrying out self-adaptive coarse layering on the STL model of the serving trolley after data preprocessing; based on the contour information, considering the sharp edge features of the model, and carrying out subdivision; extracting a contour line based on the layered transfer trolley STL model, and optimizing the contour line; a scanning method combining a vector direct offset method and reciprocating straight line filling is adopted, the optimized delivery car model layered contour line is filled, and a delivery car 3D printing possible path is generated; establishing a target function by taking the minimum idle stroke as a target, and performing optimization processing on the target function by adopting an improved HO optimization algorithm to complete the 3D printing path planning of the serving trolley; according to the invention, the efficiency is improved, the path is optimized and the global search capability is enhanced in the 3D printing path planning of the serving trolley.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a 3D printing path planning method and system for food delivery carts, and more particularly to a 3D printing path planning method and system for food delivery carts based on an improved HO algorithm, belonging to the field of 3D printing path planning technology. Background Technology

[0002] With the widespread application of 3D printing technology in various fields and the increasing demand for automation in food delivery vehicles, improving the efficiency of 3D printing path planning and the quality of finished products has become particularly urgent. However, traditional 3D printing path planning methods for food delivery vehicles often employ relatively simple algorithms for path design. These algorithms often lack the ability to accurately process complex models, failing to precisely optimize contour lines. This can lead to underfilling or overfilling during the infilling process, thus affecting printing efficiency and quality. Furthermore, existing path planning algorithms often fail to fully consider global search capabilities and convergence speed, resulting in insufficient optimization of the printing path and making it difficult to meet the growing demand for efficient and high-quality printing. Summary of the Invention

[0003] Purpose of the invention: The purpose of this invention is to provide a method and system for 3D printing path planning of food delivery vehicles based on an improved HO algorithm, which can improve planning efficiency.

[0004] Technical solution: The present invention provides a 3D printing path planning method for food delivery carts based on an improved HO algorithm, comprising:

[0005] (1) Design the STL model of the food delivery vehicle, and preprocess the design data of the model using the balanced binary tree algorithm;

[0006] (2) Adaptive coarse layering is performed on the STL model of the food delivery vehicle after data preprocessing to obtain the contour information after layering; based on the contour information, considering the sharp edge features of the model, the subdivision layer is performed.

[0007] (3) Extract the outline based on the layered food delivery vehicle STL model and optimize the outline. The optimization method is to improve the quality of the outline by encrypting and filtering small areas.

[0008] (4) A scanning method combining direct vector offset method and reciprocating straight line filling is used to fill the layered contour lines of the optimized food delivery vehicle model to generate possible paths for 3D printing of the food delivery vehicle.

[0009] (5) Based on the possible paths of the food delivery vehicle 3D printing, an objective function is established with the goal of minimizing the empty travel distance. The improved Hippo HO optimization algorithm is used to optimize the objective function and complete the path planning for the food delivery vehicle 3D printing.

[0010] Further, step (1) includes:

[0011] Based on actual usage scenarios and functional requirements, an STL model of a food delivery vehicle was designed. The STL file of the model uses triangular meshes to represent the 3D model.

[0012] A balanced binary tree algorithm is used to remove duplicate vertices from the model STL file, including:

[0013] Iterate through all the vertex data in the food delivery truck's STL file;

[0014] In a balanced binary tree, find vertex X1 according to the principle of left smaller and right larger. If vertex X1 does not exist, insert it at the corresponding position and ensure that the tree remains balanced.

[0015] If vertex X1 already exists in the tree, then determine if vertex Y1, which has the same coordinates as X1, exists in the tree.

[0016] If vertex Y1 does not exist, insert it at the appropriate position and ensure the tree remains balanced;

[0017] If vertex Y1 already exists in the tree, then determine whether vertex Z1, which has the same X1 and Y1 coordinates, exists in the tree.

[0018] If vertex Z1 does not exist, insert it at the appropriate position and ensure the tree remains balanced;

[0019] If vertex Z1 already exists in the tree, it means that vertex Z1 is a duplicate and does not need to be inserted.

[0020] Where X1, Y1, and Z1 are the vertex coordinates of the triangular mesh in the STL file.

[0021] Further, step (2) includes:

[0022] (201) Adaptive coarse layering is performed on the preprocessed food delivery cart STL model. The height of each layer is determined using the top-point height method to obtain the contour information after layering:

[0023] The formula for calculating the tip height is:

[0024]

[0025] Where δ is the top height, which refers to the maximum distance between the model boundary and the printed entity boundary, measured along the direction of the surface normal vector of the pre-processed food delivery vehicle STL model. Let θ be the layer thickness, and θ be the tilt angle of the triangular facet, where θ∈[0°,180°].

[0026] The formula for the tilt angle of a triangular facet is:

[0027]

[0028] Where cosθ is the tilt angle of the triangular facet; N1 is the normal vector of the facet; Z is the layering plane; N Z For the Z-axis component;

[0029] Let the specified thickness range of the surface layers in the food delivery cart model printing be [D]. min D max Then the formula for adaptive layer thickness is:

[0030] D'1=D max -(D max -D min )×cosθ

[0031] Where D'1 is the adaptive layer thickness; D'1∈[D min D max ];

[0032] Substituting the formula for the tilt angle of the triangular facet into the formula for adaptive layer thickness, we obtain the simplified formula for adaptive layer thickness:

[0033] D'2=D max -(D max -D min )×|N Z |

[0034] Where D'2 is the simplified adaptive layer thickness;

[0035] (202) Based on the layered contour information, considering the sharp edge features of the model, the layers are subdivided, and the model features are preserved by reducing the layer thickness, including:

[0036] The dihedral angle between two adjacent triangular facets is used to identify acute edge features. The formula is as follows:

[0037] β=π-arccos(N f1 ·N f2 )

[0038] Where β is the dihedral angle between two adjacent triangular facets; N f1 and N f2 Let be the normal vector of two adjacent triangular facets;

[0039] If the dihedral angle between two adjacent triangular facets is less than the critical value, then the common edge of the two adjacent triangular facets is considered an acute edge.

[0040] To reduce the layer thickness at sharp edge features, the adaptive layer thickness formula is:

[0041]

[0042] Where D'3 is the layer thickness at the sharp edge feature;

[0043] The weights are combined for D'2 and D'3, and the formula is as follows:

[0044]

[0045] in, The final determined layer thickness;

[0046] The formula for calculating the layer height of the next layer is:

[0047]

[0048] in, The layer height of the next level; This represents the layer height of the current layer.

[0049] Further, step (3) includes:

[0050] (301) Based on the layered STL model of the food delivery cart, a slicing plane is constructed at the current layer height. The intersection calculation of the slicing plane and the spatial triangular facets stored in the STL model file of the food delivery cart is performed to construct a mathematical model of the intersection points of the three sides of the triangular facets with the tangent plane. Let the coordinates of the three points be A=(x1,y1,z1), B=(x2,y2,z2), and C=(x3,y3,z3). Taking one side AB of the triangular facet as an example, the coordinates of the intersection point P of the side and the tangent plane are calculated using the following formula:

[0051]

[0052] in, Let P be the vector from the origin to the intersection point P of the edge of the triangular facet and the tangent plane; Let A be the vector from the origin to point A. Let be the vector from point A to point P; Let be the distance from vertex A to the tangent plane; Let be the distance between vertices A and B on the normal vector of the slice plane; Let be the vector from point A to point B;

[0053] After obtaining the coordinates of intersection point P, continue to calculate the remaining two coordinates, while excluding intersection points located on the edge extension lines; then, connect the above three intersection points in sequence to outline the contour line segments of the spatial triangular facet on the cutting plane; connect all the determined intersection line segments in this layer in a predetermined order to form the complete contour line of this layer.

[0054] (302) Enhancing the density of outlines through encryption processing, including:

[0055] Traverse the boundary lines and calculate the midpoint coordinates (x, y). mid ,y mid );

[0056] Traverse the contour lines and use a formula to refine the spacing between two points, as follows:

[0057]

[0058] in, and The coordinates are encrypted; The coordinates of the point before encryption; is the coordinate of the contour line; w is the desired distance between two points; k1 represents the number of points to be added at equal intervals between the two coordinate points; The scaling factor for encryption between two points;

[0059] Following the contour line in a clockwise direction, determine whether the line connecting the midpoint of the boundary line to each point on the contour line is completely within the area to be optimized, ensuring that the connecting line does not intersect the boundary line; retain all target vectors that are completely within the area to be optimized, and record them according to the order in which the target vectors appear on the contour line;

[0060] Calculate the angle between the first vector in the target vector and the other vectors, and take the length of the vector corresponding to the point with the smallest difference from 90° in the set of angles as the length of the current region to be optimized; if the length of the region to be optimized is less than the length filtering threshold, filter it; otherwise, save the current region.

[0061] Further, step (4) includes:

[0062] (401) Using the direct vector offset method, the offset of the contour line is gradually adjusted, including:

[0063] Calculate the unit vectors of any two points E(x4,y4) and F(x5,y5) on the optimized contour line. The formula is as follows:

[0064]

[0065] Where d is the distance between points E and F; Let x be the unit vector between points E and F; x4 and x5 are the x-coordinates between points E and F; y4 and y5 are the y-coordinates between points E and F.

[0066] Setting an offset R optimizes the printing path and reduces unnecessary blank runs. When the EF line segment is offset to the left by R, the equidistant line becomes E1F1, resulting in the offset unit vector. The formula is:

[0067]

[0068] in, The unit vector of E1F1 after biasing;

[0069] Thus, the bias vector is obtained. The calculation formula is:

[0070]

[0071] in, R is the bias vector; R is the offset.

[0072] The coordinates of E1 are:

[0073]

[0074] The equation of the equidistant line is obtained by the following formula:

[0075] x4 ≠ x5

[0076]

[0077] Where k2 is the slope of lines E1F1 and EF; b is the y-intercept of lines E1F1 and EF.

[0078] Find the intersection of the equations of two adjacent equidistant lines and calculate the coordinates of the offset point. Specifically:

[0079] First, set three adjacent points on the outline ring of the food delivery cart model as G(x6, y6), H(x7, y7), and I(x8, y8), respectively. Let H'(x6, y6) be an integer. m y m ) is the bias point of H;

[0080] When k3=∞ and k4≠∞, the coordinates of the offset point can be obtained by solving the simultaneous equations:

[0081]

[0082] Where x and y are the x and y coordinates of the offset point; x7 and x8 are the x coordinates of points H and I, respectively; y6, y7, and y8 are the y coordinates of points G, H, and I, respectively; k3 is the slope of GH; and k4 is the slope of HI.

[0083] When k3≠∞ and k4=∞, the coordinates of the offset point can be obtained by solving the simultaneous equations:

[0084]

[0085] Where x6 is the x-coordinate of point G;

[0086] Finally, the coordinates of each offset point are connected sequentially to obtain the fill path of the contour line offset;

[0087] (402) Employing a reciprocating straight line filling strategy, including:

[0088] Find the vertices of the entire contour line, sort the y-coordinates of all vertices, and find the Y-coordinate. min and Y max ;

[0089] The formula for obtaining the first scan line is:

[0090] Y = S1J + Y min

[0091] Where Y is the equation of the first scan line; S1 is the number of scan lines; J∈[0,Y] max -Y min [ ] represents the spacing between scan lines;

[0092] Assuming the contour is a straight line, (X) a ,Y a ) and (X b ,Y b If ) are two points on the contour, then the equation of the straight line of the contour is:

[0093]

[0094] The coordinates of the intersection point of the first fill line and the contour boundary are:

[0095]

[0096] Then, the intersection point of the initial fill line is determined by intersection calculation and connected to form the first fill line; subsequently, the line is translated by a distance J in a predetermined direction, and the intersection calculation is continued to obtain a new intersection point, thereby generating the second fill line; this process is repeated until the reciprocating straight line filling of the entire area is completed.

[0097] Furthermore, the objective function in step (5) is:

[0098]

[0099]

[0100] Where i3 and j3 are the numbers of each possible path for the 3D printing of the food delivery cart; N is the total number of paths; Let i be the jump distance from path i3 to path j3; S1 is a decision variable, representing whether the connecting line may contain a connecting line segment from path i3 to path j3, where 1 indicates that it contains and 0 indicates that it does not contain; S2 is the set of paths.

[0101] Furthermore, step (5) involves optimizing the objective function using the improved hippopotamus HO optimization algorithm, including:

[0102] (501) Set the number of possible paths N for 3D printing of the food delivery cart and the total number of iterations;

[0103] (502) Construct a matrix of all possible path locations for 3D printing of food delivery carts:

[0104] In the initialization phase of shortest path optimization in the 3D printing path planning of the food delivery vehicle, an initial population of a series of possible path solutions is generated; the initial population of the Fuchs mapping optimization algorithm is introduced, with the formula:

[0105]

[0106] in, This represents the possible path solutions for 3D printing the i3+1th food delivery cart; This represents the possible path solutions for 3D printing the i3th food delivery cart;

[0107] Each solution represents a possible path, which can be represented by a vector formula:

[0108]

[0109] Where r represents a random number in the range of 0 to 1; This represents the lower bound of the j3rd decision variable; The upper bound of the j3rd decision variable; N represents the number of possible path solutions for 3D printing of the food delivery truck; m represents the number of decision variables in the problem; This indicates the position of the possible path solution for 3D printing the i3th food delivery cart in the j3rd dimension;

[0110] The locations of all possible path solutions for the 3D printing of the food delivery cart are collected and constructed in matrix form, with the following formula:

[0111]

[0112] Where X represents the set of locations for all possible path solutions in the 3D printing of food delivery vehicles;

[0113] (503) Generate candidate paths for global and local optima in the 3D printing path planning of food delivery carts:

[0114] Based on the printing path position matrix, the HO algorithm update formula is used to update the optimal path for global and local 3D printing of the food delivery vehicle.

[0115] The target point of the global movement trajectory in the optimized print space is updated using the following formula:

[0116]

[0117] The target point of each local printing path is updated using the following formula:

[0118]

[0119] in, This represents the target point of the global movement trajectory in the 3D printing path planning of the food delivery vehicle. This indicates the position of the target point in the j3rd dimension of the global movement trajectory of the i3th food delivery vehicle 3D printing path planning; This represents the target point of the global movement trajectory of the food delivery vehicle's 3D printing path planning after adaptive t-distribution perturbation. Let represent the target point of the global movement trajectory of the food delivery vehicle 3D printing path planning in the t-th iteration; t(iter) represents the adaptive t-distribution function with the number of iterations as the degree of freedom parameter; Dhippo represents the optimal printing target point found among the possible paths of the current food delivery vehicle 3D printing path planning; y1 represents a random number between 0 and 1; I1 represents an integer between 1 and 2. This represents the target point of the local printing path in the 3D printing path planning of the food delivery vehicle; This indicates the position of the target point of the local printing path of the i3th food delivery vehicle 3D printing path planning in the j3rd dimension; This refers to the average of the target points of a local printing path planned from randomly selected delivery cart 3D printing paths; T represents the time variable, and the formula is... I2 represents an integer between 1 and 2; r6 represents a number between 0 and 1; h2 represents a number or vector randomly selected from the five scenarios in equation h; r7 represents a number between 0 and 1; h1 represents a number or vector randomly selected from equation h.

[0120] The formula for equation h is:

[0121]

[0122] Where I1 and I2 represent integers between 1 and 2; and r5 represents a random vector between 0 and 1; r5 represents a random number between 0 and 1. and Represents a random integer, either 1 or 0;

[0123] After the global and local printing target points of the food delivery cart's 3D printing path are updated, the global and local path trajectories are updated using the following formula:

[0124]

[0125] in, Represents the objective function value; The objective function value represents the globally optimal printing path for the 3D printing path planning of the food delivery vehicle; The objective function value represents the local optimal printing path of the food delivery vehicle 3D printing path planning;

[0126] (504) When the delivery cart encounters an obstacle during 3D printing, the local printing path is adjusted to avoid the obstacle:

[0127] In the path planning of 3D model printing for food delivery vehicles, the HO optimization algorithm is used to navigate the search space. By updating the position information of obstacles, the 3D printer head avoids obstacles in the printing area and generates a new path.

[0128] The formula for updating the position of obstacles in the search space is:

[0129]

[0130] Where Predator represents the position of the obstacle in the search space; This indicates the position of the obstacle in the j3rd dimension of the search space; Represents a random vector ranging from 0 to 1;

[0131] Next, based on the spatial location of the obstacle, assess the distance between the 3D printer head and the obstacle, and adjust the printing path accordingly. The formula is:

[0132]

[0133] in, This indicates the distance assessment between the 3D printer head and the obstacle; This represents the distance assessment between the 3D printer head and the obstacle in the j-th 3rd dimension. Let f represent a random vector with a columnar distribution, used for sudden changes in obstacle position; f represents a uniformly random number between 2 and 4; c is a uniformly random number between 1 and 1.5. It is a uniformly random number between 2 and 3, and the formula is: g represents a uniformly random number between -1 and 1; It is a random vector with dimension 1×m;

[0134] Based on the distance assessment between the 3D printer head and obstacles, the following formula is used to update the position of the food delivery cart's 3D printing path planning:

[0135]

[0136] in, The objective function value representing the distance assessment between the 3D printer head and the obstacle;

[0137] (505) After the food delivery vehicle's 3D printing path planning avoids obstacles, the globally optimal printing path is updated:

[0138] After the food delivery vehicle avoids obstacles in the 3D printing path planning, the target point of the globally optimal printing path is updated using the following formula:

[0139]

[0140] i3 = 1, 2, ..., N, j3 = 1, 2, ..., m

[0141] in, Indicates from A random vector or number randomly selected from r; 10 This represents a random number generated within the range of 0 and 1. r represents a random vector between 0 and 1; 12 r represents a normally distributed random number; 13 This represents a random number generated within the range of 0 and 1; Let represent the upper bound of the j-th decision variable at the current position; This represents the lower bound of the j-th decision variable at the current position;

[0142] This leads to the updated globally optimal printing path for the food delivery cart's 3D printing path planning, as shown in the formula:

[0143]

[0144] Based on the same inventive concept, this invention also provides a 3D printing path planning system for food delivery carts based on an improved HO algorithm, comprising:

[0145] An initialization module is used to design the STL model of the food delivery vehicle and preprocess the design data of the model using a balanced binary tree algorithm.

[0146] The layering module is used to adaptively coarsely layer the STL model of the food delivery vehicle after data preprocessing to obtain the layered contour information; based on the contour information, considering the sharp edge features of the model, it further subdivides the layers.

[0147] The optimization module is used to extract and optimize the contour lines based on the layered STL model of the food delivery vehicle. The optimization method is to improve the quality of the contour lines by encrypting and filtering small areas.

[0148] The filling module is used to fill the layered contour lines of the optimized food delivery vehicle model using a scanning method that combines direct vector offset and reciprocating straight line filling, generating possible paths for 3D printing of the food delivery vehicle.

[0149] The planning module is used to establish an objective function based on the possible paths of 3D printing of food delivery vehicles, with the goal of minimizing empty travel. The improved Hippo HO optimization algorithm is used to optimize the objective function and complete the path planning for 3D printing of food delivery vehicles.

[0150] Based on the same inventive concept, the present invention also provides a computing device, comprising: one or more processors, one or more memories, and one or more programs, the programs being stored in the memory and configured to be executed by the processor, the programs being loaded onto the processor to implement the steps of the food delivery vehicle 3D printing path planning method based on the improved HO algorithm as described in any of the preceding claims.

[0151] Based on the same inventive concept, the present invention also provides a storage medium storing a computer program, the computer program including program instructions, which, when executed by a processor, cause the processor to perform the steps of the delivery cart 3D printing path planning method based on the improved HO algorithm as described in any of the preceding claims.

[0152] Beneficial effects: Compared with the prior art, the present invention provides a more efficient path planning scheme for 3D printing of food delivery carts, achieving multiple advantages such as improved efficiency, optimized path layout, and enhanced global search capability; at the same time, the optimized contour line further improves the uniformity and stability of the filling during the printing process, effectively reducing defects caused by underfill or overfill, thereby significantly improving the overall efficiency and product quality of 3D printing of food delivery carts; the improved HO optimization algorithm enhances the global search capability, improves the convergence speed, avoids premature convergence to local optima, and thus increases the possibility of finding the globally optimal printing path. Attached Figure Description

[0153] Figure 1 This is a flowchart of a method according to an embodiment of the present invention;

[0154] Figure 2 This is a flowchart of the process for removing duplicate vertices in an STL file according to an embodiment of the present invention;

[0155] Figure 3 This is a flowchart of the improved HO optimization algorithm according to an embodiment of the present invention. Detailed Implementation

[0156] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings.

[0157] As attached Figure 1 As shown in this embodiment, the 3D printing path planning method for food delivery carts based on the improved HO algorithm includes:

[0158] (1) Design the STL model of the food delivery vehicle, and preprocess the design data of the model using the balanced binary tree algorithm;

[0159] (2) Adaptive coarse layering is performed on the STL model of the food delivery vehicle after data preprocessing to obtain the contour information after layering; based on the contour information, considering the sharp edge features of the model, the subdivision layer is performed.

[0160] (3) Extract the outline based on the layered food delivery vehicle STL model and optimize the outline. The optimization method is to improve the quality of the outline by encrypting and filtering small areas.

[0161] (4) A scanning method combining direct vector offset method and reciprocating straight line filling is used to fill the layered contour lines of the optimized food delivery vehicle model to generate possible paths for 3D printing of the food delivery vehicle.

[0162] (5) Based on the possible paths of the food delivery vehicle 3D printing, an objective function is established with the goal of minimizing the empty travel distance. The improved Hippo HO optimization algorithm is used to optimize the objective function and complete the path planning for the food delivery vehicle 3D printing.

[0163] Specifically, in step (1), the designed food delivery vehicle STL model is input, and its relevant design data is preprocessed;

[0164] To achieve high-efficiency 3D printing of food delivery carts, this invention first exports the 3D model of the food delivery cart, created based on actual usage scenarios and functional requirements, into an STL file. The model contains key information such as the overall structure of the food delivery cart, component layout, and interface dimensions. Furthermore, food delivery cart STL files typically use triangular meshes to represent the 3D model, which facilitates path planning algorithms in quickly and accurately identifying the model's outline and key features, thereby determining an efficient printing sequence.

[0165] However, in 3D printing path planning, considering that the STL file of the food delivery vehicle may contain duplicate vertex data, resulting in redundancy, this invention uses a balanced binary tree algorithm to remove duplicate vertices, such as... Figure 2 As shown, the specific steps are as follows:

[0166] (101) Traverse all vertex data in the food delivery truck STL file;

[0167] (102) In a balanced binary tree, find vertex X1 according to the principle of left smaller and right larger. If vertex X1 does not exist, insert it at the corresponding position and ensure that the tree remains balanced.

[0168] (103) If vertex X1 already exists in the tree, it means that vertex X1 is a duplicate and does not need to be inserted. Then, determine whether vertex Y1 with the same coordinates as X1 exists in the tree.

[0169] (104) If vertex Y1 does not exist, insert it at the appropriate position and ensure that the tree remains balanced;

[0170] (105) If vertex Y1 already exists in the tree, it means that vertex Y1 is a duplicate and does not need to be inserted. Then, determine whether vertex Z1 with the same X1 and Y1 coordinates exists in the tree.

[0171] (106) If vertex Z1 does not exist, insert it at the appropriate position and ensure that the tree remains balanced;

[0172] (107) If vertex Z1 already exists in the tree, it means that vertex Z1 is a duplicate and does not need to be inserted.

[0173] (108) End;

[0174] Where X1, Y1, and Z1 are the vertex coordinates of the triangular mesh in the STL file;

[0175] In step (2), the STL model of the food delivery vehicle after data preprocessing is sliced ​​using an adaptive layering algorithm;

[0176] To avoid issues such as voids and breaks that may occur in traditional layering methods, and to ensure that the printed 3D model of the food delivery cart has good structural strength and surface quality, this invention employs an adaptive layering algorithm to guarantee the efficiency and accuracy of converting the STL model of the food delivery cart into printing instructions. The adaptive layering algorithm is an intelligent 3D printing preprocessing technology that automatically analyzes the geometric features of the model to adjust the thickness of each layer, optimizing the quality and efficiency of the printed part. This converts the processed 3D model into a 2D layer file that can be recognized and executed by the printing equipment.

[0177] This invention considers the step effect and the offset and loss of model features when designing the adaptive layering algorithm. First, it performs adaptive coarse layering to obtain the contour information after slice layering. Then, considering the sharp edge features of the model, it performs subdivision layering. This algorithm improves printing speed while refining key detail areas to ensure high accuracy, thus effectively balancing printing quality and material usage. The specific steps are as follows:

[0178] (201) First, in the adaptive coarse layering part of the algorithm, this invention uses the top height method to determine the height of each layer of the model. The process is as follows:

[0179] The formula for calculating the tip height is:

[0180]

[0181] Where δ refers to the maximum distance between the boundary of the 3D model and the boundary of the printed entity, measured along the direction of the normal vector of the 3D model surface, i.e., the top height; The thickness of the layer is indicated by θ, which is the tilt angle of the triangular facet, θ∈[0°,180°].

[0182] The formula for the tilt angle of a triangular facet is:

[0183]

[0184] Where cosθ is the tilt angle of the triangular facet; N1 is the normal vector of the facet; Z is the layering plane; N Z For the Z-axis component;

[0185] Then, let D be the range of thickness for the surface layering specified in the printing of the food delivery cart model. min ~D max The formula for adaptive layer thickness is:

[0186] D'1=D max -(D max -D min )×cosθ

[0187] Where D'1 is the adaptive layer thickness; D min ~D max The range of layer thickness;

[0188] Since the normal vectors of the facets in the food delivery cart STL model file are all unit vectors, substituting the formula for the tilt angle of the triangular facets into the formula for adaptive layer thickness yields the simplified formula for adaptive layer thickness:

[0189] D'2=D max -(D max -D min )×|N Z |

[0190] Where D'2 is the simplified adaptive layer thickness;

[0191] (202) Then, based on the adaptive coarse layering and the obtained layer contour information, the sharp edge features of the model are considered to further subdivide the layers. To avoid the loss or distortion of model features in the food delivery vehicle, this invention adopts the method of reducing the layer thickness to preserve model features. The specific steps are as follows:

[0192] The dihedral angle between two adjacent triangular facets is used to identify acute edge features. The formula is as follows:

[0193] β=π-arccos(N f1 ·Nf2 )

[0194] Where β is the dihedral angle between two adjacent triangular facets; N f1 and N f2 Let be the normal vector of two adjacent triangular facets;

[0195] If the dihedral angle between two triangular facets is less than a critical value, it means that the common edge of these two triangular facets can be considered an acute edge. Therefore, the layer thickness needs to be reduced at the acute edge feature. The adaptive layer thickness formula is:

[0196]

[0197] Where D'3 is the layer thickness at the sharp edge feature;

[0198] Therefore, when determining the final layer thickness, this invention adopts a weighted approach to combine the two components to reduce the impact of the step effect, while better preserving the characteristics of the food delivery cart model. The formula is as follows:

[0199]

[0200] in, The final determined layer thickness;

[0201] Therefore, the formula for calculating the layer height of the next layer is:

[0202]

[0203] Among them, H i+1 H represents the layer height of the next level. i The layer height of the current layer (for H) i+1 (Make corrections);

[0204] In step (3), the contour lines are extracted and optimized by constructing a mathematical model. The optimization method of the contour lines is to improve the quality of the contour lines by encrypting the data and filtering small areas.

[0205] After slicing the food delivery cart model, a slicing plane is constructed at this layer height. This plane is then intersected with the spatial triangular facets stored in the food delivery cart's STL model file. By solving for the coordinates of all intersection points within this plane and connecting these points sequentially, the outline of the model in this slice layer can be obtained. The specific steps are as follows:

[0206] (301) First, construct a mathematical model of the intersection points of the three sides of the triangular facet with the tangent plane. Let the coordinates of the three points be A = (x1, y1, z1), B = (x2, y2, z2), and C = (x3, y3, z3). Taking one side AB of the triangular facet as an example, find the coordinates of the intersection point P of this side and the tangent plane using the following formula:

[0207]

[0208] in, Let P be the vector from the origin to the intersection point P of the edge of the triangular facet and the tangent plane; Let A be the vector from the origin to point A. Let be the vector from point A to point P; Let be the distance from vertex A to the tangent plane; Let be the distance between vertices A and B on the normal vector of the slice plane; Let be the vector from point A to point B;

[0209] After obtaining the coordinates of intersection point P, the coordinates of the remaining two points can be calculated, while excluding intersection points located on the edge extensions. Then, connecting these three intersection points in sequence allows the outline of the spatial triangular facet to be drawn on the cutting plane. Finally, all the determined intersection segments in this layer are connected in a predetermined order to form the complete outline of this layer.

[0210] (302) Then, after obtaining the initial outline, a densification process is used to make the outline denser, thereby improving the cutting accuracy and effectively removing small areas that have little impact on the overall structure. This avoids wasting resources and unnecessarily extending the processing time during the 3D printing of the food delivery cart. The specific steps are as follows:

[0211] First, traverse the boundary lines and calculate the midpoint coordinates (x, y). mid ,y mid );

[0212] Then, iterate through the contour lines and use a formula to refine the points between them. The formula is as follows:

[0213]

[0214] in, and The coordinates are encrypted; The coordinates of the point before encryption; P i2 is the coordinate of the contour line; w is the desired distance between two points; k1 represents the number of points to be added at equal intervals between the two coordinate points; The scaling factor for encryption between two points;

[0215] Following the contour line in a clockwise direction, determine whether the lines connecting the midpoint of the boundary line to each point on the contour line are completely within the region to be optimized, ensuring that these lines do not intersect the boundary line. Retain all target vectors that are completely within the region to be optimized and record them in the order they appear on the contour line.

[0216] Calculate the angle between the first vector in the target vector and the other vectors, and take the length of the vector corresponding to the point with the smallest difference from 90° in the set of angles as the length of the current region to be optimized. When the length of the region to be optimized is less than the length filtering threshold, filtering is performed; otherwise, the current region is saved for subsequent processing. This can effectively remove small regions that have little impact on the overall structure, thereby avoiding waste of resources and unnecessary extension of processing time.

[0217] In step (4), a scanning method combining the direct biasing of vectors and the reciprocating straight line filling is used to scan and fill the path of the food delivery vehicle model slice;

[0218] After obtaining the optimized layered contour curves of the food delivery vehicle model, it is necessary to plan the filling path within it. This invention employs a composite scanning method combining contour offset filling and reciprocating straight line filling (Zig-Zag filling) to improve filling efficiency and ensure coverage integrity.

[0219] (401) First, the vector direct offset method is adopted. By gradually adjusting the offset of the contour, the efficiency of the printing process and the accuracy of the model are improved. The specific steps are as follows:

[0220] First, calculate the unit vectors of any two points E(x4,y4) and F(x5,y5) on the optimized layered contour. The formula is:

[0221]

[0222] Where d is the distance between points E and F; Let x be the unit vector between points E and F; x4 and x5 are the x-coordinates between points E and F; y4 and y5 are the y-coordinates between points E and F.

[0223] Next, in the 3D path printing planning of the food delivery cart, considering the offset during contour offset filling ensures accurate internal filling of the model. Therefore, this invention sets a reasonable offset R to optimize the printing path, reduce unnecessary empty strokes, and thus improve printing speed and quality. The equidistant line after the EF segment is offset to the left by R is E1F1, thus obtaining the offset unit vector. The formula is:

[0224]

[0225] in, The unit vector of E1F1 after biasing;

[0226] Thus, the bias vector is obtained. The calculation formula is as follows:

[0227]

[0228] in, R is the bias vector; R is the offset.

[0229] Then the coordinates of E1 are obtained as follows:

[0230]

[0231] Next, the equation of the equidistant line is obtained, and its formula is:

[0232] x4 ≠ x5

[0233]

[0234] Where k2 is the slope of lines E1F1 and EF; b is the y-intercept of lines E1F1 and EF.

[0235] Then, the coordinates of the offset point are calculated, which involves finding the intersection of the equations of two adjacent equidistant lines. To avoid two lines having infinite slopes and no intersection point, this invention will discuss two cases:

[0236] First, set three adjacent points on the outline ring of the food delivery cart model as G(x6, y6), H(x7, y7), and I(x8, y8), and H'(x m y m ) is the bias point of H;

[0237] When k1=∞ and k2≠∞, the coordinates of the offset point can be obtained by solving the simultaneous equations:

[0238]

[0239] Where x and y are the x and y coordinates of the offset point; x7 and x8 are the x coordinates of points H and I, respectively; y6, y7, and y8 are the y coordinates of points G, H, and I, respectively; k3 is the slope of GH; and k4 is the slope of HI.

[0240] When k3≠∞ and k4=∞, the coordinates of the offset point can be obtained by solving the simultaneous equations:

[0241]

[0242] Where x6 is the x-coordinate of point G;

[0243] Finally, by connecting the coordinates of each offset point in sequence, the filling path of the contour offset can be obtained;

[0244] (402) In the process of 3D printing the food delivery vehicle model, based on the basic path framework established by contour offset, this invention adopts an efficient reciprocating straight-line filling strategy. This strategy enables stable and rapid printing while ensuring uniform material distribution in the model, which not only improves the mechanical properties and accuracy of the finished part but also simplifies the path planning process. This method not only reduces the failure rate that may occur during printing but also saves material usage, thereby reducing production costs. The specific steps are as follows:

[0245] First, locate the vertices of the entire contour line, then sort the y-coordinates of all vertices to find the Y-coordinate. min and Y max The formula for obtaining the first scan line is:

[0246] Y = S1J + Y min

[0247] Where Y is the equation of the first scan line; S1 is the number of scan lines; J∈[0,Y] max -Y min [ ] represents the spacing between scan lines;

[0248] Next, find the equation of the straight line of the contour. Assume the contour is a straight line, (X a ,Y a ) and (X b ,Y b If ) are two points on the contour, then the equation of the straight line of the contour is:

[0249]

[0250] The coordinates of the intersection point of the first fill line and the contour boundary are:

[0251]

[0252] Then, the intersection points of the initial fill lines are determined through intersection calculations and connected to form the first fill line. Subsequently, this line is translated a distance J in a predetermined direction, and intersection calculations are performed again to obtain new intersection points, thereby generating the second fill line. This process is repeated until the entire area is filled with reciprocating straight lines.

[0253] The present invention employs a scanning method that combines the direct vector bias method and the reciprocating straight line filling method to scan and fill the model slices. The direct vector bias method accurately calculates the scanning path, ensuring a balance between accuracy and efficiency. At the same time, the reciprocating straight line filling method is used to quickly cover the printing area, improving the 3D printing speed and material utilization of the food delivery vehicle.

[0254] (5) The improved HO optimization algorithm is used to optimize the printing path of the D printer head;

[0255] To improve the efficiency of 3D printing of food delivery carts and effectively control costs, considering the complexity of the 3D printing path, this invention employs an improved, highly efficient optimization algorithm—the Hippo (HO) optimization algorithm. This algorithm performs in-depth optimization of the composite infill path to find a path that minimizes overall printing time and maximizes efficiency. The specific steps are as follows:

[0256] (501) First, construct the objective function to reduce printing time and improve printing quality. This invention establishes the objective function to be optimized by the algorithm based on the principle of minimizing empty travel. The advantage of this objective function is that it can provide a fast, efficient, and cost-effective solution for 3D printing of food delivery vehicles; its optimization objective function formula is:

[0257]

[0258] Where i3 and j3 are the numbers of each possible path for the 3D printing of the food delivery cart; N is the total number of paths; Let i be the jump distance from path i3 to path j3; S1 is a decision variable, representing whether the connecting line may contain a connecting line segment from path i3 to path j3, where 1 indicates that it contains and 0 indicates that it does not contain; S2 is the set of paths.

[0259] Then, the improved Hippo optimization algorithm is used to optimize the objective function constructed for the 3D printing path planning of the food delivery vehicle, thereby improving printing efficiency. The specific steps are as follows:

[0260] (502) Set the number of possible paths N for 3D printing of the food delivery cart and the total number of iterations;

[0261] (503) Construct a matrix of all possible path locations for 3D printing of food delivery carts:

[0262] In the initial phase of path planning for 3D printing of food delivery vehicles, the shortest path optimization is performed by generating an initial population of possible path solutions, such as... Figure 3 As shown, the algorithm introduces the Fuchs mapping to optimize the initial population, thereby helping the algorithm to explore the solution space more comprehensively, improving its global search capability and convergence speed. The formula is as follows:

[0263]

[0264] in, This represents the possible path solutions for 3D printing the i3+1th food delivery cart; This represents the possible path solutions for 3D printing the i3th food delivery cart;

[0265] Each solution represents a possible path, which is a vector formula consisting of a series of decision variables, and the formula is as follows:

[0266]

[0267] Where r represents a random number in the range of 0 to 1; This represents the lower bound of the j3rd decision variable; The upper bound of the j3rd decision variable; N represents the number of possible path solutions for 3D printing of the food delivery truck; m represents the number of decision variables in the problem; This represents the position of the possible path solution for the i3th food delivery vehicle 3D printing in the j3rd dimension, i.e., the value of the j3rd decision variable;

[0268] Then, the locations of all possible path solutions for the 3D printing of the food delivery cart are collected and constructed in matrix form, with the following formula:

[0269]

[0270] Where χ represents the set of locations of all possible path solutions for 3D printing of food delivery vehicles;

[0271] (504) Generate candidate paths for global and local optima in the 3D printing path planning of food delivery carts:

[0272] Based on the printing path position matrix, the HO algorithm update formula is used to update the optimal path for global and local 3D printing of the food delivery vehicle.

[0273] To ensure efficient printing, the target points of the global movement trajectory in the optimized print space are updated using the following formula:

[0274]

[0275] To ensure printing accuracy, the target points for each local printing path are updated using the following formula:

[0276]

[0277] in, This represents the target point of the global movement trajectory in the 3D printing path planning of the food delivery vehicle. This indicates the position of the target point in the j3rd dimension of the global movement trajectory of the i3th food delivery vehicle 3D printing path planning; This represents the target point of the global movement trajectory of the food delivery vehicle's 3D printing path planning after adaptive t-distribution perturbation. Let represent the target point of the global movement trajectory of the food delivery vehicle 3D printing path planning in the t-th iteration; t(iter) represents the adaptive t-distribution function with the number of iterations as the degree of freedom parameter; Dhippo represents the optimal printing target point found among the possible paths of the current food delivery vehicle 3D printing path planning; y1 represents a random number between 0 and 1; I1 represents an integer between 1 and 2. This represents the target point of the local printing path in the 3D printing path planning of the food delivery vehicle; This indicates the position of the target point of the local printing path of the i3th food delivery vehicle 3D printing path planning in the j3rd dimension; This refers to the average of the target points of a local printing path planned from randomly selected delivery cart 3D printing paths; T represents the time variable, and the formula is... I2 represents an integer between 1 and 2; r6 represents a number between 0 and 1; h2 represents a number or vector randomly selected from the five scenarios in equation h; r7 represents a number between 0 and 1; h1 represents a number or vector randomly selected from equation h.

[0278] The formula for equation h is:

[0279]

[0280] Where I1 and I2 represent integers between 1 and 2; r5 represents a random vector between 0 and 1; r5 represents a random number between 0 and 1. and Represents a random integer, which can be 1 or 0;

[0281] After the global and local printing target points of the food delivery cart's 3D printing path are updated, the global and local path trajectories are updated using the following formula:

[0282]

[0283] in, Represents the objective function value; The objective function value represents the globally optimal printing path for the 3D printing path planning of the food delivery vehicle; The objective function value represents the local optimal printing path of the food delivery vehicle 3D printing path planning;

[0284] (505) When the delivery cart encounters an obstacle during 3D printing, the local printing path is adjusted to avoid the obstacle:

[0285] In the path planning of 3D model printing for food delivery vehicles, the HO optimization algorithm is used to navigate the search space. By updating the position information of obstacles, the 3D printer head avoids obstacles in the printing area and generates a new path.

[0286] The formula for updating the position of obstacles in the search space is:

[0287]

[0288] Where Predator represents the position of the obstacle in the search space; This indicates the position of the obstacle in the j3rd dimension of the search space; Represents a random vector ranging from 0 to 1;

[0289] Next, based on the spatial location of the obstacle, assess the distance between the 3D printer head and the obstacle, and then adjust the printing path to ensure a smooth printing process and avoid collisions. The formula is as follows:

[0290]

[0291] in, This indicates the distance assessment between the 3D printer head and the obstacle; This represents the distance assessment between the 3D printer head and the obstacle in the j-th 3rd dimension. Let f represent a random vector with a columnar distribution, used for sudden changes in obstacle position; f represents a uniformly random number between 2 and 4; c is a uniformly random number between 1 and 1.5. It is a uniformly random number between 2 and 3, and the formula is: g represents a uniformly random number between -1 and 1; It is a random vector with dimension 1×m;

[0292] Based on the distance assessment between the 3D printer head and obstacles, the following formula is used to update the position of the food delivery cart's 3D printing path planning:

[0293]

[0294] in, The objective function value representing the distance assessment between the 3D printer head and the obstacle;

[0295] (506) After the food delivery vehicle's 3D printing path planning avoids obstacles, the globally optimal printing path is updated:

[0296] After the food delivery vehicle avoids obstacles in the 3D printing path planning, the target point of the globally optimal printing path is updated using the following formula:

[0297]

[0298] i3 = 1, 2, ..., N, j3 = 1, 2, ..., m

[0299] in, Indicates from A random vector or number randomly selected from r; 10 This represents a random number generated within the range of 0 and 1. r represents a random vector between 0 and 1; 12 r represents a normally distributed random number; 13 This represents a random number generated within the range of 0 and 1; Let represent the upper bound of the j-th decision variable at the current position; This represents the lower bound of the j-th decision variable at the current position;

[0300] This leads to the updated globally optimal printing path for the food delivery cart's 3D printing path planning, as shown in the formula:

[0301]

[0302] The HO optimization algorithm is used to optimize the shortest printing path in the 3D printing path planning of the food delivery vehicle, thereby improving the overall printing efficiency of the 3D model of the food delivery vehicle and ensuring efficient and reliable production of finished products in a constantly changing printing environment.

[0303] This embodiment may also include step (6) of converting the optimized path into G-code instructions.

[0304] Based on the same inventive concept, this embodiment also provides a 3D printing path planning system for food delivery carts based on an improved HO algorithm, including:

[0305] An initialization module is used to design the STL model of the food delivery vehicle and preprocess the design data of the model using a balanced binary tree algorithm.

[0306] The layering module is used to adaptively coarsely layer the STL model of the food delivery vehicle after data preprocessing to obtain the layered contour information; based on the contour information, considering the sharp edge features of the model, it further subdivides the layers.

[0307] The optimization module is used to extract and optimize the contour lines based on the layered STL model of the food delivery vehicle. The optimization method is to improve the quality of the contour lines by encrypting and filtering small areas.

[0308] The filling module is used to fill the layered contour lines of the optimized food delivery vehicle model using a scanning method that combines direct vector offset and reciprocating straight line filling, generating possible paths for 3D printing of the food delivery vehicle.

[0309] The planning module is used to establish an objective function based on the possible paths of 3D printing of food delivery vehicles, with the goal of minimizing empty travel. The improved Hippo HO optimization algorithm is used to optimize the objective function and complete the path planning for 3D printing of food delivery vehicles.

[0310] Based on the same inventive concept, this embodiment also provides a computing device, including: one or more processors, one or more memories, and one or more programs, the programs being stored in the memory and configured to be executed by the processor, the programs being loaded onto the processor to implement the steps of the food delivery vehicle 3D printing path planning method based on the improved HO algorithm according to any one of the above claims.

[0311] Based on the same inventive concept, this embodiment also provides a storage medium storing a computer program, the computer program including program instructions, which, when executed by a processor, cause the processor to perform the steps of the food delivery vehicle 3D printing path planning method based on the improved HO algorithm described above.

Claims

1. A 3D printing path planning method for a food delivery vehicle based on an improved HO algorithm, characterized in that: include: (1) Designing an STL model of a food delivery vehicle, and preprocessing the design data of the model using a balanced binary tree algorithm; (2) Adaptively coarsely stratify the food delivery vehicle STL model after data preprocessing to obtain stratified contour information; Based on the contour information, the sharp edge features of the model are considered to perform subdivision layers; (3) extracting contour lines based on the layered STL model of the food delivery vehicle and optimizing the contour lines, wherein the optimization method is to improve the quality of the contour lines by encrypting and filtering small areas; (4) A scanning method combining vector direct offset method and reciprocating straight line filling is used to fill the layered contour lines of the optimized food delivery vehicle model and generate possible paths for 3D printing of the food delivery vehicle; (5) Based on the possible paths of 3D printing of the food delivery vehicle, an objective function is established with the goal of minimizing the empty travel distance. The improved Hippo HO optimization algorithm is used to optimize the objective function to complete the 3D printing path planning of the food delivery vehicle.

2. The method for 3D printing path planning of a food delivery vehicle based on an improved HO algorithm according to claim 1, characterized in that: The step (1) comprises: According to the actual usage scenario and functional requirements, an STL model of a food delivery vehicle is designed, wherein the STL file of the model uses a triangular mesh to represent a 3D model; Use a balanced binary tree algorithm to remove duplicate vertices from the model STL file, including: Traverse all the vertex data in the food delivery car STL file; In a balanced binary tree, search for vertex X1 according to the principle of small on the left and large on the right. If vertex X1 does not exist, insert it at the corresponding position and ensure that the tree remains balanced. If vertex X1 already exists in the tree, determine whether vertex Y1 with the same coordinates as X1 exists in the tree; If vertex Y1 does not exist, insert it at the corresponding position and ensure that the tree remains balanced; If vertex Y1 already exists in the tree, determine whether vertex Z1 with the same coordinates as X1 and Y1 exists in the tree; If vertex Z1 does not exist, insert it at the corresponding position and ensure that the tree remains balanced; If vertex Z1 already exists in the tree, it means that vertex Z1 is a duplicate and does not need to be inserted; Among them, X1, Y1 and Z1 are the vertex coordinates of the triangle mesh in the STL file.

3. The method for 3D printing path planning of a food delivery vehicle based on an improved HO algorithm according to claim 1, characterized in that: The step (2) comprises: (201) The preprocessed food delivery vehicle STL model is adaptively coarsely layered, and the top height method is used to determine the height of each layer to obtain the contour information after layering: The calculation formula for the top height is: Among them, δ is the top height, which refers to the maximum distance between the model boundary and the printed entity boundary measured along the normal vector direction of the surface of the preprocessed food delivery car STL model; is the layer thickness, θ is the tilt angle of the triangular patch, θ∈[0°,180°]; The formula for the tilt angle of a triangle is: Among them, cosθ is the tilt angle of the triangle patch; N1 is the normal vector of the patch; Z is the layering plane; N Z is the Z-direction component; Assume that the range of the dough layer thickness specified in the printing of the food delivery car model is [D min ,D max ], the formula for adaptive layer thickness is: D1,=D max -(D max -D min )×cosθ Where D1, is the adaptive layer thickness; D1,∈[D min ,D max ]; Substituting the formula of the tilt angle of the triangle into the formula of the adaptive layer thickness, the simplified adaptive layer thickness formula is: D2,=D max -(D max -D min )×|N Z | Among them, D2 is the thickness of the adaptive layer after simplification; (202) Based on the layered contour information and considering the sharp edge features of the model, the layers are subdivided and the model features are retained by reducing the layer thickness, including: Calculate the dihedral angle between two adjacent triangles to identify sharp edge features. The formula is: β=π-arccos(N f1 ·N f2 ) Where β is the dihedral angle between two adjacent triangles; N f1 and N f2 is the normal vector of two adjacent triangles; If the dihedral angle between two adjacent triangles is less than the critical value, the common edge of the two adjacent triangles is considered a sharp edge; Reduce the layer thickness at the sharp edge features. The formula for adaptive layer thickness is: Where D3 is the layer thickness at the sharp edge feature; For D2 and D3, the weights are combined, and the formula is: in, is the final layer thickness; The calculation formula for the next layer's layer height is: in, is the layer height of the next layer; The layer height of the current layer.

4. The method for 3D printing path planning of a food delivery vehicle based on an improved HO algorithm according to claim 1, characterized in that: The step (3) comprises: (301) Based on the layered food delivery vehicle STL model, a slicing plane is constructed at the layer height position of the current layer. The slicing plane is intersected with the spatial triangular facets stored in the food delivery vehicle STL model file to construct a mathematical model of the intersection of the three edges of the triangular facets and the tangent plane. The coordinates of the three points are set as A = (x1, y1, z1), B = (x2, y2, z2), and C = (x3, y3, z3). Taking an edge AB in the triangular facet as an example, the coordinates of the intersection point P of the edge and the tangent plane are calculated. The formula is as follows: in, It is the vector from the origin to the intersection point P of the edge of the triangle and the tangent plane; is the vector from the origin to point A; is the vector from point A to point P; is the distance from vertex A to the tangent plane; is the distance between vertices A and B on the slice plane normal vector; is the vector from point A to point B; After obtaining the coordinates of the intersection point P, continue to calculate the remaining two coordinates, while excluding the intersection points located on the extended edge line; then, connect the above three intersection points in sequence to outline the contour line segments of the spatial triangular facet on the cutting plane; connect all the determined intersection line segments in this layer in a predetermined order to form a complete contour line of this layer; (302) Encryption processing is used to increase the density of contour lines, including: Traverse the intersection line and calculate the midpoint coordinates (x mid ,y mid ); Traverse the contour line and use the formula to perform encryption processing between two points. The formula is as follows: in, and is the encrypted coordinate; is the point coordinate before encryption; is the contour line coordinate; w is the desired distance between two points; k1 represents the number of equally spaced points between two coordinate points; is the scaling factor for encryption between two points; According to the clockwise direction of the contour line, determine one by one whether the connecting line between the midpoint of the boundary line and each point of the contour line is completely located in the area to be optimized, and ensure that the connecting line does not intersect with the boundary line; retain all target vectors that are completely located in the area to be optimized, and record them in the order in which the target vectors appear on the contour line; Calculate the angle between the first vector in the target vector and the remaining vectors, and take the vector length corresponding to the point with the smallest difference from 90° in the angle set as the length of the current area to be optimized; when the length of the area to be optimized is less than the length filtering threshold, filter it, otherwise save the current area.

5. The method for 3D printing path planning of a food delivery vehicle based on an improved HO algorithm according to claim 1, characterized in that: The step (4) comprises: (401) The vector direct offset method is used to gradually adjust the offset of the contour line, including: Calculate the unit vectors of any two points E(x4,y4) and F(x5,y5) on the optimized contour line The formula is as follows: Where d is the distance between points E and F; is the unit vector between points E and F; x4 and x5 are the horizontal coordinates between points E and F; y4 and y5 are the vertical coordinates between points E and F; Set the offset R to optimize the printing path and reduce unnecessary empty strokes. When the EF line segment is offset to the left by R, the equidistant line is E1F1, and the unit vector after the offset is obtained. The formula is: in, is the unit vector of E1F1 after bias; So we get the bias vector The calculation formula is: in, is the bias vector; R is the offset; The coordinates of E1 are: To find the equation of the equidistant line, the formula is: x4≠x5 Where, k2 is the slope of the straight line E1F1 and EF; b is the intercept of the straight line E1F1 and EF on the y-axis; Intersect the equations of two adjacent equidistant lines and calculate the coordinates of the offset point. Specifically: First, set the three adjacent points on the contour ring of the food delivery car model to be G(x6, y6), H(x7, y7) and I(x8, y8). , (x m ,y m ) is the bias point of H; When k3=∞, k4≠∞, the coordinates of the bias point obtained by the simultaneous equations are: Among them, x and y are the horizontal and vertical coordinates of the offset point; x7 and x8 are the horizontal coordinates of points H and I respectively; y6, y7, y8 are the vertical coordinates of points G, H, and I respectively; k3 is the slope of GH; k4 is the slope of HI; When k3≠∞, k4=∞, the coordinates of the bias point obtained by the simultaneous equations are: Among them, x6 is the horizontal coordinate of point G; Finally, the coordinates of each offset point are connected in sequence to obtain the filling path of the contour line offset; (402) A reciprocating linear filling strategy is adopted, including: Find the vertices of the entire contour line, sort the y values ​​of the ordinates of all vertices, and find the Y min and Y max ; Get the first scan line, the formula is: Y=S1J+Y min Where Y is the equation of the first scan line; S1 is the number of scan lines; J∈[0,Y max -Y min ] is the spacing between scan lines; Assuming the contour is a straight line, (X a ,Y a ) and (X b ,Y b ) are two points on the contour, then the straight line equation of the contour is: Then the coordinates of the intersection of the first fill line and the contour boundary are: Then, the intersection points of the initial filling lines are determined through intersection calculation and connected to form the first filling line; then, the straight line is translated by a distance J in a predetermined direction, and the intersection calculation is continued to obtain a new intersection point, thereby generating the second filling line; this process is repeated until the reciprocating straight line filling of the entire area is completed.

6. The method for 3D printing path planning of a food delivery vehicle based on an improved HO algorithm according to claim 1, characterized in that: The objective function in step (5) is: Among them, i3 and j3 are the numbers of each possible path of the food delivery car 3D printing; N is the total number of paths; is the jump distance from path i3 to path j3; is a decision variable, indicating whether the connecting line may contain the connecting line segment from path i3 to path j3, where 1 indicates inclusion and 0 indicates non-inclusion; S2 is a path set.

7. The method for 3D printing path planning of a food delivery vehicle based on an improved HO algorithm according to claim 1, characterized in that: The step (5) uses the improved Hippo HO optimization algorithm objective function for optimization processing, including: (501) Setting the number N of possible paths for the food delivery vehicle 3D printing and the total number of iterations; (502) Construct a matrix of all possible paths for 3D printing of food delivery vehicles: In the initialization stage of the shortest path optimization in the 3D printing path planning of the food delivery vehicle, a series of possible path solutions are generated into an initial population; the initial population of the Fuch mapping optimization algorithm is introduced, and the formula is: in, represents the possible path solution for the 3D printing of the food delivery vehicle i3+1; represents the possible path solution for the 3D printing of the food delivery vehicle i3; Each solution represents a possible path, which is represented by a vector formula: Where r represents a random number in the range of 0 to 1; represents the lower bound of the j3rd decision variable; The upper bound of the j3rd decision variable; N represents the number of possible path solutions for the 3D printing of the food delivery vehicle; m represents the number of decision variables in the problem; represents the position of the i3th possible path solution for 3D printing of the food delivery vehicle in the j3th dimension; The positions of all possible path solutions for the 3D printing of the food delivery vehicle are collected and constructed in the form of a matrix. The formula is: Where X represents the location set of all possible path solutions for the 3D printing of the food delivery vehicle; (503) Generate the global optimal and local optimal candidate paths in the 3D printing path planning of the food delivery vehicle: Based on the printing path position matrix, the update formula of the HO algorithm is used to update the optimal path of global and local 3D printing of the food delivery vehicle; Update the target point of the global moving trajectory in the optimized printing space. The formula is: Update the target point of each local printing path using the formula: in, The target point representing the global moving trajectory of the 3D printing path planning of the food delivery vehicle; represents the position of the target point of the global moving trajectory of the 3D printing path planning of the i3th food delivery vehicle in the j3th dimension; It represents the target point of the global moving trajectory of the 3D printing path planning of the food delivery vehicle after the adaptive t-distribution perturbation; represents the target point of the global moving trajectory of the 3D printing path planning of the food delivery vehicle at the tth iteration; t(iter) represents the adaptive t distribution function with the number of population iterations as the degree of freedom parameter; Dhippo represents the optimal printing target point found in the possible paths of the current 3D printing path planning of the food delivery vehicle; y1 represents a random number between 0 and 1; I1 represents an integer between 1 and 2; Represents the target point of the local printing path of the 3D printing path planning of the food delivery vehicle; represents the position of the target point of the local printing path of the i3th food delivery vehicle 3D printing path planning in the j3th dimension; It refers to the average value of the target points of the local printing path of some randomly selected food delivery vehicles 3D printing path planning; T represents the time variable, and the formula is I2 represents an integer between 1 and 2; r6 represents a number between 0 and 1; h2 represents a number or vector randomly selected from the five scenarios in equation h; r7 represents a number between 0 and 1; h1 represents a number or vector randomly selected from equation h; The formula for the h equation is: Wherein, I1 and I2 represent integers between 1 and 2; and represents a random vector between 0 and 1; r5 represents a random number between 0 and 1; and Represents an integer random number, which is 1 or 0; When the global and local printing target points of the 3D printing path of the food delivery vehicle are updated, the global and local path trajectories are updated. The formula is: in, represents the objective function value; The objective function value representing the global optimal printing path of the 3D printing path planning of the food delivery vehicle; The objective function value representing the local optimal printing path of the 3D printing path planning of the food delivery vehicle; (504) When the food delivery vehicle encounters an obstacle during 3D printing, the local printing path is adjusted to avoid the obstacle: In the printing path planning of the 3D model of the food delivery vehicle, the HO optimization algorithm is used to navigate the search space. By updating the position information of obstacles, the 3D printer head avoids obstacles in the printing area and generates a new path. The obstacle position update formula in the search space is: Among them, Predator represents the position of the obstacle in the search space; Represents the position of the obstacle in the j3rd dimension in the search space; represents a random vector ranging from 0 to 1; Then, according to the spatial position of the obstacle, the distance between the 3D printer head and the obstacle is evaluated and the printing path is adjusted. The formula is: in, Represents the distance assessment between the 3D printer head and the obstacle; represents the distance evaluation between the 3D printer head and the obstacle in the j3-th dimension; represents a random vector with Levian distribution for sudden changes in the obstacle position; f represents a uniform random number between 2 and 4; c is a uniform random number between 1 and 1.5; is a uniform random number between 2 and 3, and the formula is g represents a uniform random number between -1 and 1; is a random vector of dimension 1×m; Combined with the distance evaluation between the 3D printer head and the obstacle, the following formula is used to update the position of the 3D printing path planning of the food delivery vehicle: in, represents the objective function value of the distance evaluation between the 3D printer head and the obstacle; (505) After the 3D printing path planning of the food delivery vehicle avoids obstacles, the global optimal printing path is updated: After the food delivery vehicle avoids obstacles in the 3D printing path planning, the target point of the global optimal printing path is updated. The formula is: in, Indicates from A random vector or number randomly selected from 10 Represents a random number generated in the range of 0 and 1; represents a random vector between 0 and 1; r 12 represents a normally distributed random number; r 13 Represents a random number generated between 0 and 1; represents the upper bound of the j-th decision variable at the current position; represents the lower bound of the j-th decision variable at the current position; Then the global optimal printing path after the updated 3D printing path planning of the food delivery vehicle is obtained, and the formula is:

8. A 3D printing path planning system for food delivery vehicles based on an improved HO algorithm, characterized in that: include: An initialization module is used to design an STL model of a food delivery vehicle and preprocess the design data of the model using a balanced binary tree algorithm; The stratification module is used to perform adaptive coarse stratification on the food delivery vehicle STL model after data preprocessing to obtain the contour information after stratification; Based on the contour information, the sharp edge features of the model are considered to perform subdivision layers; An optimization module is used to extract contour lines based on the layered STL model of the food delivery vehicle and optimize the contour lines. The optimization method is: to improve the quality of the contour lines by encrypting and filtering small areas; A filling module is used to fill the optimized layered contour lines of the food delivery vehicle model using a scanning method that combines a vector direct offset method with a reciprocating straight line filling method, thereby generating a possible path for 3D printing of the food delivery vehicle; The planning module is used to establish an objective function based on the possible paths of the 3D printing of the food delivery vehicle with the goal of minimizing the empty stroke, and optimize the objective function using the improved Hippo HO optimization algorithm to complete the 3D printing path planning of the food delivery vehicle.

9. A computing device, characterized in that include: One or more processors, one or more memories, and one or more programs, wherein the programs are stored in the memories and configured to be executed by the processors, and when the programs are loaded into the processors, the steps of the method for 3D printing path planning of a food delivery vehicle based on an improved HO algorithm according to any one of claims 1 to 7 are implemented.

10. A storage medium storing a computer program, characterized in that: The computer program includes program instructions, which, when executed by a processor, cause the processor to perform the steps of the method for 3D printing path planning for a food delivery vehicle based on an improved HO algorithm according to any one of claims 1 to 7.

Citation Information

Cited By

  • 3D printing local enhancement path planning method and system based on finite element analysis

    CN121257215A