Slicing method for 3D printing, storage medium and terminal
By using multi-threaded parallel processing technology, the line patterns obtained by the intersection of the shape patch data of the 3D printed model and the slicing plane are processed in parallel by the first and second types of threads, which solves the problem of low slicing efficiency in the existing technology and realizes a more efficient data conversion process.
Patent Information
- Application Number
- CN202211255456.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-13
- Publication Date
- 2026-11-20
- Estimated Expiration
- 2042-10-13
AI Technical Summary
Existing 3D printing slicing methods have low data processing efficiency, especially when processing large-scale 3D solid models, which takes too long.
The system employs multi-threaded parallel processing technology, with the first type of thread and the second type of thread running in parallel to process the line patterns obtained by the intersection of the preset shape patch data and the preset slicing plane, and the second type of thread performs graphic rendering to obtain the slice pattern corresponding to the preset slicing plane.
It improves the efficiency of 3D printing slicing, solves the problem of low slicing efficiency in existing technologies, and enables a faster data conversion process.
Smart Images

Figure CN117922012B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of 3D printing technology, and in particular to a slicing method, storage medium, and terminal for 3D printing. Background Technology
[0002] 3D printing is a novel additive manufacturing technology that can build a complete part from scratch by continuously stacking and bonding material layers. Because this processing method differs from traditional subtractive manufacturing, 3D printing has found widespread application. The 3D printing process involves data modeling and layering of a three-dimensional entity, and then importing the printing data into a 3D printer for printing. Layering and slicing is a crucial part of 3D printing.
[0003] 3D printing slicing typically involves several data processing stages, and these stages follow a fixed order. Therefore, in existing technologies, the same thread of the central processing unit is usually used to complete the data processing operations of each stage sequentially. That is, after all the data in one stage is processed, the same thread executes the data processing operation of the next stage until the 3D printing layer slicing is completed. This makes slicing large-scale 3D solid models very time-consuming and results in low efficiency for 3D printing slicing. Summary of the Invention
[0004] In view of this, the present invention provides a 3D printing slicing method, storage medium and terminal, the main purpose of which is to solve the problem of low efficiency in existing 3D printing slicing.
[0005] According to one aspect of the present invention, a 3D printing slicing method is provided, comprising:
[0006] The preset shape patch data of the target printed model is obtained to the processor, the processor including at least one first type of thread and at least one second type of thread;
[0007] The first type of thread determines the line pattern obtained by the intersection of the preset shape patch data and the preset slice plane;
[0008] The second type of thread performs graphic rendering on the line pattern to obtain a slice pattern corresponding to the preset slice plane; wherein, the first type of thread and the second type of thread run in parallel.
[0009] Further, the first type of thread includes a first type of sub-thread and a second type of sub-thread; determining the line pattern obtained by the intersection of the preset shape patch data and the preset slice plane through the first type of thread includes:
[0010] The intersection point data obtained by the intersection of the preset shape patch data and the preset slice plane is determined by the first type of sub-thread;
[0011] The line pattern is determined by the second type of sub-thread based on the intersection data; wherein the first type of sub-thread, the second type of sub-thread, and the second type of thread run in parallel.
[0012] Furthermore, the processor also includes at least one third type of thread; after rendering the line pattern using the second type of thread to obtain a slice pattern corresponding to the preset slice plane, the method further includes:
[0013] The sliced pattern is compressed using a third type of thread to obtain compressed pattern data.
[0014] Furthermore, before determining the line pattern obtained by the intersection of the preset shape patch data and the preset slice plane through the first type of thread, the method further includes:
[0015] Determine the number of available parallel threads in the processor;
[0016] If the number of available parallel threads of the processor is greater than the preset number of threads, then the preset shape patch data of the target printing model is divided into at least two groups of patch data, with at least one dividing plane parallel to the preset slicing plane as the boundary, and the multiple available parallel threads are assigned to at least two groups of parallel threads corresponding to at least two groups of patch data, wherein each group of parallel threads includes at least one first type of thread and at least one second type of thread.
[0017] Furthermore, using at least one dividing plane parallel to the preset slicing plane as a boundary, the preset shape patch data of the target printed model is divided into at least two groups of patch data, including:
[0018] Obtain the height of the target printing model, and calculate the number of slices corresponding to the target printing model based on the height and the preset slice thickness;
[0019] The position data of the partitioning plane is determined based on the number of slices and the number of groups to be grouped, wherein the number of groups to be grouped is determined by the number of parallel threads;
[0020] Based on each of the dividing planes, the preset shape patch data of the target printing model is divided into multiple groups of patch data, and the number of groups of patch data is the same as the number of groups to be divided.
[0021] Furthermore, after compressing the sliced pattern using a third type of thread to obtain compressed pattern data, the method further includes:
[0022] When it is detected that the number of compressed pattern data output by each of the third type of threads is the same as the number of patch data in the group to which the third type of thread belongs, the multiple compressed pattern data are packaged by the fourth type of thread to obtain a compressed pattern data package.
[0023] Further, determining the line pattern based on the intersection data using the second type of sub-thread includes:
[0024] The second type of sub-thread determines the connection direction of the intersection data based on the normal direction of the preset shape patch data corresponding to the intersection data;
[0025] Connect multiple intersection points in the intersection data sequentially according to the direction of the connection to obtain a line pattern corresponding to the intersection data; the line pattern is used to represent the processing area corresponding to the layer where the preset slice plane corresponding to the intersection data is located.
[0026] Further, the line pattern is graphically rendered using the second type of thread to obtain a slice pattern corresponding to the preset slice plane, including:
[0027] The second type of thread compares the normal vector direction of the preset shape patch data to which the line pattern belongs with the preset direction vector.
[0028] Lines whose normal vector direction is consistent with the direction of the preset direction vector are classified as the first type of lines;
[0029] Lines whose normal vector direction is opposite to that of the preset direction vector are classified as the second type of lines;
[0030] The area between each pair of adjacent first-type lines and second-type lines through which the preset direction vector passes from the outside to the inside of the line pattern is taken as the area to be rendered.
[0031] The area to be rendered is rendered to obtain a slice pattern corresponding to the preset slice plane.
[0032] Furthermore, each type of thread is configured with a corresponding thread identifier. Before rendering the line pattern using the second type of thread to obtain a slice pattern corresponding to the preset slice plane, the method includes:
[0033] The first type of thread sends the line pattern to the waiting queue of the second type of thread according to the identifier of the second type of thread. The waiting queue is used to cache the data to be processed by the second type of thread.
[0034] According to another aspect of the present invention, a 3D printing slicing method is provided, comprising:
[0035] The preset shape patch data of the target printing model is obtained to the processor, which includes at least one fifth type thread and at least one sixth type thread;
[0036] The intersection point data obtained by the intersection of the preset shape patch data and the preset slice plane is determined by the fifth type of thread;
[0037] The sixth type of thread determines the line pattern corresponding to the intersection data based on the intersection data, and performs graphic rendering on the line pattern to obtain a slice pattern corresponding to the preset slice plane; wherein, the fifth type of thread and the sixth type of thread run in parallel.
[0038] According to another aspect of the present invention, a storage medium is provided, wherein at least one executable instruction is stored therein, the executable instruction causing a processor to perform an operation corresponding to the slicing method of 3D printing described above.
[0039] According to another aspect of the present invention, a terminal is provided, comprising: a processor, a memory, a communication interface, and a communication bus, wherein the processor, the memory, and the communication interface communicate with each other through the communication bus;
[0040] The memory is used to store at least one executable instruction that causes the processor to perform the operation corresponding to the slicing method of the 3D printing described above.
[0041] By employing the above-described technical solutions, the technical solutions provided by the embodiments of the present invention have at least the following advantages:
[0042] This invention provides a 3D printing slicing method, storage medium, and terminal. Compared with the prior art, the embodiments of this invention acquire preset shape patch data of the target printing model to the processor; determine the line pattern obtained by the intersection of the preset shape patch data and the preset slicing plane through a first type of thread; and perform graphic rendering on the line pattern through a second type of thread running in parallel with the first type of thread to obtain a slicing pattern corresponding to the preset slicing plane. That is, by executing at least one first type of thread and at least one second type of thread in parallel, the preset shape patch data of the target printing model is converted into slicing data, which improves the efficiency of 3D printing slicing and solves the problem of low slicing efficiency in current 3D slicing.
[0043] The above description is merely an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention and to implement it in accordance with the contents of the specification, and in order to make the above and other objects, features and advantages of the present invention more apparent and understandable, specific embodiments of the present invention are described below. Attached Figure Description
[0044] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings:
[0045] Figure 1 A flowchart of a 3D printing slicing method provided by an embodiment of the present invention is shown;
[0046] Figure 2 A flowchart of another 3D printing slicing method provided by an embodiment of the present invention is shown;
[0047] Figure 3 This diagram illustrates a method for determining a surface region to be rendered, according to an embodiment of the present invention.
[0048] Figure 4 A block diagram of a 3D printing slicing device provided in an embodiment of the present invention is shown;
[0049] Figure 5 This diagram illustrates another 3D printing slicing device provided in an embodiment of the present invention.
[0050] Figure 6 A schematic diagram of the structure of a terminal provided in an embodiment of the present invention is shown. Detailed Implementation
[0051] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
[0052] In existing 3D printing methods, slicing a target model typically involves calling a single thread on the central processing unit (CPU) to complete all slice data or each layer's data processing at each stage within that thread. This means that after processing one stage of all data or each layer's data, the thread proceeds to the next stage, continuing until the 3D printing layer slicing is complete. This results in a long processing time and low efficiency when slicing large-scale 3D solid models. This invention provides a 3D printing slicing method, such as... Figure 1 As shown, the method includes:
[0053] 101. Obtain the preset shape patch data of the target printing model to the processor, wherein the processor includes at least one first type of thread and at least one second type of thread.
[0054] The preset shape patch data of the target printed model is a common data format for 3D printed models in existing technologies, such as STL data format. The STL format approximates the original model by using a large number of triangle patch data, that is, the triangle patch data corresponding to the target printed model is used as the preset shape patch data. Specifically, all triangle patch data included in the target printed model can be used as the preset shape patch data, or a set of triangle patch data included in the target printed model can be used as the preset shape patch data.
[0055] The processor calls the first type of thread and the second type of thread to execute data processing tasks at different stages in the process of converting these preset shape patch data into slice data corresponding to the target printing model. The second type of thread can receive the data output by the first type of thread and process the received data.
[0056] Specifically, in this embodiment of the invention, the processor includes at least one first type of thread and at least one second type of thread. During the execution of data processing tasks, the first type of thread can directly obtain initial preset shape patch data and execute the corresponding data processing task. Other threads following the first type of thread (such as the second type of thread) can receive data transmitted by the previous level thread (such as the first type of thread) and process the received data. That is, the second type of thread receives the data processed by the first type of thread and executes the data processing task corresponding to the second type of thread on the data.
[0057] It should be noted that the first type of thread and the second type of thread in the embodiments of the present invention can run in parallel. That is, when the second type of thread receives the data processed by the first type of thread, the first type of thread can continue to call other preset shape patch data to perform data processing. The second type of thread can also continue to receive the data processed by the first type of thread after the data processing is completed and perform data processing, and so on, so as to realize the simultaneous operation of the first type of thread and the second type of thread.
[0058] 102. The line pattern obtained by the intersection of the preset shape patch data and the preset slice plane is determined by the first type of thread.
[0059] In this context, a preset slicing plane refers to a slicing plane corresponding to multiple planar layers of varying thickness that make up the target printed model. The number of preset slicing planes can be determined based on the height of the target printed model and the thickness of each layer. For example, a fixed slice layer thickness can be set, and the corresponding number of preset slicing planes can be obtained based on the height of the target printed model. For instance, if the target printed model has a height of 1 cm, and the slice layer thickness is limited to 0.1 mm, then the number of preset slicing planes can be 1 cm / 0.1 mm = 100 layers; if the number of preset slicing planes is limited to 100 layers, then the slice layer thickness is 1 cm / 100 layers = 0.1 mm. The number or thickness of the preset slicing planes can also be set according to other limiting rules; this invention does not impose any limitations on this.
[0060] It is understood that the preset shape patch data in the embodiments of the present invention are multiple triangular patch data corresponding to the target printing model. These triangular patch data have multiple intersection points with the preset slice plane of each layer, and the intersection points of each layer can be connected to obtain the line pattern corresponding to the slice layer. The line pattern can be used to determine the processing area corresponding to the slice layer, so that the target printing model can be rendered and solidified according to the line pattern.
[0061] 103. The line pattern is rendered using a second type of thread to obtain a slice pattern corresponding to the preset slice plane.
[0062] Since the first type of thread has already obtained the line patterns of each preset slicing plane, the processing area corresponding to the line pattern of each slicing layer can be rendered to obtain the slicing pattern corresponding to the preset slicing plane. Graphical rendering of the line patterns to obtain the slicing pattern corresponding to the preset slicing plane is essentially converting the line patterns of each preset slicing plane into pixel images that can be displayed on the screen to indicate the printing position of that layer. This allows the photopolymerization equipment to display each slicing pattern during 3D printing and project the slicing pattern onto the resin tank via the light path for curing and printing.
[0063] This invention provides a 3D printing slicing method. Compared with existing technologies, this invention obtains preset shape patch data of the target printing model; calls at least one first type of thread and at least one second type of thread to process the preset shape patch data. Each thread is used to execute multiple data processing tasks in the process of converting the model data into slice data corresponding to the target printing model. The second type of thread receives data transmitted by the first type of thread and processes the received data; the first type of thread determines the line pattern obtained by the intersection of the preset shape patch data and the preset slicing plane; the second type of thread performs graphic rendering on the line pattern to obtain a slice pattern corresponding to the preset slicing plane. This achieves multi-threaded parallel execution of multiple data processing tasks in the process of converting the preset shape patch data of the target printing model into slice data, avoiding the problem of low slicing efficiency caused by using a single thread for 3D slicing, thereby improving the efficiency of 3D printing slicing.
[0064] As a refinement and improvement to the specific implementation of the above embodiments, and to fully illustrate the specific implementation process of this embodiment, another 3D printing slicing method is provided, such as... Figure 2 As shown, the method includes:
[0065] 201. Obtain the preset shape patch data of the target printing model to the processor, wherein the processor includes at least one first type of thread and at least one second type of thread.
[0066] Specifically, the preset shape can be a triangle, quadrilateral, etc. The preset shape patch data can be patch data in STL data format. For example, the preset shape patch data can be triangle patch data, including vertex information and normal vectors of the triangle patch. In some embodiments, the preset shape patch data can also be patch data in other data formats, which will not be specifically described in this application.
[0067] It should be noted that, since the model may contain a large amount of preset shape patch data, the obtained large amount of preset shape patch data can be grouped for processing to further improve data processing efficiency. However, in practical applications, the processors (such as CPUs, MCUs, etc.) configured for 3D printing slicing operating systems typically have four cores, meaning the system can only execute a maximum of four threads simultaneously for data processing tasks, making it impossible to perform other operations besides these four data processing tasks. In some embodiments, the number of processor threads may be the same as the number of processor cores; in other embodiments, the number of processor threads may not be the same as the number of processor cores. For ease of description, the following example uses the case where the number of CPU threads is the same as the number of CPU cores, but this should not be construed as limiting the scope of protection claimed in this application. Before calling multiple threads to process the preset shape patch data, it is necessary to further determine the number of available CPU threads configured in the 3D printing slicing operating system, that is, to determine the number of available parallel threads in the processor, in order to determine whether the preset shape patch data can be grouped for processing.
[0068] Specifically, before determining the line pattern obtained by the intersection of the preset shape patch data and the preset slicing plane through the first type of thread, the slicing method for 3D printing may further include: determining the number of available parallel threads in the processor; if the number of available parallel threads in the processor is greater than the preset number of threads, then dividing the preset shape patch data of the target printing model into at least two groups of patch data using at least one dividing plane parallel to the preset slicing plane as a boundary, and assigning the multiple available parallel threads to at least two groups of parallel threads corresponding to the at least two groups of patch data. Each group of parallel threads includes at least one first type of thread and at least one second type of thread.
[0069] In one implementation, the preset number of threads can be the minimum number of threads required to execute the data processing tasks described in steps 102-103 for the preset shape patch data without grouping. If the number of parallel threads available to the processor is greater than the preset number of threads, the preset shape patch data can be grouped. Since 3D printing is achieved by printing the target printing model layer by layer, the preset shape patch data can be grouped in this step by using at least one dividing plane parallel to the preset slicing plane as a boundary, dividing the preset shape patch data into two or more groups of patch data. If the number of parallel threads available to the processor is less than or equal to the preset number of threads, the preset shape patch data can be left ungrouped, and a single group of preset shape patch data can be used for the subsequent slicing process. If the number of parallel threads available to the processor is less than the preset number of threads, some or all of the parallel thread tasks can be processed serially to ensure the completion of the slicing process.
[0070] In another embodiment, the preset number of threads can be twice the minimum number of threads required to perform the data processing tasks described in steps 102-103 when the preset shape patch data is not grouped, or other preset multiples.
[0071] Specifically, the grouping operation for the preset shape patch data can be performed by obtaining the height of the target printing model and calculating the number of slices corresponding to the target printing model based on the height and the preset slice thickness; determining the position data of the dividing plane based on the number of slices and the number of groups to be grouped, wherein the number of groups to be grouped is determined by the number of parallel threads; and dividing the preset shape patch data of the target printing model into multiple groups of patch data based on each dividing plane, wherein the number of groups of patch data is the same as the number of groups to be grouped.
[0072] For example, if the target printed model has a height of 1 cm and the preset slice thickness is 0.1 mm, then the corresponding number of slices can be 1 cm / 0.1 mm = 100 layers. If the number of parallel threads is twice the aforementioned minimum number of threads, then the number of groups required can be limited to two groups. The dividing plane is positioned 0.5 cm above the preset slice plane to divide the preset shape patch data, i.e., dividing layers 1-50 into one group and layers 51-100 into another. Other division rules can also be used to group the preset shape patch data; this invention does not limit this. The processor can allocate a corresponding set of data processing threads to each group of patch data. Each set of data processing threads includes at least one first-type thread and at least one second-type thread, and these two sets of data processing threads can execute data processing tasks in parallel, achieving simultaneous processing of the two sets of patch data.
[0073] It should be noted that during data processing, if the preset shape patch data is not grouped, the minimum number of threads mentioned above can be used to process all the preset shape patch data. If the preset shape patch data is grouped, then threads equal to a multiple of the minimum number of threads need to be used to process each group of preset shape patch data in parallel. For example, if the preset shape patch data is divided into two groups, then twice the number of threads used in the ungrouped state can be used to process both groups of patch data simultaneously to improve data processing efficiency. The preset shape patch data described in subsequent steps can be each group of preset shape patch data or just one group of preset shape patch data.
[0074] 202. The first type of sub-thread determines the intersection point data obtained by the intersection of the preset shape patch data and the preset slice plane; the second type of sub-thread determines the line pattern based on the intersection point data; wherein the first type of sub-thread, the second type of sub-thread, and the second type of thread run in parallel.
[0075] In this embodiment of the invention, the first type of thread may include a first type of sub-thread and a second type of sub-thread. First, the first type of sub-thread is invoked on the preset shape patch data so that the first type of sub-thread determines the intersection point between the preset shape patch data and the corresponding preset slice plane.
[0076] As described above, the preset slice plane refers to multiple parallel slice layers that make up the target printed model. Specifically, the preset slice plane can be a Z-axis plane at any Z-axis height but perpendicular to the Z-axis. Taking this as an example, the first type of sub-thread can solve the intersection point by calculating the planar coordinates of the Z-axis plane and the vertex coordinates of the preset shape patch data. It can be understood that in three-dimensional space, the preset shape patch data has a point or line segment with a fixed height when the z-value is fixed. This embodiment of the invention obtains the intersection point coordinates between the preset shape patch data and the corresponding preset slice plane by solving the intersection point of the patch coordinate range defined by the planar coordinates of the Z-axis plane and the vertex coordinates of the preset shape patch data. The Z-axis plane is a plane perpendicular to the Z-axis. The intersection point solution essentially refers to calculating the coordinates of the points or line segments contained in the preset shape patch data when the z-value is determined, which are the intersection point coordinates of the Z-axis plane and the preset shape patch data. At this time, the line segment of the preset shape patch data that intersects with the Z-axis plane is also obtained. Specifically, the coordinates corresponding to a line segment can be represented by the coordinates of the points at both ends of the line segment. Furthermore, the vector direction of the line segment can be determined based on the line segment and the normal vector of the surface data in which the line segment is located, thus obtaining the line segment vector corresponding to the line segment.
[0077] It should be noted that the intersection point solution method can also be other intersection point solution methods in related technologies, and this application embodiment does not specifically limit it.
[0078] Since the target printing model contains a large amount of preset shape patch data, the data processing for each preset slice plane involves the calculation of multiple preset shape patch data. Therefore, after the first type of sub-thread solves the intersection point, it will obtain an intersection point data containing multiple intersection points. The first thread then sends the intersection point data to the second type of sub-thread so that the second type of sub-thread can perform subsequent data processing based on the received intersection point data.
[0079] Furthermore, the second type of sub-thread receives the intersection data processed by the first type of sub-thread. At this time, the intersection data is in an unordered state. Therefore, the second type of sub-thread needs to sort the intersection data to obtain the line pattern corresponding to each preset slice plane.
[0080] Specifically, determining the line pattern based on the intersection data using the second type of sub-thread may include: determining the connection direction of the intersection data based on the normal direction of the preset shape patch data corresponding to the intersection data using the second type of sub-thread; sequentially connecting multiple intersections in the intersection data according to the connection direction to obtain the line pattern corresponding to the intersection data; the line pattern is used to represent the processing area corresponding to the layer where the preset slice plane corresponding to the intersection data is located.
[0081] Since the target printing model contains multiple preset shape patch data, each of which has intersection data with a certain Z-axis plane, the intersection points of different preset shape patch data on a certain Z-axis plane can be connected according to the adjacent connection order of the preset shape patch data to obtain the line pattern of each preset slice plane.
[0082] In some embodiments, the direction of the line connecting the intersection points of the preset shape patch data on the Z-axis plane can be determined based on the direction of the normal vector corresponding to the preset shape patch data. Specifically, the orientation of the normal vector of the preset shape patch data can be determined first, and then the direction of the line can be obtained according to the right-hand rule. That is, if the orientation of the normal vector is taken as the direction of the right thumb, then the direction of the line is the direction of the corresponding four fingers of the right hand (such as clockwise or counterclockwise).
[0083] Then, it becomes possible to connect different points in the same data patch according to the direction of the connection to obtain line segments. Each line segment can have a corresponding line segment vector, and the direction of this line segment vector is the direction of the connection used to obtain the line segment.
[0084] In computer operations, the cross product of vectors can be used to describe connecting the intersections of different preset shape facets on a Z-axis plane according to the adjacent connection order of preset shape facet data. For example, for line segment vectors, the cross product of adjacent line segment vectors is used to obtain the cross product vector. By comparing this cross product vector with the normal vector of the preset shape facet, it can be determined whether the direction of the cross product vector and the direction of the normal vector of the preset shape facet point to the same side of the facet. For example, the direction of the connection can be determined based on whether their directions point to the same side of the facet (e.g., if the directions are the same, the connection direction is determined to be clockwise; if the directions are different, the connection direction is determined to be counterclockwise). After comparing the relationships between other adjacent intersection points or adjacent line segments, the number of connection directions between intersection points or adjacent line segments can be obtained, indicating how many connection directions are clockwise and how many are counterclockwise. Finally, among the line segments connecting the beginning and end, the final connection direction is determined by majority rule. The connection direction can be either clockwise or counter-clockwise. By connecting multiple intersection points in adjacent order according to the connection direction, the line pattern of the corresponding preset slice plane can be obtained. It should be noted that a line pattern in a preset slice plane can include one loop of connected line segments or multiple loops of connected line segments. For any loop of connected line segments, the final connection direction (clockwise or counter-clockwise) can be determined by majority vote. For adjacent loops of connected line segments, the connection directions can be opposite.
[0085] In some embodiments, since each preset shape patch data has adjacent preset shape patch data, there may be a point of intersection between two or more adjacent preset shape patch data and the Z-direction plane. If two or more adjacent preset shape patch data have a point of intersection with the Z-direction plane, the multiple normal vectors corresponding to the two or more adjacent preset shape patch data can be integrated into a single normal vector based on the point of intersection. This single normal vector is used to replace the multiple normal vectors to determine the connection direction. This method can reduce the amount of computation and improve the computational efficiency to a certain extent. Therefore, the second type of sub-thread can determine the connection order of the intersection data according to the point of intersection between adjacent preset shape patch data, so as to process the intersection data into an ordered state and obtain the line pattern of the slice layer.
[0086] It should be noted that the normal direction of the preset shape patch data can be used to identify the blank area of the preset slice plane. That is, the orientation of the normal vector of the preset shape patch data is the non-processed area corresponding to the preset slice plane. Therefore, the area enclosed by the line pattern obtained according to the above steps is the processing area corresponding to the layer of the preset slice plane corresponding to the intersection data, so that the target printing model can be rendered and solidified according to the preset slice plane based on the line pattern in the future.
[0087] It is understood that the first sub-thread, the second sub-thread, and the second type of thread in the embodiments of the present invention can run in parallel. That is, when the second type of sub-thread receives the data processed by the first type of sub-thread, the first type of sub-thread can continue to call other preset shape patch data to perform data processing. The second type of sub-thread can also continue to receive the data processed by the first type of thread after the data processing is completed and perform data processing. The second type of thread receives the data processed by the second type of sub-thread and performs the corresponding data processing task, and so on, so as to realize the simultaneous operation of the first type of sub-thread, the second type of sub-thread, and the second type of thread.
[0088] 203. Using the first type of thread, the line pattern is sent to the waiting queue of the second type of thread according to the identifier of the second type of thread. The waiting queue is used to cache the data to be processed by the second type of thread.
[0089] To improve the accuracy of data processing during slicing, this embodiment may further include: configuring thread identifiers corresponding to each of the threads, so that each thread transmits the data to be processed according to the thread identifier. When the second type of sub-thread in the first type of thread finishes data processing, it sends the obtained line pattern to the second type of thread, which adds the line pattern as data to be processed to a waiting queue. When the second type of thread completes its current data processing task, it retrieves the data to be processed from the waiting queue and processes it. In a specific implementation, the first thread can directly call the initial preset shape patch data to execute the corresponding data processing task. When the second type of sub-thread in the first thread receives the data lines transmitted by the first type of sub-thread, there may be data being processed within the second type of sub-thread. In this case, the data lines can be added to the waiting queue as data to be processed, so that when the current thread completes its current data processing task, it can retrieve the next set of data to be processed from the waiting queue according to the time identifier, thereby achieving parallel operation of multiple threads and improving data processing efficiency.
[0090] 204. The line pattern is rendered using a second type of thread to obtain a slice pattern corresponding to the preset slice plane.
[0091] Since the second type of sub-thread has obtained the line patterns of each preset slice plane, the processing area corresponding to the line patterns of each preset slice plane can be rendered, that is, each preset slice plane is converted into pixel blocks that can be displayed on the display screen. This enables the photopolymerization device to display the image of each slice layer and project the slice layer image onto the resin tank through the light path for curing and printing when performing 3D printing.
[0092] Specifically, the slice pattern is obtained by rendering the line pattern corresponding to the preset slice plane. This can be achieved through a second type of thread, which compares the normal vector direction of the preset shape patch data to which the line pattern belongs with a preset direction vector. Lines whose normal vector direction matches the preset direction vector are designated as first-type lines; lines whose normal vector direction is opposite to the preset direction vector are designated as second-type lines; the area between each pair of adjacent first-type and second-type lines through which the preset direction vector passes from the outside to the inside of the line pattern is designated as the patch area to be rendered; and the patch area to be rendered is then rendered to obtain the slice pattern corresponding to the preset slice plane.
[0093] In other words, to render the line pattern corresponding to the preset slice plane in this embodiment of the invention, it is necessary to first determine the area to be rendered (i.e., the processing area). The area to be rendered can be determined by setting a specific vector perpendicular to the Z-axis with a defined direction, and comparing it with the normal vector of the preset shape area data corresponding to the line pattern, thereby determining the area to be rendered that needs to be cured and printed.
[0094] To more clearly describe the method for determining the region of the surface to be rendered, the embodiments of the present invention use... Figure 3For example, a preset slicing plane with a line pattern shaped like the Chinese character "回" (a concentric square pattern) is set for detailed description. Specifically, first, a specific vector that is perpendicular to the Z axis and has a clear direction is set as the preset direction vector, denoted as vector v. Next, the normal vector of the preset shape patch data of the preset slicing plane is acquired, with the normal vector pointing to the non-rendering patch area. Then the starting point on the outer side of the preset slicing plane is determined, and the vector v is used to detect the normal vector of the preset shape patch data existing in the preset slicing plane area, so as to determine the to-be-rendered patch area. Lines whose normal vector direction is consistent with the direction of the preset direction vector are defined as first-type lines, such as the boundary lines between areas a1 and b2, and the boundary lines between areas a2 and b3; lines whose normal vector direction is opposite to the direction of the preset direction vector are defined as second-type lines, such as the boundary lines between areas b1 and a1, and the boundary lines between areas b2 and a2. The area between every two adjacent first-type line and second-type line that the preset direction vector sequentially passes through from the outside to the inside of the line pattern is taken as the to-be-rendered patch area. Thereby, the to-be-rendered patch area can be determined as the area enclosed by the two line patterns of the "回" shape.
[0095] In addition, a non-rendering identifier "0" can be added to non-rendering patch areas such as areas b1, b2, and b3, and a rendering identifier "1" can be added to to-be-rendered patch areas such as areas a1 and a2. Using the above method, the to-be-rendered patch area that needs to be subjected to curing printing and the non-rendering patch area that does not need to be subjected to curing printing can be quickly determined. The second-type thread renders the obtained to-be-rendered patch area to obtain a sliced pattern corresponding to the preset slicing plane.
[0096] 205. The processor further comprises at least one third-type thread; the sliced pattern is compressed by the third-type thread to obtain compressed pattern data.
[0097] One target printing model comprises a plurality of preset slicing planes, and each preset slicing plane corresponds to one sliced pattern. In order to improve the transmission efficiency of slicing data and reduce memory consumption, each sliced pattern can be compressed to obtain a plurality of pieces of compressed pattern data. Specifically, if the number of available threads of the processor configured in the 3D printing slicing operating system meets the requirement (that is, on the basis that the processor ensures at least one first-type thread and at least one second-type thread are allocated to each group of preset shape patch data, at least one spare thread can be allocated to each group of preset shape patch data), at least one third-type thread can be allocated to each group of preset shape patch data, and after the line pattern is graphically rendered by the second-type thread to obtain the sliced pattern corresponding to the preset slicing plane, each sliced pattern is compressed by the third-type thread to obtain the compressed pattern data. Then, the plurality of pieces of compressed pattern data are temporarily stored first until all threads complete data processing, and then the plurality of pieces of compressed pattern data are uniformly packaged.
[0098] 206. When it is detected that the number of compressed pattern data output by each of the third type of threads is the same as the number of patch data in the group to which the third type of thread belongs, the multiple compressed pattern data are packaged by the fourth type of thread to obtain a compressed pattern data packet.
[0099] In this embodiment of the invention, if the number of available threads of the processor configured in the 3D printing slicing operating system meets the requirements (that is, the processor ensures that at least one first type of thread, at least one second type of thread, and at least one third type of thread are allocated for each set of preset shape patch data, and also includes at least one spare thread), in order to further improve the data processing efficiency, a fourth type of thread can be added to package multiple compressed pattern data for processing.
[0100] In the specific implementation process, there may be delays in the processing of each thread task. Therefore, before packaging the compressed pattern data, it is necessary to monitor the processing volume of the third type of thread task. When the amount of data output by the third type of thread is detected to be equal to the preset number of slice planes of the corresponding preset shape patch data group, it indicates that all threads corresponding to the preset shape patch data group have completed their data processing tasks. At this time, the fourth type of thread can be used to package all the compressed pattern data of the target printing model to obtain a compressed pattern data package. In this embodiment, by calling multiple threads to execute multiple data processing tasks simultaneously, the slicing efficiency can be greatly improved. Furthermore, by monitoring the data processing volume of the third type of thread and ensuring that all threads have completed their data processing tasks before packaging the compressed pattern data, a compressed pattern data package is generated.
[0101] 207. Output compressed pattern data packets.
[0102] The compressed pattern data packet includes slice data that can be recognized by the photopolymerization device, and the photopolymerization device can print the target printing model based on the slice data. In this embodiment, the slice data can be image or pattern data obtained through data processing; for example, the slice data can be a slice pattern as described in any of the above embodiments. Furthermore, the compressed pattern data packet can be output via wireless transmission, Bluetooth transmission, solid-state transmission devices, etc., and this embodiment does not specifically limit this method.
[0103] Finally, it should be noted that since the data processing for preset shape patch data is based on multiple preset slicing planes corresponding to the preset shape patch data, when the number of available parallel threads of the processor configured in the 3D printing slicing operating system is equal to 4 (i.e., the system's CPU cores are at the minimum configuration of 4 cores), the preset slicing planes and the corresponding number of slices can still be determined according to the height of the target printed model. The preset shape patch data of the corresponding layer's preset slicing planes can then be processed, but there is no need to group the preset shape patch data; instead, it is processed as a group to achieve data processing under the minimum processor configuration. In other words, when the number of available parallel threads of the processor configured in the 3D printing slicing operating system is greater than 4 (i.e., the number of CPU cores is greater than 4 cores, such as 8 cores, 12 cores, etc.), the preset shape patch data can be grouped first, with each group consisting of 4 threads. By configuring corresponding group identifiers and thread level identifiers for each thread, the data can be accurately passed to the next level thread according to the identifiers, ensuring the accuracy of 3D slicing.
[0104] This invention provides a slicing method for 3D printing. Compared with the prior art, the embodiments of this invention acquire preset shape patch data of the target printing model to the processor; determine the line pattern obtained by the intersection of the preset shape patch data and the preset slicing plane through a first type of thread; and perform graphic rendering on the line pattern through a second type of thread running in parallel with the first type of thread to obtain a slicing pattern corresponding to the preset slicing plane. That is, by executing at least one first type of thread and at least one second type of thread in parallel, the preset shape patch data of the target printing model is converted into slicing data, which improves the efficiency of 3D printing slicing and solves the problem of low slicing efficiency in current 3D slicing.
[0105] This invention provides another 3D printing slicing method, which includes the following steps S1 to S3.
[0106] S1: Obtain the preset shape patch data of the target printing model to the processor, which includes at least one fifth type thread and at least one sixth type thread.
[0107] Except for the fifth type of thread and the sixth type of thread, the other related explanations and specific processes in step S1 are the same as step 101 in the above method embodiment, and will not be repeated here.
[0108] S2: The intersection point data obtained by the intersection of the preset shape patch data and the preset slice plane is determined by the fifth type of thread.
[0109] The specific process of determining the intersection point data obtained by the intersection of the preset shape patch data and the preset slice plane through the fifth type of thread in step S02 is the same as the specific process of determining the intersection point data obtained by the intersection of the preset shape patch data and the preset slice plane through the first type of sub-thread in step S202 of the above method embodiment, and will not be described again here.
[0110] S3: The sixth type of thread determines the line pattern corresponding to the intersection data based on the intersection data, and performs graphic rendering on the line pattern to obtain the slice pattern corresponding to the preset slice plane; among them, the fifth type of thread and the sixth type of thread run in parallel.
[0111] Specifically, the sixth type of thread may include the third type of sub-thread and the fourth type of sub-thread. Step S3, which uses the sixth type of thread to determine the line pattern corresponding to the intersection data and to perform graphic rendering on the line pattern to obtain a slice pattern corresponding to the preset slice plane, may specifically include the following steps: determining the line pattern based on the intersection data using the third type of sub-thread; and performing graphic rendering on the line pattern using the fourth type of sub-thread to obtain a slice pattern corresponding to the preset slice plane; wherein the third type of sub-thread, the fourth type of sub-thread, and the fifth type of thread run in parallel.
[0112] The process of determining the line pattern using the third type of sub-thread based on the intersection data is the same as the process of determining the line pattern using the second type of sub-thread based on the intersection data in step S202 of the method embodiment above, and will not be described again here. The process of rendering the line pattern using the fourth type of sub-thread to obtain the slice pattern corresponding to the preset slice plane is the same as the process of rendering the line pattern using the second type of thread to obtain the slice pattern corresponding to the preset slice plane in step S103 of the method embodiment above, and will not be described again here.
[0113] This invention acquires preset shape patch data of the target printing model to the processor; determines the intersection point data obtained by the intersection of the preset shape patch data and the preset slicing plane through a fifth type of thread; determines the line pattern corresponding to the intersection point data through a sixth type of thread, and performs graphic rendering on the line pattern to obtain the slicing pattern corresponding to the preset slicing plane; that is, by executing at least one fifth type of thread and at least one sixth type of thread in parallel, the preset shape patch data of the target printing model is converted into slicing data, which improves the efficiency of 3D printing slicing and solves the problem of low slicing efficiency in current 3D slicing.
[0114] As a response to the above Figure 1 To implement the method shown, this application provides a 3D printing slicing device, such as... Figure 4 As shown, the device includes: an acquisition module 41, a first data processing module 42, and a second data processing module 43.
[0115] The acquisition module 41 is used to acquire preset shape patch data of the target printing model to the processor, wherein the processor includes at least one first type of thread and at least one second type of thread;
[0116] The first data processing module 42 is used to determine the line pattern obtained by the intersection of the preset shape patch data and the preset slice plane through the first type of thread;
[0117] The second data processing module 43 is used to perform graphic rendering on the line pattern through a second type of thread to obtain a slice pattern corresponding to the preset slice plane; wherein the first type of thread and the second type of thread run in parallel.
[0118] Furthermore, such as Figure 5 As shown in the embodiment of this application, a 3D printing slicing device further includes:
[0119] The determining module 44 is used to determine the number of available parallel threads in the processor; if the number of available parallel threads in the processor is greater than the preset number of threads, then the preset shape patch data of the target printing model is divided into at least two groups of patch data with at least one dividing plane parallel to the preset slicing plane as the boundary, and the multiple available parallel threads are assigned to at least two groups of parallel threads corresponding to at least two groups of patch data, wherein each group of parallel threads includes at least one first type of thread and at least one second type of thread;
[0120] The data sending module 45 is used to send the line pattern to the waiting queue of the second type of thread through the first type of thread according to the identifier of the second type of thread, and the waiting queue is used to cache the data to be processed by the second type of thread;
[0121] The third data processing module 46 is used to compress the slice pattern through a third type of thread to obtain compressed pattern data.
[0122] The fourth data processing module 47 is used to package multiple compressed pattern data into a compressed pattern data packet by the fourth type of thread when it is detected that the number of compressed pattern data output by each of the third type of thread is the same as the number of patch data in the group to which the third type of thread belongs.
[0123] Furthermore, such as Figure 5 As shown, the first data processing module 42 further includes:
[0124] The first data processing subunit 421 is used to determine the intersection point data obtained by the intersection of the preset shape patch data and the preset slice plane through the first type of sub-thread.
[0125] The second data processing subunit 422 is used to determine the line pattern based on the intersection data through the second type of sub-thread; wherein the first type of sub-thread, the second type of sub-thread, and the second type of thread run in parallel.
[0126] Furthermore, such as Figure 5 As shown, the determining module 44 further includes:
[0127] The acquisition unit 441 is used to acquire the height of the target printing model and calculate the number of slices corresponding to the target printing model based on the height and the preset slice thickness.
[0128] The determining unit 442 is used to determine the position data of the dividing plane based on the number of slices and the number of groups to be divided, wherein the number of groups to be divided is determined by the number of parallel threads.
[0129] Grouping unit 443 is used to divide the preset shape patch data of the target printing model into multiple groups of patch data according to each of the dividing planes, wherein the number of multiple groups of patch data is the same as the number of groups to be grouped.
[0130] Furthermore, such as Figure 5 As shown, the second data processing subunit 422 is further configured to determine the connection direction of the intersection data according to the normal direction of the preset shape patch data corresponding to the intersection data through the second type of sub-thread; connect multiple intersections in the intersection data in sequence according to the connection direction to obtain a line pattern corresponding to the intersection data; the line pattern is used to represent the processing area corresponding to the layer where the preset slice plane corresponding to the intersection data is located.
[0131] Furthermore, such as Figure 5 As shown, the second data processing module 43 further includes:
[0132] The comparison unit 431 is used to compare the normal direction of the preset shape patch data to which the line pattern belongs with the preset direction vector through the second type of thread.
[0133] The determining unit 432 is used to classify lines whose normal vector direction is consistent with the direction of the preset direction vector as first-type lines; lines whose normal vector direction is opposite to the direction of the preset direction vector as second-type lines; and the area between each two adjacent first-type lines and second-type lines through which the preset direction vector passes from the outside to the inside of the line pattern as the area to be rendered.
[0134] The rendering unit 433 is used to render the area to be rendered to obtain a slice pattern corresponding to the preset slice plane.
[0135] According to one embodiment of the present invention, a storage medium is provided, the storage medium storing at least one executable instruction that can execute the slicing method for 3D printing in any of the above method embodiments.
[0136] Figure 6 The diagram shows a structural schematic of a terminal according to an embodiment of the present invention. The specific implementation of the terminal is not limited by the specific embodiments of the present invention.
[0137] like Figure 6 As shown, the terminal may include: a processor 602, a communications interface 604, a memory 604, and a communications bus 608.
[0138] The processor 602, communication interface 604, and memory 606 communicate with each other via communication bus 608.
[0139] Communication interface 604 is used to communicate with other network elements such as clients or other servers.
[0140] The processor 602 is used to execute program 610, specifically to perform the relevant steps in the above-described 3D printing slicing method embodiment.
[0141] Specifically, program 610 may include program code that includes computer operation instructions.
[0142] Processor 602 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the present invention. The terminal may include one or more processors of the same type, such as one or more CPUs; or it may include processors of different types, such as one or more CPUs and one or more ASICs.
[0143] Memory 606 is used to store program 610. Memory 606 may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk storage device.
[0144] Specifically, program 610 can be used to cause processor 602 to perform the following operations:
[0145] The preset shape patch data of the target printed model is obtained to the processor, the processor including at least one first type of thread and at least one second type of thread;
[0146] The first type of thread determines the line pattern obtained by the intersection of the preset shape patch data and the preset slice plane;
[0147] The line pattern is rendered using a second type of thread to obtain a slice pattern corresponding to the preset slice plane; wherein the first type of thread and the second type of thread run in parallel.
[0148] The 3D printing slicing method of this application embodiment may also include the following technical solutions:
[0149] Option 1: A 3D printing slicing method, comprising:
[0150] The preset shape patch data of the target printed model is obtained to the processor, the processor including at least one first type of thread and at least one second type of thread;
[0151] The first type of thread determines the line pattern obtained by the intersection of the preset shape patch data and the preset slice plane;
[0152] The second type of thread performs graphic rendering on the line pattern to obtain a slice pattern corresponding to the preset slice plane; wherein, the first type of thread and the second type of thread run in parallel.
[0153] Option 2, based on the slicing method of Option 1, the first type of thread includes a first type of sub-thread and a second type of sub-thread; the first type of thread determines the line pattern obtained by the intersection of the preset shape patch data and the preset slicing plane, including:
[0154] The intersection point data obtained by the intersection of the preset shape patch data and the preset slice plane is determined by the first type of sub-thread;
[0155] The line pattern is determined by the second type of sub-thread based on the intersection data; wherein the first type of sub-thread, the second type of sub-thread, and the second type of thread run in parallel.
[0156] Option 3: Based on the slicing method of Option 2, the second type of sub-thread determines the line pattern according to the intersection data, including:
[0157] The second type of sub-thread determines the connection direction of the intersection data based on the normal direction of the preset shape patch data corresponding to the intersection data;
[0158] Connect multiple intersection points in the intersection data sequentially according to the direction of the connection to obtain a line pattern corresponding to the intersection data; the line pattern is used to represent the processing area corresponding to the layer where the preset slice plane corresponding to the intersection data is located.
[0159] Option 4: Based on the slicing method of Option 3, the line pattern is rendered using the second type of thread to obtain a slice pattern corresponding to the preset slicing plane, including:
[0160] The second type of thread compares the normal vector direction of the preset shape patch data to which the line pattern belongs with the preset direction vector.
[0161] Lines whose normal vector direction is consistent with the direction of the preset direction vector are classified as the first type of lines;
[0162] Lines whose normal vector direction is opposite to that of the preset direction vector are classified as the second type of lines;
[0163] The area between each pair of adjacent first-type lines and second-type lines through which the preset direction vector passes from the outside to the inside of the line pattern is taken as the area to be rendered.
[0164] The area to be rendered is rendered to obtain a slice pattern corresponding to the preset slice plane.
[0165] Option 5: Based on the slicing method of Option 1, the processor further includes at least one third type of thread; after performing graphic rendering on the line pattern through the second type of thread to obtain a slice pattern corresponding to the preset slicing plane, the method further includes:
[0166] The sliced pattern is compressed using a third type of thread to obtain compressed pattern data.
[0167] Solution 6: Based on the slicing method of Solution 5, before determining the line pattern obtained by the intersection of the preset shape patch data and the preset slicing plane through the first type of thread, the method further includes:
[0168] Determine the number of available parallel threads in the processor;
[0169] If the number of available parallel threads of the processor is greater than the preset number of threads, then the preset shape patch data of the target printing model is divided into at least two groups of patch data, with at least one dividing plane parallel to the preset slicing plane as the boundary, and the multiple available parallel threads are assigned to at least two groups of parallel threads corresponding to at least two groups of patch data, wherein each group of parallel threads includes at least one first type of thread and at least one second type of thread.
[0170] Option 7: Based on the slicing method of Option 6, using at least one dividing plane parallel to the preset slicing plane as a boundary, divide the preset shape patch data of the target printing model into at least two groups of patch data, including:
[0171] Obtain the height of the target printing model, and calculate the number of slices corresponding to the target printing model based on the height and the preset slice thickness;
[0172] The position data of the partitioning plane is determined based on the number of slices and the number of groups to be grouped, wherein the number of groups to be grouped is determined by the number of parallel threads;
[0173] Based on each of the dividing planes, the preset shape patch data of the target printing model is divided into multiple groups of patch data, and the number of groups of patch data is the same as the number of groups to be divided.
[0174] Solution 8: Based on the slicing method of Solution 6, after compressing the sliced pattern using a third type of thread to obtain compressed pattern data, the method further includes:
[0175] When it is detected that the number of compressed pattern data output by each of the third type of threads is the same as the number of patch data in the group to which the third type of thread belongs, the multiple compressed pattern data are packaged by the fourth type of thread to obtain a compressed pattern data package.
[0176] Option 9: Based on the slicing method described in any one of Options 1-8, each type of thread is configured with a corresponding thread identifier. Before performing graphic rendering on the line pattern through the second type of thread to obtain a slice pattern corresponding to the preset slicing plane, the method further includes:
[0177] The first type of thread sends the line pattern to the waiting queue of the second type of thread according to the identifier of the second type of thread. The waiting queue is used to cache the data to be processed by the second type of thread.
[0178] Option 10: A 3D printing slicing method, comprising:
[0179] The preset shape patch data of the target printing model is obtained to the processor, which includes at least one fifth type thread and at least one sixth type thread;
[0180] The intersection point data obtained by the intersection of the preset shape patch data and the preset slice plane is determined by the fifth type of thread;
[0181] The sixth type of thread determines the line pattern corresponding to the intersection data based on the intersection data, and performs graphic rendering on the line pattern to obtain a slice pattern corresponding to the preset slice plane; wherein, the fifth type of thread and the sixth type of thread run in parallel.
[0182] The storage medium in this application embodiment may also include the following technical solutions:
[0183] Option 11: A storage medium storing at least one executable instruction that causes a processor to perform an operation corresponding to the slicing method of 3D printing as described in any one of Options 1-10 above.
[0184] The terminal in this application embodiment may also include the following technical solutions:
[0185] Option 12: A terminal, comprising: a processor, a memory, a communication interface, and a communication bus, wherein the processor, the memory, and the communication interface communicate with each other through the communication bus;
[0186] The memory is used to store at least one executable instruction that causes the processor to perform the operation corresponding to the slicing method of 3D printing as described in any one of the above schemes 1-10.
[0187] It is obvious to those skilled in the art that the modules or steps of the present invention described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. Optionally, they can be implemented using computer-executable program code, thereby storing them in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those presented herein, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, the present invention is not limited to any particular combination of hardware and software.
[0188] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A slicing method for 3D printing, characterized in that, include: The preset shape patch data of the target printed model is obtained to the processor, the processor including at least one first type of thread and at least one second type of thread; The first type of thread determines the line pattern obtained by the intersection of the preset shape patch data and the preset slice plane; The second type of thread performs graphic rendering on the line pattern to obtain a slice pattern corresponding to the preset slice plane; wherein, the first type of thread and the second type of thread run in parallel.
2. The slicing method according to claim 1, characterized in that, The first type of thread includes a first type of sub-thread and a second type of sub-thread; determining the line pattern obtained by the intersection of the preset shape patch data and the preset slice plane through the first type of thread includes: The intersection point data obtained by the intersection of the preset shape patch data and the preset slice plane is determined by the first type of sub-thread; The line pattern is determined by the second type of sub-thread based on the intersection data; wherein the first type of sub-thread, the second type of sub-thread, and the second type of thread run in parallel.
3. The slicing method according to claim 2, characterized in that, The second type of sub-thread determines the line pattern based on the intersection data, including: The second type of sub-thread determines the connection direction of the intersection data based on the normal vector direction of the preset shape patch data corresponding to the intersection data; Connect multiple intersection points in the intersection data sequentially according to the direction of the connection to obtain a line pattern corresponding to the intersection data; the line pattern is used to represent the processing area corresponding to the layer where the preset slice plane corresponding to the intersection data is located.
4. The slicing method according to claim 3, characterized in that, The second type of thread performs graphic rendering on the line pattern to obtain a slice pattern corresponding to the preset slice plane, including: The second type of thread compares the normal vector direction of the preset shape patch data to which the line pattern belongs with the preset direction vector. Lines whose normal vector direction is consistent with the direction of the preset direction vector are classified as the first type of lines; Lines whose normal vector direction is opposite to that of the preset direction vector are classified as the second type of lines; The area between each pair of adjacent first-type lines and second-type lines, through which the preset direction vector passes sequentially from the outside to the inside of the line pattern, is taken as the area to be rendered. The area to be rendered is rendered to obtain a slice pattern corresponding to the preset slice plane.
5. The slicing method according to claim 1, characterized in that, The processor also includes at least one third type of thread; After rendering the line pattern using the second type of thread to obtain a slice pattern corresponding to the preset slice plane, the method further includes: The sliced pattern is compressed using a third type of thread to obtain compressed pattern data.
6. The slicing method according to claim 5, characterized in that, Before determining the line pattern obtained by the intersection of the preset shape patch data and the preset slice plane through the first type of thread, the method further includes: Determine the number of available parallel threads in the processor; If the number of available parallel threads of the processor is greater than the preset number of threads, then the preset shape patch data of the target printing model is divided into at least two groups of patch data, with at least one dividing plane parallel to the preset slicing plane as the boundary, and the multiple available parallel threads are assigned to at least two groups of parallel threads corresponding to at least two groups of patch data, wherein each group of parallel threads includes at least one first type of thread and at least one second type of thread.
7. The slicing method according to claim 6, characterized in that, Using at least one dividing plane parallel to the preset slicing plane as a boundary, the preset shape patch data of the target printing model is divided into at least two groups of patch data, including: Obtain the height of the target printing model, and calculate the number of slices corresponding to the target printing model based on the height and the preset slice thickness; The position data of the partitioning plane is determined based on the number of slices and the number of groups to be grouped, wherein the number of groups to be grouped is determined by the number of parallel threads; Based on each of the dividing planes, the preset shape patch data of the target printing model is divided into multiple groups of patch data, and the number of groups of patch data is the same as the number of groups to be divided.
8. The slicing method according to claim 6, characterized in that, After compressing the sliced pattern using a third type of thread to obtain compressed pattern data, the method further includes: When it is detected that the number of compressed pattern data output by each of the third type of threads is the same as the number of patch data in the group to which the third type of thread belongs, the multiple compressed pattern data are packaged by the fourth type of thread to obtain a compressed pattern data package.
9. The slicing method according to any one of claims 1-8, characterized in that, Each type of thread is configured with a corresponding thread identifier. Before rendering the line pattern using the second type of thread to obtain a slice pattern corresponding to the preset slice plane, the method further includes: The first type of thread sends the line pattern to the waiting queue of the second type of thread according to the identifier of the second type of thread. The waiting queue is used to cache the data to be processed by the second type of thread.
10. A 3D printing slicing method, characterized in that, include: The preset shape patch data of the target printing model is obtained to the processor, which includes at least one fifth type thread and at least one sixth type thread; The intersection point data obtained by the intersection of the preset shape patch data and the preset slice plane is determined by the fifth type of thread; The sixth type of thread determines the line pattern corresponding to the intersection data based on the intersection data, and performs graphic rendering on the line pattern to obtain a slice pattern corresponding to the preset slice plane; wherein, the fifth type of thread and the sixth type of thread run in parallel.
11. A storage medium, characterized in that, The storage medium stores at least one executable instruction that causes the processor to perform the operation corresponding to the slicing method of 3D printing as described in any one of claims 1-10.
12. A terminal, comprising: A processor, a memory, a communication interface, and a communication bus, characterized in that the processor, the memory, and the communication interface communicate with each other through the communication bus; The memory is used to store at least one executable instruction that causes the processor to perform an operation corresponding to the slicing method of 3D printing as described in any one of claims 1-10.
Citation Information
Patent Citations
GPU parallel slicing method for triangular mesh model
CN110956699A
Laser three-dimensional processing model slice data processing method
CN114834043A
