Method for generating filling path in 3D printing, storage medium and electronic equipment

By numbering and offsetting the contour data of the 3D printing model, a connected loop fill line is constructed, which solves the problem of no connection between concentric rings in the prior art, and achieves a more efficient printing speed and filling effect.

CN119502356APending Publication Date: 2025-02-25ZHENGZHOU CHAOKUO ELECTRONIC TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411616362.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-12
Publication Date
2025-02-25

AI Technical Summary

Technical Problem

In the existing 3D printing technology, when the loop-back filling method is processed with complex models, the concentric rings are not connected, resulting in an increase in the empty distance of the print head and reducing the printing speed.

Method used

By numbering and offsetting the outline data of the to-print model, the sub-ring offset results are generated, and the numbers are reassigned according to specific conditions, and finally a connected loop fill line is constructed in different numbered areas.

Benefits of technology

It reduces the empty distance of the print head, improves printing speed and efficiency, meets the needs of high-speed printing, and improves the model filling effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119502356A_ABST
    Figure CN119502356A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of 3D printing, and particularly provides a method for generating a filling path in 3D printing, a storage medium and electronic device.The method comprises the steps that contour data of a to-be-printed model is obtained, and a number is allocated to each parent ring in the contour data; the numbers represent different areas of the to-be-printed model; shifting each parent ring to generate a child ring shifting result; when each sub-ring in the sub-ring offset result meets the following condition I and condition II at the same time, distributing a new number for each sub-ring; the first condition is that the number of inner rings of all the child rings is different from the number of inner rings of all the parent rings, and / or the number of outer rings of all the child rings is different from the number of outer rings of all the parent rings; the second condition is that the Hausdorff distance between each sub-ring and the independent offset result of the corresponding parent ring is not smaller than a distance threshold value; and connecting type loopback filling lines are constructed in the areas corresponding to the different numbers respectively. According to the embodiment, the printing speed can be greatly increased, and the 3D printing efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of 3D printing, and in particular to a method, storage medium and electronic device for generating a filling path in 3D printing. Background Art

[0002] Each layer of a current 3D printed model consists of a perimeter, an infill, and other parts. The infill is a structure inside the perimeter of a 3D printed model. The purpose of this structure is to improve the strength and stability of the printed part and save materials. Different infill methods will have a certain impact on the printing speed of the model.

[0003] When processing certain graphics, the existing 3D printing loop filling method of internal filling lines does not connect the concentric rings of the loop filling, which significantly increases the idle distance of the print head and reduces the printing speed.

[0004] Therefore, how to provide a technical solution for an efficient method for generating filling paths in 3D printing has become a technical problem that needs to be solved urgently. Summary of the invention

[0005] The purpose of some embodiments of the present application is to provide a method, storage medium and electronic device for generating a filling path in 3D printing. Through the technical solutions of the embodiments of the present application, the printing speed can be increased, the printing efficiency can be improved, and the demand for high-speed printing can be met.

[0006] In a first aspect, some embodiments of the present application provide a method for generating a filling path in 3D printing, comprising: obtaining contour data of a model to be printed, and assigning a number to each parent ring in the contour data; the number represents different areas of the model to be printed; offsetting each parent ring to generate a sub-ring offset result; when each sub-ring in the sub-ring offset result satisfies the following conditions one and two at the same time, assigning a new number to each sub-ring; condition one: the number of inner rings of all sub-rings is different from the number of inner rings of all parent rings, and / or the number of outer rings of all sub-rings is different from the number of outer rings of all parent rings; condition two: the Hausdorff distance between the individual offset results of each sub-ring and the corresponding parent ring is not less than a distance threshold; and constructing connected loop fill lines in the areas corresponding to different numbers.

[0007] Some embodiments of the present application assign numbers to the contour data of the model to be printed, and then offset the parent ring therein to obtain the sub-ring offset result; by analyzing the sub-ring offset results based on conditions one and two, the final number of each ring is determined; and finally, connected loop fill lines are constructed in the areas corresponding to different numbers. The embodiments of the present application re-segment the fill area based on multiple ring offsets, and assign new numbers to the rings according to the topology (number of inner and outer rings) and geometric relationship (distance between rings) of the rings before and after the offset, so that the segmentation result of the printed fill area is more suitable for complex models with inner and outer rings. By printing concentric ring areas through connected loop fill lines, the printer can route by area when printing, reducing the idle distance, which can greatly increase the printing speed, improve the printing efficiency, meet the needs of high-speed printing, and also improve the model filling effect.

[0008] In some embodiments, after obtaining the contour data of the model to be printed, the method further includes: obtaining the area of ​​each parent ring corresponding to each contour data; if the area is positive, identifying each corresponding contour data as an outer ring; if the area is negative, identifying each corresponding contour data as an inner ring; and recording the number of the inner rings and the outer rings respectively.

[0009] Some embodiments of the present application determine the inner and outer rings and the number of inner and outer rings through the area of ​​each parent ring, so as to provide support for subsequent allocation of numbers.

