A 3D model slicing method, device, medium and system

By acquiring the user's 3D model and printing mode from the cloud server, determining the model's placement pose set, and selecting target model data for slicing, the problem of the ineffective consideration of the influence of model structure in existing technologies is solved, and printing time and consumables are optimized, improving printing accuracy and efficiency.

CN116442526BActive Publication Date: 2026-07-31SHENZHEN ANYCUBIC TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHENZHEN ANYCUBIC TECH CO LTD
Filing Date
2023-03-06
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

Existing 3D printing technologies fail to effectively consider the impact of model structure on printing time, accuracy, and consumables during the slicing process, resulting in excessively long total printing time or waste of consumables.

Method used

The system obtains the user's selected 3D model, printer, and printing mode from the cloud server, determines the set of applicable model placement postures, selects target model data that matches the printing mode from this set, slices it, and constructs target model data to meet the user's printing needs, such as constraints on printing time, material consumption, and accuracy.

Benefits of technology

It enables optimized 3D model slicing schemes based on user needs, shortens printing time, reduces consumable usage, improves printing accuracy, and provides personalized printing solutions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116442526B_ABST
    Figure CN116442526B_ABST
Patent Text Reader

Abstract

This application discloses a 3D model slicing method, apparatus, medium, and system in the field of 3D printing technology. This application allows users to independently select a 3D model, printer, and printing mode. A cloud server then automatically selects the target model data closest to the selected printing mode and completes the slicing. This helps the printer to print the 3D model within the constraints of this printing mode, thus providing users with 3D model slices that meet their actual printing needs. Therefore, this solution comprehensively considers printing requirements such as printing time and material consumption, and can create personalized 3D model slicing and printing solutions for users, thereby satisfying multiple needs. Correspondingly, the 3D model slicing apparatus, medium, and system provided in this application also have the aforementioned technical effects.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of 3D printing technology, and in particular to a method, device, medium and system for slicing 3D models. Background Technology

[0002] Unlike traditional subtractive and equal-material manufacturing, 3D printing technology uses a layer-by-layer deposition process. This method eliminates the need for molds and cutting, saving significant mold-making costs, reducing material waste, and simplifying the manufacturing process.

[0003] With the widespread application of 3D printing technology, higher demands are being placed on printing success rates and printing speeds. Currently, slicing algorithms can be used to slice model data to improve printing speed and accuracy. However, this approach is designed from the perspective of processing already formed model data and does not consider the impact of the model's structure on printing time, accuracy, and material consumption. For example, model height is the biggest factor limiting the total printing time; the higher the model, the longer the total printing time. Simultaneously, the more overhanging parts the model has, the more supports are needed, resulting in greater material consumption. However, users desire shorter total printing time and / or less material consumption. Therefore, when slicing the model, how to shorten the total printing time while keeping the model height constant, or how to reduce the number of supports while keeping the overhanging parts unchanged, thus reducing material consumption, becomes a problem that those skilled in the art need to solve. Summary of the Invention

[0004] In view of this, the purpose of this application is to provide a 3D model slicing method, device, medium, and system to solve the problem that users do not know how to select a suitable 3D model slicing method based on printing needs. The specific solution is as follows:

[0005] Firstly, this application provides a 3D model slicing method applied to a cloud server, including:

[0006] Acquire the 3D model, printer, and printing mode selected by the user via the control terminal;

[0007] Obtain a set of model placement poses for the 3D model applicable to the printer; the set of model placement poses includes: model data of the 3D model under multiple placement poses;

[0008] Select the target model data that matches the printing pattern from the set of model placement postures;

[0009] The 3D model is sliced ​​based on the target model data to obtain the slice file of the 3D model.

[0010] Optionally, obtaining a set of model placement poses suitable for the 3D model used in the printer includes:

[0011] Determine the type identification information of the printer;

[0012] The set of model placement postures is obtained based on the printer type identification information and the 3D model model identification information.

[0013] Optionally, selecting target model data that matches the printing pattern from the set of model placement poses includes:

[0014] Determine the target placement posture that corresponds to the printing pattern;

[0015] Select the target model data corresponding to the target placement posture from the set of model placement postures.

[0016] Optionally, the printing mode is used to constrain at least one of printing time, printing material quantity, and printing accuracy; the method further includes:

[0017] If the set of model placement poses is not obtained, or if the target model data is not present in the set of model placement poses, then the target model data is constructed, and based on the constructed target model data, the 3D model is sliced ​​to obtain the slice file of the 3D model.

[0018] Optionally, constructing the target model data includes:

[0019] The target algorithm is selected based on the printer type identification information and the number of models that need to be sliced ​​simultaneously;

[0020] The target algorithm is invoked in the print mode to find the target model data that minimizes the objective function value;

[0021] Accordingly, the method further includes storing the constructed target model data into the model placement pose set.

[0022] Optionally, the algorithm for selecting the target model based on the printer type identification information and the number of models that need to be sliced ​​simultaneously includes:

[0023] If the type identification information is LCD and there is only one model that needs to be sliced ​​at the same time, then the single-model algorithm suitable for LCD is selected as the target algorithm.

[0024] If the type identification information is LCD and there are multiple models that need to be sliced ​​simultaneously, then the multi-model algorithm suitable for LCD is selected as the target algorithm.

[0025] If the type identification information is FDM and there is only one model that needs to be sliced ​​at the same time, then the single-model algorithm suitable for FDM is selected as the target algorithm.

