Method for generating slice file and storage medium

By generating multiple cutting planes to process the intersection points of the facets of the 3D model in parallel, the problems of high memory consumption and long slicing time in 3D printing are solved, and efficient and accurate slice file generation is achieved.

CN121515481APending Publication Date: 2026-02-13GUANGZHOU HEIGE ZHIZAO INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511496510.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-20
Publication Date
2026-02-13

AI Technical Summary

Technical Problem

Existing technologies for 3D printing suffer from high memory consumption and long slicing processing times due to the large amount of 3D model data, and dimensional deviations occur when the cutting plane contacts the vertices or top surface of the 3D model.

Method used

By generating multiple tangent planes, determining the groups of facets that intersect with the tangent planes in parallel, processing the intersection points in parallel, and generating slice files.

Benefits of technology

It improves the efficiency of 3D model slicing processing, reduces memory usage, reduces the size of slice files, and improves slicing accuracy and processing speed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121515481A_ABST
    Figure CN121515481A_ABST
Patent Text Reader

Abstract

The invention is suitable for the field of three-dimensional printing, and provides a method for generating a slice file and a storage medium. A method of generating a slice file includes generating a plurality of tangent planes according to a three-dimensional model and a layer thickness parameter, determining a first set of patches intersecting a first tangent plane of the plurality of tangent planes, determining a second set of patches intersecting a second tangent plane of the plurality of tangent planes, determining a first set of intersections and a second set of intersections in parallel, the first group of intersection points are intersection points of the first tangent plane and the first group of dough sheets, and the second group of intersection points are intersection points of the second tangent plane and the second group of dough sheets; and outputting the first slice file based on the first set of intersections, and outputting the second slice file based on the second set of intersections. By grouping the surface patches for parallel processing, the efficiency of slicing the three-dimensional model is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the field of three-dimensional printing, and particularly relates to a method for generating a slice file and a storage medium. BACKGROUND Three-dimensional printing relies on slice files (slice images) for layer-by-layer construction.

[0003] For example, the process of light-curing three-dimensional printing is: first, slice processing is performed on a three-dimensional model to generate slice images, and then light is projected based on each slice image to obtain a solidified layer.

[0004] In some scenarios, the data volume of the three-dimensional model is large, and the data of the entire three-dimensional model needs to be loaded into the memory for calculation, and then the slice images are output. This results in large memory occupation and long processing time for obtaining all slice images.

[0005] Therefore, how to quickly obtain slice images of a three-dimensional model is a challenge.

[0006] In addition, in the prior art, there is a risk that the slice plane is in contact with the vertex or top surface of the three-dimensional model when slicing. When the slice plane is in contact with the vertex or top surface of the three-dimensional model, the manufacturing corresponding to the slice image causes the formed solidified layer to be all extra parts. For example, when the slice plane is spaced apart from the vertex or top surface of the three-dimensional model by 25 μm and the layer thickness is 50 μm, 25 μm of the 50 μm solidified layer formed is an ideal part, and the remaining 25 μm is an extra part. When the slice plane is in contact with the vertex or top surface of the three-dimensional model and the layer thickness is 50 μm, 50 μm of the 50 μm solidified layer formed is an extra part. This, for example, causes a deviation in size. SUMMARY

[0007] Therefore, the embodiments of the present application provide a method for generating a slice file and a storage medium, which can solve the problem of low efficiency of slice processing on a three-dimensional model.

[0008] A first aspect of the embodiments of the present application provides a method for generating a slice file, comprising: generating a plurality of slice planes according to a three-dimensional model and a layer thickness parameter, the three-dimensional model comprising a plurality of different patches; determining a first group of patches intersecting a first slice plane in the plurality of slice planes; determining a second group of patches intersecting a second slice plane in the plurality of slice planes, wherein the second slice plane is spaced apart from the first slice plane; determining a first set of intersection points and a second set of intersection points in parallel, the first set of intersection points being intersection points of the first tangent plane and the first set of patches, the second set of intersection points being intersection points of the second tangent plane and the second set of patches; and outputting a first slice file based on the first set of intersection points and outputting a second slice file based on the second set of intersection points.

[0009] In an embodiment, a plurality of tangent planes is generated according to a three-dimensional model and a layer thickness parameter, comprising: generating an initial tangent plane according to the three-dimensional model and the layer thickness parameter; offsetting at least one of the initial tangent plane and an initial vertex of the three-dimensional model to separate the initial tangent plane and the initial vertex, to obtain a tangent plane corresponding to the initial tangent plane and a vertex corresponding to the initial vertex.

[0010] In an embodiment, a coordinate of the tangent plane on a preset coordinate axis is an odd multiple of a basic unit, and a coordinate of the vertex on the preset coordinate axis is an even multiple of the basic unit; or, a coordinate of the tangent plane on a preset coordinate axis is an even multiple of a basic unit, and a coordinate of the vertex on the preset coordinate axis is an odd multiple of the basic unit.

[0011] In an embodiment, a distance between the initial tangent plane and the initial vertex is 20% to 80% of a layer thickness associated with the initial tangent plane.

