A 3D printing method, system, device and medium
Through scanning line and layer cutting processing technology, high-precision 3D printing files are generated, which solves the problem of difficulty in manufacturing highly complex lattice structures with traditional 3D printing technology, and achieves efficient and accurate 3D printing file generation.
Patent Information
- Application Number
- CN202311691984.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-11
- Publication Date
- 2024-10-08
- Estimated Expiration
- 2043-12-11
AI Technical Summary
Traditional 3D printing technology is difficult to efficiently manufacture highly complex and high-precision lattice structures, and the generated grid representation files are large, resulting in low efficiency.
The 3D printed model is scanned in an all-round way through scanning lines to establish the outer envelope of the space, and fill in the landmarks based on the intersection points to generate the filled model. It performs layer cutting processing according to the preset thickness and intersection processing to generate accurate lattice data. , integrate to generate 3D printing files of objects to be printed.
It realizes that the filled body is infinitely close to the real object, showing the hollow parts, increasing the intersection accuracy, and the generated 3D printing files are accurate and efficient.
Smart Images

Figure CN117698130B_ABST
Abstract
Description
Background Art
[0002] The lattice structure has excellent properties such as high strength, high porosity, efficient heat dissipation and insulation, absorption of electromagnetic waves and sound waves, and is a highly promising advanced lightweight multifunctional material. However, due to its complex internal structure, it is difficult to process with traditional manufacturing processes. Additive manufacturing (3D printing) technology can well manufacture high-complexity, high-precision, and functional lattice structures due to its layer-by-layer printing characteristics. However, the generation of high-precision lattice structures often requires a lot of computing power and time, and the generated grid representation files are also very large, that is, the generation efficiency is too low. Summary of the invention
[0003] The technical problem to be solved by the present invention is to provide a 3D printing method, system, device and medium in view of the deficiencies of the prior art, as follows:
[0004] 1) In the first aspect, the present invention provides a 3D printing method, and the specific technical solution is as follows:
[0005] S1, omni-directionally scan the 3D printing model corresponding to the object to be printed through scanning lines and store the scanning intersections, establish a spatial outer envelope, and fill the mark position of each unit cell in the spatial outer envelope based on all the intersections to generate a filled model over-filled body;
[0006] S2, performing layer cutting processing on the 3D printed model and the overfilled body of the model respectively along the same direction according to the preset 3D printing thickness, to obtain m layer cutting results corresponding to the 3D printed model and n layer cutting results corresponding to the overfilled body of the model;
[0007] S3, performing intersection processing on the i-th layer in the m layer cutting results and the i-th layer in the n layer cutting results to obtain the precise dot matrix data corresponding to the i-th layer, and integrating all the precise dot matrix data when m=n to generate a 3D printing file of the object to be printed.
[0008] The beneficial effects of a 3D printing method provided by the present invention are as follows:
[0009] By scanning the 3D printing model and filling the 3D printing model according to the scanning intersection, the filling body can be infinitely close to the real object to be printed, and the hollow parts of the real object to be printed can be displayed. In addition, by performing layer cutting processing on the 3D printing model and the model filling body according to the same 3D printing thickness and direction, the accuracy of comparison or intersection determination can be increased. In addition, the generation of 3D printing files based on the processing results of the intersection is not only accurate but also efficient.
[0010] Based on the above solution, the present invention can also be improved as follows.
[0011] Furthermore, the process of filling the flag bit of each unit cell in the outer envelope of the space based on all intersection points is as follows:
[0012] After each scan, it is determined whether the area composed of two adjacent intersections, the boundary of the 3D printed model corresponding to the two adjacent intersections, and the scan line between the two adjacent intersections is inside the 3D printed model, and the flag bit of the unit cell corresponding to the area is filled according to the judgment result, and the judgment is repeated until the judgment of all intersections is completed.
[0013] Furthermore, S1 also includes:
[0014] The overfilled body of the model is verified, and S2 is executed when the verification passes, and a warning message is issued if the verification fails.
[0015] Furthermore, after obtaining the accurate lattice data corresponding to the i-th layer, the method further includes:
[0016] The precise dot matrix data corresponding to the i-th layer is verified, and when the verification passes, a 3D printing file of the object to be printed is generated.
[0017] Furthermore, it also includes:
[0018] S4, performing intersection processing on the pixel results in the same layer in the first layer cutting result and the second layer cutting result to obtain pixel dot matrix data corresponding to each layer, and integrating all the pixel dot matrix data to generate a three-dimensional display file of the object to be printed.
[0019] 2) In the second aspect, the present invention also provides a 3D printing system, and the specific technical solution is as follows:
[0020] The filling module is used to: perform an all-round scan of the 3D printing model corresponding to the object to be printed through scanning lines and store the scanning intersections, establish a spatial outer envelope, and fill the mark position of each unit cell in the spatial outer envelope based on all the intersections to generate a filled model over-filled body;
[0021] The layer cutting module is used to: perform layer cutting processing on the 3D printed model and the model overfilled body respectively along the same direction according to the preset 3D printing thickness, and obtain m layer cutting results corresponding to the 3D printed model and n layer cutting results corresponding to the model overfilled body;
[0022] The printing module is used to: perform intersection processing on the i-th layer in the m layer cutting results and the i-th layer in the n layer cutting results to obtain the precise dot matrix data corresponding to the i-th layer, and integrate all the precise dot matrix data when m=n to generate a 3D printing file of the object to be printed.
[0023] Based on the above solution, the present invention can also be improved as follows.
[0024] Furthermore, the process of filling the flag bit of each unit cell in the outer envelope of the space based on all intersection points is as follows:
[0025] After each scan, it is determined whether the area composed of two adjacent intersections, the boundary of the 3D printed model corresponding to the two adjacent intersections, and the scan line between the two adjacent intersections is inside the 3D printed model, and the flag bit of the unit cell corresponding to the area is filled according to the judgment result, and the judgment is repeated until the judgment of all intersections is completed.
[0026] Furthermore, it also includes: a first verification module;
[0027] The first verification module is used to verify the overfilling body of the model, and execute the layer cutting module when the verification passes, and issue a warning message if the verification fails.
[0028] Furthermore, it also includes:
[0029] The second verification module is used to verify the precise dot matrix data corresponding to the i-th layer, and generate a 3D printing file of the object to be printed when the verification passes.
[0030] Furthermore, it also includes:
[0031] The display module is used to perform intersection processing on the pixel results of the i-th layer in the m layer cutting results and the i-th layer in the n layer cutting results to obtain the pixel dot matrix data corresponding to the i-th layer, and integrate all the pixel dot matrix data to generate a three-dimensional display file of the object to be printed.
[0032] 3) In a third aspect, the present invention further provides a computer device, comprising a processor, wherein the processor is coupled to a memory, wherein the memory stores at least one computer program, and wherein the at least one computer program is loaded and executed by the processor so that the computer device implements any of the above methods.
[0033] 4) In a fourth aspect, the present invention further provides a computer-readable storage medium, wherein at least one computer program is stored in the computer-readable storage medium, and the at least one computer program is loaded and executed by a processor so that a computer implements any of the above methods.
[0034] It should be noted that the beneficial effects achieved by the technical solutions of the second to fourth aspects of the present invention and the corresponding possible implementation methods can be found in the above-mentioned technical effects of the first aspect and its corresponding possible implementation methods, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Other features, objects and advantages of the present invention will become more apparent from the detailed description of non-limiting embodiments made with reference to the following drawings:
[0036] Figure 1 A schematic diagram of a 3D printing method according to an embodiment of the present invention;
[0037] Figure 2 It is a schematic diagram of the structure of a computer device;
[0038] Figure 3 The working principle and flow chart are as follows;
[0039] Figure 4 It is a schematic diagram of the scanning line array in the Z direction;
[0040] Figure 5 Schematic diagram of the outer envelope of the lattice structure constructed for the intersection of scan lines;
[0041] Figure 6 It is a schematic diagram of the relationship between the scan line and the model;
[0042] Figure 7 Schematic diagram of body-centered cubic stacking;
[0043] Figure 8 A schematic diagram showing the model and the 3D view after filling;
[0044] Fig. 9 This is a preview diagram after pixel intersection processing;
[0045] Fig.10 It is a schematic diagram of the model entity and the overfilled layer cut cache and comparison;
[0046] Fig.11 This is a comparison diagram between layer cache and entity cache;
[0047] Fig.12 Schematic diagram of different lattice structures;
[0048] Fig.13 This is a schematic diagram of outer envelope conformal filling;
[0049] Fig.14 Schematic diagram of layer cutting preview for mixed modeling of solid and lattice structures. DETAILED DESCRIPTION
[0050] To make the objectives, technical solutions and advantages of the present invention more clear, the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings.
[0051] like Figure 1 As shown, a 3D printing method according to an embodiment of the present invention comprises the following steps:
[0052] S1, omni-directionally scan the 3D printing model corresponding to the object to be printed through scanning lines and store the scanning intersections, establish a spatial outer envelope, and fill the mark position of each unit cell in the spatial outer envelope based on all the intersections to generate a filled model over-filling body;
[0053] S2, performing layer cutting processing on the 3D printed model and the overfilled body of the model respectively along the same direction according to the preset 3D printing thickness, to obtain m layer cutting results corresponding to the 3D printed model and n layer cutting results corresponding to the overfilled body of the model;
[0054] S3, performing intersection processing on the i-th layer in the m layer cutting results and the i-th layer in the n layer cutting results to obtain the precise lattice data corresponding to the i-th layer, and integrating all the precise lattice data when m=n to generate a 3D printing file of the object to be printed.
[0055] The beneficial effects of a 3D printing method provided by the present invention are as follows:
[0056] By scanning the 3D printing model and filling the 3D printing model according to the scanning intersection, the filling body can be infinitely close to the real object to be printed, and the hollow parts of the real object to be printed can be displayed. In addition, by performing layer cutting processing on the 3D printing model and the model filling body according to the same 3D printing thickness and direction, the accuracy of comparison or intersection determination can be increased. In addition, the generation of 3D printing files based on the processing results of the intersection is not only accurate but also efficient.
[0057] like Figure 3 As shown, S1, a 3D printing model corresponding to the object to be printed is scanned in all directions through scanning lines and the scanning intersections are stored to establish a spatial outer envelope, and each unit cell in the spatial outer envelope is filled with flags based on all intersections to generate a filled model overfilled body. Among them:
[0058] Omnidirectional means that all positions of the 3D printing model corresponding to the object to be printed are scanned without missing any parts.
[0059] The 3D printing model corresponding to the object to be printed is a model file of the shell of the object to be printed that is generated by scanning the object to be printed.
[0060] Usually, the 3D printing model corresponding to the object to be printed is in the following formats: boundary representation (.step), triangular facet (.stl, .obj) representation, etc., and the file content is identified by reading the file. It should be noted that the volume of the 3D printing model corresponding to the object to be printed (i.e. the volume corresponding to the bounding box or shell) should not be larger than the 3D printer workspace. Before importing the 3D printing model corresponding to the object to be printed, the model of the 3D printer should be set first to facilitate the determination of the printer workspace.
[0061] The first algorithm is used to scan the 3D printing model corresponding to the object to be printed and store the scanning intersection points. The first algorithm is specifically as follows:
[0062] like Figure 4 As shown, taking the Z direction as an example, the Z direction is perpendicular to the ground. Project the bounding box of the 3D printing model corresponding to the object to be printed onto the XY plane, and take point A (x min ,y min , z min ) as the starting point, in the plane area [x min , x max ]×[y min ,y max ] creates a Z-buffer, called z-buffer. Figure 4 represents a scan line array.
[0063] The bounding box of the 3D printing model corresponding to the object to be printed refers to: the bounding box structure stores two three-dimensional point coordinates, represented as min[3] and max[3] respectively; where min[3] represents the three minimum values in the three-dimensional coordinates of the 3D printing model, namely: [x min ,y min ,z min ], max[3] represents the three maximum values in the three-dimensional coordinates of the 3D printing model, namely: [x max ,y max ,z max ]; So far, the bounding box is represented as a cuboid with min[3] and max[3] as diagonals, and the entire 3D printed model is completely contained in the cuboid.
[0064] Scan the 3D printing model corresponding to the object to be printed according to the scanning line array, and record the 2n intersections of the scanning line and the model. All the intersections are P from bottom to top (in the direction of increasing Z-axis values). 1 , P 2 , ...P 2n , record the corresponding intersection points in the scan line buffer, and use all intersection points as vertices to construct the outer envelope of the lattice structure, such as Figure 5 shown.
[0065] The scan line array is defined as: the unit cell size w of the lattice structure set by the user (if the user does not set it, the default value is used).
[0066] The second algorithm is used to establish the outer envelope of the space, and fill the flags of each unit cell in the outer envelope of the space based on all intersections to generate the filled model overfilled body. The second algorithm is specifically as follows:
[0067] The spatial outer envelope is established based on the vertices of the outer envelope obtained by the first algorithm, the intersection information cached on the scan line, and the in-and-out relationship between the line segments formed by the intersections and the model.
[0068] The outer envelope refers to: the proposed lattice structure is constructed by filling the pre-defined unit cell structure into the outer envelope of the hexahedral format in sequence. The outer envelope of the unit cell can be understood as the bounding box of the unit cell. It is specifically implemented by dividing the entire model bounding box according to the unit cell size w input by the user, and defining the dimensions of the model's bounding box in three directions as: A*B*C. The outer envelope of the unit cell is a regular hexahedron distribution, and the total number of unit cells divided into the model bounding box is: A / w*B / w*C / w.
[0069] A unit cell refers to the smallest repeating unit of the lattice structure used to fill the model. The repetitive arrangement of unit cells constitutes the model lattice structure.
[0070] The relationship between the intersection point forming the line segment and the model in and out refers to:
[0071] To ensure the filling effect of the lattice structure, the cache size [n x ,n y ] The unit cell side length w needs to be rounded upward. The 2n intersection points of the scan line and the model are P from bottom to top. 1 ,P 2 ,…,P 2n , they divide the scan line into several segments. It is easy to judge from bottom to top, from point P 2k-1 and point P 2k The scanning line segment formed by (k=1,2,…,n) is inside the model, and point P 2k and point P 2k+1 The scanning line segments formed by (k=1,2,…,n-1) are outside the model. Figure 6 As shown, line segment P 1 P 2 and P 3 P 4 is inside the model, and line segment P 2 P 3 is outside the model.
[0072] The process of filling the flag bit is:
[0073] The flag fs is set for the outer envelope vertices. The flag of all the unit cells inside the model is fs=1, the flag of all the unit cells outside the model is fs=0, and the flag of the unit cells located at the boundary of the model is fs=2. For the cases of fs=1 and fs=2: since they are repeatedly arranged periodically in the X, Y, and Z directions (the outer envelope of the unit cells is formed by regular division, and the process of filling the unit cells into the outer envelope can be regarded as the process of arranging the unit cells in the model bounding box according to the unit cell size w array, and several unit cells arranged in a repeated periodic manner together constitute the lattice structure of the entire model), such unit cells can be stored "in strings" as a filling body structure cb; for the case of fs=0, no processing is performed and the established lattice unit cell topology is used to fill the outer envelope to achieve the overfilling operation of the lattice structure.
[0074] Among them, the outer envelope of each unit cell has eight vertices in total, and the internal and external relationships of these eight vertices and the model are determined;
[0075] If all eight vertices are outside the model, then the unit cell is completely inside the model and fs=0.
[0076] If all eight vertices are inside the model, then the unit cell is completely inside the model and fs=1.
[0077] In other cases, the unit cell is partially located inside the model and fs=2.
[0078] The lattice unit cell topology is Figure 7 As shown, it is an axisymmetric cube.
[0079] After generating the filled model overfilled body, the method further includes: relying on the OpenGL library to realize the three-dimensional model drawing of the model lattice structure corresponding to the overfilled body, realizing the preview of the model overfilled body, and checking whether the model filling is normal.
[0080] The model entity and the model overfill body are intersected to obtain the trimmed model filling body, and then the model filling body is drawn. Taking the most classic bar lattice body-centered cubic packing (BCC) as an example (such as Figure 7 ), in order to save running time and memory, the wireframe model is used for preview, that is, the rods are simplified into line segments; for detailed running results, see Figure 8 .
[0081] S2, according to the preset 3D printing thickness, perform layer cutting processing on the 3D printed model and the overfilled body of the model respectively along the same direction to obtain m layer cutting results corresponding to the 3D printed model and n layer cutting results corresponding to the overfilled body of the model.
[0082] The preset 3D printing thickness is the thickness data generated according to the actual situation of the 3D printer.
[0083] The imported model (3D printing model) is treated as a solid and sliced. Since the conventional model file only represents the model surface, the scan line algorithm is used to determine the in-and-out relationship between the scan line and the model boundary. Figure 6 As shown, the line segments inside the model are treated as entities to achieve the layer cutting of the model surface into the model entity, and the layer cutting result is stored as zb, that is, the first layer cutting result. The first layer cutting result has a pixel setting, that is, the storage of pixel point information.
[0084] The model overfilled body is sliced and the scan line algorithm is used to determine whether the information stored in the model overfilled body is located on the scan line. If it is located on the scan line, it is stored and the pixel information of the point is pixel = 255 (indicating white), otherwise pixel = 0 (indicating black), thereby realizing the layer cutting of the model overfilled body and storing the layer cutting result as zb2, i.e., the second layer cutting result.
[0085] The scan line algorithm refers to: establishing a scan line array within a specific bounding box. The scan line array is defined as: by setting the scan line interval size, in the plane area [x min , x max ]×[y min ,y max ], divide the grid according to the corresponding size, take the corresponding grid point as the starting point, and make a ray in the z-axis direction (or model building direction) until the bounding box boundary, forming Figure 4 The scan line array is shown.
[0086] For the scan line algorithm used by the layer cutting module, the scan line interval size used is the printer pixel size (i.e., a single pixel point), which is determined by the printer model. After the scan line array is established, the intersection points of the scan line array, the model entity, and the filling volume information are stored, and the intersection point coordinate information is stored in the scan line structure. After obtaining the intersection point information, the pixel=255 operation is performed.
[0087] S3, performing intersection processing on the i-th layer in the m layer cutting results and the i-th layer in the n layer cutting results to obtain the precise dot matrix data corresponding to the i-th layer, and integrating all the precise dot matrix data to generate a 3D printing file of the object to be printed when m=n.
[0088] When m is greater than n, the maximum value of i is n, and the n+1 to m sets in the m layer are directly defined as empty sets. At this time, the result of the intersection processing is that there is no intersection;
[0089] When n is greater than m, the maximum value of i is m, and the m+1 to n layers in the n layer are defined as empty sets. At this time, the result of the intersection processing is no intersection;
[0090] The process of intersection processing is:
[0091] The imported stl model stores both the entity layer slice cache zb and the lattice structure filling volume layer slice cache zb2. The caches of the same height are taken for the two layer slice models, and the bounding boxes of the two are merged (the x value of the two cache bounding boxes is min ,y min 、z min The minimum value of the two values, x man ,y max 、z max The maximum value of the two is taken) so that the two layer cut models are in the same bounding box to prevent pixel misalignment during the subsequent intersection processing. Then, the pixels in the two layer cut buffers are intersected, that is, when both pixels are 255, pixel = 255 is output, and in other cases, pixel = 0 is output, and the intersection result is saved.
[0092] S3 also includes S4, which relies on the OpenGL library to realize the processing and drawing functions of the layer-cut model at a specific height z; Fig. 9 It is a preview display after image processing. The intersection of the two caches is calculated, and the non-overlapping parts are not drawn, so as to obtain a dot matrix structure filling model that fits the outer contour of the model.
[0093] After image processing of the model entity layer cutting cache zb and the filling body layer cutting cache zb2, the corresponding result files (.bmp.png, etc.) are output, and the pixel cache parray is introduced for subsequent result output. The pixel data in the first layer cutting result and the second layer cutting result are saved in parray. The range of pixel points stored in parray is set by the printer parameters. Let the horizontal resolution of the printer be PL and the vertical resolution be PW, then the number of stored pixel points is PL*PW, and subsequent operations such as grayscale judgment and drawing are performed on parray. Taking the light-curing printer as an example, the pixel data stored in parray is the actual printing pixel information of the printer. After being processed and packaged in the memory, it is converted into the printer-specific printing file format and transmitted to the printer for printing. The remaining printing parameters are determined by the printer.
[0094] The results are as follows Fig.10 as well as Fig.11 As shown, Fig.10 The model entity layer cutting cache, overfilled body layer cutting cache and the comparison between the two caches are shown; Fig.11 The saved results after the intersection processing and the comparison between the results and the solid model are displayed. It can be seen that the comparison results are completely consistent, which proves the correctness of this method. This intersection method realizes high-precision modeling and drawing of lattice structures.
[0095] Since this method uses the scanning line method to construct the lattice outer envelope, different lattice structures can be filled into the outer envelope ( Fig.12 ), and a variety of lattice structures can be used for mixed modeling, and the lattice structure parameters (thickness, radius, etc.) can be adjusted within the outer envelope to establish a gradient structure to meet various application requirements
[0096] By changing the form of the scan line in the second algorithm, different forms of outer envelope structures can be generated to achieve non-equidistant filling of the lattice structure, such as the parametric unit method: weights are defined for the eight vertices of the outer envelope, and they are mapped to the irregular grid by isoparametric transformation to achieve "conformal filling" of the lattice structure ( Fig.13 ).
[0097] Furthermore, the process of filling the flag bit of each unit cell in the outer envelope of the space based on all intersection points is as follows:
[0098] After each scan, it is determined whether the area composed of two adjacent intersections, the boundary of the 3D printed model corresponding to the two adjacent intersections, and the scan line between the two adjacent intersections is inside the 3D printed model, and the flag bit of the unit cell corresponding to the area is filled according to the judgment result, and the judgment is repeated until the judgment of all intersections is completed.
[0099] This method supports the input of model files with different representations, is suitable for filling various lattice structures, and supports the output of data results of different 3D printing methods;
[0100] This method proposes a lattice structure overfilling algorithm based on model boundary judgment, which narrows the scope of intersection processing to the vicinity of the model boundary and greatly reduces the amount of data that needs to be processed in the intersection operation.
[0101] Since this method stores the model entity and filling volume data separately, it can realize the mixed modeling of entity and filling volume, which is not limited to single lattice structure modeling ( Fig.14 : Black is solid, gray is dot matrix filling).
[0102] This method realizes an integrated operation from model input to result output, without relying on other software for processing.
[0103] Furthermore, S1 also includes:
[0104] The overfilled body of the model is verified, and S2 is executed when the verification passes, and a warning message is issued if the verification fails.
[0105] Furthermore, after obtaining the accurate lattice data corresponding to each layer, the method further includes:
[0106] The precise dot matrix data corresponding to each layer is verified, and when the verification passes, a 3D printing file of the object to be printed is generated.
[0107] Furthermore, it also includes:
[0108] S4, performing intersection processing on the pixel results in the same layer in the first layer cutting result and the second layer cutting result to obtain pixel dot matrix data corresponding to each layer, and integrating all the pixel dot matrix data to generate a three-dimensional display file of the object to be printed.
[0109] like Figure 2 As shown, the present invention also provides a 3D printing system, and the specific technical solution is as follows:
[0110] The filling module is used to: scan the 3D printing model corresponding to the object to be printed through the scanning line and store the scanning intersection points, establish the outer envelope of the space, and fill the mark position of each unit cell in the outer envelope of the space based on all the intersection points to generate the filled model overfilled body;
[0111] The layer cutting module is used to: perform layer cutting processing on the 3D printed model and the model overfilled body according to the preset 3D printing thickness, and obtain a first layer cutting result corresponding to the 3D printed model and a second layer cutting result corresponding to the model overfilled body;
[0112] The printing module is used to perform intersection processing on the first layer cutting result and the result of the same layer in the second layer cutting result to obtain the precise dot matrix data corresponding to each layer, and integrate all the precise dot matrix data to generate a 3D printing file of the object to be printed.
[0113] Furthermore, the process of filling the flag bit of each unit cell in the outer envelope of the space based on all intersection points is as follows:
[0114] After each scan, it is determined whether the area composed of two adjacent intersections, the boundary of the 3D printed model corresponding to the two adjacent intersections, and the scan line between the two adjacent intersections is inside the 3D printed model, and the flag bit of the unit cell corresponding to the area is filled according to the judgment result, and the judgment is repeated until the judgment of all intersections is completed.
[0115] Further, it also includes: a first verification module;
[0116] The first verification module is used to verify the overfilling body of the model, and execute the layer cutting module when the verification passes, and issue a warning message if the verification fails.
[0117] Furthermore, it also includes:
[0118] The second verification module is used to verify the precise dot matrix data corresponding to each layer, and generate a 3D printing file of the object to be printed when the verification passes.
[0119] Furthermore, it also includes:
[0120] The display module is used to perform intersection processing on the pixel results in the same layer of the first layer cutting result and the second layer cutting result to obtain the pixel dot matrix data corresponding to each layer, and integrate all the pixel dot matrix data to generate a three-dimensional display file of the object to be printed.
[0121] In the above embodiments, although the steps are numbered S1, S2, etc., these are only specific embodiments given by the present invention. Those skilled in the art may adjust the execution order of S1, S2, etc. according to actual conditions, which is also within the protection scope of the present invention. It can be understood that in some embodiments, some or all of the above embodiments may be included.
[0122] It should be noted that the beneficial effects of a 3D printing system provided in the above embodiment are the same as the beneficial effects of the above 3D printing method, which will not be described in detail here. In addition, when the system provided in the above embodiment realizes its functions, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the system can be divided into different functional modules according to actual conditions to complete all or part of the functions described above. In addition, the system and method embodiments provided in the above embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be described in detail here.
[0123] like Figure 2 As shown, a computer device 300 according to an embodiment of the present invention includes a processor 320, the processor 320 is coupled to a memory 310, and the memory 310 stores at least one computer program 330, and the at least one computer program 330 is loaded and executed by the processor 320, so that the computer device 300 implements any of the above methods, specifically:
[0124] The computer device 300 may have relatively large differences due to different configurations or performances, and may include one or more processors 320 (Central Processing Units, CPU) and one or more memories 310, wherein the one or more memories 310 store at least one computer program 330, and the at least one computer program 330 is loaded and executed by the one or more processors 320, so that the computer device 300 implements a 3D printing method provided in the above embodiment. Of course, the computer device 300 may also have components such as a wired or wireless network interface, a keyboard, and an input and output interface for input and output, and the computer device 300 may also include other components for implementing device functions, which will not be described in detail here.
[0125] A computer-readable storage medium according to an embodiment of the present invention stores at least one computer program, and the at least one computer program is loaded and executed by a processor so that a computer implements any one of the above methods.
[0126] Optionally, the computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a compact disc (CD-ROM), a magnetic tape, a floppy disk, an optical data storage device, and the like.
[0127] In an exemplary embodiment, a computer program product or a computer program is also provided, the computer program product or the computer program comprising computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs any of the above methods.
[0128] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects and represent the definition of a specific order or sequence. The order of use of similar objects can be interchanged where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than the order shown or described.
[0129] Those skilled in the art know that the present invention can be implemented as a system, method or computer program product. Therefore, the present disclosure can be specifically implemented in the following forms, namely: it can be complete hardware, it can be complete software (including firmware, resident software, microcode, etc.), or it can be a combination of hardware and software, which is generally referred to as "circuit", "module" or "system" herein. In addition, in some embodiments, the present invention can also be implemented in the form of a computer program product in one or more computer-readable media, and the computer-readable medium contains computer-readable program code.
[0130] Any combination of one or more computer-readable media may be used. A computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, device, or device.
[0131] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present invention.
Claims
1. A 3D printing method, characterized in that: include: S1, omni-directionally scan the 3D printing model corresponding to the object to be printed through scanning lines and store the scanning intersections, establish a spatial outer envelope, and fill the mark position of each unit cell in the spatial outer envelope based on all the intersections to generate a filled model over-filled body; S2, performing layer cutting processing on the 3D printed model and the overfilled body of the model respectively along the same direction according to the preset 3D printing thickness, to obtain m layer cutting results corresponding to the 3D printed model and n layer cutting results corresponding to the overfilled body of the model; S3, performing intersection processing on the i-th layer in the m layer cutting results and the i-th layer in the n layer cutting results to obtain precise lattice data corresponding to the i-th layer, and integrating all precise lattice data to generate a 3D printing file of the object to be printed when m=n; The first algorithm is used to scan the 3D printing model corresponding to the object to be printed and store the scanning intersection points. The first algorithm is specifically as follows: The bounding box of the 3D printing model corresponding to the object to be printed is projected onto the XY plane, and the point A(x min ,y min , z min ) as the starting point, in the plane area [x min , x max ]×[y min ,y max ] creates a Z-buffer, which is called z-buffer. The Z direction is perpendicular to the ground. The bounding box of the 3D printing model corresponding to the object to be printed refers to: the bounding box structure stores two three-dimensional point coordinates, represented as min[3] and max[3] respectively; where min[3] represents the three minimum values in the three-dimensional coordinates of the 3D printing model, namely: [x min ,y min ,z min ], max[3] represents the three maximum values in the three-dimensional coordinates of the 3D printing model, namely: [x max ,y max ,z max ]; So far, the bounding box is represented as a cuboid with min[3] and max[3] as diagonals, and the entire 3D printed model is completely contained in the cuboid; The 3D printing model corresponding to the object to be printed is scanned according to the scanning line array, and the 2n intersection points of the scanning line and the model are recorded at the same time. All the intersection points are P1, P2, ...P from bottom to top. 2n , record the corresponding intersection points in the scan line buffer, and use all the intersection points as vertices for constructing the outer envelope of the lattice structure; The scan line array is defined as follows: the unit cell size w of the lattice structure set by the user; The second algorithm is used to establish the outer envelope of the space, and fill the flags of each unit cell in the outer envelope of the space based on all intersections to generate the filled model overfilled body. The second algorithm is specifically as follows: The spatial outer envelope is established according to the vertices of the outer envelope obtained by the first algorithm, the intersection information cached on the scan line, and the in-and-out relationship between the line segments formed by the intersections and the model; The outer envelope refers to: the proposed lattice structure is constructed by filling the pre-defined unit cell structure into the outer envelope of the hexahedron format in sequence. The outer envelope of the unit cell can be understood as the bounding box of the unit cell. The specific implementation is to divide the entire model bounding box according to the unit cell size w input by the user, and define the bounding box of the model in three directions as: A*B*C. The outer envelope of the unit cell is a regular hexahedron distribution, and the number of unit cells divided into the model bounding box is: A / w*B / w*C / w; Unit cell refers to the smallest repeating unit of the lattice structure used to fill the model. The repetitive arrangement of unit cells constitutes the model lattice structure. The relationship between the intersection point forming the line segment and the model in and out refers to: To ensure the filling effect of the lattice structure, the cache size [n x ,n y ] It is necessary to round up the length of the unit cell side w, and record the 2n intersections of the scan line and the model from bottom to top as P1, P2, ..., P 2n , which divide the scan line into several segments, from point P 2k-1 and point P 2k The scanning line segment formed by (k=1,2,…,n) is inside the model, and point P 2k and point P 2k+1 The scanning line segment formed by (k=1,2,…,n-1) is outside the model; The process of filling the flag bit is: The flag fs is set for the outer envelope vertex. The flag of all the unit cells inside the model is fs=1, the flag of all the unit cells outside the model is fs=0, and the flag of the unit cells located at the boundary of the model is fs=2. For the cases of fs=1 and fs=2: since they are repeatedly arranged periodically in the X, Y, and Z directions, such unit cells are stored in series as a filling body structure cb; for the case of fs=0, no processing is performed and the established lattice unit cell topology is used to fill the outer envelope to realize the overfilling operation of the lattice structure. The outer envelope of the unit cell is formed by regular division. The process of filling the unit cell into the outer envelope is regarded as the process of arranging the unit cells in the model bounding box according to the unit cell size w array. Several unit cells arranged in a repeated period together constitute the lattice structure of the entire model. Among them, the outer envelope of each unit cell has eight vertices in total, and the internal and external relationships of these eight vertices and the model are determined; If all eight vertices are outside the model, the unit cell is completely inside the model, and fs = 0; If all eight vertices are inside the model, then the unit cell is completely inside the model, and fs = 1; In other cases, the unit cell is partially located inside the model, and fs = 2; The lattice unit cell topology is an axisymmetric cube; After the filled model overfilled body is generated, the method further includes: relying on the OpenGL library to realize the three-dimensional model drawing of the model lattice structure corresponding to the overfilled body, and realizing the preview of the model overfilled body, so as to check whether the model filling is normal; The model entity and the model overfill body are intersected to obtain the trimmed model filling body, and then the model filling body is drawn.
2. A 3D printing method according to claim 1, characterized in that: The process of filling the flag bit of each unit cell in the outer envelope of the space based on all intersection points is: After each scan, it is determined whether the area composed of two adjacent intersections, the boundary of the 3D printed model corresponding to the two adjacent intersections, and the scan line between the two adjacent intersections is inside the 3D printed model, and the flag bit of the unit cell corresponding to the area is filled according to the judgment result, and the judgment is repeated until the judgment of all intersections is completed.
3. A 3D printing method according to claim 1, characterized in that: S1 and later also include: The overfilled body of the model is verified, and S2 is executed when the verification passes, and a warning message is issued if the verification fails.
4. A 3D printing method according to claim 1, characterized in that: After obtaining the accurate lattice data corresponding to the i-th layer, the following further comprises: The precise dot matrix data corresponding to the i-th layer is verified, and when the verification passes, a 3D printing file of the object to be printed is generated.
5. A 3D printing method according to claim 1, characterized in that: Also includes: S4, performing intersection processing on the pixel results of the i-th layer in the m layer cutting results and the i-th layer in the n layer cutting results to obtain the pixel dot matrix data corresponding to the i-th layer, and integrating all the pixel dot matrix data to generate a three-dimensional display file of the object to be printed.
6. A 3D printing system, characterized in that: include: The filling module is used to: perform an all-round scan of the 3D printing model corresponding to the object to be printed through scanning lines and store the scanning intersections, establish a spatial outer envelope, and fill the mark position of each unit cell in the spatial outer envelope based on all the intersections to generate a filled model over-filled body; The layer cutting module is used to: perform layer cutting processing on the 3D printed model and the model overfilled body respectively along the same direction according to the preset 3D printing thickness, and obtain m layer cutting results corresponding to the 3D printed model and n layer cutting results corresponding to the model overfilled body; The printing module is used to: perform intersection processing on the i-th layer in the m layer cutting results and the i-th layer in the n layer cutting results to obtain the precise dot matrix data corresponding to the i-th layer, and integrate all the precise dot matrix data to generate a 3D printing file of the object to be printed when m=n; The first algorithm is used to scan the 3D printing model corresponding to the object to be printed and store the scanning intersection points. The first algorithm is specifically as follows: The bounding box of the 3D printing model corresponding to the object to be printed is projected onto the XY plane, and the point A(x min ,y min , z min ) as the starting point, in the plane area [x min , x max ]×[y min ,y max ] creates a Z-buffer, which is called z-buffer. The Z direction is perpendicular to the ground. The bounding box of the 3D printing model corresponding to the object to be printed refers to: the bounding box structure stores two three-dimensional point coordinates, represented as min[3] and max[3] respectively; where min[3] represents the three minimum values in the three-dimensional coordinates of the 3D printing model, namely: [x min ,y min ,z min ], max[3] represents the three maximum values in the three-dimensional coordinates of the 3D printing model, namely: [x max ,y max ,z max ]; So far, the bounding box is represented as a cuboid with min[3] and max[3] as diagonals, and the entire 3D printed model is completely contained in the cuboid; The 3D printing model corresponding to the object to be printed is scanned according to the scanning line array, and the 2n intersection points of the scanning line and the model are recorded at the same time. All the intersection points are P1, P2, ...P from bottom to top. 2n , record the corresponding intersection points in the scan line buffer, and use all the intersection points as vertices for constructing the outer envelope of the lattice structure; The scan line array is defined as follows: the unit cell size w of the lattice structure set by the user; The second algorithm is used to establish the outer envelope of the space, and fill the flags of each unit cell in the outer envelope of the space based on all intersections to generate the filled model overfilled body. The second algorithm is specifically as follows: The spatial outer envelope is established according to the vertices of the outer envelope obtained by the first algorithm, the intersection information cached on the scan line, and the in-and-out relationship between the line segments formed by the intersections and the model; The outer envelope refers to: the proposed lattice structure is constructed by filling the pre-defined unit cell structure into the outer envelope of the hexahedron format in sequence. The outer envelope of the unit cell can be understood as the bounding box of the unit cell. The specific implementation is to divide the entire model bounding box according to the unit cell size w input by the user, and define the bounding box of the model in three directions as: A*B*C. The outer envelope of the unit cell is a regular hexahedron distribution, and the number of unit cells divided into the model bounding box is: A / w*B / w*C / w; Unit cell refers to the smallest repeating unit of the lattice structure used to fill the model. The repetitive arrangement of unit cells constitutes the model lattice structure. The relationship between the intersection point forming the line segment and the model in and out refers to: To ensure the filling effect of the lattice structure, the cache size [n x ,n y ] It is necessary to round up the length of the unit cell side w, and record the 2n intersections of the scan line and the model from bottom to top as P1, P2, ..., P 2n , which divide the scan line into several segments, from point P 2k-1 and point P 2k The scanning line segment formed by (k=1,2,…,n) is inside the model, and point P 2k and point P 2k+1 The scanning line segment formed by (k=1,2,…,n-1) is outside the model; The process of filling the flag bit is: The flag fs is set for the outer envelope vertex. The flag of all the unit cells inside the model is fs=1, the flag of all the unit cells outside the model is fs=0, and the flag of the unit cells located at the boundary of the model is fs=2. For the cases of fs=1 and fs=2: since they are repeatedly arranged periodically in the X, Y, and Z directions, such unit cells are stored in series as a filling body structure cb; for the case of fs=0, no processing is performed and the established lattice unit cell topology is used to fill the outer envelope to realize the overfilling operation of the lattice structure. The outer envelope of the unit cell is formed by regular division. The process of filling the unit cell into the outer envelope is regarded as the process of arranging the unit cells in the model bounding box according to the unit cell size w array. Several unit cells arranged in a repeated period together constitute the lattice structure of the entire model. Among them, the outer envelope of each unit cell has eight vertices in total, and the internal and external relationships of these eight vertices and the model are determined; If all eight vertices are outside the model, the unit cell is completely inside the model, and fs = 0; If all eight vertices are inside the model, then the unit cell is completely inside the model, and fs = 1; In other cases, the unit cell is partially located inside the model, and fs = 2; The lattice unit cell topology is an axisymmetric cube; After the filled model overfilled body is generated, the method further includes: relying on the OpenGL library to realize the three-dimensional model drawing of the model lattice structure corresponding to the overfilled body, and realizing the preview of the model overfilled body, so as to check whether the model filling is normal; The model entity and the model overfill body are intersected to obtain the trimmed model filling body, and then the model filling body is drawn.
7. A 3D printing system according to claim 6, characterized in that: The process of filling the flag bit of each unit cell in the outer envelope of the space based on all intersection points is: After each scan, it is determined whether the area composed of two adjacent intersections, the boundary of the 3D printed model corresponding to the two adjacent intersections, and the scan line between the two adjacent intersections is inside the 3D printed model, and the flag bit of the unit cell corresponding to the area is filled according to the judgment result, and the judgment is repeated until the judgment of all intersections is completed.
8. A 3D printing system according to claim 6, characterized in that: Also includes: A first verification module; The first verification module is used to verify the overfilling body of the model, and execute the layer cutting module when the verification passes, and issue a warning message if the verification fails.
9. A computer device, characterized in that: The computer device comprises a processor, the processor is coupled to a memory, at least one computer program is stored in the memory, and the at least one computer program is loaded and executed by the processor so that the computer device implements the method according to any one of claims 1 to 5.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one computer program, and the at least one computer program is loaded and executed by a processor so that a computer implements the method according to any one of claims 1 to 5.