[0026] If the type identification information is FDM and there are multiple models that need to be sliced ​​simultaneously, then the multi-model algorithm suitable for FDM is selected as the target algorithm.

[0027] Accordingly, the step of calling the target algorithm in the print mode to solve for the target model data that minimizes the objective function value includes:

[0028] Determine the placement angle corresponding to each placement posture, and calculate the material volume, printing duration, and model data of the 3D model at each placement angle;

[0029] Based on the constraints of the printing mode on the consumable volume and printing duration, the target model data that minimizes the objective function value is selected from the model data under each placement posture.

[0030] Optionally, the calculation of the 3D model's material volume and printing duration at each placement angle includes:

[0031] Construct the transformation matrix of the 3D model from the default placement angle to the current placement angle;

[0032] Calculate the projected volume and model volume of the 3D model at the current placement angle based on the transformation matrix;

[0033] The difference between the projected volume and the model volume is determined as the material volume of the 3D model at the current placement angle;

[0034] Based on the vertical height of the 3D model at the current placement angle, the single-layer printing thickness of the printer, and the single-layer printing time, the printing duration of the 3D model at the current placement angle is calculated.

[0035] Optionally, constructing the transformation matrix for the 3D model from the default placement angle to the current placement angle includes:

[0036] Determine the first translation matrix that will translate the 3D model from its original position to the world coordinate origin;

[0037] After translating the 3D model according to the first translation matrix, determine the X-axis rotation matrix, Y-axis rotation matrix, and Z-axis rotation matrix required to transform the 3D model from the default placement angle to the current placement angle;

[0038] Determine the second translation matrix that will translate the 3D model from the world coordinate origin back to its original position;

[0039] The transformation matrix is ​​obtained by calculating the matrix multiplication of the first translation matrix, the X-axis rotation matrix, the Y-axis rotation matrix, the Z-axis rotation matrix, and the second translation matrix.

[0040] Optionally, calculating the projected volume and model volume of the 3D model at the current placement angle based on the transformation matrix includes:

[0041] The 3D model at the current placement angle is orthogonally projected using the WebGL tool to obtain the projection result.

[0042] The coordinates corresponding to the actual pixels of the model in the projection result are converted into world coordinates;

[0043] The sum of the volumes of all real pixels of the model is calculated based on the world coordinates of the real pixels of each model, and the projected volume of the 3D model at the current placement angle is obtained.

[0044] The sum of the volumes of all the triangular pyramids that make up the 3D model at the current placement angle is determined as the model volume of the 3D model at the current placement angle.

[0045] Optionally, selecting the target model data that minimizes the objective function value from the model data under each placement posture, based on the constraints of the printing mode on the consumable volume and printing duration, includes:

[0046] Based on the weight ratio of the printing mode to the printing duration and the amount of printing consumables, determine the constraint weight value of the printing mode for the consumable volume and the printing duration.

[0047] Based on the constraint weight values, the target model data that minimizes the objective function value is selected from the model data under each placement posture.

[0048] Secondly, this application provides an electronic device, comprising:

[0049] Memory, used to store computer programs;

[0050] A processor for executing the computer program to implement the aforementioned disclosed 3D model slicing method.

[0051] Thirdly, this application provides a readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the aforementioned disclosed 3D model slicing method.

[0052] Fourthly, this application provides a 3D model slicing system, including: a cloud server as disclosed above, at least one control terminal connected to the cloud server, and at least one printer.

[0053] As can be seen from the above solutions, this application provides a 3D model slicing method applied to a cloud server, including: acquiring a 3D model, printer, and printing mode selected by a user through a control terminal; acquiring a set of model placement postures suitable for the printer; the set of model placement postures includes: model data of the 3D model under multiple placement postures; selecting target model data that conforms to the printing mode from the set of model placement postures; slicing the 3D model based on the target model data to obtain a slice file of the 3D model.

[0054] As can be seen, this application allows users to independently select the 3D model, printer, and printing mode. The cloud server then determines a set of model placement poses suitable for the current 3D model on the printer based on this user-selected information. It selects the target model data that matches the current printing mode from multiple placement poses provided by this set. The cloud server then slices the 3D model based on the target model data, obtaining sliced ​​3D model files. This allows the printer to print the 3D model according to the user's wishes. For example, if the user's selected printing mode constrains the printing time to the shortest possible duration or the amount of printing consumables to the minimum, the cloud server will automatically select the target model data that best matches these conditions, slice it, and send the corresponding sliced ​​files to the printer. This allows the printer to print the 3D model under these three constraints, providing the user with 3D model sliced ​​files and a printing solution that meets their actual printing needs. Therefore, this application comprehensively considers printing requirements such as printing time and consumable consumption to create personalized 3D model slicing and printing solutions for users. This satisfies multiple needs and can also improve printing speed and accuracy while saving printing consumables.

[0055] Correspondingly, the 3D model slicing device, medium, and system provided in this application also have the above-mentioned technical effects. Attached Figure Description

[0056] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0057] Figure 1 This is a flowchart of a 3D model slicing method disclosed in this application;

[0058] Figure 2 This is a schematic diagram of a 3D model disclosed in this application;

[0059] Figure 3 This is a flowchart of a contraction-reflection operation disclosed in this application;

[0060] Figure 4 This is a flowchart of another 3D model slicing method disclosed in this application;

[0061] Figure 5 This is a schematic diagram of an electronic device disclosed in this application. Detailed Implementation