[0012] In an embodiment, determining a first set of patches intersecting a first tangent plane of the plurality of tangent planes comprises: determining a first set of patches intersecting the first tangent plane of the plurality of tangent planes according to vertex coordinates of each patch of the plurality of different patches and a coordinate of the first tangent plane.

[0013] In an embodiment, determining a first set of intersection points and a second set of intersection points in parallel comprises: determining a first set of edges intersecting the first tangent plane and a second set of edges intersecting the second tangent plane from the first set of patches and the second set of patches; taking intersection points of the first tangent plane and the first set of edges as the first set of intersection points and taking intersection points of the second tangent plane and the second set of edges as the second set of intersection points.

[0014] In an embodiment, outputting a first slice file based on the first set of intersection points comprises: connecting the first set of intersection points in sequence according to an edge on which each intersection point of the first set of intersection points is located, to obtain a first slice contour; generating the first slice file according to the first slice contour.

[0015] In an embodiment, the first slice file is generated according to the first slice contour, including: determining a first pixel point through which the first slice contour passes; generating the first slice file according to pixel coordinates and a gray value of the first pixel point.

[0016] In an embodiment, after the first pixel point through which the first slice contour passes is determined, the method further includes: dividing a space in which the first pixel point is located into a plurality of subspaces; determining a gray value of the first pixel point according to a number of subspaces covered by the first slice contour and a total number of the subspaces.

[0017] A second aspect of the embodiments of the present application provides a device for generating a slice file, including: a slice plane generation module configured to generate a plurality of slice planes according to a three-dimensional model and a layer thickness parameter, the three-dimensional model including a plurality of different patches; a grouping module configured to determine a first group of patches intersecting a first slice plane of the plurality of slice planes; and determine a second group of patches intersecting a second slice plane of the plurality of slice planes, wherein the second slice plane is spaced apart from the first slice plane; a parallel processing module configured to determine a first group of intersection points and a second group of intersection points in parallel, the first group of intersection points being intersection points of the first slice plane and the first group of patches, the second group of intersection points being intersection points of the second slice plane and the second group of patches; and output a first slice file based on the first group of intersection points, and output a second slice file based on the second group of intersection points.

[0018] A third aspect of the embodiments of the present application provides an electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor, the processor implementing the method for generating a slice file as described in the first aspect above when executing the computer program.

[0019] A fourth aspect of the embodiments of the present application provides a computer readable storage medium storing a computer program, the computer program being executable by a processor to implement the method for generating a slice file as described in the first aspect above.

[0020] A fifth aspect of the embodiments of the present application provides a computer program product, when the computer program product is executed on an electronic device, causing the electronic device to execute the method for generating a slice file as described in any one of the first aspect above.

[0021] The beneficial effects of the embodiments of the present application compared with the prior art are: a plurality of tangent planes are generated according to a three-dimensional model, for any first tangent plane and second tangent plane in the plurality of tangent planes, a first group of face patches intersecting the first tangent plane is determined, a second group of face patches intersecting the second tangent plane is determined, thereby grouping the plurality of face patches, and the first group of intersection points of the first tangent plane and the first group of face patches and the second group of intersection points of the second tangent plane and the second group of face patches are determined in parallel, a first slice file is output based on the first group of intersection points, and a second slice file is output based on the second group of intersection points. By determining the first group of face patches intersecting the first tangent plane and the second group of face patches intersecting the second tangent plane, the face patches are grouped, and the intersection points of each tangent plane and the face patches are processed in parallel, and the slice file is output, thereby improving the efficiency of slicing the three-dimensional model. BRIEF DESCRIPTION OF DRAWINGS In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or prior art description will be briefly introduced as follows.

[0022] Figure 1 is an implementation flow diagram of a method for generating a slice file provided by an embodiment of the present application; Figure 2 is a schematic diagram of sorting the vertices of a face patch provided by an embodiment of the present application; Figure 3 is a schematic diagram of distributing a face patch to a tangent plane provided by an embodiment of the present application; Figure 4 is a schematic diagram of recording data of the intersection points of a tangent plane and a face patch provided by an embodiment of the present application; Figure 5 is a schematic diagram of a cube model provided by an embodiment of the present application; Figure 6 is a schematic diagram of grouping the face patches of a cube model according to a tangent plane provided by an embodiment of the present application; Figure 7 is a schematic diagram of determining a slice contour provided by an embodiment of the present application; Figure 8 is a schematic diagram of rasterizing a slice contour provided by an embodiment of the present application; Figure 9 is a schematic diagram of a device for generating a slice file provided by an embodiment of the present application; Figure 10 is a structural schematic diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0023] In the following description, for purposes of explanation and not limitation, specific details are set forth such as particular architectures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. However, it will be apparent to those skilled in the art that the present application can be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known methods, devices, circuits, and

[0024] It is to be understood that the terminology "includes", "has", "holds", "contains" and / or "comprising", when used in this specification and in the following claims, indicates the presence of the described features, integers, steps, operations, elements, and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.

[0025] It is also to be understood that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting. As used in this specification and the appended claims, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.

[0026] It will be further understood that the terms "and / or", "including", "comprising" when used in this specification and in the following claims, specify the presence of features, integers, steps, operations, elements, and / or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.