[0010] In some embodiments, offsetting each parent ring to generate a sub-ring offset result includes: offsetting each parent ring according to a fixed offset parameter to generate the sub-ring offset result, and the offset parameter includes: an offset direction and an offset distance; if the sub-ring offset result is empty, terminating the offset; obtaining the length of each edge in each sub-ring, and removing the edges whose length is less than a length threshold; obtaining the area of ​​each sub-ring, and removing the sub-rings whose area is less than an area threshold.

[0011] Some embodiments of the present application provide a basis for the subsequent generation of appropriate loop filling lines by filtering out side lengths and sub-rings that do not meet the requirements after offsetting each parent ring according to the offset parameters.

[0012] In some embodiments, the area corresponding to each number contains concentric rings with equal spacing and in a parallel state; wherein, the connecting loop filling lines are constructed in the areas corresponding to different numbers, respectively, including: determining the i-th connection point on the i-th ring of the concentric rings, i is a positive integer, and retreating a distance along the printing direction at the i-th connection point to obtain the i-th starting point; determining the i+1-th connection point closest to the i-th connection point on the i+1-th ring, and advancing a distance along the printing direction at the i+1-th connection point to obtain the i-th end point; connecting the i-th starting point and the i-end point through a transition line segment to form a connecting line between the i-th ring and the i+1-th ring; and connecting the connecting lines between all adjacent concentric rings in sequence along the printing path to form a spirally continuous loop filling line.

[0013] Some embodiments of the present application generate connectivity between rings by determining corresponding starting points, end points and connection points on the i-th ring and the (i+1)-th ring; finally, all the connection lines between the rings are connected to obtain loop filling lines, thereby achieving continuous printing between concentric rings, greatly reducing the idle distance of the print head and improving the printing speed.

[0014] In some embodiments, the transition line segment is a third-order Bezier curve, a circular arc, or a parabola.

[0015] In some embodiments, determining the i-th connection point from the i-th ring of the concentric rings includes: when i=1, traversing all edges of the first ring, finding the longest edge of the first ring, and determining the midpoint of the longest edge as the first connection point; when i≠1, determining the point on the i-th ring that is closest to the i-1th connection point of the i-1th ring as the i-th connection point.

[0016] Some embodiments of the present application determine the connection points on the first ring and other rings in different ways, providing a connection basis for the subsequent creation of appropriate connected loop filling lines.

[0017] In some embodiments, the truncation distance is not less than a minimum truncation distance, and the minimum truncation distance is determined according to a minimum speed on a preset transition segment and a type of the transition segment.

[0018] Some embodiments of the present application can generate suitable connected loop filling lines through the minimum truncation distance, thereby improving printing quality and printing efficiency.

[0019] In some embodiments, connecting the i-th starting point and the i-th end point through a transition line segment to form a connecting line between the i-th ring and the i+1-th ring includes: obtaining a minimum speed on the transition line segment; based on the minimum speed on the transition line segment being less than a preset speed, increasing a preset cutoff distance so that the minimum speed is not less than the preset speed, using the increased preset cutoff distance to redetermine the i-th starting point and the i-th end point, and connecting the i-th starting point and the i-th end point through the transition line segment.

[0020] Some embodiments of the present application compare the minimum speed on the transition line with the preset speed and adjust the preset cutoff distance to determine the appropriate starting and ending points, so that the printing speed of the filling area is not less than the set minimum printing speed, thereby obtaining the appropriate starting and ending points of the connected loop fill line and obtaining the connected loop fill line that meets the expected printing requirements.

[0021] In a second aspect, some embodiments of the present application provide a device for generating a filling path in 3D printing, comprising: an acquisition module, used to acquire contour data of a model to be printed, and assign a number to each parent ring in the contour data; the number represents different areas of the model to be printed; an offset module, used to offset each parent ring to generate a sub-ring offset result; a numbering module, used to assign a new number to each sub-ring when each sub-ring in the sub-ring offset result satisfies the following conditions one and two at the same time; condition one: the number of inner rings of all sub-rings is different from the number of inner rings of all parent rings, and / or the number of outer rings of all sub-rings is different from the number of outer rings of all parent rings; condition two: the Hausdorff distance between the individual offset results of each sub-ring and the corresponding parent ring is not less than a distance threshold; a construction module, used to respectively construct connected loop fill lines in areas corresponding to different numbers.

[0022] In a third aspect, some embodiments of the present application provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, can implement the method described in any embodiment of the first aspect.

[0023] In a fourth aspect, some embodiments of the present application provide an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor can implement a method as described in any embodiment of the first aspect when executing the program.

[0024] In a fifth aspect, some embodiments of the present application provide a computer program product, wherein the computer program product comprises a computer program, wherein the computer program, when executed by a processor, can implement the method described in any embodiment of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] In order to more clearly illustrate the technical solutions of some embodiments of the present application, the drawings required for use in some embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0026] Figure 1 A schematic diagram of prior art loop filling provided for some embodiments of the present application;

[0027] Figure 2 A flow chart of a method for generating a filling path in 3D printing provided in some embodiments of the present application;

[0028] Figure 3 A schematic diagram of the STL model structure provided for some embodiments of the present application;

[0029] Figure 4 An offset schematic diagram provided for some embodiments of the present application;

[0030] Figure 5 A schematic diagram of selecting relevant points on a ring provided for some embodiments of the present application;