[0062] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0063] Currently, slicing algorithms can be used to slice model data to improve printing speed and accuracy. However, this approach is designed from the perspective of processing pre-existing model data and does not consider the impact of the model's structure on printing time, accuracy, and materials. For example, model height is the biggest factor limiting total printing time; the taller the model, the longer the total printing time. While shorter total printing time is generally better, users still need to consider other printing requirements to select a suitable 3D model slicing and printing scheme. Therefore, this application provides a 3D model slicing and printing method that can provide users with a 3D model slicing and printing method that meets their actual printing needs.

[0064] See Figure 1 As shown in the figure, this application discloses a 3D model slicing method applied to a cloud server, including:

[0065] S101. Obtain the 3D model, printer, and printing mode selected by the user through the control terminal.

[0066] In one embodiment of the present invention, the control terminal is such as a smartphone, tablet computer, laptop computer, or desktop computer. The printing mode can be set to several fixed modes, for example: mode 1 constitutes the longest printing time and the largest amount of printing consumables; mode 2 constitutes the shortest printing time and the largest amount of printing consumables; and mode 3 constitutes the shortest printing time and the smallest amount of printing consumables. Then, the user only needs to select mode 1, mode 2, or mode 3 on the control terminal to select the printing mode.

[0067] In one embodiment of the present invention, the items in the printing mode can also be set by the user. For example, the control terminal provides tabs for three items: printing duration, printing consumables, and printing accuracy. The user can fill in maximum, minimum, or moderate values ​​for these three items, and then obtain the user-selected printing mode based on the items filled in by the user and their values. It can be seen that the items that can be constrained in the printing mode can include printing accuracy, printing duration, printing consumables, etc. Specifically, the value corresponding to a certain item can be regarded as the constraint weight value of that item. Therefore, when the printing mode includes three items: printing duration, printing consumables, and printing accuracy, the values ​​of these three items can be 0.5, 0.2, and 0.3, respectively. It can be seen that the sum of the constraint weight values ​​of all items in the same printing mode is 1.

[0068] S102. Obtain a set of model placement poses for the 3D model suitable for the printer; the set of model placement poses includes: model data of the 3D model under multiple placement poses.

[0069] It should be noted that since there are various types of printers, and different types of printers have different methods for processing model data and different model data formats, it is necessary to select appropriate model data for the printer selected by the user. Therefore, in one specific implementation, obtaining a set of model placement postures suitable for the printer includes: determining the printer type identification information; and obtaining a set of model placement postures based on the printer type identification information and the 3D model's model identification information.

[0070] In this embodiment, the cloud server can preset sets of model placement poses for different 3D models. Each set of model placement poses for a 3D model stores model data for that 3D model under multiple placement poses. For example, the model data for a 3D model under multiple placement poses, i.e., the content of the set of model placement poses for different 3D models, includes some or all of the following: {model name, type, printer type, printer model, printing mode, consumable volume, printing duration, printing accuracy, placement pose 1, placement pose 2... placement pose 1 corresponds to the model tilt angle, placement pose 2 corresponds to the model tilt angle...}. The server will create different sets of model placement poses for different 3D printed models. If the 3D model selected by the user can obtain relevant parameter information from the model placement posture set stored on the server, then after the user confirms the 3D model and selects the printing mode, the server will automatically determine the model placement posture and corresponding tilt angle corresponding to the printing mode from the model placement posture set, and slice the 3D model with this placement posture and tilt angle. If the 3D model selected by the user cannot be obtained from the model placement posture set stored on the server, or the retrieval fails, then after the user confirms the 3D model and selects the printing mode, the server will determine the corresponding model placement posture and corresponding tilt angle, and other parameters that need to be saved from the model placement posture set, and save them to the model placement posture set corresponding to the 3D model, or create a new model placement posture set for the 3D model, and store the determined parameters that need to be saved in the newly created model placement posture set for the model. Finally, the 3D model is sliced ​​with the determined placement posture and corresponding tilt angle, and the sliced ​​file is sent to the corresponding printer for printing. By creating different sets of model placement poses for different 3D models, users can automatically select the appropriate model placement angle from these sets when slicing a 3D model. This eliminates the need to calculate the model placement pose or angle corresponding to the printing mode each time, thus improving model slicing efficiency. Please see [link to relevant documentation]. Figure 2 , Figure 2 The 3D model shown can be positioned in various ways on a plane. Figure 2 As shown in A, B, C, etc., a 3D model can have multiple poses. In each pose, the 3D structural information that constitutes the model is its data for that pose. If the 3D model is an irregular shape such as a comic book figure, its poses are even more numerous.

[0071] S103. Select the target model data that matches the printing mode from the model placement posture set.

[0072] S104. Slice the 3D model based on the target model data to obtain the slice file of the 3D model.

[0073] It should be noted that different model placement positions affect printing time, filament consumption, and printing accuracy. Since the user has already selected a printing mode on the control terminal, they can choose target model data that matches the printing mode from the set of model placement positions. This allows the printer to print the 3D model based on the target model data in the user-selected printing mode.

[0074] like Figure 2 As shown, comparing the three placement postures A, B, and C, the angle between the model's bottom surface and the horizontal plane increases progressively. Therefore, different placement postures of the same 3D model have different placement angles, and there is a one-to-one correspondence between placement postures and placement angles. Thus, different placement postures can be represented by different angle values. Of course, since it is a 3D model, the placement angle used to represent a certain placement posture must include three values: the X-axis angle, the Y-axis angle, and the Z-axis angle. In one implementation, selecting target model data that conforms to the printing mode from the set of model placement postures includes: determining the target placement posture that corresponds to the printing mode; and selecting the target model data corresponding to the target placement posture from the set of model placement postures.