[0027] As used in this specification and the appended claims, the term "if" can be construed to mean "when" or "once" or "in response to a determination" or "in response to the occurrence of" that follows, depending on the context. Similarly, the phrase "if it is determined" or "if [a described condition or event] is detected" can be construed to mean "once it is determined" or "in response to a determination" or "once [the described condition or event] is detected" or "in response to the occurrence of [a described condition or event]," depending on the context.

[0028] The method for generating a slice file provided by the present application is described below.

[0029] Referring to the drawings Figure 1 The method for generating a slice file provided by an embodiment of the present application comprises steps S101-S104.

[0030] S101: generating a plurality of slice planes according to a three-dimensional model and a layer thickness parameter, wherein the three-dimensional model comprises a plurality of different patches.

[0031] Specifically, the three-dimensional model is formed by a plurality of different facets, and the shape of the facet can be a triangle, a pentagon, a hexagon, or the like. A plurality of slicing planes are parallel to each other, and are used to divide the three-dimensional model into a plurality of slices for subsequent three-dimensional printing. The layer thickness parameter is the distance between two adjacent slicing planes. Exemplarily, when the three-dimensional model is in a righted state, taking any point on the bottom surface of the three-dimensional model as the coordinate origin O, and establishing a three-dimensional coordinate system with the bottom surface of the three-dimensional model as the XOY plane, the Z axis is perpendicular to the XOY plane. According to the layer thickness parameter L, a plurality of slicing planes parallel to the XOY plane are generated, and the distance between adjacent slicing planes is L. Among them, according to the layer thickness parameter, a plurality of slicing planes with equal intervals can be generated, or a plurality of slicing planes with non-equal intervals can be generated.

[0032] S102: Determine a first group of facets intersecting a first slicing plane in the plurality of slicing planes.

[0033] S103: Determine a second group of facets intersecting a second slicing plane in the plurality of slicing planes, wherein the second slicing plane is spaced apart from the first slicing plane.

[0034] Among them, the first slicing plane is any slicing plane in the plurality of slicing planes, the first group of facets includes a plurality of facets intersecting the first slicing plane, the second slicing plane represents other slicing planes other than the first slicing plane, and the second group of facets includes a plurality of facets intersecting the second slicing plane. It can be understood that for each slicing plane in the plurality of slicing planes, the method of determining the corresponding facets is the same as the method of determining the first group of facets and the method of determining the second group of facets.

[0035] It can be understood that a group of facets corresponds to a slicing plane, and a facet can intersect a plurality of slicing planes, so the same facet can be located in different groups. By grouping the facets, it is convenient to subsequently process the facets in each group in parallel, which advantageously improves the calculation efficiency.

[0036] In an embodiment, after obtaining the three-dimensional model, the vertex (top vertex or bottom vertex) of the three-dimensional model is taken as an initial vertex. First, generate an initial slicing plane according to the three-dimensional model and the layer thickness parameter, and the interval between adjacent initial slicing planes is determined according to the layer thickness parameter. Among them, the distance between the initial slicing plane and the initial vertex is 20%~80% of the layer thickness associated with the initial slicing plane.

[0037] Then, offset the initial slicing plane point, and take the offset initial slicing plane as the slicing plane, so that the slicing plane obtained after the offset does not intersect all the initial vertices, so that the slicing plane can cut all the facets, avoiding the complex processing problem of the slicing plane cutting the vertex.

[0038] In one embodiment, a basic unit is defined, which is smaller than the layer thickness parameter. The coordinates of the initial tangent plane and the initial vertex on a preset coordinate axis (e.g., the Z-axis) are determined, with the initial tangent plane perpendicular to the preset coordinate axis. The coordinates are adjusted according to the multiple relationship between the initial tangent plane's coordinates on the preset coordinate axis and the basic unit, so that the adjusted coordinates are odd multiples of the basic unit, thus obtaining the coordinates of the corresponding tangent plane. Similarly, the coordinates of the initial vertex are adjusted (by moving the 3D model) according to the multiple relationship between the initial tangent plane's coordinates on the preset coordinate axis and the basic unit, so that the adjusted coordinates are even multiples of the basic unit, thus obtaining the coordinates of the corresponding vertex. Alternatively, the coordinates are adjusted according to the multiple relationship between the initial tangent plane's coordinates on the preset coordinate axis and the basic unit, so that the adjusted coordinates are even multiples of the basic unit, thus obtaining the coordinates of the corresponding tangent plane. Similarly, the coordinates of the initial vertex are adjusted according to the multiple relationship between the initial tangent plane's coordinates on the preset coordinate axis and the basic unit, so that the adjusted coordinates are odd multiples of the basic unit, thus obtaining the coordinates of the corresponding vertex. Therefore, the vertices and tangent planes obtained after adjusting the coordinates are completely offset and will not intersect. By adjusting the slicing plane and vertices simultaneously, the accumulation of deviations and the destruction of the topology of the 3D model can be avoided, thus improving the slicing accuracy.