[0031] Figure 6 A schematic diagram of a connecting loop filling line provided for some embodiments of the present application;

[0032] Figure 7 A schematic diagram of a curve corner provided for some embodiments of the present application;

[0033] Figure 8 A schematic diagram of printing a boat model using a connected loop fill line provided in some embodiments of the present application;

[0034] Fig. 9 A flow chart of a method for filling area segmentation numbering in 3D printing provided in some embodiments of the present application;

[0035] Fig.10 A flow chart of a method for creating a connected loop fill line in 3D printing provided in some embodiments of the present application;

[0036] Fig.11 A block diagram of a device for generating a filling path in 3D printing provided in some embodiments of the present application;

[0037] Fig.12 A schematic diagram of an electronic device is provided for some embodiments of the present application. DETAILED DESCRIPTION

[0038] The technical solutions in some embodiments of the present application will be described below in conjunction with the drawings in some embodiments of the present application.

[0039] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.

[0040] In the related technology, the internal filling methods of existing 3D printing technology mainly include straight line filling, loop filling, grid filling, etc. Figure 1 The prior art shown in the figure is not connected between concentric rings when processing certain models that require loop filling, which significantly increases the idle distance of the print head and reduces the printing speed. The current prior art proposes a double arc connection to achieve a continuous transition between loops, but this filling path planning method can only be used for simple models. It is not applicable to complex models with inner and outer rings, and printing errors and unsuccessful printing will occur. The connection between two adjacent filling paths in this technology may be designed at a smaller edge or corner, which will cause too much printing material to pile up at the connection, resulting in printing failure and affecting the printing quality. In addition, this double arc transition connection method has great defects under high-speed printing. Because the radius of the double arc curve is determined by the distance between the rings, under the action of the corner speed, the actual minimum speed of the printer nozzle passing through the double arc curve is also fixed. This connection method makes it impossible for users to customize the minimum connection speed according to their needs. Therefore, the double arc connection method cannot be applied to high-speed printing.

[0041] In view of this, some embodiments of the present application provide a method for generating a filling path in 3D printing. When planning a loop filling line for a 3D printing model, in order to avoid excessive invalid empty driving and wire drawing caused by the nozzle, the method needs to perform initial numbering on the contour data of the 3D printing model, and then perform offset processing on each parent ring in the contour data to obtain a sub-ring offset result; by analyzing the sub-ring situation in the sub-ring offset result, the number of each sub-ring is determined, and finally, a connecting loop filling line (referred to as a connecting loop line) is constructed in the area corresponding to the number. The connecting loop line is a connecting curve. The flatter the connecting curve, the smaller the loss of printing speed, and the more it can meet the high-speed printing requirements, and finally each concentric ring area corresponding to different numbers can be filled with a continuous loop line, achieving a better model filling effect.

[0042] Compared with the traditional loop filling and double arc connection spiral path planning mentioned above, the filling area division and connection loop line solution introduced in this application can greatly improve the printing speed, improve the printing efficiency and meet the needs of high-speed printing.

[0043] The following is combined with Figure 2 The implementation process of filling path generation in 3D printing provided by some embodiments of the present application is exemplified. It is understandable that the method of filling path generation in 3D printing can be executed by a terminal device connected to a 3D printer, or by a processor inside the 3D printer, and the embodiments of the present application are not specifically limited here.

[0044] Please see attached Figure 2 , Figure 2 A flow chart of a method for generating a filling path in 3D printing is provided for some embodiments of the present application. The method for generating a filling path in 3D printing may include:

[0045] S210, acquiring contour data of a model to be printed, and assigning a number to each parent ring in the contour data; the number represents different areas of the model to be printed.

[0046] For example, in some embodiments of the present application, the layer data (that is, the contour data) of the model to be printed is read. An original ID is assigned to each ring in the layer data (as a specific example of numbering). The layer data is obtained by intersecting the plane and the model triangular patch data to obtain some intersection points and inner and outer ring data. This contour data is called layer data. The specific method of obtaining the layer data is as follows:

[0047] S1. Parse the STL file of the 3D printing model and read the 3D triangle vertex information and normal vector coordinates of the model.

[0048] Among them, the triangle is the basic unit that constitutes the surface of the three-dimensional model; the triangle contains 3 vertices, 3 edges and the normal vector coordinates perpendicular to the triangle. These parameters together determine the spatial position and spatial angle information of each triangle. The vertex information of the triangle is one of the most important parts of the STL file. Each vertex is represented by its coordinate value (x, y, z) in three-dimensional space. These coordinate values ​​define the position and direction of the triangle in three-dimensional space. By reading this vertex information, the slicing software can construct a complete three-dimensional model surface and perform subsequent slicing processing.

[0049] S2. Slice the model in layers by intersecting the slicing plane and the model triangle patch data.

[0050] S3. After acquiring the layered slices, the contour data of the inner ring contour line and the outer ring contour line of each layer can be obtained.