[0075] In one implementation, target model data can be sent to a printer, enabling the printer to print a 3D model based on the target model data. Specifically, a cloud server can slice the 3D model based on the target model data to obtain sliced ​​3D model files; these sliced ​​files are then sent to the printer, allowing the printer to print the 3D model based on the sliced ​​files, thereby improving printing accuracy and speed. Any slicing algorithm can be used to slice the target model data.

[0076] Although cloud servers can preset sets of model placement poses for different 3D models, the data included in a set of model placement poses for a particular 3D model may not be comprehensive enough, or the set of model placement poses corresponding to the 3D model selected by the user may not yet be set in the cloud server. Therefore, in one embodiment of the present invention, the method further includes: if no set of model placement poses is obtained, or if target model data is not found in the set of model placement poses, then target model data is constructed, and based on the constructed target model data, the 3D model is sliced ​​to obtain a slice file of the 3D model; and the printing mode is used to constrain at least one of printing time, printing material consumption, and printing accuracy, that is, after the user selects any one or more printing modes, the server will automatically obtain target model data or construct target model data according to the model selected by the user and the printing mode, and perform slicing processing on the model. In other words: when no set of model placement poses is found, and / or target model data is not found in the set of model placement poses, target model data is constructed, the 3D model is sliced ​​based on the target model data, and the obtained slice file is sent to the printer so that the printer prints the 3D model based on the slice file. Then, you can set the set of model placement poses corresponding to the user's selected 3D model in the cloud server, and store the constructed target model data in the set of model placement poses.

[0077] As can be seen, in one embodiment of the present invention, the user can independently select a 3D model, printer, and printing mode. Then, the cloud server can query a set of model placement postures suitable for the current printer and the current 3D model based on the user's selection. From the model data of multiple placement postures provided by the model placement posture set, the cloud server selects target model data that matches the current printing mode. The cloud server then slices the 3D model based on the target model data and sends the obtained slice files to the printer selected by the user, enabling the printer to print the current 3D model based on the slice files. This allows the printer to print the 3D model according to the user's wishes. For example, if the user's selected printing mode constrains the printing time to the shortest, the printing consumables to the least, and the printing accuracy to the highest, then the cloud server selects the target model data that best matches these conditions, slices the 3D model based on the target model data, obtains the slice files, and sends the slice files to the printer, allowing the printer to print the 3D model under these three constraints. This provides the user with a 3D model slicing and printing solution that meets their actual printing needs. As can be seen, this application can comprehensively consider printing needs such as printing time and printing material consumption, and formulate personalized 3D model slicing and printing solutions for users. This can meet the needs of multiple parties and also provide the possibility of improving printing speed and printing accuracy, and saving printing materials.

[0078] Based on the above embodiments, it should be noted that, in one embodiment of the present invention, constructing target model data includes: selecting a target algorithm according to the printer type identification information and the number of models that need to be sliced ​​simultaneously; calling the target algorithm in printing mode to solve for the target model data that minimizes the objective function value; correspondingly, it also includes: storing the constructed target model data into a model placement pose set.

[0079] In one implementation, a target algorithm is selected based on the printer type identification information and the number of models that need to be sliced ​​simultaneously. This includes: if the type identification information is LCD and there is only one model that needs to be sliced ​​simultaneously, then a single-model algorithm suitable for LCD is selected as the target algorithm; if the type identification information is LCD and there are multiple models that need to be sliced ​​simultaneously, then a multi-model algorithm suitable for LCD is selected as the target algorithm; if the type identification information is FDM and there is only one model that needs to be sliced ​​simultaneously, then a single-model algorithm suitable for FDM is selected as the target algorithm; if the type identification information is FDM and there are multiple models that need to be sliced ​​simultaneously, then a multi-model algorithm suitable for FDM is selected as the target algorithm. Please refer to [link to relevant documentation]. Figure 2 One situation is as follows Figure 2 The 3D model shown can be divided into two parts: a regular solid (cube) and an irregular solid (television set). The printer can then print these two parts separately, so the number of models requiring simultaneous slicing is 2. Alternatively, if four identical 3D models need to be printed simultaneously, then the number of models requiring simultaneous slicing is 4. That is, models that can be sliced ​​simultaneously include identical 3D models, different 3D models, or different parts derived from the same 3D model. By selecting the target model based on the printer type identification information and the number of models requiring simultaneous slicing, the slicing success rate can be improved. Simultaneously, storing the constructed target model data in a model placement pose set enriches the set of possible 3D model placement poses, allowing users to automatically select the corresponding target model data during subsequent printing, saving slicing and printing time.

[0080] It should be noted that since a 3D model can have multiple placement positions, the 3D structural information of the model under multiple placement positions can be calculated. Then, the position that minimizes the objective function value can be selected as the optimal solution. Accordingly, the objective algorithm is invoked in printing mode to solve for the target model data that minimizes the objective function value. This includes: determining the placement angle corresponding to each placement position, and calculating the filament volume, printing duration, and model data of the 3D model at each placement angle; based on the constraints of the printing mode on filament volume and printing duration, selecting the target model data that minimizes the objective function value from the model data under each placement position. Here, the objective function is the function that the objective algorithm needs to solve for, and this objective function can output the target model data that best matches the user's selected printing mode. For example, given a model, we have two placement postures, A and C. The printing time for posture A is 100 minutes, the amount of printing material is 80, and the printing accuracy is 96%. The printing time for posture B is 90 minutes, the amount of printing material is 80, and the printing accuracy is 96%. The user has selected the printing mode with the longest printing time, the most printing material, and the highest printing accuracy. In this case, the 3D structural data of the model in posture A will be output as the target model data.