[0039] For example, the basic unit can be set to any value between 1μm and 50μm. Adjust the position of the initial tangent plane and / or the 3D model so that none of the adjusted tangent planes touch the vertices of the 3D model. For example, if the basic unit is 1μm, and the height coordinates of the bottom and top vertices of the 3D model are 15μm and 1675μm respectively, then multiple tangent planes can be set to height coordinates of 50μm, 100μm, 150μm, 200μm, ..., with adjacent tangent planes spaced 50μm apart.

[0040] In another embodiment, the coordinates of the initial tangent plane or the initial vertex can be adjusted so that the adjusted tangent plane is located between the two vertices of the adjusted face.

[0041] In one embodiment, after determining multiple tangent planes, for a first tangent plane, based on the coordinates of the vertices of each facet and the coordinates of the first tangent plane, multiple facests intersecting the first tangent plane are determined, and these multiple facests intersecting the first tangent plane are designated as a first group of faces. For a second tangent plane, based on the coordinates of the vertices of each facet and the coordinates of the second tangent plane, multiple facests intersecting the second tangent plane are determined, and these multiple facests intersecting the second tangent plane are designated as a second group of faces. For example, as... Figure 2 As shown, the face is triangular. The three vertices of the face are ordered in ascending order of their Z-axis coordinates, namely Zmin, Zmid, and Zmax. The edges of the face are represented by two vertices, with the three edges being e1:{Zmin, Zmax}, e2:{Zmin, Zmid}, and e3:{Zmid, Zmax}.Figure 3 As shown, for any tangent plane, the tangent plane intersects a plurality of facets according to the coordinate of the tangent plane on the Z axis and two vertices Zmin (the vertex with the minimum coordinate on the Z axis) and Zmax (the vertex with the maximum coordinate on the Z axis) of each facet. For example, referring to FIG. 3, the facets intersecting the tangent plane P1 include the facet t1 and the facet t3, the facets intersecting the tangent plane P2 include the facet t2 and the facet t3, the facets intersecting the tangent plane P3 include the facet t3, the facets intersecting the tangent plane P4 include the facet t3, and the facets intersecting the tangent plane P5 include the facet t4. Figure 3 As shown, for any tangent plane, the tangent plane intersects a plurality of facets according to the coordinate of the tangent plane on the Z axis and two vertices Zmin (the vertex with the minimum coordinate on the Z axis) and Zmax (the vertex with the maximum coordinate on the Z axis) of each facet. For example, referring to FIG. 3, the facets intersecting the tangent plane P1 include the facet t1 and the facet t3, the facets intersecting the tangent plane P2 include the facet t2 and the facet t3, the facets intersecting the tangent plane P3 include the facet t3, the facets intersecting the tangent plane P4 include the facet t3, and the facets intersecting the tangent plane P5 include the facet t4.

[0042] S104: determining a first set of intersection points and a second set of intersection points in parallel, the first set of intersection points being intersection points of the first tangent plane and the first set of facets, and the second set of intersection points being intersection points of the second tangent plane and the second set of facets; and outputting a first slice file based on the first set of intersection points and outputting a second slice file based on the second set of intersection points.

[0043] Specifically, a plurality of processing tasks can be invoked to process the intersection of each tangent plane and the corresponding facets in parallel. The number of processing tasks is the same as the number of tangent planes, and each processing task is used to determine the intersection of a tangent plane and the facets assigned to the tangent plane. The plurality of processing tasks run in parallel, so that the computing efficiency can be improved.

[0044] In an embodiment, a first set of edges of each facet in the first set of facets intersecting the first tangent plane is determined, and a second set of edges of each facet in the second set of facets intersecting the second tangent plane is determined, the intersection of the first tangent plane and the first set of edges is taken as the first set of intersection points, and the intersection of the second tangent plane and the second set of edges is taken as the second set of intersection points.

[0045] In an embodiment, the first set of intersection points is sequentially connected according to the edges on which each intersection point in the first set of intersection points is located, to obtain a first slice contour, and a first slice file is generated according to the first slice contour. The second set of intersection points is sequentially connected according to the edges on which each intersection point in the second set of intersection points is located, to obtain a second slice contour, and a second slice file is generated according to the second slice contour.

[0046] Specifically, for any tangent plane, the edges of the facet intersecting the tangent plane are determined according to the coordinate of the tangent plane on a preset coordinate axis (for example, the Z axis) and the coordinates of the two vertices of the edge on the preset coordinate axis, the intersection of the tangent plane and the edge is determined according to the intersection point formula of the plane and the line segment, and the intersection point is taken as the intersection of the tangent plane and the facet. According to the edge on which the intersection point is located, the corresponding intersection points are sequentially accessed in order, and the plurality of intersection points are sequentially connected to obtain a slice contour, the slice contour being a closed curve, and a slice file can be generated according to the slice contour.

[0047] For example, after determining the intersection point of the tangent plane and the edge of the face, the coordinates of the intersection point, the index of the face, and the edge containing the intersection point are stored. For instance, as shown... Figure 4 As shown, the storage includes the coordinates of the intersection points (point), the index of the edge containing the intersection point (key), the indices of the edges connected to the edge containing the intersection point and located to its left and right (right and left), the index of the face (face), and the access control flag (flag). Based on the indices of the edges containing the intersection points, the indices of the edges to its left and right (left and right), and the topology of the 3D model, all intersection points can be accessed quickly and sequentially, and all intersection points can be connected sequentially to obtain the slice outline, thus improving the efficiency of determining the slice outline.