[0051] For example, Figure 3The schematic diagram of the STL model structure shown in the figure shows that the spatial triangle P1-P2-P3 is a triangular face on the STL model. The coordinates of its three vertices are P1(x1, y1, z1), P2(x2, y2, z2), and P3(x3, y3, z3). The height of the plane is z0, and the intersection line segment is AB. The vertex A(x a ,y a ,z a ) is on the edge P1P2, vertex B(x b ,y b ,z b ) is on the edge of P1P3. Taking endpoint A as an example, first project the line segment P1P2 onto the XoZ plane, and obtain the line segment P1'P2' consisting of point P1'(x1,z1) and point P2'(x2,z2). The line it is on can be expressed as:

[0052]

[0053] If the height is z0, the X-axis coordinate x of the endpoint A can be obtained. a :

[0054]

[0055] Similarly, we can get the Y-axis coordinate y of endpoint A a :

[0056]

[0057] The same method can be used to obtain the two-dimensional coordinates of endpoint B (x b ,y b ). The intersection line segments of the sliced ​​surface and all intersecting triangles are calculated in sequence, and the contour data of the sliced ​​shape can be obtained by connecting them end to end. From another perspective, the layer data is actually composed of multiple rings.

[0058] In some embodiments of the present application, after executing S210, the method for generating a filling path in 3D printing may include: obtaining the area of ​​each parent ring corresponding to each contour data; if the area is positive, identifying each corresponding contour data as an outer ring; if the area is negative, identifying each corresponding contour data as an inner ring; and recording the number of the inner rings and the outer rings respectively.

[0059] For example, in some embodiments of the present application, the layer data includes inner ring contour data and / or outer ring contour data. The ring area is calculated for each parent ring in the layer data. If the area is positive, it indicates an outer ring, and if the area is negative, it indicates an inner ring, and the number of inner and outer rings is recorded at the same time.

[0060] Specifically, the shoelace formula is mainly used to calculate the ring area of ​​each parent ring. The calculation process is as follows:

[0061] 1) Traverse the vertices of the ring, taking two adjacent vertices each time;

[0062] 2) For each pair of adjacent vertices (x1, y1) and (x2, y2), calculate (y1+y2)*(x2-x1);

[0063] 3) Accumulate the calculation results of all vertices in the ring;

[0064] 4) Multiply the accumulated result by 0.5 to get the final area A.

[0065] The mathematical expression can be written as: A = 0.5 × ∑ (x i ×y i+1 -x i+1 ×y i )

[0066] In the formula, (x i ,y i ) is the i-th vertex of the ring, (x i+1 ,y i+1 ) is the next vertex of the i-th vertex; for the last vertex, its next vertex is the first vertex.

[0067] S220, offset each parent ring to generate a child ring offset result.

[0068] In some embodiments of the present application, S220 may include: offsetting each parent ring according to a fixed offset parameter to generate the sub-ring offset result, the offset parameter including: offset direction and offset distance; wherein, if the sub-ring offset result is empty, terminating the offset; obtaining the length of each edge in each sub-ring, and removing the edges whose length is less than a length threshold; obtaining the area of ​​each sub-ring, and removing the sub-rings whose area is less than an area threshold.

[0069] For example, in some embodiments of the present application, each parent ring in the layer data is offset, and extremely short edges (i.e., short edges whose two end points are too close to each other) and extremely small rings (i.e., rings with too small an area) are removed.

[0070] Specifically, during the offset, the fixed offset parameters may include an offset distance and an offset direction. Figure 4 As shown in the offset diagram, for a directed line segment l, it can be obtained by It is determined by four parameters, where P0 is the starting point of line segment l. is the direction vector, T is the line segment length parameter, d is the offset distance, is the offset direction, which is generally If the offset distance and offset direction are given, P' can be obtained, and then the offset line segment l' can be obtained. It should be noted that if the sub-ring offset result is empty, it will end directly and no longer perform the following operations.

[0071] Since a ring in the layer data is composed of several line segments, the sub-ring offset result corresponding to the layer data can be obtained according to the above-mentioned principle of line segment offset. The sub-ring offset result is then optimized to remove extremely short edges and extremely small rings. Specifically, according to the printer accuracy, a threshold for extremely short distances (for example, 0.01mm, as a specific example of an edge length threshold) and a threshold for extremely small areas (for example, 1mm*1mm, as a specific example of an area threshold) are set. Each sub-ring area in the sub-ring offset result is traversed, and the length distance of each edge is calculated using the Euclidean distance formula, that is: The extremely short edges are eliminated according to the extremely short distance threshold. The area of ​​the sub-ring region is calculated according to the calculation formula of the area A above. If there is a sub-ring region with an area smaller than the extremely short area threshold, it is removed.

[0072] S230, when each sub-ring in the sub-ring offset result satisfies the following conditions one and two at the same time, assign a new number to each sub-ring; Condition one: the number of inner rings of all sub-rings is different from the number of inner rings of all parent rings, and / or the number of outer rings of all sub-rings is different from the number of outer rings of all parent rings; Condition two: the Hausdorff distance between each sub-ring and the corresponding parent ring's individual offset result is not less than the distance threshold.

[0073] For example, in some embodiments of the present application, each sub-ring after the migration is compared and analyzed with the layer data obtained before, and an ID is assigned to the new round of migration results. For example, whether to re-assign a new ID is determined based on the topological structure (e.g., the number of inner and outer rings) and geometric relationship of the filling area before and after the migration.