[0081] In one embodiment of the present invention, the process of selecting target model data that minimizes the objective function value from model data under each placement posture, based on the constraints of the printing mode on the consumable volume and printing duration, includes: determining the constraint weight value of the printing mode on the consumable volume and printing duration according to the weight ratio of the printing mode on the printing duration and the amount of printing consumables; and selecting the target model data that minimizes the objective function value from model data under each placement posture based on the constraint weight value.

[0082] In one embodiment of the present invention, calculating the consumable volume and printing duration of a 3D model at each placement angle includes: constructing a transformation matrix for the 3D model from a default placement angle to the current placement angle; calculating the projected volume and model volume of the 3D model at the current placement angle based on the transformation matrix; determining the difference between the projected volume and the model volume as the consumable volume of the 3D model at the current placement angle; and calculating the printing duration of the 3D model at the current placement angle based on the vertical height of the 3D model at the current placement angle, the single-layer printing thickness of the printer, and the single-layer printing time.

[0083] In one embodiment of the present invention, constructing a transformation matrix for transforming a 3D model from a default placement angle to a current placement angle includes: determining a first translation matrix to translate the 3D model from its original position to the world coordinate origin; after translating the 3D model according to the first translation matrix, determining the X-axis rotation matrix, Y-axis rotation matrix, and Z-axis rotation matrix required to transform the 3D model from the default placement angle to the current placement angle; determining a second translation matrix to translate the 3D model from the world coordinate origin back to its original position; and calculating the matrix multiplication result of the first translation matrix, the X-axis rotation matrix, the Y-axis rotation matrix, the Z-axis rotation matrix, and the second translation matrix to obtain the transformation matrix.

[0084] In one embodiment of the present invention, calculating the projected volume and model volume of a 3D model at the current placement angle based on a transformation matrix includes: performing orthogonal projection on the 3D model at the current placement angle using a WebGL tool to obtain a projection result; converting the coordinates corresponding to the actual pixels of the model in the projection result into world coordinates; calculating the sum of the volumes of all actual pixels of the model based on the world coordinates of each actual pixel to obtain the projected volume of the 3D model at the current placement angle; and determining the sum of the volumes of all triangular pyramids constituting the 3D model at the current placement angle as the model volume of the 3D model at the current placement angle. The coordinates corresponding to the actual pixels of the model are the window screen coordinates.

[0085] It should be noted that WebGL (Web Graphics Library) is a 3D graphics protocol that enables the creation of interactive 3D animations on the web through HTML scripts themselves, without the need for any browser plugins. It can utilize the underlying graphics hardware acceleration capabilities for graphics rendering, which is achieved through a unified, standard, and cross-platform OpenGL interface.

[0086] In one embodiment of the present invention, the specific calculation process in the target algorithm includes:

[0087] (1) Determine the current placement angles Dx, Dy, and Dz, and convert Dx, Dy, and Dz to radians respectively. Then we have: Rx = Dx / 180*π, Ry = Dy / 180*π, Rz = Dz / 180*π. Wherein, the placement angles Dx, Dy, and Dz are the angles that the three coordinate axes need to rotate when the 3D model is rotated from the default placement angle to the current placement angle.

[0088] (2) Establish a coordinate system for the 3D model at the default orientation angle, and determine the maximum and minimum values ​​of the 3D model in the X, Y, and Z axes at the default orientation angle: Max_x, Min_x, Max_y, Min_y, Max_z, Min_z. Based on this, calculate the coordinates of the center point of the model (Xz, Yz, Zz). Then determine the first translation matrix POj to translate the 3D model from its own coordinate system origin to the world coordinate system origin.

[0089] The center point coordinates (Xz, Yz, Zz) are calculated as follows: Xz = (Max_x - Min_x) / 2, Yz = (Max_y - Min_y) / 2, Zz = (Max_z - Min_z) / 2. First translation matrix.

[0090]

[0091] (3) After the model is translated to the origin of the world coordinate system, calculate the rotation matrices of the model around the X-axis, Y-axis and Z-axis: Qx, Wy and Ez.

[0092] Specifically,

[0093] (4) The second translation matrix OPj is used to translate the 3D model from the origin of the world coordinate system back to its original position.

[0094] Second translation matrix

[0095] (5) Based on the above, the transformation matrix Mb = OPj * Qx * Wy * Ez * POj of the 3D model from the default placement angle to the current placement angle.

[0096] (6) By multiplying the model transformation matrix Mb with the physical model, the size and coordinates of the model when it is rotated to the current placement angle can be determined. Thus, the projected volume of the model, the volume of the model itself, and the printing time can be calculated.

[0097] A. Obtain the coordinates of the model at the current placement angle based on the model transformation matrix Mb, and take the maximum and minimum values ​​on the X-axis, Y-axis, and Z-axis respectively: Xmax, Xmin, Ymax, Ymin, Zmax, Zmin.

[0098] B. Perform orthographic projection on the model at the current placement angle in WebGL so that the view of the model remains consistent regardless of the angle.

[0099] C. For the projected 3D image, obtain the depth value of the entire window using the WebGL vertex shader API: gl_Position.z, and set it as the initial depth. Compare the pixel depth values ​​on the 3D image with the initial depth. If the pixel depth value on the 3D image is less than the initial depth, it means that the pixel is a real pixel of the model. Based on this, select all real pixels of the model from the 3D image.