[0048] In one embodiment, the slice file may be a set of coordinates of the intersection points in the slice outline.

[0049] In another embodiment, after determining the slice outline, the slice outline is rasterized, and edge anti-aliasing is calculated simultaneously to make the outline edges smoother. For example, for a first slice outline, the first pixel points traversed by the first slice outline are determined, and a first slice file is generated based on the pixel coordinates and grayscale values ​​of multiple first pixel points. For a second slice outline, the second pixel points traversed by the second slice outline are determined, and a second slice file is generated based on the pixel coordinates and grayscale values ​​of multiple second pixel points.

[0050] Specifically, for any cutting plane, the planar region containing the cutting plane is divided into uniformly sized grids according to the resolution, with each grid corresponding to a pixel. The pixels at each intersection point are determined based on the coordinates of the intersection points on the slice outline. The multiple pixels traversed by the slice outline are determined based on the lines connecting these pixels. A slice file is generated based on the pixel coordinates of these pixels and the grayscale values ​​of each pixel. Compared to outputting slice files as image files, generating slice files based on pixel coordinates and grayscale values ​​reduces the memory footprint of the slice files, increases the speed of outputting slice files, and thus improves the efficiency of the slicing process.

[0051] In one embodiment, the grayscale value of a pixel is determined based on the area covered by the edge contour at the corresponding pixel. For a first pixel, the space containing the first pixel is divided into multiple subspaces, and the grayscale value of the first pixel is determined based on the number of subspaces covered by the first slice contour and the total number of subspaces. For a second pixel, the space containing the second pixel is divided into multiple subspaces, and the grayscale value of the second pixel is determined based on the number of subspaces covered by the second slice contour and the total number of subspaces.

[0052] Specifically, for any given pixel, the space (grid) containing the pixel is divided into multiple subspaces. The grayscale value of the pixel is determined based on the number of subspaces covered by the slice outline and the total number of subspaces. For example, if the space containing the pixel is divided into n (ranging from 1 to 256) subspaces, and the number of subspaces covered by the slice outline is m, then the grayscale value of the pixel is 255*m / n.

[0053] In one embodiment, after determining the data (pixel coordinates and grayscale values) of the pixels traversed by the slice outline, the pixel data is sorted according to the pixel coordinates, and the sorted data is encoded to obtain a slice file. For example, pixel coordinates include y-coordinate values ​​and x-coordinate values. The pixel data is sorted according to the y-coordinate values, and the same y-coordinate values ​​are sorted according to the x-coordinate values. The sorted pixel data is then encoded according to run-code to obtain a slice file. The slice file can be in a preset HGI format.

[0054] For example, after sorting the pixel data, pixel values ​​greater than 0 and less than 255 are replaced with target values, and the data of the replaced pixels is stored in the first data stream. For the first data stream, the first pixel is used as the target pixel. All pixels are traversed, and pixels with values ​​different from the previous pixel are designated as new target pixels. The pixel values ​​of all target pixels are stored in the second data stream. The number of pixels between adjacent target pixels is determined and recorded as the consecutive number corresponding to the previous target pixel. The newly recorded data is stored in the third data stream. The first, second, and third data streams are integrated to obtain the encoded slice file. Encoding the slice file allows for further data compression, reducing the memory footprint of the slice file.

[0055] It is understandable that the encoded slice file can also be in other formats, such as SLC, CTB, or PHZ.

[0056] The following is based on Figure 5 The method for generating slice files provided in this application embodiment is illustrated by taking a cube model with dimensions of 2.83mm*2.83mm*2.83mm and top and bottom surfaces parallel to the XOY plane as an example.

[0057] Initial tangent planes parallel to the XOY plane are generated with a layer thickness parameter of 3mm. The number of initial tangent planes is 56. The Z-axis coordinate of the bottom face of the cube model is set to 0, and the Z-axis coordinates of the multiple initial tangent planes are {0.05, 0.1, 0.15, ..., 2.75, 2.80}. The initial tangent planes and the initial vertices of the cube model are offset so that the Z-axis coordinates of the offset vertices are even multiples of 0.00003, and the Z-axis coordinates of the offset tangent planes are odd multiples of 0.00003. For example, among all the initial vertices of the cube model, the maximum Z-axis coordinate is 2.83mm, and the Z-axis coordinate of the offset vertex is 2.83002mm, which is an even multiple of 0.00003; among the initial tangent planes, the maximum Z-axis coordinate is 2.8mm, and the Z-axis coordinate of the offset tangent plane is 2.79891mm, which is an odd multiple of 0.00003.

