A model decomposition method, system, device and medium for unsupported printing
By dividing the 3D model into sub-models that meet the support conditions through a planar search method, the problem of support structure in five-axis 3D printing is solved, enabling supportless printing, reducing material waste and improving printing accuracy.
Patent Information
- Application Number
- CN202311437859.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-31
- Publication Date
- 2026-02-24
- Estimated Expiration
- 2043-10-31
AI Technical Summary
Existing 3D model segmentation methods cannot be directly applied to five-axis 3D printing, which leads to complex models requiring support structures, increasing material loss and affecting surface accuracy.
The optimal plane is obtained through a planar search method, the model is divided into sub-models that meet the support conditions or reduce the number of facets that do not meet the support conditions, and G-code suitable for five-axis 3D printers is generated.
It enables supportless printing, reduces material waste, avoids the support removal process, improves the surface accuracy of the model, and plans a reasonable printing sequence to avoid mechanical interference.
Smart Images

Figure CN117261233B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of 3D printing technology, and specifically relates to a method, system, device and medium for unsupported printing of model decomposition. Background Technology
[0002] Existing 3D printers using various processes typically have printheads with three translational degrees of freedom: X, Y, and Z. During the printing process, the printer first uses a layer-slicing method to create layers along a single direction of the model, and then stacks the material layer by layer in a direction perpendicular to the layering. Therefore, when printing complex models with branching structures, supports must be added, and a process of removing the supports must be added after printing, resulting in additional loss of support material and potentially affecting the surface accuracy of the model.
[0003] For the reasons mentioned above, in recent years researchers have proposed increasing the degrees of freedom of movement of printing equipment, such as developing five-axis 3D printers to change the printing direction and layering slicing method, to study more flexible 3D printing methods, in order to improve the surface accuracy of models and achieve supportless printing. However, existing 3D printing methods are only suitable for some simple parts.
[0004] Currently, when faced with complex models with bifurcated structures, some have proposed dividing the model into simpler part structures in three dimensions, and then printing them using a five-axis 3D printer. However, commonly used 3D model segmentation methods divide a set of facets, and the dividing lines are usually curved contours. 3D printing requires material stacking on a plane and does not consider the supportability of each part after segmentation. Therefore, existing 3D model segmentation results cannot be directly applied to five-axis 3D printing. Summary of the Invention
[0005] To address the technical problems existing in the prior art, this invention provides a method, system, device, and medium for unsupported printing of model decomposition, in order to solve the technical problem that the existing 3D model segmentation results cannot be directly applied to five-axis 3D printing.
[0006] To achieve the above objectives, the technical solution adopted by the present invention is as follows:
[0007] This invention provides a method for model decomposition in supportless printing, comprising:
[0008] Read the STL file of the target workpiece and store it in the preset model group structure to generate the current model group;
[0009] In the current model group, select all models that do not meet the support conditions to obtain several current models to be decomposed;
[0010] Using a planar search method, a planar search is performed on each current model to be decomposed to obtain the optimal plane; and the current model to be decomposed is divided using the optimal plane to obtain the current decomposition result; wherein, the optimal plane satisfies: both new sub-models in the current decomposition result satisfy the support condition; or satisfies: compared with the current model to be decomposed, the descent gradient of the number of patches that do not satisfy the support condition in the two new sub-models is the largest.
[0011] The current model group is updated using the current decomposition results to obtain the updated model group;
[0012] Generate a model decomposition tree based on the current decomposition results;
[0013] Based on the model decomposition tree, the printing order of the models in the updated model group is planned to obtain the printing order of the models;
[0014] Based on the printing order of the model, generate G-code executable for a five-axis 3D printer.
[0015] Furthermore, the current model group includes several models; wherein each model is stored according to a preset data structure.
[0016] Specifically, the preset data structure model is as follows:
[0017] {vertices, faces, normal, partNo, closedmodel, risk, base_plane, base_poly}
[0018] Where vertices are model vertices; faces are model faces; normal is the normal vector of the model face; partNo is the model number; closedmodel is the adjacency relationship of associated triangular faces in the model; risk is the number of faces in the model that do not meet the support conditions; base_plane is the base plane information of the model; base_poly is the cross-sectional profile where the base plane of the model intersects with the model.
[0019] Furthermore, the model that does not meet the support conditions is one in which the number of faces that do not meet the support conditions is greater than 0.
[0020] Furthermore, the process of using a plane search method to perform a plane search for each current model to be decomposed and obtaining the optimal plane is as follows:
[0021] Construct a unit upper hemisphere; wherein, the unit upper hemisphere is the upper half of a sphere with a radius of unit length and the origin as its center;
[0022] A point is randomly selected on the upper hemisphere of the unit as the initial plane normal vector point, and the normal vector at the initial plane normal vector point is used as the initial plane normal vector.
[0023] Randomly select a point on the current model to be decomposed as the model random point;
[0024] An initial plane is constructed using the points representing the initial plane normal vector, the initial plane normal vector, and the random points of the model.
[0025] A starting position is randomly selected on the initial plane, and based on the starting position, an equally spaced plane search is performed on the initial plane along the normal vector direction of the initial plane or along the opposite direction of the normal vector of the initial plane according to a preset search step size to obtain several search planes; wherein, the several search planes constitute a plane search space.
[0026] Within the planar search space, if there exists a search plane that divides the current model to be decomposed into two new sub-models, and both new sub-models satisfy the support conditions, then the search plane is the optimal plane.
[0027] Alternatively, within the plane search space, if there exists a search plane that divides the current model to be decomposed into two new sub-models, and compared to the current model to be decomposed, the decreasing gradient of the number of faces that do not meet the support conditions in the two new sub-models is the largest, then the search plane is the optimal plane.
[0028] Furthermore, the process of generating the model decomposition tree based on the current decomposition results is as follows:
[0029] The model in the current model group is used as the root node of the model decomposition tree;
[0030] After dividing the current model to be decomposed using the optimal plane, the sub-models located below the optimal plane in the current decomposition result are added to the left leaf node of the model decomposition tree, and the sub-models located above the optimal plane in the current decomposition result are added to the right leaf node of the model decomposition tree.
[0031] Repeat the optimal planar segmentation operation on the left or right leaf node of the model decomposition tree until it cannot be segmented further, thus obtaining the model decomposition tree; wherein each leaf node of the model decomposition tree represents the smallest printable sub-model.
[0032] Furthermore, based on the model decomposition tree, the process of planning the printing order of the models in the updated module group to obtain the printing order of the models is as follows:
[0033] The leaf nodes of the decomposition tree of the model are traversed from left to right to obtain the traversal results of the leaf nodes.
[0034] Based on the traversal results of the leaf nodes, the models in the updated module group are sorted to obtain the printing order of the models.
[0035] Furthermore, the process of generating G-code executable for a five-axis 3D printer based on the printing order of the model is as follows:
[0036] Following the printing order of the models, rotate the models in the updated model group to a horizontal position one by one; then, slice each model into layers to obtain the layer slice information of each model.
[0037] Based on the layered slicing information of each model, generate G-code that can be executed by a five-axis 3D printer.
[0038] The present invention also provides a supportless printing model decomposition system, comprising:
[0039] The file reading module is used to read the STL file of the target workpiece and store it in the preset model group structure to generate the current model group;
[0040] The model selection module is used to select all models that do not meet the support conditions in the current model group, and obtain several models to be decomposed.
[0041] The plane search module is used to perform a plane search on each current model to be decomposed using a plane search method to obtain the optimal plane; and to use the optimal plane to divide the current model to be decomposed to obtain the current decomposition result; wherein, the optimal plane satisfies: both new sub-models in the current decomposition result satisfy the support condition; or satisfies: compared with the current model to be decomposed, the descent gradient of the number of patches that do not satisfy the support condition in the two new sub-models is the largest.
[0042] The model group update module is used to update the current model group using the current decomposition results to obtain the updated model group;
[0043] The decomposition tree module is used to generate a model decomposition tree based on the current decomposition results;
[0044] The printing order planning module is used to plan the printing order of the models in the updated model group according to the model decomposition tree, so as to obtain the printing order of the models;
[0045] The G-code generation module is used to generate executable G-code suitable for a five-axis 3D printer based on the printing order of the model.
[0046] The present invention also provides a supportless printing model decomposition device, comprising:
[0047] Memory, used to store computer programs;
[0048] A processor is used to implement the steps of the multi-supportless printing model decomposition method when executing the computer program.
[0049] The present invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the model decomposition method for unsupported printing.
[0050] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0051] This invention provides a model decomposition method for supportless printing. It obtains the optimal plane through a planar search method and uses this optimal plane to divide the model into two new sub-models that satisfy the support conditions or maximize the descent gradient of the number of facets that do not satisfy the support conditions. This allows for supportless printing of models with bifurcated structures, enabling supportless printing with a five-axis 3D printer. It achieves multi-directional supportless printing of the target workpiece, reduces support material consumption, and avoids the cumbersome process of removing supports after printing. The decomposition process is simple, and the printing sequence of the model is planned based on the model decomposition tree generated from the decomposition results, allowing the entire model to be printed sequentially. Simultaneously, it effectively avoids mechanical interference by constraining the cutting planes. Attached Figure Description
[0052] Figure 1 This is a schematic diagram of the model decomposition tree in the embodiment;
[0053] Figure 2 This is a schematic diagram of the decomposition results of the model in the embodiment. Detailed Implementation
[0054] To make the technical problems solved by the present invention, the technical solutions, and the beneficial effects clearer, the following specific embodiments provide a further detailed description of the present invention. It should be understood that the specific embodiments described herein are merely illustrative and are not intended to limit the scope of the invention.
[0055] This invention provides a model decomposition method for supportless printing, which is oriented towards a target workpiece with a bifurcated structure and is used in the supportless printing process of a five-axis 3D printer.
[0056] The unsupported printing model decomposition method includes the following steps:
[0057] Step 1: Read the STL file of the target workpiece and store it in the preset model group structure to generate the current model group; wherein, the current model group includes several models, and each model is stored according to the preset data structure model.
[0058] Specifically, the preset data structure model is as follows:
[0059] {vertices, faces, normal, partNo, closedmodel, risk, base_plane, base_poly}
[0060] Where vertices are model vertices; faces are model faces; normal is the normal vector of the model face; partNo is the model number; closedmodel is the adjacency relationship of the associated triangular faces; risk is the number of faces in the model that do not meet the support conditions; base_plane is the base plane information of the model; base_poly is the cross-sectional profile where the base plane of the model intersects with the model.
[0061] Step 2: In the current model group, select all models that do not meet the support conditions to obtain several current models to be decomposed; wherein, the models that do not meet the support conditions are those in which the number of faces that do not meet the support conditions is greater than 0.
[0062] Step 3: Using the planar search method, perform a planar search for each current model to be decomposed to obtain the optimal plane; and use the optimal plane to divide the current model to be decomposed to obtain the current decomposition result; wherein, the optimal plane satisfies: both new sub-models in the current decomposition result satisfy the support condition; or satisfies: compared with the current model to be decomposed, the descent gradient of the number of patches that do not satisfy the support condition in the two new sub-models is the largest.
[0063] Specifically, the process of using the planar search method to perform a planar search for each current model to be decomposed and obtain the optimal plane is as follows:
[0064] Construct a unit upper hemisphere; wherein, the unit upper hemisphere is the upper half of a sphere with a radius of unit length and the origin as its center;
[0065] A point is randomly selected on the upper hemisphere of the unit as the initial plane normal vector point, and the normal vector at the initial plane normal vector point is used as the initial plane normal vector.
[0066] Randomly select a point on the current model to be decomposed as the model random point;
[0067] An initial plane is constructed using the points representing the initial plane normal vector, the initial plane normal vector, and the random points of the model.
[0068] A starting position is randomly selected on the initial plane, and based on the starting position, an equally spaced plane search is performed on the initial plane along the normal vector direction of the initial plane or along the opposite direction of the normal vector of the initial plane according to a preset search step size to obtain several search planes; wherein, the several search planes constitute a plane search space.
[0069] Within the planar search space, if there exists a search plane that divides the current model to be decomposed into two new sub-models, and both new sub-models satisfy the support conditions, then the search plane is the optimal plane.
[0070] Alternatively, within the plane search space, if there exists a search plane that divides the current model to be decomposed into two new sub-models, and compared to the current model to be decomposed, the decreasing gradient of the number of faces that do not meet the support conditions in the two new sub-models is the largest, then the search plane is the optimal plane.
[0071] Step 4: Update the current model group using the current decomposition results to obtain the updated model group.
[0072] Step 5: Repeat steps 2-4 above for the updated model group until the number of faces that do not meet the support conditions in all models in the updated model group is 0.
[0073] Step 6: Generate the model decomposition tree based on the current decomposition results.
[0074] Specifically, the process of generating a model decomposition tree includes the following steps:
[0075] The model in the current model group is used as the root node of the model decomposition tree;
[0076] After dividing the current model to be decomposed using the optimal plane, the sub-models located below the optimal plane in the current decomposition result are added to the left leaf node of the model decomposition tree, and the sub-models located above the optimal plane in the current decomposition result are added to the right leaf node of the model decomposition tree.
[0077] Repeat the optimal planar segmentation operation on the left or right leaf node of the model decomposition tree until it cannot be segmented further, thus obtaining the model decomposition tree; wherein each leaf node of the model decomposition tree represents the smallest printable sub-model.
[0078] Step 7: Based on the model decomposition tree, plan the printing order of the models in the updated model group to obtain the printing order of the models; specifically, traverse the leaf nodes of the model decomposition tree from left to right to obtain the traversal results of the leaf nodes; based on the traversal results of the leaf nodes, sort the models in the updated module group to obtain the printing order of the models.
[0079] Step 8: Generate G-code executable for a five-axis 3D printer according to the printing order of the model; the process of generating G-code executable for a five-axis 3D printer according to the printing order of the model is as follows:
[0080] Following the printing order of the models, rotate the models in the updated model group to a horizontal position one by one; then, slice each model into layers to obtain the layer slice information of each model.
[0081] Based on the layered slicing information of each model, generate G-code that can be executed by a five-axis 3D printer.
[0082] The supportless printing model decomposition method described in this invention is applicable to different types of five-axis 3D printing equipment. It can decompose various models with bifurcated structures for supportless printing, reducing material waste and avoiding the tedious process of removing supports after printing. Therefore, it is conducive to the promotion and application of five-axis 3D printing technology. Secondly, it can plan the printing sequence according to the decomposition results, so that the printing of the whole model can be carried out sequentially, and effectively avoids mechanical interference by constraining the cutting plane.
[0083] This invention also provides a supportless printing model decomposition system, including a file reading module, a model selection module, a plane search module, a model group update module, a printing sequence planning module, and a code generation module; the file reading module is used to read the STL file of the target workpiece and store it in a preset model group structure to generate the current model group; the model selection module is used to select all models that do not meet the support conditions in the current model group to obtain several current models to be decomposed; the plane search module is used to perform a plane search on each current model to be decomposed using a plane search method to obtain the optimal plane; and uses the optimal plane to divide the current model to be decomposed to obtain the current decomposition result; wherein, the... The optimal plane satisfies: both new sub-models in the current decomposition result satisfy the support condition; or satisfies: compared with the current model to be decomposed, the descent gradient of the number of faces that do not satisfy the support condition in the two new sub-models is the largest; the model group update module is used to update the current model group using the current decomposition result to obtain the updated model group; the decomposition tree module is used to generate a model decomposition tree based on the current decomposition result; the printing order planning module is used to plan the printing order of the models in the updated model group based on the model decomposition tree to obtain the printing order of the models; the G-code generation module is used to generate G-code executable by a five-axis 3D printer based on the printing order of the models.
[0084] The present invention also provides a supportless printing model decomposition device, comprising: a memory for storing a computer program; and a processor for executing the computer program to implement the supportless printing model decomposition method.
[0085] When the processor executes the computer program, it implements the steps of the above-mentioned unsupported printing model decomposition method, for example: reading the STL file of the target workpiece and storing it in a preset model group structure to generate the current model group; selecting all models that do not meet the support conditions in the current model group to obtain several current models to be decomposed; using a plane search method, performing a plane search on each current model to be decomposed to obtain the optimal plane; and using the optimal plane to divide the current model to be decomposed to obtain the current decomposition result; wherein, the optimal plane satisfies: both new sub-models in the current decomposition result satisfy the support conditions; or satisfies: compared with the current model to be decomposed, the descent gradient of the number of faces that do not meet the support conditions in the two new sub-models is the largest; updating the current model group using the current decomposition result to obtain the updated model group; generating a model decomposition tree based on the current decomposition result; planning the printing order of the models in the updated model group based on the model decomposition tree to obtain the printing order of the models; and generating G-code executable for a five-axis 3D printer based on the printing order of the models.
[0086] Alternatively, when the processor executes the computer program, it implements the functions of each module in the above system, such as: a file reading module for reading the STL file of the target workpiece and storing it in a preset model group structure to generate the current model group; a model selection module for selecting all models that do not meet the support conditions in the current model group to obtain several current models to be decomposed; and a plane search module for performing a plane search on each current model to be decomposed using a plane search method to obtain the optimal plane; and using the optimal plane to divide the current model to be decomposed to obtain the current decomposition result; wherein, the optimal plane satisfies: in the current decomposition result, two All new sub-models satisfy the support conditions; or satisfy the following: compared to the current model to be decomposed, the descent gradient of the number of faces that do not satisfy the support conditions is the largest among the two new sub-models; the model group update module is used to update the current model group using the current decomposition results to obtain the updated model group; the decomposition tree module is used to generate a model decomposition tree based on the current decomposition results; the printing order planning module is used to plan the printing order of the models in the updated model group based on the model decomposition tree to obtain the printing order of the models; the G-code generation module is used to generate G-code executable for a five-axis 3D printer based on the printing order of the models.
[0087] For example, the computer program can be divided into one or more modules / units, which are stored in the memory and executed by the processor to complete the present invention. The one or more modules / units can be a series of computer program instruction segments capable of performing a preset function, the instruction segments describing the execution process of the computer program in the unsupported printing model decomposition device.
[0088] For example, the computer program can be divided into a file reading module, a model selection module, a plane search module, a model group update module, a printing sequence planning module, and a code generation module. The specific functions of each module are as follows: The file reading module reads the STL file of the target workpiece and stores it in a preset model group structure to generate the current model group; the model selection module selects all models in the current model group that do not meet the support conditions to obtain several current models to be decomposed; the plane search module uses a plane search method to perform a plane search on each current model to be decomposed to obtain the optimal plane; and uses the optimal plane to divide the current model to be decomposed to obtain the current decomposition result; wherein, the The optimal plane satisfies: both new sub-models in the current decomposition result satisfy the support condition; or satisfies: compared with the current model to be decomposed, the descent gradient of the number of faces that do not satisfy the support condition in the two new sub-models is the largest; the model group update module is used to update the current model group using the current decomposition result to obtain the updated model group; the decomposition tree module is used to generate a model decomposition tree based on the current decomposition result; the printing order planning module is used to plan the printing order of the models in the updated model group based on the model decomposition tree to obtain the printing order of the models; the G-code generation module is used to generate G-code executable by a five-axis 3D printer based on the printing order of the models.
[0089] The supportless printing model decomposition device can be a computing device such as a desktop computer, laptop, handheld computer, or cloud server. The supportless printing model decomposition device may include, but is not limited to, processors and memory. Those skilled in the art will understand that the above are examples of supportless printing model decomposition devices and do not constitute a limitation on supportless printing model decomposition devices. It may include more components than described above, or combine certain components, or different components. For example, the supportless printing model decomposition device may also include input / output devices, network access devices, buses, etc.
[0090] The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor, or any conventional processor. The processor is the control center of the supportless printing model decomposition device, connecting all parts of the supportless printing model decomposition device via various interfaces and lines.
[0091] The memory can be used to store the computer program and / or modules. The processor implements various functions of the supportless printing model decomposition device by running or executing the computer program and / or modules stored in the memory and calling the data stored in the memory.
[0092] The memory may primarily include a program storage area and a data storage area. The program storage area may store the operating system and at least one application program required for a given function (such as sound playback or image playback). The data storage area may store data created based on the use of the phone (such as audio data or a phonebook). Furthermore, the memory may include high-speed random access memory (RAM) and non-volatile memory, such as hard disks, RAM, plug-in hard disks, SmartMediaCards (SMC), Secure Digital (SD) cards, flash cards, at least one disk storage device, flash memory device, or other volatile solid-state storage devices.
[0093] The present invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the model decomposition method for unsupported printing.
[0094] If the modules / units integrated in the unsupported printing model decomposition system are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium.
[0095] Based on this understanding, the present invention can implement all or part of the processes in the above-described supportless printing model decomposition method, or it can be accomplished by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the above-described supportless printing model decomposition method. The computer program includes computer program code, which can be in the form of source code, object code, executable file, or a preset intermediate form, etc.
[0096] The computer-readable storage medium may include: any entity or device capable of carrying the computer program code, recording media, USB flash drive, portable hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal, and software distribution medium, etc.
[0097] Example
[0098] In this embodiment, the unsupported printing process of a target workpiece with a bifurcated structure using a mainstream five-axis 3D printer is taken as an example. The five-axis 3D printer incorporates a double-rotating cradle-type turntable into the traditional gantry-type three-axis motion mechanism of a 3D printer. The double-rotating cradle-type turntable includes a turntable surface with a horizontal rotational degree of freedom and a normal rotational degree of freedom. To achieve the two rotational degrees of freedom of the turntable surface, the double-rotating cradle-type turntable is provided with two rotational axes in the horizontal and normal directions, both driven by stepper motors and reducers. The target workpiece with a bifurcated structure includes a main structure and an L-shaped bifurcated structure disposed on the side wall of the main structure.
[0099] This embodiment provides a model decomposition method for supportless printing, including the following steps:
[0100] Step 1: Read the STL file of the target workpiece and store it in the preset model group structure to generate the current model group; wherein, the current model group includes several models, and each model is stored according to the preset data structure model.
[0101] Specifically, the preset data structure model is as follows:
[0102] {vertices, faces, normal, partNo, closedmodel, risk, base_plane, base_poly}
[0103] Where vertices are model vertices; faces are model faces; normal is the normal vector of the model face; partNo is the model number; closedmodel is the adjacency relationship of the associated triangular faces; risk is the number of faces in the model that do not meet the support conditions; base_plane is the base plane information of the model; base_poly is the cross-sectional profile where the base plane of the model intersects with the model.
[0104] It should be noted that the base plane information of the model includes the base plane normal vector [A,B,C] and the offset D, and the base plane is represented by Ax+By+Cz+D=0.
[0105] Step 2: To accelerate layer cutting, ensure the accuracy of cutting results, and support subsequent operations, the triangular faces of the models in the current model group are associated according to the adjacency relationship of the triangular faces to obtain the initial model group structure, so as to reduce cutting time and cutting complexity and provide convenience for subsequent model operations; the adjacency relationship table is shown in Table 1 below.
[0106] Table 1 Adjacency Relationship Table
[0107]
[0108] Step 3: In the current model group, select all models that do not meet the support conditions to obtain several current models to be decomposed; wherein, the models that do not meet the support conditions are those in which the number of faces that do not meet the support conditions is greater than 0.
[0109] Step 4: Using the planar search method, perform a planar search for each current model to be decomposed to obtain the optimal plane; and use the optimal plane to divide the current model to be decomposed to obtain the current decomposition result.
[0110] Specifically, the process of using the planar search method to perform a planar search for each current model to be decomposed and obtain the optimal plane is as follows:
[0111] Step 41: Construct a unit upper hemisphere; wherein, the unit upper hemisphere is the upper half of a sphere with a radius of unit length and the origin as its center.
[0112] Step 42: Randomly select a point on the upper hemisphere of the unit plane as the initial plane normal vector point, and use the normal vector at the initial plane normal vector point as the initial plane normal vector.
[0113] Step 43: Randomly select a point on the current model to be decomposed as the model random point.
[0114] Step 44: Construct an initial plane using the initial plane normal vector point, the initial plane normal vector, and the model random point.
[0115] Step 45: Randomly select a starting position on the initial plane, and based on the starting position, perform an equidistant plane search along the normal direction of the initial plane or along the opposite direction of the normal direction of the initial plane according to a preset search step size. That is, perform an equidistant plane search along the outward direction of the two sides of the initial plane with the normal direction of the initial plane to obtain several search planes; wherein, the several search planes constitute a plane search space, and the preset search step size is 2mm.
[0116] Step 46: Within the planar search space, if there exists a search plane that divides the current model to be decomposed into two new sub-models, and both new sub-models satisfy the support condition, then the search plane is the optimal plane; or within the planar search space, if there exists a search plane that divides the current model to be decomposed into two new sub-models, and compared to the current model to be decomposed, the decreasing gradient of the number of faces that do not satisfy the support condition in the two new sub-models is the largest, then the search plane is the optimal plane.
[0117] It should be noted that during the search process, if there exists a plane that divides the current model to be decomposed into two new sub-models, and both new sub-models satisfy the support condition, then the plane is the optimal plane. In this case, the optimal plane satisfies the following: both new sub-models in the current decomposition result satisfy the support condition, that is, the risk of both new sub-models is 0.
[0118] Alternatively, during the search process, if there exists a plane that divides the current model to be decomposed into two new sub-models, and compared to the current model to be decomposed, the descent gradient of the number of faces that do not meet the support conditions in the two new sub-models is the largest, then this plane is the optimal plane; at this time, the optimal plane satisfies: compared to the current model to be decomposed, the descent gradient of the number of faces that do not meet the support conditions in the two new sub-models is the largest, making the value of R(M0)-(R(M1)+R(M2)) the largest; where M0 is the model to be decomposed, M1 is one of the new sub-models, M2 is the other new sub-model, and R(·) is the number of faces in the model that do not meet the support conditions.
[0119] Step 5: Update the current model group using the current decomposition results to obtain the updated model group.
[0120] Step 6: Repeat steps 2-4 above for the updated model group until the number of faces that do not meet the support conditions in all models in the updated model group is 0. Specifically, update the current model group using the current decomposition result after each repeated operation, and arrange the models in the updated model group in descending order of risk, and repeat until the risk of all models in the model group is 0.
[0121] It should be noted that when decomposing models that do not meet the support conditions in the current model to be decomposed, the optimal plane is searched to avoid collisions between the nozzle and the printer of the five-axis 3D printer. The optimal plane is required not to intersect with the base_poly of any model. If, during the plane search, a plane divides the current model to be decomposed into two new sub-models, and both new sub-models meet the support conditions (i.e., both have a risk of 0), then that plane is returned as the optimal plane, and the current decomposition result is returned. Alternatively, if, during the plane search, a plane divides the current model to be decomposed into two new sub-models, and the difference between the number of faces that do not meet the support conditions in the current model and the sum of the number of faces that do not meet the support conditions in the two new sub-models is the largest, then that plane is returned as the optimal plane, and the current decomposition result is returned.
[0122] Step 7: Generate a model decomposition tree based on the current decomposition results; specifically, this includes the following steps:
[0123] Step 71, Initial state: Use the model in the current model group as the root node of the model decomposition tree, that is, use the model in the current model group as node part1.
[0124] Step 72, Segmentation process: After dividing the current model to be decomposed using the optimal plane, add the sub-models located below the optimal plane in the current decomposition result to the left leaf node of the model decomposition tree, and add the sub-models located above the optimal plane in the current decomposition result to the right leaf node of the model decomposition tree.
[0125] Step 73, Recursive Construction: Repeat the splitting operation of Step 72 on the left or right leaf nodes of the model decomposition tree until it cannot be split further, thus obtaining the model decomposition tree; wherein each leaf node of the model decomposition tree represents the smallest independently printable sub-model, as shown in the appendix. Figure 1 As shown.
[0126] It should be noted that when using the optimal plane for model decomposition, sub-models located below the optimal plane in the current decomposition result are added to the left leaf node of the model decomposition tree, and sub-models located above the optimal plane in the current decomposition result are added to the right leaf node of the model decomposition tree. For each new node, the decomposition operation is repeated until it can no longer be divided, thus obtaining all parts and constructing a complete model decomposition tree. Specifically, based on the optimal plane obtained from the first plane search, node part1 is divided into node part2 and node part3. Then, a second plane search is performed. Based on the optimal plane obtained from the second plane search, node part2 and node part3 are decomposed respectively. The above steps are repeated to obtain node part2n and node part2n+1 after the nth decomposition. Figure 1 The decomposition results for node part2 are only shown in the image. The decomposition process for node part3 is similar and will not be described in detail here.
[0127] In this embodiment, by constructing a decomposition tree, the hierarchical structure of model decomposition can be obtained, and the relationship between decomposition steps is maintained. During the construction of the decomposition tree, the information of each decomposition, i.e. the optimal plane, is added to the nodes of the decomposition tree so that the subsequent printing order can be determined.
[0128] Step 8: Based on the model decomposition tree, plan the printing order of the models in the updated model group to obtain the printing order of the models; specifically, traverse the leaf nodes of the model decomposition tree from left to right to obtain the traversal results of the leaf nodes; based on the traversal results of the leaf nodes, sort the models in the updated module group to obtain the printing order of the models.
[0129] It should be noted that after obtaining the complete decomposition tree, the leaf nodes of the decomposition tree can be traversed from left to right to obtain the printing order of the models; that is, first print the sub-model corresponding to the leftmost leaf node of the decomposition tree, and then print the sub-model corresponding to the rightmost leaf node in turn, until all leaf nodes have been traversed.
[0130] Step 9: Following the printing order of the models, rotate the models in the updated model group to a horizontal position in sequence; then, slice each model into layers to obtain the layer slicing information of each model; based on the layer slicing information of each model, generate G-code executable for a five-axis 3D printer.
[0131] Specifically, it includes the following steps:
[0132] First, add rotation amounts to the G-code generated by Cura; specifically, based on the angles that the A-axis and C-axis need to rotate when the bottom surface of each part of the model in the updated model group is turned to horizontal, add rotation instructions to the G-code to rotate the model around the corresponding coordinate axes; for example, use the "R" instruction in the G-code to specify the rotation angle.
[0133] It should be noted that the angle by which the A-axis needs to be rotated when the bottom surface of each part of the model in the updated model group is rotated to be horizontal is denoted as the rotation angle. The angle by which the C-axis needs to be rotated is denoted as the rotation angle θ; where the rotation angle... The calculation process for the rotation angle θ is as follows:
[0134]
[0135]
[0136]
[0137]
[0138] Where Tr is the rotation transformation matrix. This is the normal vector of the base plane of the model.
[0139] Then, the offset is represented by adding translation commands; specifically, based on the offset between the base plane of each part of the model in the updated model group and the center position of the frustum, translation commands are added to the G code to move the model to the correct position; for example, the "X", "Y", and "Z" commands in the G commands are used to specify the translation amount.
[0140] It should be noted that the offset between the base plane of each part of the updated model group and the center position of the frustum can be directly calculated from the distance between the base plane of each part of the updated model group and the center position of the frustum.
[0141] Finally, each model is sliced into layers to obtain the layer slice information of each model; based on the layer slice information of each model, the G-code of each model is generated, that is, the G-code suitable for five-axis 3D unsupported printing is generated.
[0142] It should be noted that after rotating each part of the updated model group to a horizontal position, the model is layered using equal-thickness slicing to generate G-code. The design G-code start code and the G-code of each part are merged in the printing order; as shown in Table 2 below, Table 2 shows the implementation method of the start G-code.
[0143] Table 2 shows the G-code implementation method.
[0144]
[0145] In this embodiment, the model decomposition process of unsupported printing of a target workpiece with a bifurcated structure is taken as an example. Figure 2 As shown, attached Figure 2 The diagram below shows the model decomposition results. Figure 2 As can be seen from the above, the method can effectively decompose and achieve unsupported printing of the model.
[0146] The description of relevant parts of the supportless printing model decomposition system, device and computer-readable storage medium provided in this embodiment can be found in the detailed description of the corresponding parts of the supportless printing model decomposition method described in this embodiment, and will not be repeated here.
[0147] The model decomposition method described in this invention, targeting the multi-degree-of-freedom characteristics of five-axis 3D printers and complex models with bifurcated structures, provides a supportless printing model decomposition algorithm applicable to different types of five-axis 3D printers, enabling multi-directional supportless printing of parts. By obtaining the optimal plane in each decomposition cycle, the currently processed model can be divided into two parts that do not require support for printing, or the gradient of the decreasing number of support-required facets can be maximized. Through model decomposition, printing sequence planning is achieved, and G-code executable by the printer is generated, realizing supportless printing of the model.
[0148] The method proposed in this invention is applicable to different types of five-axis 3D printing equipment. It can also decompose various models with bifurcated structures for supportless printing, reducing material waste and avoiding the cumbersome process of removing supports after printing. Therefore, it is beneficial for the promotion and application of five-axis 3D printing technology. This invention can plan the printing sequence based on the decomposition results, allowing the overall model to be printed sequentially, and effectively avoids mechanical interference through constraints on the cutting planes.
[0149] The above embodiments are merely one of the implementation methods for achieving the technical solution of the present invention. The scope of protection claimed by the present invention is not limited to this embodiment, but also includes any variations, substitutions and other implementation methods that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention.
Claims
1. A method for model decomposition in supportless printing, characterized in that, include: Read the STL file of the target workpiece and store it in the preset model group structure to generate the current model group; In the current model group, select all models that do not meet the support conditions to obtain several current models to be decomposed; Using a planar search method, a planar search is performed on each current model to be decomposed to obtain the optimal plane; and the current model to be decomposed is divided using the optimal plane to obtain the current decomposition result; wherein, the optimal plane satisfies: both new sub-models in the current decomposition result satisfy the support condition; or satisfies: compared with the current model to be decomposed, the descent gradient of the number of patches that do not satisfy the support condition in the two new sub-models is the largest. The current model group is updated using the current decomposition results to obtain the updated model group; Generate a model decomposition tree based on the current decomposition results; Based on the model decomposition tree, the printing order of the models in the updated model group is planned to obtain the printing order of the models; Based on the printing order of the model, generate G-code that can be executed by a five-axis 3D printer; The process of using a planar search method to perform a planar search for each current model to be decomposed and obtain the optimal plane is as follows: Construct a unit upper hemisphere; wherein, the unit upper hemisphere is the upper half of a sphere with a radius of unit length and the origin as its center; A point is randomly selected on the upper hemisphere of the unit as the initial plane normal vector point, and the normal vector at the initial plane normal vector point is used as the initial plane normal vector. Randomly select a point on the current model to be decomposed as the model random point; An initial plane is constructed using the points representing the initial plane normal vector, the initial plane normal vector, and the random points of the model. A starting position is randomly selected on the initial plane, and based on the starting position, an equally spaced plane search is performed on the initial plane along the normal vector direction of the initial plane or along the opposite direction of the normal vector of the initial plane according to a preset search step size to obtain several search planes; wherein, the several search planes constitute a plane search space. Within the planar search space, if there exists a search plane that divides the current model to be decomposed into two new sub-models, and both new sub-models satisfy the support conditions, then the search plane is the optimal plane. Alternatively, within the plane search space, if there exists a search plane that divides the current model to be decomposed into two new sub-models, and compared to the current model to be decomposed, the decreasing gradient of the number of faces that do not meet the support conditions in the two new sub-models is the largest, then the search plane is the optimal plane. The process of generating a model decomposition tree based on the current decomposition results is as follows: The model in the current model group is used as the root node of the model decomposition tree; After dividing the current model to be decomposed using the optimal plane, the sub-models located below the optimal plane in the current decomposition result are added to the left leaf node of the model decomposition tree, and the sub-models located above the optimal plane in the current decomposition result are added to the right leaf node of the model decomposition tree. Repeat the optimal planar splitting operation on the left or right leaf node of the model decomposition tree until it cannot be split anymore, thus obtaining the model decomposition tree; wherein each leaf node of the model decomposition tree represents the smallest printable sub-model. The process of planning the printing order of the models in the updated model group based on the model decomposition tree to obtain the printing order of the models is as follows: The leaf nodes of the decomposition tree of the model are traversed from left to right to obtain the traversal results of the leaf nodes. Based on the traversal results of the leaf nodes, the models in the updated model group are sorted to obtain the printing order of the models.
2. The model decomposition method for supportless printing according to claim 1, characterized in that, The current model group includes several models; each model is stored according to a preset data structure. Specifically, the preset data structure model is as follows: {vertices, faces, normal, partNo, closedmodel, risk, base_plane, base_poly} Where vertices are model vertices; faces are model faces; normal is the normal vector of the model face; partNo is the model number; closedmodel is the adjacency relationship of associated triangular faces in the model; risk is the number of faces in the model that do not meet the support conditions; base_plane is the base plane information of the model; base_poly is the cross-sectional profile where the base plane of the model intersects with the model.
3. The model decomposition method for supportless printing according to claim 1, characterized in that, The model that does not meet the support conditions is one in which the number of faces that do not meet the support conditions is greater than 0.
4. The model decomposition method for supportless printing according to claim 1, characterized in that, The process of generating G-code executable for a five-axis 3D printer based on the printing order of the model is as follows: Following the printing order of the models, rotate the models in the updated model group to a horizontal position one by one; then, slice each model into layers to obtain the layer slice information of each model. Based on the layered slicing information of each model, generate G-code that can be executed by a five-axis 3D printer.
5. A supportless printing model decomposition system, characterized in that, include: The file reading module is used to read the STL file of the target workpiece and store it in the preset model group structure to generate the current model group; The model selection module is used to select all models that do not meet the support conditions in the current model group, and obtain several models to be decomposed. The plane search module is used to perform a plane search on each current model to be decomposed using a plane search method to obtain the optimal plane; and to use the optimal plane to divide the current model to be decomposed to obtain the current decomposition result; wherein, the optimal plane satisfies: both new sub-models in the current decomposition result satisfy the support condition; or satisfies: compared with the current model to be decomposed, the descent gradient of the number of patches that do not satisfy the support condition in the two new sub-models is the largest. The model group update module is used to update the current model group using the current decomposition results to obtain the updated model group; The decomposition tree module is used to generate a model decomposition tree based on the current decomposition results; The printing order planning module is used to plan the printing order of the models in the updated model group according to the model decomposition tree, so as to obtain the printing order of the models. The G-code generation module is used to generate executable G-code suitable for a five-axis 3D printer based on the printing order of the model. The process of using a planar search method to perform a planar search for each current model to be decomposed and obtain the optimal plane is as follows: Construct a unit upper hemisphere; wherein, the unit upper hemisphere is the upper half of a sphere with a radius of unit length and the origin as its center; A point is randomly selected on the upper hemisphere of the unit as the initial plane normal vector point, and the normal vector at the initial plane normal vector point is used as the initial plane normal vector. Randomly select a point on the current model to be decomposed as the model random point; An initial plane is constructed using the points representing the initial plane normal vector, the initial plane normal vector, and the random points of the model. A starting position is randomly selected on the initial plane, and based on the starting position, an equally spaced plane search is performed on the initial plane along the normal vector direction of the initial plane or along the opposite direction of the normal vector of the initial plane according to a preset search step size to obtain several search planes; wherein, the several search planes constitute a plane search space. Within the planar search space, if there exists a search plane that divides the current model to be decomposed into two new sub-models, and both new sub-models satisfy the support conditions, then the search plane is the optimal plane. Alternatively, within the plane search space, if there exists a search plane that divides the current model to be decomposed into two new sub-models, and compared to the current model to be decomposed, the decreasing gradient of the number of faces that do not meet the support conditions in the two new sub-models is the largest, then the search plane is the optimal plane. The process of generating a model decomposition tree based on the current decomposition results is as follows: The model in the current model group is used as the root node of the model decomposition tree; After dividing the current model to be decomposed using the optimal plane, the sub-models located below the optimal plane in the current decomposition result are added to the left leaf node of the model decomposition tree, and the sub-models located above the optimal plane in the current decomposition result are added to the right leaf node of the model decomposition tree. Repeat the optimal planar splitting operation on the left or right leaf node of the model decomposition tree until it cannot be split anymore, thus obtaining the model decomposition tree; wherein each leaf node of the model decomposition tree represents the smallest printable sub-model. The process of planning the printing order of the models in the updated model group based on the model decomposition tree to obtain the printing order of the models is as follows: The leaf nodes of the decomposition tree of the model are traversed from left to right to obtain the traversal results of the leaf nodes. Based on the traversal results of the leaf nodes, the models in the updated model group are sorted to obtain the printing order of the models.
6. A supportless printing model decomposition device, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the model decomposition method for unsupported printing as described in any one of claims 1-4 when executing the computer program.
7. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the model decomposition method for unsupported printing as described in any one of claims 1-4.
Citation Information
Patent Citations
Supportless 3D printing method based on five-axis printing platform
CN107825701A
3D printing file generation method and device, terminal, storage medium and printing equipment
CN115519793A