[0100] D. To remove z-axis errors, the WebGL `gluUnProject()` method is used to convert the screen coordinates of all real pixels on the window into world coordinates. Based on the world coordinates of each real pixel, the area `S` of that real pixel in the x, y directions is calculated. Then, the minimum z-coordinate value `Zmin` is subtracted from the z-coordinate values ​​of all real pixels to obtain the difference. Multiplying the area `S` by the difference between the z-coordinate of a given pixel and the minimum value `Zmin` yields the projected volume of each real pixel. The projected volumes of all real pixels are summed to obtain `Zsum`. Therefore, the projected volume of the model at the current orientation angle is `Vt = S * Zsum`.

[0101] E. When calculating the volume of the model itself, the model is divided into n triangular pyramids of equal volume. Therefore, by calculating the volumes of all the triangular pyramids and summing them, the volume of the model can be obtained, i.e., the model volume. V i This represents the volume of a single triangular pyramid.

[0102] F. Model support volume (i.e., consumable volume) Vh = Vt - Vs.

[0103] G. The height of the model is Zmax-Zmin at the current placement angle. If the time required to print the model is Hi, the thickness of each layer is CH, and the printing time for each layer is H, then Hi = (Zmax-Zmin)*H / CH.

[0104] It is evident that printing time is affected by the model's height, and the model's height is closely related to its placement. The shorter the model is placed, the lower its height, the fewer the total number of layers, and the shorter the printing time.

[0105] (7) As described above, the model support volume and printing time under multiple placement angles can be calculated. Combined with the constraint weight values ​​of each item in the user-selected constraint conditions, the objective function can be solved using the objective algorithm to obtain the optimal placement posture.

[0106] The inputs to the objective algorithm are: all placement angles, the support volume and printing time at each placement angle, and the constraint weights of each item in the user-selected constraints. The input to the objective algorithm is the 3D structural data of the model at a placement angle that minimizes the objective function value while satisfying the user-selected constraints.

[0107] Specifically, in the target algorithm, the process of solving the 3D structural data of the model at a certain placement angle includes: for each triangular pyramid in the model constituting the current angle, calculating the function values ​​of the four points x1, x2, x3, and x4 of the pyramid with respect to the objective function: f(x1), f(x2), f(x3), and f(x4). These four function values ​​are sorted in ascending order, and the maximum value fh, the second largest value fs, and the minimum value fl are selected. The points Xh, Xs, and Xl corresponding to these three values ​​are then determined. For f(x1), f(x2), f(x3), and f(x4), the maximum value fh is removed, and the centroid is calculated based on the coordinates of the remaining three points. Based on the maximum value fh of all triangular pyramids, a shrinkage reflection algorithm is performed, that is: different triangular pyramids are compared pairwise without repetition, the larger fh of the two triangular pyramids being compared is retained, and the smaller fh is replaced with the larger fh so that the Xh of the triangular pyramid is reflected to the better side, thereby generating a new point to try to replace the worst point Xh. This process is repeated until the reflection shrinkage condition is met, and finally the best point is obtained.

[0108] Please see Figure 3 The specific steps of a certain round in the contraction-reflection algorithm include: setting a reflection point Xr = 2 × C - Xh and calculating the corresponding function value fr. If fr is less than fl, then setting an expansion point Xe = C + (Xr - C) and calculating the corresponding function value fe. If fr is not less than fl, then checking if fl < fr < fs. If fl < fr < fs, then the reflection point replaces the worst point. If fl < fr < fs, then when fr < fh, setting a contraction point Xc = C + β × (Xr - C), where β is the rate of change of the contraction point, and when fr is not less than fh, setting a contraction point Xc = C + β × (Xh - C), and then calculating the function value fc corresponding to the contraction point Xc. Then checking if fc < fr. If fc < fr, then the contraction point replaces the worst point. If fc is not less than fr, then performing a contraction-expansion interchange. When fe < fr, the expansion point replaces the worst point; when fe is not less than fr, the reflection point replaces the worst point. This process of comparing different triangular pyramids continues until the result of the shrinkage change is negligible, at which point the process ends.

[0109] An embodiment of the present invention provides a 3D model slicing system, which includes a cloud server, a control device and a printer. The cloud server has a set of model placement poses corresponding to multiple 3D models pre-set.

[0110] In embodiments of the present invention, the control device may be a mobile phone, smartphone, tablet computer, or other intelligent control device that can connect to the printer and cloud server via a network. The cloud server can receive information from the printer, such as printer status information and type. The cloud server can also receive print requests, 3D model data, and model placement pose sets from the control device. The print request can specify the printer, 3D model, and print requirements (i.e., print mode).

[0111] Specifically, the set of poses for a given 3D model includes the structural data of the 3D model when it is positioned in different poses. Users can use control devices to update the set of poses for each model stored on the cloud server in real time.

[0112] In one printing process, the user selects a 3D model online via a control device. The device previews the 3D model, prompting the user to select their printer. The user then clicks the one-click print button, at which point a print mode selection window appears, offering at least two options, including fastest printing speed and consumable consumption. After selecting the appropriate print mode, the selected 3D model file is transmitted over the network to a cloud server. The cloud server selects the optimal placement angle from a set of model placement poses corresponding to the selected 3D model, slices the 3D model using this optimal angle, and obtains the sliced ​​files. These sliced ​​files are then sent to the printer for printing. Selecting different print modes allows the printer to print at the fastest speed or with the least consumable, enabling the creation of personalized 3D model slicing and printing solutions for the user.