[0058] For each facet of the cube model, based on the Z-axis coordinates of each vertex, they are sorted in ascending order to obtain Zmin, Zmid, and Zmax. Correspondingly, the three edges of each facet are e1:{Zmin, Zmax}, e2:{Zmin, Zmid}, and e3:{Zmid, Zmax}. Based on the Zmin and Zmax of each facet and the Z-axis coordinates of the tangent planes, the facets intersecting each tangent plane can be determined. For each tangent plane, the multiple facets intersecting the tangent plane are assigned to the corresponding tangent plane. For example, as shown... Figure 6 As shown, the cube model includes a top face, a bottom face, and two side faces. The top and bottom faces do not intersect with any tangent planes. Each side face consists of eight facets, numbered 1, 2, 3, 4, 5, 6, 7, and 8. The tangent planes are numbered p1, p2, p3... p59, p60. Based on the Zmin and Zmax values ​​of each facet, it can be seen that each facet intersects with all tangent planes. Therefore, for each tangent plane, the assigned facets include {1, 2, 3, 4, 5, 6, 7, 8}. Thus, assigning facets to 60 tangent planes results in 60 groups of facets, namely {g1, g2, g3, ..., g59, g60}.

[0059] Parallel processing tasks are performed to determine the intersection points of each tangent plane and its corresponding face. For any tangent plane (e.g., p30), and the group g30 containing the corresponding face, the processing task determines all intersection points between p30 and g30. For each face, the task determines the intersection points of each edge of the face with the tangent plane. For any intersection point, the task records the coordinates of the intersection point, the index of the edge containing the intersection point, and the indices of the edges connected to the edge containing the intersection point and located to the left and right of the edge containing the intersection point. For example... Figure 7As shown, based on the index of the edge where the intersection point is located, and the indices of the edges connected to the edge where the intersection point is located and located on the left and right sides of the edge where the intersection point is located, all intersection points are traversed, and all intersection points are connected in turn to obtain the slice outline.

[0060] like Figure 8 As shown, the horizontal axis represents the x-axis, and the vertical axis represents the y-axis. Based on the resolution, the planar region containing the cutting plane is divided into uniformly sized grids. Each grid corresponds to a pixel, and each pixel corresponds to a pixel coordinate. Each grid is further divided into 16 subspaces. The pixel at each intersection point is determined by the coordinates of the intersection points on the slice outline. The multiple pixels traversed by the slice outline are determined by the lines connecting the pixels. For each pixel, the grayscale value is determined by the ratio of the subspace covered by the slice outline to the total number of subspaces. For example, for a pixel with coordinates (0, 2), if the slice outline covers 3 subspaces, then the grayscale value of this pixel is calculated as 3 / 16 * 255 = 48. Therefore, the data for the pixel with coordinates (0, 2) is x=0, y=0, gray=48.

[0061] After obtaining the data for each pixel, the pixels are first sorted according to their y-axis coordinates. Among pixels with the same y-axis coordinate, they are then sorted according to their x-axis coordinates. The pixels that the slice outline passes through are (0, 1), (0, 2), (1, 0), (1, 1), (1, 2), (1, 3), (2, 0), (2, 1), (2, 3), (3, 1), (3, 2). The data for each pixel is then encoded to obtain the slice file.

[0062] For a model with a size of 1.1GB, the slice image size is (15120, 6230). Therefore, one slice image occupies 15120 * 6230 = 89.8MB of memory. If the layer thickness parameter is 0.05mm, a total of 4400 slice files are generated. Tests were conducted on a computer with an i7-10700k 8-core, 16-processor CPU, outputting PNG format slice files. The entire process took 332 seconds, with a peak memory usage of 5.5GB, and the generated slice file package size was 3.4GB. Using the slice file generation method of this application, outputting HGI format slice files, the entire process took 167 seconds, with a peak memory usage of 4.3GB, and the generated slice file package size was 1.1GB.

[0063] In the above embodiments, by offsetting the initial cutting planes and the initial vertices respectively and then generating the slicing file, the complex problem of the vertices falling on the cutting planes can be avoided, the slicing accuracy, the model integrity and the numerical calculation stability are ensured. By determining the surface patches intersecting with each cutting plane, processing the intersection points of each cutting plane and the corresponding surface patches in parallel, the slicing file is generated, and the efficiency of the slicing processing can be improved. By sorting the Z-axis coordinates of each surface patch and storing the information of the intersection points of the cutting planes and the edges of the surface patches, each intersection point can be quickly accessed, and the efficiency of generating the slicing file is improved. When rasterizing the slicing contour, the anti-aliasing gray values of each pixel point are calculated, and the efficiency of the slicing processing can be further improved. According to the coordinates and the gray values of each pixel point, the slicing file is generated, and the size of the generated slicing file can be reduced, and the memory occupation space can be reduced. It should be understood that the size of the serial number of each step in the above embodiments does not mean the order of execution, and the execution order of each process should be determined according to its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0064] According to the method for generating a slicing file described in the above embodiments, Figure 9 The structure block diagram of the device for generating a slicing file provided by the embodiments of the present application is shown, and only the parts related to the embodiments of the present application are shown for the convenience of description.

[0065] As Figure 9 shown, the device for generating a slicing file includes a cutting plane generation module 91, a grouping module 92 and a parallel processing module 93.