[0074] Specifically, the number of inner / outer rings in each sub-ring in the sub-ring offset result is calculated. If the number of inner and outer rings is consistent with that in the layer data, it means that the topological structure has not changed, and the ID of each sub-ring uses the ID of the parent ring; if there is inconsistency on one side, it means that the topological structure of the offset result has changed, and it is necessary to further judge based on the Hausdorff distance between the result of the individual offset of its parent ring (i.e., the parent ring) and the sub-ring to re-determine whether the sub-ring is assigned a new ID. For example, a distance threshold is set, such as 0.1mm. The parent ring of a sub-ring is individually offset to obtain an individual offset result; the maximum hausdoff distance between the individual offset result and the sub-ring is calculated. If the maximum hausdoff distance is less than the distance threshold, it means that the sub-ring and the individual offset result are approximately the same ring, that is, it has a parent ring and is not a newly generated ring, so it can inherit the parent ID, that is, the ID of the sub-ring is the ID of its corresponding parent ring; if the maximum hausdoff distance is not less than the distance threshold, it is a new ring, and a new ID is assigned to it. Finally, each ring with the same ID is stored in ID order to achieve the effect of region segmentation.

[0075] The maximum hausdoff distance is the maximum distance from a point in a set X to the nearest point in another set Y. It considers the two directions from X to Y and from Y to X, and takes the maximum value of the two to ensure the symmetry of the distance. The maximum hausdoff distance formula is:

[0076] H(x,y)=max{sup{inf{d(x,y):y∈Y:x∈X},sup{inf{d(x,y):y∈Y

[0077] Among them, sup represents the supremum, and inf represents the infimum.

[0078] S240: Constructing connected loop filling lines in the regions corresponding to different numbers. Each region corresponding to a number contains concentric loop lines that are equally spaced and parallel.

[0079] For example, in some embodiments of the present application, by constructing connected loop lines in the areas corresponding to different IDs, continuous printing between concentric loop lines is achieved, thereby reducing the travel distance of the print head. If there is only one loop, it is not processed.

[0080] In some embodiments of the present application, S240 may include:

[0081] S241, determining the i-th connection point on the i-th ring of the concentric ring line, where i is a positive integer, and obtaining the i-th starting point by retreating a cutoff distance along the printing direction at the i-th connection point.

[0082] For example, in some embodiments of the present application, the maximum value of i is the number of concentric loops. For the ith loop, a suitable connection point is first determined on it, and then the ith starting point on the ith loop is obtained by truncating the distance w backward in the printing direction. For example, Figure 5 As shown, taking i=1 as an example, P1 is the first connection point and the starting point is Ps.

[0083] In one implementation, when i=1, all edges of the first ring are traversed to find the longest edge of the first ring, and the midpoint of the longest edge is determined as the first connection point.

[0084] For example, Figure 5 As shown, first you need to select a suitable starting point on the outermost ring (that is, the first ring, i=1). Specifically, traverse all the edges on the ring, use the distance formula mentioned above to find the longest edge, and then calculate the midpoint of the longest edge and insert it into the original filling area structure as the starting point P1 (as a specific example of the first connection point). It should be understood that P1 can be the flattest position on the ring, which can select the midpoint of the longest edge on the ring or the vertex with the smallest angle on the ring. Looping back from the flattest position of the ring can avoid connecting at small places or large corners, which may cause too much material to pile up and affect the printing quality.

[0085] In another embodiment, when i≠1, the point on the i-th ring that is closest to the i-1th connection point of the i-1th ring is used as the i-th connection point.

[0086] For example, for all but the outermost ring, the connection points on other rings are determined by the distance from the connection point of the previous ring.

[0087] S242, determining the i+1th connection point closest to the i+1th connection point on the i+1th ring, and advancing along the printing direction at the i+1th connection point to cut off the distance to obtain the i+1th end point.

[0088] For example, in some embodiments of the present application, taking i=1 as an example, it is detected whether there is a next layer of rings (i.e., the i+1th ring) under the first ring. If it exists, the point closest to P1 in the next layer of rings is calculated as the next connection point (as a specific example of the i+1th connection point). Based on the same principle, the connection point between two adjacent rings can be obtained. For example, the second connection point on the second ring is Figure 5 As shown in nextP (nextP is closest to P1), moving forward along the printing direction w can get the end point Pe.

[0089] S243, connecting the i-th starting point and the i-th end point through a transition line segment to form a connecting line between the i-th ring and the (i+1)-th ring.

[0090] For example, in some embodiments of the present application, taking i=1 as an example, the four control points Ps, P1, nextP, and Pe are determined above. Ps, P1, nextP, and Pe are connected by transition line segments to obtain the connection line between the first ring and the second ring. It should be understood that the transition line segment is a third-order Bezier curve, a circular arc, or a parabola. The embodiments of the present application are not specifically limited here. Among them, the connection effect of using the Bezier curve is better, and the transition is smoother. The smoother the transition, the smaller the loss of printing speed during printing.

[0091] Specifically, first, a polyline is obtained by directly connecting the four points Ps, P1, nextP, and Pe, such as Figure 5 Although the broken line reduces the idle travel in printing, the loss of corner speed is still large. Considering the limitations of the broken line, it is further optimized into a smooth curve for connection, and the following is obtained: Figure 6 The final connected loop line is shown.

[0092] For example, the third-order Bezier curve equation can be used to smooth the broken line. By inputting the four control points Ps, P1, nextP, and Pe into the third-order Bezier curve equation, a smooth connected loop line can be obtained, that is, B(t) = (1-t) 3 P s +3t(1-t) 2 P1+3t 2 (1-t)nextP+t 3 P e ,t∈[0,1].

[0093] In some embodiments of the present application, S243 may include: obtaining the minimum speed on the transition line segment; based on the minimum speed on the transition line segment being less than a preset speed, increasing the preset cutoff distance so that the minimum speed is not less than the preset speed, using the increased preset cutoff distance to redetermine the i-th starting point and the i-th end point, and connecting the i-th starting point and the i-th end point through the transition line segment.

[0094] For example, in some embodiments of the present application, the preset cutoff distance can be adjusted by comparing the minimum speed on the transition line segment with the preset speed. The start point and the end point are re-determined by the adjusted preset cutoff distance. It should be understood that by obtaining a preset cutoff distance that meets the requirements, a loop line that is more suitable for printing can be obtained, and the printing effect is better.

[0095] S244, connecting the connecting lines between all adjacent concentric loop lines in sequence along the printing path to form a spiral continuous loop filling line.

[0096] For example, all concentric loops are repeatedly operated according to the above-mentioned method of determining the connecting line to obtain a connected ring structure, thereby obtaining a loop filling line.

[0097] In order to obtain a connected loop line suitable for the expected printing requirements, the setting of the truncation distance w mentioned above is crucial. In some embodiments of the present application, the truncation distance is not less than the minimum truncation distance, and the minimum truncation distance is determined according to the minimum speed on the preset transition line segment and the type of the transition line segment.

[0098] The following takes the Bezier curve as an example. Figure 7 The process of obtaining the minimum cutoff distance is explained by way of example.

[0099] Specifically, based on an initial cutoff distance w0, an initial Bezier curve (that is, an initial connecting loop) can be obtained in the above manner, and the parameter interval of the initial Bezier curve is divided into ten equal parts, and then the ten points Pi (i = 1, 2, ..., 10) on the curve are obtained. The angular velocity V corresponding to Pi is junction for:

[0100]

[0101] Among them, θ is the angle at the turn, V0 is the corner speed in the right angle case set later, a is the motion acceleration set by the user, and δ is the distance from the corner to the arc in the right angle case. Finally, the speed V at each corner can be obtained. junction The calculation formula is:

[0102]

[0103] On the initial connection loop line, the minimum corner speed min can be obtained i (V junction ). For high-speed printing needs, users can set V junction Minimum speed V min , if min i (V junction ) <V min , then increase the cutoff distance w until min i (V junction ) is not less than V min , so as to obtain the minimum cutoff distance w that meets the high-speed printing requirements. Through w, the starting point Ps and the end point Pe can be better located on the layer, and then the Bezier curve (that is, the final connected loop line) that meets the expected printing speed requirements can be obtained.

[0104] By creating the connecting loop lines in the areas corresponding to different numbers, the same Figure 1The latest model renderings of the corresponding boat model, such as Figure 8 As shown. It can be seen that Figure 8 The medium blue part can be printed in one go by constructing a connected loop filling line, which reduces the travel distance of the print head and improves printing efficiency.

[0105] The following is combined with Fig. 9 The specific process of numbering the filling areas in 3D printing provided by some embodiments of the present application is exemplified.

[0106] Please see attached Fig. 9 , Fig. 9 A flow chart of a method for segmenting a fill area in 3D printing is provided for some embodiments of the present application.

[0107] The above process is explained below as an example.

[0108] S901, assigning an original ID to each parent ring in the contour data in the printing model.

[0109] Specifically, in this step, the area of ​​each parent ring corresponding to each contour data is obtained; if the area is positive, each corresponding contour data is identified as an outer ring; if the area is negative, each corresponding contour data is identified as an inner ring; the number of inner rings and outer rings is recorded respectively, that is, the number of inner rings and outer rings of the parent ring before the offset.

[0110] S902, perform an offset and process on each parent ring to obtain an offset result.

[0111] Each subring in the offset result is the offset result of each parent ring. When the next offset is performed, the subring inherits the ID of the parent ring or has been reassigned an ID to become the parent ring, and its offset result is the subring.

[0112] S903, determine whether the offset result is empty, if it is empty, end, otherwise execute S904.

[0113] S904, determine whether the topology of the migration result has changed, if so, execute S905, otherwise, execute S907.

[0114] Specifically, in this step, the number of inner and outer rings after each offset of the parent ring is calculated (the number of inner and outer rings of the parent ring before the offset has been recorded above, and the number of inner and outer rings of the child ring after the offset refers to the above description, and the inner and outer rings are distinguished by the positive and negative areas of the polygon). If the number of inner and outer rings before and after the offset is all the same, it means that the topological structure has not changed, and each child ring continues to use the parent ID; if one side is inconsistent, it means that the resulting topological structure after the offset has changed, and further judgment is required. That is, when the number of inner rings of all child rings is different from the number of inner rings of all parent rings, and / or the number of outer rings of all child rings is different from the number of outer rings of all parent rings, S905 and S906 are executed in sequence. When the number of inner rings of all child rings is consistent with the number of inner rings of all parent rings, and the number of outer rings of all child rings is consistent with the number of outer rings of all parent rings, step S907 is executed.

[0115] S905, perform a separate shift on the parent ring of each sub-ring to obtain a separate shift result; and calculate a maximum hausdoff distance between each sub-ring and the separate shift result.

[0116] Specifically, when the topology structure changes, a separate offset is performed on the parent ring corresponding to each sub-ring, and the maximum hausdoff distance between the current separate offset result and the sub-ring is calculated.

[0117] S906, determine whether the maximum hausdoff distance is less than the distance threshold, if so, execute S907, otherwise execute S908.

[0118] Specifically, in this step, a distance threshold is first given. If the hausdoff distance is less than the distance threshold, it means that the current sub-ring and the individual offset result are approximately the same ring, that is, it has a parent ring and is not a newly generated ring. Then, the parent ID is inherited. After that, step S907 is executed to start the next offset and processing. If the topological structure of the offset result changes and the maximum hausdoff distance is not less than the distance threshold, the offset ring is a new ring and a new ID is assigned to it, that is, step S908 is executed to start the next offset and processing.

[0119] S907, taking the original ID of each parent ring as the ID of each child ring in the offset result; and looping and executing step S902 again until the offset result of performing an offset on each parent ring is empty.

[0120] S908, re-allocate a new ID for each child ring; and loop through step S902 again until the offset result of performing an offset on each parent ring is empty.

[0121] It can be understood that the specific implementation process of S901 to S908 can refer to the method embodiment provided above, and in order to avoid repetition, the detailed description is appropriately omitted here.

[0122] The following is combined with Fig.10 The specific process of creating a connected loop line in 3D printing provided by some embodiments of the present application is exemplified.

[0123] Please see attached Fig.10 , Fig.10 A flow chart of a method for creating a connected loop line in 3D printing is provided for some embodiments of the present application.

[0124] The following is an exemplary description of the process of creating a connecting loop line between concentric loop lines.

[0125] S101, selecting a suitable starting point from the current layer.

[0126] The current layer can be any ring in the concentric rings, or the i-th ring mentioned above. In order to ensure that each ring can be split at the same point during the construction of the connected loop, we first need to select a suitable starting point on the outermost ring, traverse all the edges on the ring, find the longest edge, and then calculate the midpoint of the longest edge and insert it into the original ring structure as the starting point.

[0127] S102, determine whether there is a next layer, if so, execute S103, otherwise execute S106.

[0128] It should be understood that in this step, if there is only one concentric ring area, it will not be processed. If there are more than two rings, then continue to execute S103 to construct a connecting loop line; when there is no next layer, it indicates that the connecting lines between all rings are completed, and then execute S106.

[0129] S103, find the closest point on the next layer.

[0130] Specifically, in this step, a point on the next layer ring that is closest to the starting point can be found on the next layer as the closest point.

[0131] S104, the starting point and the nearest point are moved back and forward by the minimum cutoff distance respectively in the printing direction to obtain the starting point and the end point.

[0132] S105, connecting the current layer and the next layer using a smooth spline curve such as a third-order Bezier curve, a circular arc, a parabola, etc. according to the starting point, the start point, the nearest point, and the end point; returning to S102.

[0133] S106, output connection loop line.

[0134] It can be understood that the specific implementation process of S101 to S106 can refer to the method embodiment provided above, and in order to avoid repetition, the detailed description is appropriately omitted here.

[0135] Please refer to Fig.11 , Fig.11 The block diagram of the composition of the device for generating a filling path in 3D printing provided by some embodiments of the present application is shown. It should be understood that the device for generating a filling path in 3D printing corresponds to the above method embodiment and can execute each step involved in the above method embodiment. The specific functions of the device for generating a filling path in 3D printing can be found in the description above. To avoid repetition, the detailed description is appropriately omitted here.

[0136] Fig.11 The device for generating a filling path in 3D printing includes at least one software function module that can be stored in a memory in the form of software or firmware or solidified in the device for generating a filling path in 3D printing. The device for generating a filling path in 3D printing includes: an acquisition module 1110, which is used to acquire the contour data of the model to be printed and assign a number to each parent ring in the contour data; the number represents different areas of the model to be printed; an offset module 1120, which is used to offset each parent ring to generate a sub-ring offset result; a numbering module 1130, which is used to assign a new number to each sub-ring when each sub-ring in the sub-ring offset result satisfies the following conditions 1 and 2 at the same time; condition 1: the number of inner rings of all sub-rings is different from the number of inner rings of all parent rings, and / or the number of outer rings of all sub-rings is different from the number of outer rings of all parent rings; condition 2: the Hausdorff distance between each sub-ring and the corresponding parent ring's individual offset result is not less than a distance threshold; a construction module 1140, which is used to respectively construct a connected loop filling line in the areas corresponding to different numbers.

[0137] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the device described above can refer to the corresponding process in the aforementioned method, and will not be described in detail here.

[0138] Some embodiments of the present application further provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, can implement the operations of the method corresponding to any of the above methods provided in the above embodiments.

[0139] Some embodiments of the present application further provide a computer program product, which includes a computer program, wherein when the computer program is executed by a processor, it can implement the operations corresponding to any of the above methods provided in the above embodiments.

[0140] like Fig.12As shown, some embodiments of the present application provide an electronic device 1200, which includes: a memory 1210, a processor 1220, and a computer program stored in the memory 1210 and executable on the processor 1220, wherein the processor 1220 can implement a method as described in any of the above embodiments when reading the program from the memory 1210 through a bus 1230 and executing the program.

[0141] Processor 1220 can process digital signals and can include various computing structures, such as complex instruction set computer structure, reduced instruction set computer structure, or a structure that implements a combination of multiple instruction sets. In some examples, processor 1220 can be a microprocessor.

[0142] The memory 1210 may be used to store instructions executed by the processor 1220 or data related to the execution of instructions. These instructions and / or data may include codes for implementing some or all functions of one or more modules described in the embodiments of the present application. The processor 1220 of the disclosed embodiment may be used to execute instructions in the memory 1210 to implement the method shown above. The memory 1210 includes a dynamic random access memory, a static random access memory, a flash memory, an optical memory, or other memory known to those skilled in the art.

[0143] The above description is only an embodiment of the present application and is not intended to limit the scope of protection of the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the scope of protection of the present application. It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings.

[0144] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0145] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

Claims

1. A method for generating a filling path in 3D printing, characterized in that: include: Acquire the contour data of the model to be printed, and assign a number to each parent ring in the contour data; The numbers represent different areas of the model to be printed; Offset each parent ring to generate the child ring offset result; When each sub-ring in the sub-ring offset result satisfies the following conditions 1 and 2 at the same time, a new number is assigned to each sub-ring; Condition 1: the number of inner rings of all sub-rings is different from the number of inner rings of all parent rings, and / or the number of outer rings of all sub-rings is different from the number of outer rings of all parent rings; Condition 2: the Hausdorff distance between each sub-ring and the individual offset result of the corresponding parent ring is not less than the distance threshold; Construct connected loop filling lines in the areas corresponding to different numbers.

2. The method according to claim 1, characterized in that After obtaining the contour data of the model to be printed, the method further includes: Get the area of ​​each parent ring corresponding to each contour data; If the area is positive, each corresponding contour data is marked as an outer ring; if the area is negative, each corresponding contour data is marked as an inner ring; The numbers of the inner ring and the outer ring are recorded respectively.

3. The method according to claim 1 or 2, characterized in that The step of offsetting each parent ring to generate a sub-ring offset result includes: Each parent ring is shifted according to a fixed shift parameter to generate the sub-ring shift result, wherein the shift parameter includes: a shift direction and a shift distance; wherein, If the sub-ring offset result is empty, then the offset is terminated; Obtain the length of each edge in each subring, and remove the edges whose length is less than the edge length threshold; The area of ​​each sub-ring is obtained, and the sub-rings whose area is smaller than the area threshold are removed.

4. The method according to claim 1, characterized in that Each area corresponding to a number contains concentric loops with equal spacing and in parallel; wherein the connecting loop filling lines are constructed in the areas corresponding to different numbers, respectively, including: Determine the i-th connection point on the i-th ring of the concentric ring line, i being a positive integer, and obtain the i-th starting point by retreating a distance along the printing direction at the i-th connection point; Determine the i+1th connection point closest to the i+1th connection point on the i+1th ring, and advance along the printing direction at the i+1th connection point to obtain the i+1th end point by cutting off the distance; Connecting the i-th starting point and the i-th end point through a transition line segment to form a connecting line between the i-th ring and the i+1-th ring; The connecting lines between all adjacent concentric loop lines are connected in sequence along the printing path to form a spiral continuous loop filling line.

5. The method as claimed in claim 4, characterized in that The transition line segment is a third-order Bezier curve, a circular arc or a parabola.

6. The method according to claim 4 or 5, characterized in that The step of determining the i-th connection point on the i-th ring of the concentric ring lines comprises: When i=1, traverse all edges of the first ring, find the longest edge of the first ring, and determine the midpoint of the longest edge as the first connection point; When i≠1, the point on the i-th ring that is closest to the i-1th connection point of the i-1th ring is taken as the i-th connection point.

7. The method according to claim 4 or 5, characterized in that The truncation distance is not less than a minimum truncation distance, and the minimum truncation distance is determined according to a minimum speed on a preset transition segment and a type of the transition segment.

8. The method according to claim 4 or 5, characterized in that The connecting line between the i-th ring and the i+1-th ring is formed by connecting the i-th starting point and the i-th end point through a transition line segment, including: Obtaining the minimum speed on the transition line segment; According to the minimum speed on the transition line segment being less than the preset speed, the preset cutoff distance is increased so that the minimum speed is not less than the preset speed, the i-th starting point and the i-th end point are re-determined using the increased preset cutoff distance, and the i-th starting point and the i-th end point are connected by the transition line segment.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program executes the method according to any one of claims 1 to 8 when executed by a processor.

10. An electronic device, characterized in that: The method comprises a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the computer program executes the method according to any one of claims 1 to 8 when being run by the processor.