[0113] Please see Figure 4 After the user sends the model file and print mode to the cloud server via intelligent focus, the cloud server first determines the machine type to identify whether the selected printer is an LCD printer or an FDM printer. For LCD or FDM printers, if the cloud server already has a set of model placement postures suitable for the selected printer, it finds a placement angle that matches the selected print mode within that set, slices the model, and sends the resulting sliced ​​file to the printer for printing. If the cloud server does not have a set of model placement postures for the selected model, or if the set does not contain a placement angle that matches the selected print mode, it further determines the number of models and uses either a multi-model algorithm or a single-model algorithm to generate a placement angle that matches the selected print mode. The newly generated placement angles can then be stored on the cloud server.

[0114] It should be noted that for FDM printers, a model placement algorithm adapted for FDM printers is required; for LCD printers, a model placement algorithm adapted for LCD printers is required. This embodiment of the invention uses an LCD printer as an example for detailed description. After determining the number of models, it can be decided whether to use a single-model algorithm or a multi-model algorithm. This embodiment uses a single-model algorithm as an example for detailed description.

[0115] The model placement algorithm mainly performs the following calculations: calculating the model's support volume and printing time; after obtaining the model's support volume and printing time, it determines whether the printing time is the fastest or the support volume is the smallest based on the weighting coefficients set in the printing mode, and then slices and prints the model accordingly. Specific calculation steps can be found in the descriptions of other embodiments, and will not be repeated here.

[0116] As can be seen, the solution provided in this embodiment allows users to select the optimal placement angle of the model and can realize different 3D model slicing schemes according to user wishes, such as fast printing speed and fewer printing supports. It can meet the needs of multiple parties and also provide the possibility of improving printing speed and printing accuracy while saving printing consumables.

[0117] The following describes an electronic device provided by an embodiment of this application. The electronic device described below can be referred to in conjunction with the other embodiments described above.

[0118] See Figure 5 As shown in the figure, an embodiment of this application discloses an electronic device, including:

[0119] Memory 501 is used to store computer programs;

[0120] Processor 502 is configured to execute the computer program to implement the method disclosed in any of the above embodiments.

[0121] Furthermore, this application embodiment also provides a server as the aforementioned electronic device. Specifically, the server may include: at least one processor, at least one memory, a power supply, a communication interface, an input / output interface, and a communication bus. The memory stores a computer program, which is loaded and executed by the processor to implement the relevant steps in the 3D model slicing method disclosed in any of the foregoing embodiments.

[0122] In this embodiment, the power supply is used to provide operating voltage for each hardware device on the server; the communication interface can create a data transmission channel between the server and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and is not specifically limited here; the input / output interface is used to acquire external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.

[0123] In addition, the memory, as a carrier for resource storage, can be a read-only memory, random access memory, disk or optical disk, etc. The resources stored on it include operating system, computer programs and data, etc., and the storage method can be temporary storage or permanent storage.

[0124] The operating system is used to manage and control the various hardware devices and computer programs on the server, enabling the processor to perform operations and processes on the data in the memory. It can be Windows Server, Netware, Unix, Linux, etc. The computer programs, in addition to those capable of performing the 3D model slicing method disclosed in any of the foregoing embodiments, may further include computer programs capable of performing other specific tasks. The data may include, in addition to data such as virtual machine data, data such as virtual machine developer information.

[0125] Furthermore, this application also provides a terminal as the aforementioned electronic device. This terminal may specifically include, but is not limited to, a smartphone, tablet computer, laptop computer, or desktop computer.

[0126] Typically, the terminal in this embodiment includes a processor and a memory.

[0127] The processor may include one or more processing cores, such as a quad-core processor or an octa-core processor. The processor can be implemented using at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), or PLA (Programmable Logic Array). The processor may also include a main processor and coprocessors. The main processor, also known as a CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, the processor may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, the processor may also include an AI (Artificial Intelligence) processor, which handles machine learning-related construction operations.

[0128] The memory may include one or more computer-readable storage media, which may be non-transitory. The memory may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In this embodiment, the memory is used to store at least the following computer program, which, after being loaded and executed by the processor, is capable of implementing the relevant steps in the 3D model slicing method executed on the terminal side as disclosed in any of the foregoing embodiments. In addition, the resources stored in the memory may also include operating systems and data, and the storage method may be temporary or permanent storage. The operating system may include Windows, Unix, Linux, etc. The data may include, but is not limited to, application update information.

[0129] In some embodiments, the terminal may further include a display screen, an input / output interface, a communication interface, a sensor, a power supply, and a communication bus.

[0130] The following describes a readable storage medium provided in an embodiment of this application. The readable storage medium described below can be referred to in conjunction with the other embodiments described above.

[0131] This application discloses a readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the 3D model slicing method disclosed in the aforementioned embodiments. The readable storage medium is a computer-readable storage medium, which serves as a carrier for resource storage and can be a read-only memory, random access memory, disk, or optical disk, etc. The resources stored thereon include an operating system, computer programs, and data, and the storage method can be temporary or permanent storage.

[0132] The following describes a 3D model slicing system provided in an embodiment of this application. The 3D model slicing system described below can be referred to in conjunction with the other embodiments described above.

[0133] This application discloses a 3D model slicing system, including: a cloud server disclosed in any of the foregoing embodiments, at least one control terminal connected to the cloud server, and at least one printer.

[0134] The various embodiments in this specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.

[0135] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of readable storage medium known in the art.