[0066] The cutting plane generation module 91 is configured to generate a plurality of cutting planes according to a three-dimensional model and a layer thickness parameter, wherein the three-dimensional model includes a plurality of different surface patches. The grouping module 92 is configured to determine a first group of surface patches intersecting with a first cutting plane in the plurality of cutting planes; and determine a second group of surface patches intersecting with a second cutting plane in the plurality of cutting planes, wherein the second cutting plane is spaced apart from the first cutting plane; The parallel processing module 93 is configured to determine a first group of intersection points and a second group of intersection points in parallel, wherein the first group of intersection points are the intersection points of the first cutting plane and the first group of surface patches, and the second group of intersection points are the intersection points of the second cutting plane and the second group of surface patches; and output a first slicing file based on the first group of intersection points, and output a second slicing file based on the second group of intersection points.

[0067] In an embodiment, the cutting plane generation module 91 is specifically configured to: generate an initial cutting plane according to the three-dimensional model and the layer thickness parameter; offsetting at least one of the initial tangent plane and the initial vertex of the three-dimensional model to separate the initial tangent plane and the initial vertex, to obtain a tangent plane corresponding to the initial tangent plane and a vertex corresponding to the initial vertex.

[0068] In an embodiment, a coordinate of the tangent plane on a preset coordinate axis is an odd multiple of a basic unit, and a coordinate of the vertex on the preset coordinate axis is an even multiple of the basic unit; or, a coordinate of the tangent plane on a preset coordinate axis is an even multiple of a basic unit, and a coordinate of the vertex on the preset coordinate axis is an odd multiple of the basic unit.

[0069] In an embodiment, a distance between the initial tangent plane and the initial vertex is 20% to 80% of a layer thickness associated with the initial tangent plane.

[0070] In an embodiment, the grouping module 92 is specifically configured to: determine, according to vertex coordinates of each patch in the plurality of different patches and a coordinate of the first tangent plane, a first group of patches intersecting the first tangent plane in the plurality of tangent planes.

[0071] In an embodiment, the parallel processing module 93 is specifically configured to: determine a first group of edges intersecting the first tangent plane by the first group of patches, and determine a second group of edges intersecting the second tangent plane by the second group of patches; take intersection points of the first tangent plane and the first group of edges as a first group of intersection points, and take intersection points of the second tangent plane and the second group of edges as a second group of intersection points.

[0072] In an embodiment, the parallel processing module 93 is specifically configured to: connect the first group of intersection points in sequence according to an edge where each intersection point in the first group of intersection points is located, to obtain a first slice contour; generate the first slice file according to the first slice contour.

[0073] In an embodiment, the parallel processing module 93 is specifically configured to: determine a first pixel point passed by the first slice contour; generate the first slice file according to pixel coordinates and a gray value of a plurality of the first pixel points.

[0074] In an embodiment, the parallel processing module 93 is specifically configured to: divide a space where the first pixel point is located into a plurality of subspaces; determine a gray value of the first pixel point according to a number of subspaces covered by the first slice contour and a total number of the subspaces.

[0075] It should be noted that the information interaction, execution process and the like between the above apparatuses / units are based on the same concept as the method embodiments of the present application, and the specific functions and the brought technical effects can be referred to the method embodiments part. Therefore, no further description is given here.

[0076] Figure 10 is a structural schematic diagram of an electronic device provided by the embodiments of the present application. The electronic device can be a desktop computer, a notebook computer, a palm computer, a cloud server and the like.

[0077] As shown in Figure 10 , the electronic device of this embodiment includes a processor 101, a memory 102, and a computer program 103 stored in the memory 102 and executable on the processor 101. The processor 101 implements the steps in the above method embodiments for generating slice files when executing the computer program 103, such as Figure 1 steps S101-S104 shown in the figure. Alternatively, the processor 101 implements the functions of the modules / units in the above apparatus embodiments when executing the computer program 103, such as Figure 9 the functions of the tangent plane generation module 91 and the parallel processing module 93 shown in the figure.

[0078] For example, the computer program 103 can be divided into one or more modules / units, which are stored in the memory 102 and executed by the processor 101 to complete the present application. The one or more modules / units can be a series of computer program instruction segments capable of completing a specific function, which are used to describe the execution process of the computer program 103 in the electronic device.

[0079] Those skilled in the art can understand, Figure 10 that the above-mentioned electronic device is only an example and does not constitute a limitation on the electronic device, which can include more or fewer components than those shown, or combine certain components, or different components, for example, the electronic device can also include an input / output device, a network access device, a bus and the like.

[0080] The processor 101 can be a central processing unit (CPU), and can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor.

[0081] The memory 102 can be an internal storage unit of the electronic device, such as a hard disk or a memory of the electronic device. The memory 102 can also be an external storage device of the electronic device, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device. Further, the memory 102 can also include both the internal storage unit and the external storage device of the electronic device. The memory 102 is used to store the computer program and other programs and data required by the electronic device. The memory 102 can also be used to temporarily store data that has been output or will be output.

[0082] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above functional units and modules is exemplified, and in actual application, the above functions can be completed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to complete all or part of the functions described above. Each functional unit and module in the embodiment can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit, and the integrated unit can be realized in the form of hardware or in the form of software functional unit. In addition, the specific names of each functional unit and module are only for easy distinction, and do not limit the protection scope of the present application. The specific working process of the units and modules in the above system can refer to the corresponding process in the foregoing method embodiments, which will not be described here.

