Mapping 3D model slicing method, printing method, apparatus and device
The slicing method for three-dimensional models automatically generates full-color data from texture information, addressing the inefficiencies in manual coloring and improving the quality and speed of three-dimensional printing.
Patent Information
- Application Number
- JP2023566695
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2021-04-27
- Filing Date
- 2021-08-30
- Publication Date
- 2025-01-31
- Estimated Expiration
- 2041-08-30
AI Technical Summary
Existing three-dimensional printing technologies struggle to efficiently print colored three-dimensional models, requiring manual coloring and resulting in low efficiency and poor quality.
A slicing method that analyzes a three-dimensional model file to identify polygon patches with texture information, slices each patch, and generates full-color picture data for automated color printing based on contour areas.
Enables high-efficiency, automated color printing of three-dimensional models with improved quality by directly generating full-color models, enhancing printing efficiency and accuracy.
Smart Images

Figure 0007625099000003 
Figure 0007625099000004 
Figure 0007625099000005
Abstract
Description
[Technical field]
[0001] FIELD OF THE DISCLOSURE Embodiments of the present application relate to the field of three-dimensional printing technology, and in particular to a method, apparatus and device for slicing and printing a mapping three-dimensional model. [Background technology]
[0002] The three-dimensional printing system can obtain a corresponding three-dimensional object by printing based on the three-dimensional model designed by the designer. To print the three-dimensional object, the data of the three-dimensional model can be sliced, and each slice can define a portion of a material layer, which is hardened or consolidated by the three-dimensional printing system based on the associated definition of the slice.
[0003] However, since currently existing slicing algorithms cannot complete slicing of the mapping 3D model, the mapping 3D model cannot be printed in color, and users need to manually color it as needed, so the printing of the mapping 3D model is incomplete and inefficient, and cannot meet the needs of users. Summary of the Invention [Problem to be solved by the invention]
[0004] The embodiments of the present application provide a slicing method, a printing method, an apparatus and a device for a mapping 3D model, and for the mapping 3D model, by determining the color corresponding to the contour area corresponding to each slicing plane according to the texture information in the file, color printing of the mapping 3D model is realized with high printing completeness and high efficiency. [Means for solving the problem]
[0005] In a first aspect, an embodiment of the present application provides a method for slicing a mapping 3D model, the method including: analyzing a mapping 3D model file and obtaining each polygon patch for representing the mapping 3D model, where at least one of the polygon patches includes texture information of the mapping 3D model; slicing each of the polygon patches using a slice plane to obtain at least one outer contour line corresponding to the slice plane; obtaining a contour area according to the at least one outer contour line, filling the contour area; and generating full-color picture data for coloring the filled contour area according to the texture information.
[0006] Optionally, the step of obtaining a contour region according to the at least one outer contour line includes the steps of: shrinking each of the outer contour lines to obtain an inner contour line based on a predetermined mapping thickness; and The corresponding area of for the corresponding inner contour The corresponding area of and performing an exclusive OR operation with the contour region to obtain each of the contour regions.
[0007] Optionally, after the step of shrinking each of the outer contour lines to obtain an inner contour line based on a predetermined mapping thickness, the method further comprises the step of, for each outer contour line, obtaining an associated outer contour line corresponding to each of a predetermined number of slice planes above and below the slice plane corresponding to the outer contour line based on the predetermined mapping thickness and a predetermined slice thickness. The corresponding area of for the corresponding inner contour The corresponding area of and the step of obtaining each of the contour regions is The corresponding area of For each of the associated outer contours The corresponding area of and the corresponding outer contour line The corresponding area of and performing an exclusive OR operation with the contour region to obtain each of the contour regions.
[0008] Optionally, the step of generating full-color picture data for coloring the filled contour area in accordance with the texture information includes the steps of: associating the filled contour area with the picture in accordance with a resolution of the picture; obtaining pixel coordinates of each pixel point in the picture of the filled contour area; determining spatial coordinates of each point of the filled contour area in accordance with corresponding pixel coordinates of each point of the filled contour area; determining color values of each pixel point in the picture of the filled contour area in accordance with the spatial coordinates of each point in the filled contour area and the texture information; and generating full-color picture data for coloring the filled contour area in accordance with the color values of each pixel point in the picture of the filled contour area.
[0009] Optionally, the step of analyzing the mapping 3D model file includes the steps of obtaining the mapping 3D model file, wherein the mapping 3D model file includes a texture library, vertex coordinates of each vertex, and a polygon index of the mapping 3D model; determining spatial coordinates of each vertex of each of the polygon patches according to the vertex coordinates and the polygon index; and traversing the texture library according to the polygon index to obtain texture information of each vertex of each of the polygon patches.
[0010] Optionally, the step of traversing the texture library according to the polygon index and obtaining texture information for each vertex of each of the polygon patches includes: determining a texture file corresponding to each of the polygon patches according to the polygon index; for each vertex of each of the polygon patches, if the vertex coordinates of the vertex include vertex texture coordinates, obtaining a texture image in the texture file and determining texture information of the vertex from the texture image according to the vertex texture coordinates of the vertex; and / or, for each vertex of each of the polygon patches, if the vertex coordinates of the vertex do not include vertex texture coordinates, obtaining a diffuse light color value in the texture file; The diffuse light color value is determined as texture information of the vertex. Includes steps.
[0011] Optionally, the step of slicing each of the polygon patches using a slicing plane to obtain at least one outer contour corresponding to the slicing plane includes the steps of performing an intersection operation with the slicing plane for each of the polygon patches to obtain each intersection point, and connecting each intersection point from beginning to end to obtain at least one of the outer contours corresponding to the slicing plane.
[0012] Optionally, before performing the intersection operation on the polygon patches with the slice plane to obtain each intersection point, the method further includes: grouping and sorting each of the polygon patches according to a spatial coordinate of a layering direction corresponding to the polygon patches to obtain a grouping relationship matrix, the grouping relationship matrix including the polygon patches of each group corresponding to each of the slice planes. Accordingly, performing the intersection operation on the polygon patches with the slice plane to obtain each intersection point includes performing the intersection operation on the polygon patches of each group with the corresponding slice plane to obtain each intersection point.
[0013] Optionally, after obtaining each polygon patch for representing the mapping three-dimensional model, the method further includes sampling each polygon patch to obtain a point cloud information set, the point cloud information set including spatial coordinates and texture information of each sampling point. Accordingly, generating full-color picture data for coloring the filled contour region according to the texture information includes: determining a color value of each point in the filled contour region according to the point cloud information set and corresponding spatial coordinates of each point in the filled contour region; and generating full-color picture data for coloring the filled contour region according to the color value of each point in the filled contour region.
[0014] Optionally, after obtaining each polygon patch for representing the mapping three-dimensional model, the method further includes: for each polygon patch, determining adjacent polygon patches of each of the polygon patches, where the adjacent polygon patches contact the polygon patch at one side of the polygon patch; and generating a polygon topology according to each polygon patch and each of its corresponding adjacent polygon patches. Accordingly, slicing each of the polygon patches using a slice plane and obtaining at least one outer contour line corresponding to the slice plane includes: slicing each of the polygon patches using the slice plane and obtaining an intersection point between the slice plane and each of the polygon patches; and determining a connection order of each intersection point according to the polygon topology, and obtaining at least one outer contour line corresponding to the slice plane.
[0015] Optionally, filling the contoured region includes filling the contoured region based on a complementary color filling algorithm.
[0016] In a second aspect, embodiments of the present application provide a method for mapping a three-dimensional model. printingA method is further provided, the method including the steps of acquiring slice image data, the slice image data including full-color picture data generated according to a slicing method for a mapping 3D model provided by any embodiment corresponding to the first aspect of the present application, generating printing control data according to the slice image data, and printing the mapping 3D model based on the printing control data.
[0017] In a third aspect, an embodiment of the present application further provides a slicing device for a mapping 3D model, the device including: an analysis module for analyzing a mapping 3D model file and obtaining each polygon patch for representing the mapping 3D model, where at least one of the polygon patches includes texture information of the mapping 3D model; a contour acquisition module for slicing each of the polygon patches using a slicing plane and obtaining at least one outer contour line corresponding to the slicing plane; a contour filling module for obtaining a contour area according to the at least one outer contour line and filling the contour area; and a full-color picture generation module for generating full-color picture data for coloring the filled contour area according to the texture information.
[0018] Optionally, the contour filling module includes: a contour area obtaining unit for obtaining a contour area according to the at least one outer contour line; and a filling unit for filling the contour area.
[0019] Optionally, the contour area obtaining unit includes a shrinking subunit for shrinking each of the outer contour lines to obtain an inner contour line based on a predetermined mapping thickness; and The corresponding area of for the corresponding inner contour The corresponding area of and a contour area obtaining subunit for performing an exclusive OR operation with the contour area obtaining subunit to obtain each of the contour areas.
[0020] Optionally, the apparatus shrinks each of the outer contour lines based on a predetermined mapping thickness to obtain an inner contour line, and then, for each outer contour line, shrinks the outer contour lines based on the predetermined mapping thickness and a predetermined slice thickness to obtain associated outer contour lines corresponding to each of a predetermined number of slice planes above and below the slice plane corresponding to the outer contour line. line Accordingly, the contour area acquisition subunit specifically includes: The corresponding area of For each of the associated outer contours The corresponding area of and the corresponding outer contour line The corresponding area of and used to obtain each of the contour regions.
[0021] Optionally, the full-color picture generation module is specifically used for associating the filled contour area with the picture according to a resolution of a picture, obtaining pixel coordinates of each pixel point in the picture of the filled contour area, determining spatial coordinates of each point of the filled contour area according to the corresponding pixel coordinates of each point of the filled contour area, determining color values of each pixel point in the picture of the filled contour area according to the spatial coordinates of each point in the filled contour area and the texture information, and generating full-color picture data for coloring the filled contour area according to the color values of each pixel point in the picture of the filled contour area.
[0022] Optionally, the analysis module includes: a file acquisition unit for acquiring the mapping 3D model file, wherein the mapping 3D model file includes a texture library of the mapping 3D model, a vertex coordinate of each vertex, and a polygon index; an indexing unit for determining spatial coordinates of each vertex of each of the polygon patches according to the vertex coordinates and the polygon index; and a texture information determination unit for traversing the texture library according to the polygon index and acquiring texture information of each vertex of each of the polygon patches.
[0023] Optionally, the texture information determining unit specifically comprises: determining a texture file corresponding to each of the polygon patches according to the polygon index; for each vertex of each of the polygon patches, if the vertex coordinates of the vertex include vertex texture coordinates, obtaining a texture image in the texture file and determining texture information of the vertex from the texture image according to the vertex texture coordinates of the vertex; and / or, for each vertex of each of the polygon patches, if the vertex coordinates of the vertex do not include vertex texture coordinates, obtaining a diffuse light color value in the texture file; The diffuse light color value is determined as texture information of the vertex. Optionally, the contour obtaining module includes: an intersection obtaining unit for performing an intersection operation with the slice plane for each of the polygon patches to obtain each intersection point, and a contour obtaining unit for connecting each of the intersection points from beginning to end to obtain at least one of the outer contour lines corresponding to the slice plane.
[0024] Optionally, the device further includes a grouping sorting module for grouping and sorting each of the polygon patches according to a spatial coordinate of a layering direction corresponding to the polygon patch before performing an intersection operation with the slice plane on the polygon patch and obtaining each intersection point, the grouping relationship matrix including the polygon patches of each group corresponding to each slice plane. Accordingly, the intersection point obtaining unit is specifically used for performing an intersection operation with the corresponding slice plane on the polygon patch of each group and obtaining each intersection point.
[0025] Optionally, the apparatus further includes a point cloud information set acquisition module for obtaining each polygon patch for representing the mapping three-dimensional model, and then sampling each polygon patch to obtain a point cloud information set, the point cloud information set including spatial coordinates and texture information of each sampling point. Accordingly, the full-color picture generation module is specifically used for determining a color value of each point in the filled contour area according to the point cloud information set and the corresponding spatial coordinates of each point in the filled contour area, and generating full-color picture data for coloring the filled contour area according to the color value of each point in the filled contour area.
[0026] Optionally, the device further includes a topology generating module for obtaining each polygon patch for representing the mapping three-dimensional model, and for each polygon patch, determining adjacent polygon patches of each of the polygon patches, where the adjacent polygon patches are in contact with the polygon patch at one side of the polygon patch, and generating a polygon topology according to each polygon patch and each of its corresponding adjacent polygon patches.Accordingly, the contour obtaining module is specifically for slicing each of the polygon patches using the slice plane, obtaining intersection points between the slice plane and each of the polygon patches, and determining a connection order of each of the intersection points according to the polygon topology, and obtaining at least one outer contour corresponding to the slice plane.
[0027] Optionally, a filling unit is specifically used to fill the contour region based on a complementary color filling algorithm.
[0028] In a fourth aspect, embodiments of the present application provide a three dimensional printing apparatus including a memory and at least one processor. device The memory may further include computer executable instructions stored therein, the at least one processor executing the computer executable instructions stored in the memory to perform a method of slicing a mapping three-dimensional model as provided by any embodiment of the present application. and / or printing method Execute.
[0029] In a fifth aspect, the present embodiment further provides a computer readable storage medium having computer executable instructions stored thereon, the computer readable storage medium being adapted to perform a method of slicing a mapping three-dimensional model provided by any of the embodiments of the present application, when executed by a processor. and / or printing method It is used to achieve this.
[0030] In a sixth aspect, embodiments of the present application further provide a computer program product including a computer program, the computer program being configured to, when executed by a processor, perform the method of slicing a mapping three-dimensional model provided by any embodiment of the present application. and / or printing method is realized. Effect of the Invention
[0031] The mapping 3D model slicing method, printing method, apparatus and device provided in the embodiments of the present application include: for a mapping 3D model, analyzing the mapping 3D model file to obtain each polygon patch, at least one polygon patch includes texture information of the mapping 3D model; using a slicing plane to slice each polygon patch, and connecting each intersection from beginning to end to obtain an outer contour line corresponding to the slicing plane; then shrinking the outer contour line to obtain a contour area, and filling the contour area; and then generating full-color picture data for coloring each contour area based on the texture information, and performing 3D printing based on the full-color picture data, so as to directly obtain a colorful mapping 3D model entity, thereby realizing automatic color printing of the mapping 3D model, and improving the printing efficiency and quality of the mapping 3D model. [Brief description of the drawings]
[0032] The drawings herein are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application, and together with the specification serve to explain the principles of the present invention. [Figure 1] FIG. 2 is a diagram of an application scene of the mapping 3D model slicing method provided by an embodiment of the present application. [Diagram 2] 1 is a flowchart of a method for slicing a mapping 3D model provided by one embodiment of the present application; [Diagram 3] FIG. 3 is a schematic diagram of a polygon patch in the embodiment shown in FIG. 2 of the present application. [Figure 4]FIG. 4 is a schematic diagram of polygon patch P intersecting a slice plane in the embodiment shown in FIG. 3 of the present application; [Diagram 5] 3 is a flowchart of step S201 in the embodiment shown in FIG. 2 of the present application. [Figure 6] FIG. 4 is a schematic diagram of polygon patch sampling in the embodiment shown in FIG. 3 of the present application. [Figure 7] 4 is a flowchart of a method for slicing a mapping 3D model provided by another embodiment of the present application; [Figure 8] FIG. 8 is a schematic diagram of a contour region in the embodiment shown in FIG. 7 of the present application. [Figure 9] FIG. 8 is another schematic diagram of the contour region in the embodiment shown in FIG. 7 of the present application. [Figure 10] 1 is a flowchart of a method for printing a mapping three-dimensional model provided by one embodiment of the present application. [Figure 11] FIG. 2 is a structural schematic diagram of a mapping 3D model slicing device provided by one embodiment of the present application; [Figure 12] 1 is a structural schematic diagram of a three-dimensional printing device provided according to one embodiment of the present application. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0033] Specific embodiments of the present application are illustrated by means of the figures above and will be described in more detail below. These figures and textual description are not intended to limit the scope of the concepts of the present application in any way, but are intended to explain the concepts of the present application to those skilled in the art by reference to specific embodiments.
[0034] Exemplary embodiments will now be described in detail, examples of which are shown in the drawings. When describing the drawings hereinafter, the same numerals in different drawings refer to the same or similar elements unless otherwise specified. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods that are compatible with certain aspects of the present application, as detailed in the appended claims.
[0035] The technical solution of the present application and how the technical solution of the present application solves the above technical problems are described in detail below using specific examples. Some specific examples below may be combined with each other, and some examples may not describe the same or similar concepts or processes. The following examples are described with reference to the drawings.
[0036] Hereinafter, application scenes of the embodiments of the present application will be described.
[0037] 1 is a diagram of an application scene of the slicing method of a mapping 3D model provided by an embodiment of the present application. As shown in FIG. 1, a 3D printing system 100 generally includes a modeling platform 110 and a 3D printer 120. The modeling platform 110 is installed with modeling software such as 3Dmax software and slicing software such as S3D software. A designer can generate 3D model data using the modeling software, and slice the 3D model data based on the slicing software to obtain print data that can be recognized and executed by the 3D printer 120, thereby realizing the printing of the 3D model. It can be understood that the modeling software and / or the slicing software can be integrated into the 3D printer to integrally realize functions such as modeling, slicing, and printing.
[0038] The mapping 3D model needs to embody the texture mapping of the 3D object on the surface of the printed 3D model, so that the printed 3D model is closer to the real thing and the realism of the 3D model is improved. In the prior art, the mapping 3D model tends to first print a 3D model that does not include texture mapping, such as a white 3D model, and then manually color or map the 3D model to obtain a colorful 3D model. The above mapping 3D model has poor printing efficiency, takes a long time to map, and cannot directly print the color of the mapping 3D model.
[0039] In order to realize color printing of a mapping 3D model and improve printing efficiency, the present application provides a slicing method for a mapping 3D model, which analyzes a mapping 3D model file to obtain each polygon patch containing texture information, slices each polygon patch to obtain each outer contour line, and obtains a contour area based on the outer contour line, and generates full-color picture data for coloring the contour area based on the above texture information, so that the full-color printing of the mapping 3D model is realized based on the full-color picture data corresponding to each contour area, and the automation degree and efficiency of mapping 3D model printing are improved.
[0040] 2 is a flowchart of a slicing method for a mapping 3D model provided by an embodiment of the present application. The slicing method for a mapping 3D model can be applied to a 3D printing device or a 3D printing system. As shown in FIG. 2, the slicing method for a mapping 3D model provided by the present embodiment includes steps S201 to S204.
[0041] In step S201, a mapping 3D model file is analyzed to obtain each polygon patch for representing the mapping 3D model.
[0042] At least one of the polygon patches includes texture information of the mapping three-dimensional model. The texture information is information for describing the color value of each point, for example, grayscale value, color value, and may be represented using a color model such as RGB, YUV, etc. The mapping three-dimensional model file may be stored in a memory of the three-dimensional printing device, or may be transmitted to the three-dimensional printing device from outside, for example, stored in the memory of the three-dimensional printing device via a network, an interface, or the like. In the mapping three-dimensional model file, the shape and range in a three-dimensional coordinate system of at least a part of a three-dimensional geometric model of an object, including at least a part of the object, such as a solid part, may be defined.
[0043] Polygon patches are used to describe the texture and contours of the surface of the mapping 3D model, and may contain spatial coordinates and texture information of the corresponding portion of the mapping 3D model. Polygon patches may be shapes such as triangles or quadrilaterals.
[0044] In some embodiments, the keywords to analyze in the mapping 3D model file include vertex space coordinates v, vertex texture coordinates vt, polygon index f, texture library mtllib, diffuse kd, and the like.
[0045] Furthermore, a texture correspondence between the spatial coordinates of each point on each polygon patch of the mapping 3D model and the corresponding texture information can be established, so that in a subsequent step, the texture information of each point is easily determined.
[0046] In step S202, a slicing plane is used to slice each of the polygon patches to obtain at least one outer contour corresponding to the slicing plane.
[0047] The slicing direction corresponding to the slicing planes can be in the X, Y, or Z axis direction, and there is a fixed interval between adjacent slicing planes. Each point on the outer contour is an intersection point of the corresponding slicing plane with the polygon patch. The slicing planes define each slice to be generated in a single layer of fabrication, and the contours define the shape, extent, and texture information of the solid part of the slice.
[0048] Specifically, each slice plane is used to slice the polygon patch, thereby obtaining the intersection points between the slice plane and the polygon patch, and each intersection point is connected from beginning to end to obtain each outer contour line corresponding to each slice plane.
[0049] Furthermore, one slice plane may correspond to one outer contour line or to multiple outer contour lines.
[0050] Optionally, the step of slicing each of the polygon patches based on a slicing plane to obtain at least one outer contour line may include: The method includes the steps of: performing an intersection operation between the polygon patch and the slice plane to obtain each intersection point; and connecting each intersection point from start to finish to obtain at least one of the outer contour lines.
[0051] Specifically, for each slice plane, the intersection between the slice plane and each polygon patch is obtained by determining the intersection between the slice plane and each polygon patch, and by connecting the intersections between each polygon patch and the slice plane from beginning to end, the outer contour corresponding to the polygon patch and the slice plane can be obtained.
[0052] Illustratively, Fig. 3 is a schematic diagram of a polygon patch in the embodiment shown in Fig. 2 of the present application. As shown in Fig. 3, Fig. 3 takes the case where the polygon patch is a triangular patch as an example, and the triangular patch P includes a number of vertices P0, P1, and P2, and the vertex P0 has spatial coordinates (X0, Y0, Z0) and texture information (U0, V0), the vertex P1 has spatial coordinates (X1, Y1, Z1) and texture information (U1, V1), and the vertex P2 has spatial coordinates (X2, Y2, Z2) and texture information (U2, V2). Fig. 4 is a schematic diagram of the polygon patch P in the embodiment shown in Fig. 3 of the present application being sliced by a slice plane, and as shown in Fig. 4, the slice direction of the slice plane in Fig. 4 is the Z-axis direction, and the polygon patch P intersects with the slice plane Q at points M and N. If the intersection points between the slice plane and the multiple polygon patches are connected from beginning to end, an outer contour line corresponding to the slice plane is obtained.
[0053] In step S203, a contour area is obtained according to the at least one outer contour line, and the contour area is filled.
[0054] Specifically, the outer contour line defines a texture representation corresponding to a mapping thickness of one voxel, and using only the contour line to describe the mapping three-dimensional model is incomplete, so the contour line needs to be expanded to obtain the corresponding contour area. The contour area defines a texture representation of the mapping three-dimensional model corresponding to a slice of a given mapping thickness, and using the contour area to describe the mapping three-dimensional model ensures the completeness of the mapping pattern and improves the printing quality.
[0055] Specifically, the mapping thicknesses corresponding to different contour regions may be the same, i.e., each contour region corresponds to one constant mapping thickness, or the mapping thicknesses corresponding to different contour regions may be different, i.e., each outer contour line extends into each contour region of a variable mapping thickness.
[0056] Specifically, filling the contour area means assigning texture information to each point in the contour area and obtaining a printing pass corresponding to each slice plane, and the filled contour area becomes the outer layer corresponding to the mapping of the mapping 3D model.
[0057] Furthermore, the contour region can be filled based on a preset algorithm, which can be a direction parallel fill algorithm, a contour parallel fill algorithm, a complementary color fill algorithm, and so on.
[0058] Specifically, each contour area can be filled based on a complementary color filling algorithm, and the specific steps are to distinguish between contour areas and non-contour areas, perform color filling on the contour areas, and fill the non-contour areas corresponding to the contour areas, i.e., the fill areas, with the complementary color of the color of the contour area.
[0059] Illustratively, the outlined areas are filled with a black color and the non-outlined areas are filled with a white color.
[0060] In step S204, full-color picture data for coloring the filled outline region is generated according to the texture information.
[0061] Specifically, texture information of each point is determined according to the spatial coordinates of each point on the contour area, and the above-mentioned full-color picture data is generated based on the texture information of each point, thereby coloring the contour area based on the full-color picture data, and a full-color mapping three-dimensional model can be obtained by three-dimensional printing.
[0062] Furthermore, before obtaining the full-color picture data, the method includes a step of determining a size and a resolution of the full-color picture according to hardware parameters of the three-dimensional printing system, the hardware parameters being a size of the printable area, a resolution of the three-dimensional printer, andInkjet Head D The method further includes a step of including parameters such as a layout, etc. This allows the contour region to be associated with the full-color picture based on the size and resolution of the full-color picture, and obtains full-color picture data corresponding to the full-color picture.
[0063] The mapping 3D model slicing method provided by the embodiment of the present application includes: analyzing a mapping 3D model file for a mapping 3D model to obtain each polygon patch, at least one polygon patch including texture information of the mapping 3D model; slicing each polygon patch using a slicing plane, connecting each intersection from beginning to end to obtain an outer contour line corresponding to the slicing plane; contracting the outer contour line to obtain a contour area, and filling the contour area; and generating full-color picture data for coloring each contour area based on the texture information. 3D printing is performed based on the full-color picture data, so that a colorful mapping 3D model entity can be directly obtained, and automatic color printing of the mapping 3D model can be realized, and the printing efficiency and quality of the mapping 3D model are improved.
[0064] Optionally, FIG. 5 is a flowchart of step S201 in the embodiment shown in FIG. 2 of the present application, and as shown in FIG. 5, step S201 includes steps S2011 to S2013.
[0065] In step S2011, the mapping 3D model file is obtained.
[0066] The mapping 3D model file includes a texture library of the mapping 3D model, vertex coordinates of each vertex, and a polygon index. The mapping 3D model file can be in a format such as OBJ (Object, target file format), PLY (Polygon File Format, polygon file format), AMF (Action Message Format, operation message format), etc.
[0067] Specifically, the mapping 3D model file can be automatically obtained through a preset interface of the modeling software, which can be installed in the modeling platform of the 3D printing system, or the user can manually upload the mapping 3D model file to the 3D printing system or 3D printer.
[0068] In step S2012, the spatial coordinates of each vertex of each of the polygon patches are determined according to the vertex coordinates and the polygon index.
[0069] The vertex coordinates may include the texture coordinates of the vertices in addition to the spatial coordinates of the vertices. The spatial coordinates are used to describe the position information of each vertex in the mapping 3D model. The texture coordinates are used to describe the position information of each vertex in the texture image of the mapping 3D model. The polygon index is used to index the vertices corresponding to each polygon patch, and each polygon patch is assigned according to the polygon index. patch You can get the spatial and texture coordinates of the vertices.
[0070] In step S2013, the texture library is traversed according to the polygon index to obtain texture information for each vertex of each of the polygon patches.
[0071] The texture library contains texture files or texture information that correspond to each vertex of each polygon patch.
[0072] Specifically, based on the polygon index, the texture library can be traversed according to the spatial coordinates of each vertex to search for texture information that matches the spatial coordinates of the vertices.
[0073] Furthermore, a texture library can be searched based on the polygon index to determine whether a texture file corresponding to the current polygon patch exists; if not, the color value of each vertex of the polygon patch is set to white; if present, the color value of each vertex of the polygon patch is determined based on the texture file.
[0074] Selectively ,before The step of traversing the texture library according to the polygon index and obtaining texture information for each vertex of each of the polygon patches includes: determining a texture file corresponding to each of the polygon patches according to the polygon index; for each vertex of each of the polygon patches, if the vertex coordinates of the vertex include vertex texture coordinates, obtaining a texture image in the texture file and determining texture information of the vertex from the texture image according to the vertex texture coordinates of the vertex; and / or, for each vertex of each of the polygon patches, if the vertex coordinates of the vertex do not include vertex texture coordinates, obtaining a diffuse light color value in the texture file; The diffuse light color value is determined as texture information of the vertex. Includes steps.
[0075] A texture file is a file that contains texture information that describes each vertex.
[0076] Specifically, a texture file corresponding to each vertex can be determined based on the spatial coordinates or vertex coordinates of the vertex and the above-mentioned polygon index. If the vertex coordinates of the vertex include the vertex texture coordinates of the vertex, a corresponding texture image is directly extracted from the texture file based on the vertex texture coordinates, and texture information of the vertex is determined according to the texture image. However, if the vertex coordinates do not include the vertex texture coordinates, that is, it is indicated that the texture information of the point is not specified by the mapping three-dimensional model, default texture information can be used as the texture information of the vertex, that is, the diffuse light color value in the corresponding texture file can be used as the texture information of the vertex.
[0077] The correspondence relationship between each vertex's spatial coordinate, vertex texture coordinate, and color value is determined by the above indexing and traversal steps, so that in subsequent steps, the color value of each point can be quickly located based on the vertex's spatial coordinate, and the generation speed of full-color picture data is improved, thereby improving the printing speed.
[0078] Specifically, taking the mapping three-dimensional model file in OBJ format as an example, the step of analyzing the mapping three-dimensional model file is specifically as follows: Mapping 3D Model A step of checking whether the file format of the file is correct using a file name suffix; if so, mapping three-dimensional Model The method includes the steps of: reading the content of the file line by line; determining the keyword at the beginning of each line and performing corresponding operations according to the keyword, including operations such as extracting texture information, reading vertex spatial coordinates, reading vertex texture coordinates, and reading polygon index; and determining whether the line is the last line of the mapping 3D model file, and if so, the analysis is completed and the current OBJ format mapping 3D model file is closed.
[0079] In the operation of extracting texture information, if the keyword is mtllib, a texture file with a .mtl suffix is opened, the content of the texture file is read line by line, and if the keyword at the beginning of the line is a first keyword, the texture image following the first keyword is loaded into memory and texture information is determined based on the texture image, but if the keyword at the beginning of the line is a second keyword, the diffuse light color value following the second keyword is loaded into memory and the color value of the corresponding vertex is determined as the diffuse light color value.
[0080] In an operation to read the spatial coordinates of a vertex, if the keyword is v, it indicates that this line represents the spatial coordinates of a vertex, and in this case, the three floating-point numbers following the keyword can be stored in the spatial coordinate container as the X, Y, and Z values of the spatial coordinates of the vertex, respectively.
[0081] For operations that read vertex texture coordinates, the keyword vt indicates that this line represents the vertex texture coordinates of the vertex, and in this case the two floating-point numbers following the keyword are stored in the texture coordinate container as the U and V values of the vertex texture coordinate of the vertex, respectively.
[0082] In the operation of reading a polygon index, if the keyword is f, it indicates that this line represents a polygon patch. In this case, the v / vt pairs of multiple groups following the keyword are analyzed as the spatial coordinate index and texture coordinate index of each vertex that constitutes the polygon patch, the spatial coordinate of the vertex is determined based on the spatial coordinate index, and the vertex texture coordinate of the vertex is determined based on the texture coordinate index.
[0083] In addition, when texture mapping does not exist for some parts of the mapping 3D model, the vertices of the polygon patch corresponding to the part do not include vertex texture coordinates.
[0084] In some embodiments, after obtaining each polygon patch for representing the mapping three-dimensional model, the method further comprises sampling each polygon patch to obtain a point cloud information set, the point cloud information set including spatial coordinates and texture information of each sampling point. Accordingly, generating full-color picture data for coloring the filled contour region according to the texture information comprises: determining a color value of each point in the filled contour region according to the point cloud information set and corresponding spatial coordinates of each point in the filled contour region; and generating full-color picture data for coloring the filled contour region according to the color value of each point in the filled contour region.
[0085] The point cloud information set includes the spatial coordinates and texture information of each sampling point.
[0086] Specifically, the division sampling for each polygon patch includes sampling for each side of the polygon patch and sampling for the interior of the polygon patch, and the sampling algorithm for the points on each side of the polygon patch may be different from the sampling algorithm for the points inside the polygon patch.
[0087] For example, FIG. 6 is a schematic diagram of the polygon patch sampling in the embodiment shown in FIG. 3 of the present application. As shown in FIG. 6, the spatial coordinates of each vertex P0, P1, and P2 of the triangular patch P are obtained by the above analysis process, and can be expressed as 0.05 mm, 0.03 mm, or other values. SamplingA length interval is preset, and a linear interpolation algorithm is used to sample each side of the triangular patch to obtain the spatial coordinates of each sampling point, and an internal point algorithm is used to calculate the spatial coordinates of each sampling point within the triangular patch. The smallest rectangle that can contain the triangular patch is found, and the rectangle is divided according to the length interval at the time of sampling to sequentially determine whether each point is within or on the triangular patch, and for each point within or on the triangular patch, the spatial coordinates of the point are calculated.
[0088] Then, a color value of each sampling point is obtained, and the color value can be determined from the spatial coordinates and the texture library. If the texture library does not include a texture file for the polygon patch, or if the vertex coordinates of the polygon patch do not include vertex texture coordinates, the color value of each sampling point in the polygon patch is the same as the color value of the vertices of the polygon patch. However, if the texture library includes a texture file for the polygon patch and the vertices of the polygon patch include vertex texture coordinates, the sampling point texture coordinates of the sampling point can be determined in accordance with the vertex texture coordinates of the vertices. Thus, based on the sampling point texture coordinates, a corresponding color value from the texture image is determined as the texture information of the sampling point.
[0089] For example, as shown in Figures 3 and 4, in a calculation method of the texture coordinates of a sampling point p, first the area of a triangular patch P is calculated using the following equation (1), and then the components of each side of the triangular patch of the sampling point p are calculated using the following equations (2), (3), and (4), in that case the spatial coordinates of the sampling point p are given by the following equation (5), and the sampling point texture coordinates may be given by the following equation (6).
number
[0090] In some embodiments, after obtaining each polygon patch for representing the mapping three-dimensional model, the method further includes: for each polygon patch, determining adjacent polygon patches of each of the polygon patches, where the adjacent polygon patches contact the polygon patch at one side of the polygon patch; and generating a polygon topology according to each polygon patch and each of its corresponding adjacent polygon patches. Accordingly, slicing each of the polygon patches based on a slicing plane to obtain at least one outer contour line includes: slicing each of the polygon patches using the slicing plane, obtaining intersection points between the slicing plane and each of the polygon patches, and determining a connection order of each of the intersection points according to the polygon topology, and obtaining at least one outer contour line corresponding to the slicing plane.
[0091] Specifically, first, the intersection point between the first polygon patch and one slice plane is obtained, and then the intersection points between each polygon patch and the slice plane can be sequentially connected in order of adjacent polygon patches, so that the mapping three-dimensional model is obtained. Manifold If it matches the patch, it returns to the starting point, which is the first intersection, and a closed outer contour is formed. However, if there is a structure such as a hole, the mapping 3D model connects the intersections of each polygon patch individually from beginning to end to obtain the outer contour corresponding to each polygon patch, as shown in Figure 4.
[0092] By constructing a polygon topology, the speed at which the outer contour is determined is accelerated, thus improving the efficiency of three-dimensional printing.
[0093] FIG. 7 is a flowchart of a slicing method for a mapping 3D model provided by another embodiment of the present application. The slicing method for a mapping 3D model provided by this embodiment is based on the embodiment shown in FIG. 2 and further subdivides steps S202, S203, and S204. As shown in FIG. 7, the slicing method for a mapping 3D model provided by this embodiment includes steps S701 to S712.
[0094] In step S701, a mapping 3D model file is analyzed to obtain each polygon patch for representing the mapping 3D model.
[0095] In step S702, each polygon patch is grouped and sorted according to the spatial coordinates of the layering direction corresponding to the polygon patch, to obtain a grouping relationship matrix.
[0096] The grouping relationship matrix includes the polygon patches of each group corresponding to each slice plane. The layering direction is generally the Z-axis direction, but the X-axis or Y-axis direction may also be used.
[0097] Specifically, for each slice plane, the polygon patches intersecting the slice plane are grouped and sorted according to the spatial coordinate values corresponding to the layering direction to obtain a group of polygon patches corresponding to the slice plane.
[0098] Furthermore, a number in the corresponding group of each polygon patch can be determined according to the value of the spatial coordinate corresponding to the layering direction, and the smaller the value of the spatial coordinate, the smaller the corresponding number.
[0099] By iterating through all the polygon patches, the grouping relationship matrix can be constructed using the layer number of the slice plane and the group number corresponding to the slice plane as an index, in which each polygon patch in the group corresponding to the slice plane of each layer is described.
[0100] For example, Table 1 is a grouping relationship matrix table in the embodiment shown in FIG. 7 of the present application. As shown in Table 1, in the grouping relationship matrix, a set or group of polygon patches corresponding to the slice plane of each layer is described, and the polygon patches of each group are sorted in ascending order of the spatial coordinate values corresponding to the slice direction, i.e., the polygon patch f ia The Z value of f ib is smaller than the Z value of a, where a is smaller than b.
[0101] [Table 1]
[0102] In step S703, an intersection operation is performed on the polygon patches of each group with the corresponding slice plane to obtain each intersection point.
[0103] In step S704, each of the intersection points is connected from beginning to end to obtain at least one of the outer contour lines corresponding to the slicing plane.
[0104] In step S705, each of the outer contours is shrunk to obtain an inner contour based on a predetermined mapping thickness.
[0105] The predetermined mapping thickness may be set by a user or may utilize a default value, and the present application does not limit the value of the predetermined mapping thickness.
[0106] Specifically, after each outer contour line is obtained, each outer contour line is contracted inward by a predetermined mapping thickness to obtain an inner contour line corresponding to each outer contour line.
[0107] In step S706, each of the outer contours The corresponding area of for the corresponding inner contour The corresponding area of and perform an exclusive OR operation with the above to obtain each of the contour regions.
[0108] Specifically, the contour area is composed of corresponding areas of the inner contour and corresponding areas of the outer contour as one group, and the contour area can be obtained by performing an exclusive OR operation between the corresponding areas of the outer contour and the corresponding areas of the inner contour.
[0109] For example, FIG. 8 is a schematic diagram of the contour area in the embodiment shown in FIG. 7 of the present application. As shown in FIG. 8, the outer contour corresponding to the intersection between the polygon patch and the slice plane is C1, and the outer contour C1 is contracted inward to obtain the inner contour C2, and the contour area A1 is the area between the outer contour C1 and the inner contour C2.
[0110] Furthermore, in order to ensure that all mapping patterns are complete when the printed mapping three-dimensional model is viewed from various angles, it is necessary to determine contour regions of variable mapping thickness. Optionally, after the step of shrinking each of the outer contour lines to obtain an inner contour line based on a predetermined mapping thickness, the method further includes the step of obtaining, for each outer contour line, an associated outer contour line corresponding to each of a predetermined number of slicing planes above and below the slicing plane corresponding to the outer contour line based on the predetermined mapping thickness and a predetermined slicing thickness. Correspondingly, each of the outer contour lines The corresponding area of for the corresponding inner contour The corresponding area of and the step of obtaining each of the contour segments is performed by performing an exclusive OR operation with the inner contour The corresponding area of For each of the associated outer contours The corresponding area of and the corresponding outer contour line The corresponding area of and performing an exclusive OR operation with the contour region to obtain each of the contour regions.
[0111] The predetermined number may be the number of slice planes corresponding to the predetermined mapping thickness, or may be a positive integer corresponding to the ratio between the predetermined mapping thickness and the slice thickness. The related outer contour lines are the outer contour lines located in other slice planes within the same predetermined mapping thickness that are in the vicinity of the current outer contour line.
[0112] The outer contours of the slice planes above and below the current slice plane, i.e., the associated outer contours, The corresponding area of For each associated outer contour The corresponding area of The inner contour is modified by performing a NOR operation with , to obtain a new inner contour that may be shrunk further inwards. The corresponding area of and the outer contour The corresponding area of The contour area is obtained based on an exclusive OR operation with
[0113] The mapping three-dimensional model is formed by stacking multiple slice layers, and if the mapping thickness is insufficient or the contour range of the upper and lower slices is too small, it is likely to cause exposure of the object's interior, i.e., incomplete mapping pattern, so it is necessary to adjust the outer contours of the upper and lower layers, i.e., the inner contour of the slice plane of the current layer based on the associated outer contours, thereby obtaining a contour area of variable mapping thickness.
[0114] For example, FIG. 9 shows the outline area of the embodiment shown in FIG. other This is a schematic diagram, and as can be seen by referring to Figures 8 and 9, in this embodiment, in addition to the inner contour C2 and outer contour C1 of Figure 8, one associated outer contour C3 is also included, and the associated outer contour C3 is an outer contour where a slice plane above or below the slice plane of the outer contour C1 intersects with a polygon patch. After performing a NEXOR operation on the area corresponding to the inner contour C2 and the area corresponding to the associated outer contour C3, a new inner contour is obtained, and thus a new contour area A2 is obtained, and the contour area A2 is increased by an additional contour area A3 compared to the contour area A1 of Figure 8.
[0115] In step S707, the contour region is filled based on a complementary color filling algorithm.
[0116] In step S708, the filled outline region is associated with the picture according to the resolution of the picture.
[0117] The picture is a picture for printing a mapping three-dimensional model, and may be a picture of the maximum outer contour line provided by three-dimensional printing that can accommodate said mapping three-dimensional model.
[0118] Specifically, after each contour region is obtained, each contour region is associated with a picture according to the resolution of the picture.
[0119] Specifically, the size and resolution of the picture can be determined according to the hardware parameters of the 3D printing system, such as the size of the printable area, the resolution of the 3D printer, and Inkjet Head D Includes parameters such as placement.
[0120] Furthermore, the contour region can be mapped into the picture based on the position of the polygon patch corresponding to the contour region and the resolution of the picture.
[0121] In step S709, pixel coordinates of each pixel point in the picture of the filled contour region are obtained.
[0122] The pixel coordinates are, ie, the position of the corresponding pixel point in the picture for each point in the contour region.
[0123] In step S710, the spatial coordinates of each point of the filled contour region are determined according to the corresponding pixel coordinates of each point of the filled contour region.
[0124] Specifically, when filling a contour area, the contour area and non-contour area (filled area) are filled with different colors, so that it is possible to determine whether each pixel point is a point in the contour area according to the pixel value or color value of each pixel point.
[0125] For each pixel point belonging to the contour region, the spatial coordinates of the point in the contour region corresponding to the pixel point can be determined according to the pixel coordinates of the pixel point and the resolution of the picture.
[0126] In step S711, a color value of each pixel point in the picture of the filled contour region is determined according to the spatial coordinates of each point in the filled contour region and the texture information.
[0127] Specifically, after determining the spatial coordinates of the points in the contour region corresponding to each pixel point, for each pixel point, a target point closest to the spatial coordinates corresponding to that pixel point is searched for among all polygon patches based on the spatial coordinates corresponding to that pixel point, and the texture information or color value of the target point is set as the color value of that pixel point.
[0128] Furthermore, the point cloud information can be collected to search for the color value of each pixel point.
[0129] Furthermore, if it is determined that the pixel point does not belong to the contour region, for example, the color value of the pixel point can be set to a color value corresponding to the color white.
[0130] By iterating through each pixel point in the picture, the color value of each pixel point is determined.
[0131] In step S712, full color picture data is generated for coloring the filled contour region according to the color values of each pixel point in the picture of the filled contour region.
[0132] In this embodiment, the mapping three-dimensional model is analyzed to obtain each polygon patch, and then each polygon patch is sliced based on a slice plane to obtain each outer contour line, and the outer contour line is contracted to obtain the corresponding inner contour line, and thus obtain the contour area. In order to improve the completeness of the mapping pattern, the inner contour line is modified based on the outer contour lines of multiple adjacent slice planes to realize a contour area with a variable mapping thickness, and further, a complementary color is obtained. Filling Algorithm The contour area is filled based on the pixel value of each pixel point in the picture and the resolution of the picture, and the spatial coordinates of each pixel point are determined based on the pixel value of each pixel point in the picture and the resolution of the picture. Then, a color value of each pixel point is determined based on the spatial coordinates to obtain full-color picture data. Thus, when three-dimensional printing is performed on the mapping three-dimensional model based on the full-color picture data, a full-color mapping three-dimensional model can be obtained by coloring each contour area, and color, automatic printing of the mapping three-dimensional model can be realized, with high printing efficiency and high accuracy.
[0133] FIG. 10 is a flowchart of a mapping three-dimensional model printing method provided by one embodiment of the present application. The mapping three-dimensional model printing method provided by this embodiment is applied to a three-dimensional printer. As shown in FIG. 10, the mapping three-dimensional model printing method provided by this embodiment includes steps S1001 to S1002.
[0134] In step S1001, slice image data is acquired.
[0135] The slice image data includes full-color picture data generated according to the mapping 3D model slicing method provided by any embodiment corresponding to FIG. 2, FIG. 5, and FIG. 7 of the present application.
[0136] In step S1002, print control data is generated in accordance with the slice image data, and a mapping three-dimensional model is printed based on the print control data.
[0137] The mapping 3D model printing method provided by the embodiment of the present application realizes full-color, automatic printing of mapping 3D models, with high printing efficiency and high accuracy.
[0138] FIG. 11 is a structural schematic diagram of a mapping 3D model slicing device provided by one embodiment of the present application. As shown in FIG. 11, the mapping 3D model slicing device provided by this embodiment includes an analysis module 1110, a contour line acquisition module 1120, a contour filling module 1130, and a full-color picture generation module 1140.
[0139] An analysis module 1110 is used to analyze a mapping 3D model file and obtain each polygon patch for representing the mapping 3D model, at least one of the polygon patches includes texture information of the mapping 3D model; a contour acquisition module 1120 is used to slice each of the polygon patches using a slice plane and obtain at least one outer contour line corresponding to the slice plane; a contour filling module 1130 is used to obtain a contour area according to the at least one outer contour line and fill the contour area; and a full-color picture generation module 1140 is used to generate full-color picture data for coloring the filled contour area according to the texture information.
[0140] Optionally, the contour filling module 1130: A contour area obtaining unit for obtaining a contour area according to the at least one outer contour line, and a filling unit for filling the contour area.
[0141] Optionally, the contour area obtaining unit is a shrinking subunit for shrinking each of the outer contour lines to obtain an inner contour line based on a predetermined mapping thickness; The corresponding area of for the corresponding inner contour The corresponding area of and a contour area obtaining subunit for performing an exclusive OR operation with the contour area obtaining subunit to obtain each of the contour areas.
[0142] Optionally, the apparatus further comprises: and shrinking each of the outer contour lines to obtain an inner contour line based on a predetermined mapping thickness, and then, for each outer contour line, obtaining associated outer contour lines corresponding to a predetermined number of slice planes above and below the slice plane corresponding to the outer contour line based on the predetermined mapping thickness and a predetermined slice thickness. line It further includes an acquisition module.
[0143] In response to this, the contour area acquisition subunit specifically: The inner contour The corresponding area of For each of the associated outer contours The corresponding area of and the corresponding outer contour line The corresponding area of and used to obtain each of the contour regions.
[0144] Optionally, the full-color picture generation module 1140 specifically: The method is used for associating the filled contour area with the picture according to a resolution of a picture; obtaining pixel coordinates of each pixel point in the picture of the filled contour area; determining spatial coordinates of each point of the filled contour area according to the corresponding pixel coordinates of each point of the filled contour area; determining color values of each pixel point in the picture of the filled contour area according to the spatial coordinates of each point in the filled contour area and the texture information; and generating full-color picture data for coloring the filled contour area according to the color values of each pixel point in the picture of the filled contour area.
[0145] Optionally, the analysis module 1110: The method includes: a file acquisition unit for acquiring the mapping 3D model file, the mapping 3D model file including a texture library of the mapping 3D model, a vertex coordinate of each vertex, and a polygon index; an indexing unit for determining spatial coordinates of each vertex of each of the polygon patches according to the vertex coordinates and the polygon index; and a texture information determination unit for circulating the texture library according to the polygon index and acquiring texture information of each vertex of each of the polygon patches.
[0146] Optionally, the texture information determining unit specifically comprises: determining a texture file corresponding to each of the polygon patches according to the polygon index; for each vertex of each of the polygon patches, if the vertex coordinates of the vertex include vertex texture coordinates, obtaining a texture image in the texture file and determining texture information of the vertex from the texture image according to the vertex texture coordinates of the vertex; and / or, for each vertex of each of the polygon patches, if the vertex coordinates of the vertex do not include vertex texture coordinates, obtaining a diffuse light color value in the texture file; The diffuse light color value is determined as texture information of the vertex. It is used in this sense.
[0147] Optionally, the contour acquisition module 1120: The system includes an intersection point acquisition unit for performing an intersection operation between each of the polygon patches and the slice plane to obtain each intersection point, and a contour line acquisition unit for connecting each of the intersection points from beginning to end to obtain at least one of the outer contour lines.
[0148] Optionally, the apparatus further comprises: The present invention further includes a grouping and sorting module for performing an intersection operation on the polygon patches with the slice planes before obtaining each intersection point, grouping and sorting each of the polygon patches according to spatial coordinates in a layering direction corresponding to the polygon patches to obtain a grouping relationship matrix, wherein the grouping relationship matrix includes the polygon patches of each group corresponding to each of the slice planes.
[0149] In response to this, the intersection acquisition unit specifically: The polygon patches of each group are used to perform an intersection operation with the corresponding slice plane to obtain intersection points.
[0150] Optionally, the apparatus further comprises: The method further includes a point cloud information set acquisition module for sampling each of the polygon patches to obtain a point cloud information set after obtaining each polygon patch to represent the mapping three-dimensional model, wherein the point cloud information set includes spatial coordinates and texture information of each sampling point.
[0151] In response, the full-color picture generation module 1140 specifically: It is used for determining a color value of each point in the filled contour region according to the point cloud information set and the corresponding spatial coordinates of each point in the filled contour region, and generating full-color picture data for coloring the filled contour region according to the color value of each point in the filled contour region.
[0152] Optionally, the apparatus further comprises: The method further includes a topology generation module for: after obtaining each polygon patch for representing the mapping three-dimensional model, determining, for each polygon patch, an adjacent polygon patch of each of the polygon patches, where the adjacent polygon patch contacts the polygon patch at one side of the polygon patch; and generating a polygon topology according to each polygon patch and its corresponding adjacent polygon patch.
[0153] In response to this, the contour acquisition module 1120 specifically: The method is used to slice each of the polygon patches using the slice plane to obtain intersections between the slice plane and each of the polygon patches; and determine a connection order of each of the intersections according to the polygon topology to obtain at least one outer contour line corresponding to the slice plane.
[0154] Optionally, the fill unit specifically includes: A complementary color filling algorithm is used to fill the contour area.
[0155] The mapping 3D model slicing device provided by an embodiment of the present application can execute the mapping 3D model slicing method provided by any embodiment corresponding to Figures 2, 5, and 7 of the present application, and has functional modules and beneficial effects according to the execution of the method.
[0156] FIG. 12 is a structural schematic diagram of a three-dimensional printing device provided according to one embodiment of the present application. As shown in FIG. 12, the three-dimensional printing device includes a memory 1210, a processor 1220, and a computer program.
[0157] The computer program is stored in the memory 1210 and configured to be executed by the processor 1220 to realize the method for slicing a mapping three-dimensional model provided by any of the embodiments corresponding to Figures 2, 5, and 7 of the present application, and / or the method for printing a mapping three-dimensional model provided by the embodiment shown in Figure 10.
[0158] The memory 1210 and the processor 1220 are connected by a bus 1230 .
[0159] The relevant descriptions can be understood with reference to the relevant descriptions and effects corresponding to the steps in FIG. 2, FIG. 5, FIG. 7, and FIG. 10, and therefore will not be further described here.
[0160] One embodiment of the present application provides a computer-readable storage medium having a computer program stored therein, which, when executed by a processor, realizes a method for slicing a mapping three-dimensional model provided by any of the embodiments corresponding to Figures 2, 5, and 7 of the present application, and / or a method for printing a mapping three-dimensional model provided by the embodiment shown in Figure 10.
[0161] The computer readable storage medium may be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and so on.
[0162] One embodiment of the present application provides a computer program product including a computer program, which, when executed by a processor of a three-dimensional printing device, controls a mapping three-dimensional model slicing apparatus to realize a mapping three-dimensional model slicing method provided by any of the embodiments corresponding to Figures 2, 5, and 7 of the present application, and / or a mapping three-dimensional model printing method provided by the embodiment shown in Figure 10.
[0163] The processor may be an integrated circuit chip having a signal processing capability. The above-mentioned processor may be a general-purpose processor including a central processing unit (abbreviated as CPU), a network processor (abbreviated as NP), etc., and may realize or execute each method, step, and logic block diagram disclosed in the embodiments of the present application. The general-purpose processor may be a microprocessor, or the processor may be any conventional processor, etc.
[0164] In some embodiments provided in the present application, it should be understood that the disclosed apparatus and method can be realized in other ways. For example, the above-mentioned apparatus embodiments are merely exemplary, and for example, the division of modules is merely a logical division of functions, and in actual implementation, it may be performed in a different division manner, for example, multiple modules or components may be combined or integrated into another system, or some features may be omitted or not executed. In addition, the coupling or direct coupling or communication connection between the illustrated or described mutually may be an indirect coupling or communication connection via some interfaces, devices, or modules, and may be in an electrical, mechanical, or other form.
[0165] Other implementations of the present application will be readily contemplated by those skilled in the art upon consideration of this specification and practicing the disclosures set forth herein. This application is intended to cover any modifications, uses or adaptations of the present application that follow the general principles of the present application and include well-known knowledge or customary technical means in the art that are not disclosed herein. The specification and examples are considered to be exemplary only, with a true scope and spirit of the present application being indicated by the following claims.
[0166] It should be understood that the present application is not limited to the exact construction described above and illustrated in the drawings, but various modifications and changes are possible without departing from the scope thereof, which is limited only by the appended claims.
[0167] This application claims priority to a Chinese patent application filed with the China Patent Office on April 27, 2021, bearing application number 202110462298.8 and entitled "Mapping 3D model slicing method, printing method, apparatus and device," the entire contents of which are incorporated herein by reference.
Claims
1. 1. A method for slicing a mapping three-dimensional model, the method comprising: parsing a mapping 3D model file to obtain polygon patches for representing the mapping 3D model, at least one of the polygon patches including texture information of the mapping 3D model; slicing each of said polygon patches using a slicing plane to obtain at least one outer contour corresponding to said slicing plane; obtaining a contour area according to the at least one outer contour line and filling the contour area; generating full-color picture data for coloring the filled outline region according to the texture information; The step of analyzing the mapping three-dimensional model file includes: obtaining the mapping 3D model file, the mapping 3D model file including a texture library, vertex coordinates for each vertex, and polygon index for the mapping 3D model; determining spatial coordinates of each vertex of each of the polygon patches according to the vertex coordinates and the polygon index; and traversing the texture library according to the polygon index to obtain texture information for each vertex of each of the polygon patches; The step of traversing the texture library according to the polygon index and obtaining texture information for each vertex of each of the polygon patches includes: determining a texture file corresponding to each of the polygon patches according to the polygon index; For each vertex of each of the polygon patches, if the vertex coordinates of the vertex include vertex texture coordinates, obtaining a texture image in the texture file and determining texture information of the vertex from the texture image according to the vertex texture coordinates of the vertex; and / or For each vertex of each of the polygon patches, if the vertex coordinates of the vertex do not include a vertex texture coordinate, obtaining a diffuse light color value in the texture file and determining the diffuse light color value as texture information of the vertex. A method for slicing a mapping three-dimensional model, comprising:
2. The step of obtaining a contour area according to the at least one outer contour line includes: shrinking each of the outer contour lines to obtain an inner contour line based on a predetermined mapping thickness; and performing an exclusive-or operation on each of the outer contour regions with a corresponding inner contour region to obtain each of the contour regions.
3. After the step of shrinking each of the outer contour lines to obtain an inner contour line based on a predetermined mapping thickness, the method further comprises: for each outer contour line, obtaining an associated outer contour line corresponding to a predetermined number of slice planes above and below the slice plane corresponding to the outer contour line based on the predetermined mapping thickness and a predetermined slice thickness; Accordingly, the step of performing an exclusive-OR operation on each of the corresponding regions of the outer contour with the corresponding region of the inner contour to obtain each of the contour regions includes:
3. The method of claim 2, further comprising the step of: performing an exclusive-OR operation on the corresponding area of the inner contour with the corresponding area of each of the associated outer contours, and then performing an exclusive-OR operation on the corresponding area of the corresponding outer contour to obtain each of the contour areas.
4. generating full-color picture data for coloring the filled outline region according to the texture information, mapping the filled contour region to the picture according to a resolution of the picture; obtaining pixel coordinates of each pixel point in the picture of the filled contour region; determining spatial coordinates of each point of the filled contour region according to corresponding pixel coordinates of each point of the filled contour region; determining a color value of each pixel point in the picture of the filled contour region according to the spatial coordinates of each point in the filled contour region and the texture information; and generating full color picture data for coloring the filled contour region according to a color value of each pixel point in the picture of the filled contour region.
5. Slicing each of the polygonal patches using a slicing plane to obtain at least one outer contour corresponding to the slicing plane includes: performing an intersection operation with the slice plane for each of the polygon patches to obtain each intersection point; and connecting each of the intersection points from start to finish to obtain at least one of the outer contour lines corresponding to the slicing plane.
6. Prior to the step of performing an intersection operation on the polygon patch with the slice plane to obtain each intersection point, the method further comprises: The method further includes the steps of: grouping each of the polygon patches based on a layer number of each of the slice planes; sorting each of the polygon patches of each group according to a spatial coordinate of a layering direction corresponding to the polygon patch; and obtaining a grouping relationship matrix, the grouping relationship matrix including the polygon patches of each group corresponding to each of the slice planes; Accordingly, the step of performing an intersection operation with the slice plane on the polygon patch to obtain each intersection point includes:
6. The method of claim 5, further comprising performing an intersection operation for each group of polygon patches with a corresponding slice plane to obtain intersection points.
7. After obtaining each polygon patch for representing the mapping three-dimensional model, the method further comprises: Sampling each of the polygon patches to obtain a point cloud information set, the point cloud information set including spatial coordinates and texture information of each sampling point; Accordingly, the step of generating full-color picture data for coloring the filled outline region in accordance with the texture information comprises: determining a color value of each point in the filled contour region according to the point cloud information set and corresponding spatial coordinates of each point in the filled contour region; and generating full-color picture data for coloring the filled contour region according to the color value of each point in the filled contour region.
8. After obtaining each polygon patch for representing the mapping three-dimensional model, the method further comprises: determining, for each polygon patch, a respective adjacent polygon patch of said polygon patch, said adjacent polygon patch contacting said polygon patch at one edge of said polygon patch; generating a polygon topology according to each polygon patch and each of its corresponding neighboring polygon patches; Accordingly, the step of slicing each of the polygonal patches using a slicing plane to obtain at least one outer contour line corresponding to the slicing plane comprises: slicing each of the polygon patches using the slicing plane to obtain an intersection of the slicing plane with each of the polygon patches; and determining a connection order of each of the intersection points according to the polygon topology to obtain at least one outer contour line corresponding to the slice plane.
9. The step of filling the contour region includes:
5. The method according to claim 1, further comprising the steps of: distinguishing between the contour region and the non-contour region; filling the contour region; and filling the non-contour region corresponding to the contour region with a complementary colour to the colour of the contour region.
10. 1. A method for printing a mapping three-dimensional model, the method comprising: acquiring slice image data, said slice image data comprising full-color picture data generated according to the method for slicing a mapping 3D model according to any one of claims 1 to 9; generating print control data in accordance with the slice image data, and printing the mapping three-dimensional model based on the print control data.
11. 1. An apparatus for mapping three-dimensional models, the apparatus comprising: an analysis module for analyzing a mapping 3D model file and obtaining polygon patches representing the mapping 3D model, at least one of the polygon patches including texture information of the mapping 3D model; a contour obtaining module for slicing each of the polygon patches using a slicing plane to obtain at least one outer contour corresponding to the slicing plane; a contour filling module for obtaining a contour area according to the at least one outer contour line and filling the contour area; a full-color picture generation module for generating full-color picture data for coloring the filled-in contour region according to the texture information; The analysis module includes: a file obtaining unit for obtaining the mapping 3D model file, the mapping 3D model file including a texture library, a vertex coordinate of each vertex, and a polygon index of the mapping 3D model; an indexing unit for determining spatial coordinates of each vertex of each of the polygon patches according to the vertex coordinates and the polygon index; a texture information determining unit for traversing the texture library according to the polygon index to obtain texture information for each vertex of each of the polygon patches; The texture information determining unit includes: determining a texture file corresponding to each of the polygon patches according to the polygon index; For each vertex of each of the polygon patches, if the vertex coordinates of the vertex include vertex texture coordinates, obtaining a texture image in the texture file and determining texture information of the vertex from the texture image according to the vertex texture coordinates of the vertex; and / or For each vertex of each of the polygon patches, if the vertex coordinates of the vertex do not include vertex texture coordinates, obtain a diffuse light color value in the texture file and determine the diffuse light color value as texture information of the vertex. An apparatus for mapping three-dimensional models.
12. 1. A three dimensional printing device comprising a memory and at least one processor, The memory stores computer executable instructions, A three-dimensional printing device, characterized in that, when the at least one processor executes computer-executable instructions stored in the memory, the at least one processor performs the method for slicing a mapping three-dimensional model described in any one of claims 1 to 9 and / or the method for printing a mapping three-dimensional model described in claim 10.
13. A computer-readable storage medium having computer-executable instructions stored thereon, the computer-readable storage medium being used to implement the method for slicing a mapping three-dimensional model according to any one of claims 1 to 9 and / or the method for printing a mapping three-dimensional model according to claim 10, when executed by a processor.
Citation Information
Patent Citations
Full-color layered slicing algorithm based on three-dimensional model of texture mapping
CN110757804A
Cross section data creation device, cross section data creation method, and program
JP2017097517A