[0136] This document uses specific examples to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A 3D model slicing method, characterized in that, Applied to cloud servers, including: The system acquires the 3D model, printer, and printing mode selected by the user via a control terminal; the printing mode is used to constrain at least one of the following: printing time, printing material consumption, and printing accuracy. Obtain a set of model placement poses for the 3D model applicable to the printer; the set of model placement poses includes: model data of the 3D model under multiple placement poses; Select the target model data that matches the printing pattern from the set of model placement postures; The 3D model is sliced ​​based on the target model data to obtain the sliced ​​file of the 3D model, so as to provide users with 3D model sliced ​​files and printing solutions that meet actual printing needs.

2. The method according to claim 1, characterized in that, The step of obtaining a set of model placement poses for the 3D model suitable for the printer includes: Determine the type identification information of the printer; The set of model placement poses is obtained based on the printer type identification information and the 3D model model identification information.

3. The method according to claim 1, characterized in that, The step of selecting target model data that matches the printing pattern from the set of model placement postures includes: Determine the target placement posture that corresponds to the printing pattern; Select the target model data corresponding to the target placement posture from the set of model placement postures.

4. The method according to any one of claims 1 to 3, characterized in that, The method further includes: If the set of model placement poses is not obtained, or if the target model data is not present in the set of model placement poses, then the target model data is constructed, and based on the constructed target model data, the 3D model is sliced ​​to obtain the slice file of the 3D model.

5. The method according to claim 4, characterized in that, The construction of the target model data includes: The target algorithm is selected based on the printer type identification information and the number of models that need to be sliced ​​simultaneously; The target algorithm is invoked in the print mode to find the target model data that minimizes the objective function value; Accordingly, the method further includes storing the constructed target model data into the model placement pose set.

6. The method according to claim 5, characterized in that, The algorithm for selecting the target model based on the printer type identification information and the number of models to be sliced ​​simultaneously includes: If the type identification information is LCD and there is only one model that needs to be sliced ​​at the same time, then the single-model algorithm suitable for LCD is selected as the target algorithm. If the type identification information is LCD and there are multiple models that need to be sliced ​​simultaneously, then the multi-model algorithm suitable for LCD is selected as the target algorithm. If the type identification information is FDM and there is only one model that needs to be sliced ​​at the same time, then the single-model algorithm suitable for FDM is selected as the target algorithm. If the type identification information is FDM and there are multiple models that need to be sliced ​​simultaneously, then the multi-model algorithm suitable for FDM is selected as the target algorithm. Accordingly, the step of calling the target algorithm in the print mode to solve for the target model data that minimizes the objective function value includes: Determine the placement angle corresponding to each placement posture, and calculate the material volume, printing duration, and model data of the 3D model at each placement angle; Based on the constraints of the printing mode on the consumable volume and printing duration, the target model data that minimizes the objective function value is selected from the model data under each placement posture.

7. The method according to claim 6, characterized in that, Calculate the material volume and printing duration of the 3D model at each placement angle, including: Construct the transformation matrix of the 3D model from the default placement angle to the current placement angle; Calculate the projected volume and model volume of the 3D model at the current placement angle based on the transformation matrix; The difference between the projected volume and the model volume is determined as the material volume of the 3D model at the current placement angle; Based on the vertical height of the 3D model at the current placement angle, the single-layer printing thickness of the printer, and the single-layer printing time, the printing duration of the 3D model at the current placement angle is calculated.

8. The method according to claim 7, characterized in that, The transformation matrix for constructing the 3D model from the default placement angle to the current placement angle includes: Determine the first translation matrix that will translate the 3D model from its original position to the world coordinate origin; After translating the 3D model according to the first translation matrix, determine the X-axis rotation matrix, Y-axis rotation matrix, and Z-axis rotation matrix required to transform the 3D model from the default placement angle to the current placement angle; Determine the second translation matrix that will translate the 3D model from the world coordinate origin back to its original position; The transformation matrix is ​​obtained by calculating the matrix multiplication of the first translation matrix, the X-axis rotation matrix, the Y-axis rotation matrix, the Z-axis rotation matrix, and the second translation matrix.

9. The method according to claim 7, characterized in that, The step of calculating the projected volume and model volume of the 3D model at the current placement angle based on the transformation matrix includes: The 3D model at the current placement angle is orthogonally projected using the WebGL tool to obtain the projection result. The coordinates corresponding to the actual pixels of the model in the projection result are converted into world coordinates; The sum of the volumes of all real pixels of the model is calculated based on the world coordinates of the real pixels of each model, and the projected volume of the 3D model at the current placement angle is obtained. The sum of the volumes of all the triangular pyramids that make up the 3D model at the current placement angle is determined as the model volume of the 3D model at the current placement angle.

10. The method according to claim 6, characterized in that, The step of selecting the target model data that minimizes the objective function value from the model data under various placement postures, based on the constraints of the printing mode on the consumable volume and printing duration, includes: Based on the weight ratio of the printing mode to the printing duration and the amount of printing consumables, determine the constraint weight value of the printing mode for the consumable volume and the printing duration. Based on the constraint weight values, the target model data that minimizes the objective function value is selected from the model data under each placement posture.

11. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the method as described in any one of claims 1 to 10.

12. A readable storage medium, characterized in that, Used to store a computer program, wherein the computer program, when executed by a processor, implements the method as described in any one of claims 1 to 10.

13. A 3D model slicing system, characterized in that, include: A cloud server, at least one control terminal connected to the cloud server, and at least one printer; The cloud server is used to perform the method according to any one of claims 1 to 10.