[0083] In the above embodiments, the description of each embodiment has its own emphasis, and the parts not described or recorded in detail in a certain embodiment can be referred to the relevant description of other embodiments.

[0084] In the embodiments of the present application, it should be understood that the disclosed apparatus / equipment and method can be implemented by other manners. For example, the apparatus / equipment embodiments described above are merely illustrative, for example, the division of the modules or units is merely a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units or components shown or discussed can be indirect coupling or communication connection through some interfaces, apparatuses or units, and can be electrical, mechanical or other forms.

[0085] The units described as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, i.e., can be located in one place or distributed on a plurality of network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiment.

[0086] If the integrated modules / units are implemented in the form of software function units and sold or used as independent products, they can be stored in a computer readable storage medium. Based on such understanding, all or part of the processes in the above-mentioned embodiment methods can also be completed by computer programs instructing related hardware, and the computer programs can be stored in a computer readable storage medium. When the processor executes the computer programs, the steps of the above-mentioned various method embodiments can be implemented. The computer programs include computer program codes, which can be in the form of source code, object code, executable files or some intermediate forms, etc. The computer readable medium can include any entity or device capable of carrying the computer program codes, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal and software distribution medium, etc. Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be realized in electronic hardware or a combination of computer software and electronic hardware. Whether the functions are executed in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.

[0087] The above-described embodiments are only used to illustrate the technical solutions of the present application, but not limit them; although the present application is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement to part of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application.

Claims

1. A method for generating slice files, characterized in that, include: Multiple cutting planes are generated based on the three-dimensional model and layer thickness parameters. The three-dimensional model includes multiple different facets. Determine the first set of facets that intersect with the first tangent plane among the plurality of tangent planes; A second set of facets is determined that intersects with the second tangent plane among the plurality of tangent planes, wherein the second tangent plane is spaced apart from the first tangent plane; The first set of intersection points and the second set of intersection points are determined in parallel. The first set of intersection points is the intersection point of the first tangent plane and the first set of facets, and the second set of intersection points is the intersection point of the second tangent plane and the second set of facets. and The first slice file is output based on the first set of intersection points, and the second slice file is output based on the second set of intersection points.

2. The method for generating slice files according to claim 1, characterized in that, Multiple tangential planes are generated based on the 3D model and layer thickness parameters, including: An initial cutting plane is generated based on the three-dimensional model and the layer thickness parameters; Offset at least one of the initial tangent plane and the initial vertex of the three-dimensional model to separate the initial tangent plane and the initial vertex, thereby obtaining a tangent plane corresponding to the initial tangent plane and a vertex corresponding to the initial vertex.

3. The method for generating slice files according to claim 2, characterized in that, The coordinates of the tangent plane on the preset coordinate axis are odd multiples of the basic unit, and the coordinates of the vertex on the preset coordinate axis are even multiples of the basic unit; or, the coordinates of the tangent plane on the preset coordinate axis are even multiples of the basic unit, and the coordinates of the vertex on the preset coordinate axis are odd multiples of the basic unit.

4. The method for generating slice files according to claim 2, characterized in that, The spacing between the initial tangent plane and the initial vertex is 20% to 80% of the layer thickness associated with the initial tangent plane.

5. The method for generating slice files according to claim 1, characterized in that, Determining the first set of facets that intersect with the first tangent plane among the plurality of tangent planes includes: Based on the vertex coordinates of each of the plurality of different facets and the coordinates of the first tangent plane, a first group of facets intersecting with the first tangent plane among the plurality of tangent planes is determined.

6. The method for generating slice files according to claim 1, characterized in that, Determine the first set of intersection points and the second set of intersection points in parallel, including: Determine the first set of edges where the first group of facets intersects with the first tangent plane, and determine the second set of edges where the second group of facets intersects with the second tangent plane; The intersection of the first tangent plane and the first set of edges is taken as the first set of intersection points, and the intersection of the second tangent plane and the second set of edges is taken as the second set of intersection points.

7. The method for generating slice files according to claim 1, characterized in that, The first slice file is output based on the first set of intersection points, including: Based on the edge containing each intersection point in the first group of intersection points, connect the first group of intersection points in sequence to obtain the first slice outline; The first slice file is generated based on the first slice outline.

8. The method for generating slice files according to claim 7, characterized in that, Generating the first slice file based on the first slice outline includes: Determine the first pixel point through which the first slice outline passes; The first slice file is generated based on the pixel coordinates and grayscale values ​​of multiple first pixel points.

9. The method for generating slice files according to claim 8, characterized in that, After determining the first pixel point traversed by the first slice contour, the method further includes: Divide the space containing the first pixel into multiple subspaces; The grayscale value of the first pixel is determined based on the number of subspaces covered by the first slice contour and the total number of the subspaces.

10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the method for generating slice files as described in any one of claims 1 to 9.

Citation Information

Patent Citations

  • Sectioning method of three-dimensional model and three-dimensional printing device

    CN109159425A

  • Slice file generation method, photo-curing three-dimensional printing method, photo-curing three-dimensional printing device and medium

    CN119589959A