WO2016173069A1 - Three-dimensional model processing method and apparatus thereof, three-dimensional printing method, and three-dimensional printing device - Google Patents
Three-dimensional model processing method and apparatus thereof, three-dimensional printing method, and three-dimensional printing device Download PDFInfo
- Publication number
- WO2016173069A1 WO2016173069A1 PCT/CN2015/080193 CN2015080193W WO2016173069A1 WO 2016173069 A1 WO2016173069 A1 WO 2016173069A1 CN 2015080193 W CN2015080193 W CN 2015080193W WO 2016173069 A1 WO2016173069 A1 WO 2016173069A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- color
- value
- dimensional model
- colors
- dimensional
- Prior art date
Links
Images
Classifications
-
- B—PERFORMING OPERATIONS; TRANSPORTING
- B29—WORKING OF PLASTICS; WORKING OF SUBSTANCES IN A PLASTIC STATE IN GENERAL
- B29C—SHAPING OR JOINING OF PLASTICS; SHAPING OF MATERIAL IN A PLASTIC STATE, NOT OTHERWISE PROVIDED FOR; AFTER-TREATMENT OF THE SHAPED PRODUCTS, e.g. REPAIRING
- B29C67/00—Shaping techniques not covered by groups B29C39/00 - B29C65/00, B29C70/00 or B29C73/00
- B29C67/24—Shaping techniques not covered by groups B29C39/00 - B29C65/00, B29C70/00 or B29C73/00 characterised by the choice of material
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T15/00—3D [Three Dimensional] image rendering
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N1/00—Scanning, transmission or reproduction of documents or the like, e.g. facsimile transmission; Details thereof
- H04N1/46—Colour picture communication systems
Definitions
- the present application relates to the field of three-dimensional printing technology, and in particular, to a three-dimensional model processing method and device thereof, a three-dimensional printing method, and a three-dimensional printing device.
- a 3D printer also known as a 3D printer, is a machine that uses rapid prototyping technology to create three-dimensional objects by printing a layer of adhesive material using a special wax, powdered metal or plastic bondable material.
- the process of 3D printing is as follows: a digital model of a three-dimensional shape is created by computer-aided design or modeling software, or an off-the-shelf digital model is used; a three-dimensional model is "partitioned" into a layer-by-layer section, ie, a slice, according to a certain algorithm; Reading the cross-sectional information in the three-dimensional model, extruding the printed material from at least one of the nozzles, and printing the cross-sections layer by layer through the continuous movement of the nozzles and the extruded material; bonding the layers of the layers in various ways ( Including the bonding caused by the solidification of each layer of material itself to create a three-dimensional body.
- the multi-color three-dimensional shape can be printed by a plurality of nozzles, each of which corresponds to a material of a different color or a material of a different material.
- the number of colors that the three-dimensional shape to be printed can be limited by the number of three-dimensional printer nozzles: the number of colors on the model of the three-dimensional shape must be less than or equal to the number of printing nozzles, that is, the number of colors is limited. If this limit is exceeded, the three-dimensional printer cannot be caused. normal work.
- a three-dimensional model processing method comprising:
- the first three-dimensional model is modified to a second three-dimensional model according to at least the second value color.
- a three-dimensional printing method comprising:
- a three-dimensional model processing apparatus comprising:
- a first determining module configured to determine, according to the similarity between the colors of the first three-dimensional model, the first three-dimensional model of the three-dimensional shape to be printed has a color number exceeding a preset value a second value color corresponding to the first value color, wherein the first value is a quantity of colors that the first three-dimensional model has, and the second value does not exceed the first value;
- a processing module configured to modify the first three-dimensional model to a second three-dimensional model according to at least the second value color.
- a three-dimensional printing apparatus comprising the above three-dimensional model processing apparatus, further comprising:
- a printing module configured to print the three-dimensional shape to be printed according to the second three-dimensional model modified by the three-dimensional model processing device.
- the method, device and device of the embodiments of the present application can automatically process the color of the three-dimensional model when the color exceeds the limit of the number of colors, so as to reduce the color of the three-dimensional model and help to achieve normality under the limitation of the number of colors. 3D printing.
- FIG. 1 is a flow chart of a three-dimensional model processing method according to an embodiment of the present application.
- FIG. 2 is a flow chart of a three-dimensional printing method in accordance with an embodiment of the present application.
- 3(a) to 3(f) are schematic block diagrams showing various structures of a three-dimensional model processing apparatus according to an embodiment of the present application
- FIG. 4 schematically shows two structural block diagrams of a three-dimensional printing apparatus according to an embodiment of the present application.
- FIG. 1 is a flow chart of a three-dimensional model processing method in accordance with an embodiment of the present application.
- the method may be performed by a device that constructs a three-dimensional model of a three-dimensional shape, or by a three-dimensional printing device, and may be performed by any other device having processing capabilities.
- the method includes:
- the first three-dimensional model in response to the three-dimensional shape to be printed has a number of colors exceeding a preset value, and determining the color with the first value based on at least the similarity between colors of the first three-dimensional model.
- Corresponding second value color wherein the first value is a quantity of colors that the first three-dimensional model has, and the second value does not exceed the first value.
- the preset value may be set according to the number of colors of the three-dimensional printing device.
- the preset value is set to not exceed the number of nozzles of the three-dimensional printing device, and more preferably, the pre- Set the value to the number of nozzles that the 3D printing device has.
- the method of the present embodiment is for processing a three-dimensional model that does not meet the color quantity limit, so that the processed three-dimensional model conforms to the color quantity limit.
- the initial three-dimensional model of the three-dimensional shape to be printed is referred to as a first three-dimensional model. If the number of colors of the first three-dimensional model conforms to the color quantity limit, no processing is performed on the first three-dimensional model; if the number of colors of the first three-dimensional model does not meet the color quantity limit, that is, the pre-existence is exceeded Set the value and you need to process it.
- the first value color is modified to the second value color based on the similarity between the colors, so that the processed three-dimensional model, that is, the second three-dimensional model, has a reduction in the number of colors that can be met.
- the number of colors, the second value is less than the first value.
- the second value may be set according to at least the number of nozzles that the three-dimensional printing device has, for example, the second value is set to a value that does not exceed the number of the nozzles.
- the method of the embodiment can automatically process the color of the three-dimensional model when it exceeds the limit of the number of colors, so as to reduce the color of the three-dimensional model, and help to achieve normal three-dimensional printing under the limitation of the number of colors. .
- the method of this embodiment further includes:
- the execution body of the method of the present embodiment may construct an initial three-dimensional model of the three-dimensional shape to be printed, that is, the first three-dimensional model.
- the first three-dimensional model that has been constructed may be acquired from outside the execution body of the method of the embodiment mode in step S112.
- the number of colors of the first three-dimensional shape may be statistically determined by the execution body of the method of the present embodiment in step S114.
- the number of colors of the first three-dimensional model may be directly learned from the outside of the execution body of the method of the embodiment mode in step S114.
- the number of colors of the first three-dimensional model can be counted by any technique known to those skilled in the art. Taking the first three-dimensional model as a triangular mesh model as an example:
- the number of colors of the first three-dimensional model may be determined according to at least the color of each triangular surface of the first three-dimensional model.
- the first three-dimensional model may be determined according to at least the color of each vertex of each triangular face of the first three-dimensional model. The number of colors.
- the first may be determined according to at least the texture map corresponding to each triangle of the first three-dimensional model. The number of colors in the 3D model.
- the number of colors of the first three-dimensional model determined in step S114 is set to a first value M, and in step S120, a second value N colors, N ⁇ M, is determined based on the similarity between the M colors.
- the appropriate metrics can be used to measure the similarity between colors based on any technique known to those skilled in the art, thereby dividing the M colors into N subspaces and determining the color corresponding to each subspace.
- the M colors may be clustered into N colors based on a preset clustering algorithm.
- the step S120 may include:
- the first value (M) colors are divided into second value (N) classes based on at least a preset clustering algorithm.
- the preset clustering algorithm includes but is not limited to: a K-means algorithm (K-Means), an expectation maximization algorithm (EM), a BIRCH algorithm, an OPTICS algorithm, and the like.
- K-Means K-means algorithm
- EM expectation maximization algorithm
- BIRCH BIRCH
- OPTICS OPTICS algorithm
- any suitable index may be used, including but not limited to Euclidean distance, square Euclidean distance, Manhattan distance, maximum distance or Mahalanobis distance, and the like.
- S124 Determine, according to at least each of the M colors corresponding to each class, a color corresponding to each class, and further determine N colors.
- an average value of each of the M colors corresponding to each class may be determined as a color corresponding to the class.
- the "average” is a mathematical concept in a broad sense: including arithmetic mean, median, mode, and weighted average. Taking the red, green and blue (RGB) color space as an example (but not limited thereto), assuming that the first type of color corresponds to two of the M colors, the average of the RGB values corresponding to the two colors is taken as the first The final color value of the class color.
- step S120 may include:
- M colors are mapped into M' reference colors, where M' ⁇ N.
- the reference color may be determined according to the color of the subject in the color space model, and the number of reference colors, that is, the third value, is determined according to the color or the like provided by the printed material.
- the reference color is usually a fixed value, and the color of the subject in the color space model is taken.
- the RGB color model is usually represented by a unit cube, and the color of the body in the color space model is on the eight vertices of the cube. Namely: red, green, blue, yellow, water green (Cyan), magenta (Magenta), white, black.
- the similarity between the first value color and the third value reference color may also be determined by various metrics, preferably, the distance between the first value color and the third value reference color on the color space model may be It is determined which of the third value reference colors will be mapped to the first value color, respectively.
- the second value of each of the third value reference colors is determined in descending order of the appearance probability of the color space.
- Colors For example, N-1 colors are determined in descending order of appearance probability of each color in each of the M′ reference colors in the color space, and the remaining colors are mapped to the Nth color, and the Nth color may take the mapped The average of the color (M'-(N-1)).
- the "average” is a mathematical concept in a broad sense: including arithmetic mean, median, mode, and weighted average, etc., so that The M' groups are subdivided into N groups, and the corresponding color of each group can be the average of the colors in the group. The color should be.
- the color histogram can be used to determine the distribution characteristics of each color in the color space.
- the color histogram can be directly obtained from the outside, or the color histogram can be determined by the execution body of the method of the embodiment. In this implementation manner, the embodiment of the present embodiment is different.
- the method may further include before step S122':
- the method of the present embodiment can reduce the number of colors of the three-dimensional model based on the similarity between the colors of the three-dimensional model, and the modified three-dimensional model color is closer to the original three-dimensional model.
- the method of the embodiment may further include:
- the mapping relationship between the M colors of the first three-dimensional model and the N color values of the second three-dimensional model is established in a form of a color mapping table, and the mapping table can be saved for a long time for the next processing, and can be in the step In S120, N color values are directly determined by looking up the mapping table, and/or in step S140, the second three-dimensional model may be obtained according to at least the color of the first three-dimensional model according to the mapping relationship.
- the color value is on the triangular face, replace the color of each triangular face; if the color value is defined on each of the vertices of the triangular face, replace the color of each vertex; if the color value is from The texture map is calculated to replace the color of each pixel corresponding to the three-dimensional shape on the texture map.
- the method of the present embodiment can automatically process a three-dimensional model into a three-dimensional model conforming to the color quantity limit when the three-dimensional model does not meet the color quantity limit, and contribute to normal three-dimensional printing under the color quantity limitation, and the efficiency is high.
- FIG. 2 is a flow chart of a three-dimensional printing method in accordance with an embodiment of the present application.
- the method can be The 3D printing device is executed. As shown in Figure 2, the method includes:
- the first three-dimensional model in response to the three-dimensional shape to be printed has a number of colors exceeding a preset value, and determining the color with the first value based on at least the similarity between colors of the first three-dimensional model.
- Corresponding second value color wherein the first value is a quantity of colors that the first three-dimensional model has, and the second value does not exceed the first value.
- the preset value may be set according to the number of colors of the three-dimensional printing device.
- the preset value is set to not exceed the number of nozzles of the three-dimensional printing device, and more preferably, the pre- Set the value to the number of nozzles that the 3D printing device has.
- the method of the present embodiment is for achieving normal printing when the three-dimensional model does not meet the color number limit.
- the initial three-dimensional model of the three-dimensional shape to be printed is referred to as a first three-dimensional model. If the number of colors of the first three-dimensional model conforms to the color quantity limit, no processing is performed on the first three-dimensional model; if the number of colors of the first three-dimensional model does not meet the color quantity limit, that is, the pre-existence is exceeded Set the value and you need to process it.
- the first value color is modified to the second value color based on the similarity between the colors, so that the processed three-dimensional model, that is, the second three-dimensional model, has a reduction in the number of colors that can be met.
- the number of colors, the second value is less than the first value.
- the second value may be set according to at least the number of nozzles that the three-dimensional printing device has, for example, the second value is set to a value that does not exceed the number of the nozzles.
- the method of the present embodiment can automatically process a three-dimensional model into a three-dimensional model having a reduced color when the color of the three-dimensional model exceeds the limit of the number of colors, thereby enabling normal three-dimensional printing under the limitation of the number of colors.
- the method of this embodiment further includes:
- step S212 the execution body of the method of the present embodiment can construct an initial three-dimensional model of the three-dimensional shape to be printed, that is, the first three-dimensional model.
- the first three-dimensional model that has been constructed may be acquired from outside the execution body of the method of the embodiment mode in step S212.
- the number of colors of the first three-dimensional shape may be statistically determined by the execution body of the method of the present embodiment in step S214.
- the number of colors of the first three-dimensional model may be directly learned from the outside of the execution body of the method of the embodiment mode in step S214.
- the number of colors of the first three-dimensional model can be counted by any technique known to those skilled in the art. Taking the first three-dimensional model as a triangular mesh model as an example:
- the number of colors of the first three-dimensional model may be determined according to at least the color of each triangular surface of the first three-dimensional model.
- the first three-dimensional model may be determined according to at least the color of each vertex of each triangular face of the first three-dimensional model. The number of colors.
- the first three-dimensional model may be determined according to at least the texture map corresponding to each triangular surface of the first three-dimensional model. The number of colors.
- the first three-dimensional model have the first number M of colors, and in step S220, determine the second value N colors based on the similarity between the M colors, N ⁇ M.
- the appropriate metrics can be used to measure the similarity between colors based on any technique known to those skilled in the art, thereby dividing the M colors into N subspaces and determining the color corresponding to each subspace.
- step S220 may include:
- the preset clustering algorithm includes but is not limited to: a K-means algorithm, an expectation maximization algorithm, a BIRCH algorithm, an OPTICS algorithm, and the like.
- any suitable index may be used, including but not limited to Euclidean distance, square Euclidean distance, Manhattan distance, maximum distance or Mahalanobis distance, and the like.
- S224 Determine, according to at least each of the M colors corresponding to each class, a color corresponding to each class, and further determine N colors.
- an average value of each of the M colors corresponding to each class may be determined as a color corresponding to the class.
- the "average value” is a mathematical concept in a broad sense: including arithmetic mean, median, mode, and weighted average, and the like. Taking the red, green and blue (RGB) color space as an example (but not limited thereto), assuming that the first type of color corresponds to two of the M colors, the average of the RGB values corresponding to the two colors is taken as the first The final color value of the class color.
- step S220 may include:
- M colors are mapped into M' reference colors, where M' ⁇ N.
- the reference color may be determined according to the color of the subject in the color space model, and the number of reference colors, that is, the third value, is determined according to the color or the like provided by the printed material.
- the reference color is usually a fixed value, and the color of the subject in the color space model is taken.
- the RGB color model is usually represented by a unit cube, and the color of the body in the color space model is on the eight vertices of the cube. Namely: red, green, blue, yellow, water green (Cyan), magenta (Magenta), white, black.
- the similarity between the first value color and the third value reference color may also be determined by various metrics, preferably, the distance between the first value color and the third value reference color on the color space model may be It is determined which of the third value reference colors will be mapped to the first value color, respectively.
- the second value of each of the third value reference colors is determined in descending order of the appearance probability of the color space.
- Colors For example, N-1 colors are determined in descending order of appearance probability of each color in each of the M′ reference colors in the color space, and the remaining colors are mapped to the Nth color, and the Nth color may take the mapped The average of the color (M'-(N-1)).
- the "average” is a mathematical concept in a broad sense: including arithmetic mean, median, mode, and weighted average, etc., so that The M' groups are subdivided into N groups, and the color corresponding to each group may be the color corresponding to the average value of each color in the group.
- the color histogram can be used to determine the distribution characteristics of each color in the color space.
- the color histogram can be directly obtained from the outside, or the color histogram can be determined by the execution body of the method of the embodiment. In this implementation manner, the embodiment of the present embodiment is different.
- the method also includes:
- the method of the present embodiment can reduce the number of colors of the three-dimensional model based on the similarity between the colors of the three-dimensional model, and the modified three-dimensional model color is closer to the original three-dimensional model.
- the method of the embodiment may further include:
- the mapping relationship between the M colors of the first three-dimensional model and the N color values of the second three-dimensional model is established in a form of a color mapping table, and the mapping table may be saved for a long time for printing, in step S220.
- the N color values can be determined directly by looking up the form of the mapping table, and/or the color of the first three-dimensional model can be modified according to the mapping relationship at least in step 240 to obtain the second three-dimensional model.
- the color value is on the triangle face, replace the color of each triangle face; if the color value is defined on the triangle face vertex, replace the color of each vertex; if the color value is from the texture
- the texture is calculated to replace the color of each pixel corresponding to the three-dimensional shape on the texture map.
- the method of the embodiment can automatically process the three-dimensional model into a three-dimensional model conforming to the color quantity limit when the three-dimensional model does not meet the color quantity limit, thereby realizing normal three-dimensional printing under the limitation of the number of colors, and the efficiency is high.
- sequence number of each step does not mean the order of execution sequence, and the order of execution of each step should be determined by its function and internal logic, and should not be addressed.
- the implementation process of applying for a specific embodiment constitutes any limitation.
- embodiments of the present application further provide a computer readable medium comprising computer readable instructions that, when executed, perform the operations of the steps of the method of the embodiment shown in FIG.
- embodiments of the present application further provide a computer readable medium comprising computer readable instructions that, when executed, perform the operations of the steps of the method of the embodiment shown in FIG.
- FIG. 3(a) is a structural block diagram showing an example of a three-dimensional model processing apparatus according to an embodiment of the present application.
- the device may belong to a device for constructing a three-dimensional model of a three-dimensional shape, may also belong to a three-dimensional printing device, and may also be a device independent, and the device of the embodiment further includes, when necessary, in addition to the components to be described below.
- the apparatus 300 includes:
- the first determining module 320 is configured to determine, according to the similarity between the colors of the first three-dimensional model, the first three-dimensional model of the three-dimensional shape to be printed has a color number exceeding a preset value, The second value color corresponding to the first value color, wherein the first value is a quantity of colors that the first three-dimensional model has, and the second value does not exceed the first value.
- the preset value may be set according to the number of colors of the three-dimensional printing device, and optionally, the preset value is set to not exceed the number of nozzles of the three-dimensional printing device, and Preferably, the preset value is set to the number of nozzles that the three-dimensional printing device has.
- the processing module 340 is configured to modify the first three-dimensional model to a second three-dimensional model according to at least the second value color.
- the apparatus of the present embodiment is for processing a three-dimensional model that does not meet the color quantity limit, so that the processed three-dimensional model conforms to the color quantity limit.
- the initial three-dimensional model of the three-dimensional shape to be printed is referred to as a first three-dimensional model. If the number of colors of the first three-dimensional model conforms to the color quantity limit, no processing is performed on the first three-dimensional model; if the number of colors of the first three-dimensional model does not meet the color quantity limit, that is, the pre-existence is exceeded Set the value and you need to process it.
- the first determining module 320 modifies the first value color to the second value color based on the similarity between the colors, so that the processed three-dimensional model, that is, the second three-dimensional model, has a reduction in the number of colors that can be met.
- the number of colors, the second value is less than the first value.
- the second value may be set according to at least the number of nozzles that the three-dimensional printing device has, for example, the second value is set to a value that does not exceed the number of the nozzles.
- the device of the embodiment can automatically process the color of the three-dimensional model when the color of the three-dimensional model exceeds the limit of the number of colors, thereby reducing the color of the three-dimensional model and facilitating normal three-dimensional printing under the limitation of the number of colors. .
- the apparatus 300 of the present embodiment may further include:
- the first obtaining module 312 is configured to acquire the first three-dimensional model.
- the first obtaining module 312 can obtain an initial three-dimensional model of the three-dimensional shape to be printed, that is, the first three-dimensional model, by means of a self-constructed manner. In another possible implementation manner, the first obtaining module 312 can obtain the first three-dimensional model that has been constructed from the outside.
- the second determining module 314 is configured to determine a color quantity of the first three-dimensional model acquired by the first acquiring module 312.
- the second determining module 314 may determine the color quantity of the first three-dimensional shape by itself. In another possible implementation manner, the second determining module 314 can directly learn the manner from the outside of the mode of the embodiment. The number of colors in the first 3D model. In an implementation in which the device of the present embodiment itself determines the number of colors of the first three-dimensional shape, the second determining module 314 can count the number of colors of the first three-dimensional model by any technique known to those skilled in the art.
- the first three-dimensional model is a triangular mesh model, and the color is represented by a color value of a red, green, and blue (RGB) color space as an example:
- the number of colors of the first three-dimensional model may be determined according to at least the color of each triangular surface of the first three-dimensional model.
- the first three-dimensional model may be determined according to at least the color of each vertex of each triangular face of the first three-dimensional model. The number of colors.
- the first may be determined according to at least the texture map corresponding to each triangle of the first three-dimensional model. The number of colors in the 3D model.
- the first three-dimensional model has a first number M of colors, and the first determining module 320 determines a second value N colors based on the similarity between the M colors, N ⁇ M.
- the first determining module 320 can measure the similarity between the colors using suitable indicators based on any technique known to those skilled in the art, thereby dividing the M colors into N subspaces, and determining the color corresponding to each subspace. .
- the M colors may be clustered into N colors based on a preset clustering algorithm.
- the first determining module 320 may include:
- the dividing unit 322 is configured to divide the first value (M) colors into second value (N) classes based on at least a preset clustering algorithm.
- the preset clustering algorithm includes but is not limited to: a K-means algorithm (K-Means), an expectation maximization algorithm (EM), a BIRCH algorithm, an OPTICS algorithm, and the like.
- K-Means K-means algorithm
- EM expectation maximization algorithm
- BIRCH BIRCH
- OPTICS OPTICS algorithm
- any suitable index may be used, including but not limited to Euclidean distance, square Euclidean distance, Manhattan distance, maximum distance or Mahalanobis distance, and the like.
- the first determining unit 324 is configured to determine a color corresponding to each class based on at least each of the M colors corresponding to each class, and further determine N colors.
- the first determining unit 324 may determine that an average value of each of the M colors corresponding to each class is a color corresponding to the class.
- the "average value” is a mathematical concept in a broad sense: an arithmetic mean, a median, a mode, a weighted average, and the like. Taking the red, green and blue (RGB) color space as an example (but not limited thereto), assuming that the first type of color corresponds to two of the M colors, the average of the RGB values corresponding to the two colors is taken as the first The final color value of the class color.
- the first determining module 320 may include:
- the mapping unit 322' is configured to map the first value color to the third value reference color based on at least the similarity between the first value color and the third value reference color, where The third value is not less than the second value.
- M colors are mapped into M' reference colors, where M' ⁇ N.
- the reference color may be determined according to the color of the subject in the color space model, and the number of reference colors, that is, the third value, is determined according to the color or the like provided by the printed material.
- the reference color is usually a fixed value, and the color of the subject in the color space model is taken.
- the RGB color model is usually represented by a unit cube, and the color of the body in the color space model is on the eight vertices of the cube. Namely: red, green, blue, yellow, water green (Cyan), magenta (Magenta), white, black.
- the similarity between the first value color and the third value reference color may also be determined by various metrics, preferably, the distance between the first value color and the third value reference color on the color space model may be It is determined which of the third value reference colors will be mapped to the first value color, respectively.
- the second determining unit 324' is configured to determine the second value color based on at least the distribution feature of the mapped third value reference color in the color space.
- the second determining unit 324 ′ may be configured to map the first value color to the third value reference color, and the color of the third color reference color in the color space distribution ratio is in descending order Determining the second value of the color. For example, N-1 colors are determined in descending order of appearance probability of each color in each of the M' reference colors in the color space, and the remaining colors are mapped to the Nth type.
- the Nth color may take the average of the mapped colors (M'-(N-1)), and similarly, the "average” is a mathematical concept in a broad sense: including arithmetic mean, median, The majority, as well as the weighted average, etc., thereby reclassifying the M' groups into N groups, the color corresponding to each group being the color corresponding to the average of the colors in the group.
- the color histogram can be used to determine the distribution characteristics of each color in the color space.
- the color histogram can be directly obtained from the outside, or the color histogram can be determined by the device of the embodiment.
- the apparatus 300 of this embodiment may further include:
- the second obtaining module 316 is configured to obtain a color histogram of the first value color.
- the third determining module 318 is configured to determine a distribution feature of each color of the first value color in the color space based on at least the color histogram.
- the apparatus of the present embodiment can reduce the number of colors of the three-dimensional model based on the similarity between the colors of the three-dimensional model, and the modified three-dimensional model color is closer to the original three-dimensional model.
- the device 300 of the present embodiment may further include:
- the establishing module 330 is configured to establish a mapping relationship between the first value color and the second value color.
- the establishing module 330 establishes a mapping relationship between the M colors of the first three-dimensional model and the N color values of the second three-dimensional model in a form of a color mapping table, and saves the mapping table for the next processing, the first
- the determining module 320 may determine N color values directly by looking up the form of the mapping table, and/or the processing module 340 may modify the color of the first three-dimensional model according to at least the mapping relationship to obtain the second three-dimensional model.
- the color value is on the triangular face, replace the color of each triangular face; if the color value is defined on each of the vertices of the triangular face, replace the color of each vertex; if the color value is from The texture map is calculated to replace the color of each pixel corresponding to the three-dimensional shape on the texture map.
- the device of the present embodiment can automatically process a three-dimensional model into a three-dimensional model that conforms to the color quantity limit when the three-dimensional model does not meet the color quantity limit, and contributes to normal three-dimensional printing under the color number limitation, and has high efficiency.
- the apparatus 400 includes any three-dimensional model processing apparatus 300 shown in FIGS. 3(a) to 3(f), and further includes a printing module 420 for processing the apparatus 300 according to the three-dimensional model.
- the obtained second three-dimensional model prints the three-dimensional shape to be printed.
- the three-dimensional printing apparatus of the present embodiment can automatically process a three-dimensional model into a three-dimensional model having a reduced color when the color of the three-dimensional model exceeds the limit of the number of colors, thereby enabling normal three-dimensional printing under the limitation of the number of colors, and the efficiency is relatively high. high.
Landscapes
- Engineering & Computer Science (AREA)
- Mechanical Engineering (AREA)
- Computer Graphics (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Image Processing (AREA)
- Facsimile Image Signal Circuits (AREA)
Abstract
The present application relates to the technical field of three-dimensional printing. Disclosed are a three-dimensional model processing method and an apparatus thereof, a three-dimensional printing method, and a three-dimensional printing device. The three-dimensional model processing method comprises: in response to that the number of colors of a first three-dimensional model of a three-dimensional object to be printed exceeds a preset value, determining the second number of colors corresponding to the first number of colors at least according to the similarity between the colors of the first three-dimensional model, wherein the first number is the number of the colors of the first three-dimensional model and the second number does not exceed the first number; and modifying the first three-dimensional model into a second three-dimensional model at least according to the second number of colors. By means of the method, the apparatus and the device in embodiments of the present application, a three-dimensional model can be automatically processed when the number of colors of the three-dimensional model exceeds a limit of the number of colors, so as to reduce the colors of the three-dimensional model, which helps to implement normal three-dimensional printing under the limit of the number of the colors.
Description
本申请涉及三维打印技术领域,尤其涉及一种三维模型处理方法及其装置、三维打印方法及三维打印设备。The present application relates to the field of three-dimensional printing technology, and in particular, to a three-dimensional model processing method and device thereof, a three-dimensional printing method, and a three-dimensional printing device.
随着科学技术的发展,现代制造业得以快速的发展,一种快速成形技术——三维(Three Dimensions,3D)打印(又称增材制造(Additive Manufacturing,AM))技术随之而来。三维打印机又称3D打印机,是一种使用快速成形技术的机器,运用特殊蜡材、粉末状金属或塑料等可粘合材料,通过打印一层层的粘合材料来制造三维的物体。With the development of science and technology, modern manufacturing has developed rapidly, and a rapid forming technology called Three Dimensions (3D) printing (also known as Additive Manufacturing (AM)) technology has followed. A 3D printer, also known as a 3D printer, is a machine that uses rapid prototyping technology to create three-dimensional objects by printing a layer of adhesive material using a special wax, powdered metal or plastic bondable material.
三维打印的过程是这样的:通过计算机辅助设计或建模软件建立三维形体的数字模型,或使用现成的数字模型;按照一定的算法将三维模型“分区”成逐层的截面,即切片;打印机读取三维模型中的横截面信息,将打印材料从至少一个喷头挤出,通过喷头的持续移动以及挤出的材料,逐层打印出这些截面;将各层截面以各种方式粘合起来(包括各层材料本身固化导致的粘合)从而制造出一个三维形体的实体。The process of 3D printing is as follows: a digital model of a three-dimensional shape is created by computer-aided design or modeling software, or an off-the-shelf digital model is used; a three-dimensional model is "partitioned" into a layer-by-layer section, ie, a slice, according to a certain algorithm; Reading the cross-sectional information in the three-dimensional model, extruding the printed material from at least one of the nozzles, and printing the cross-sections layer by layer through the continuous movement of the nozzles and the extruded material; bonding the layers of the layers in various ways ( Including the bonding caused by the solidification of each layer of material itself to create a three-dimensional body.
可通过多个喷头、且每个喷头各对应一种不同颜色的材料或不同材质的材料来打印多色的三维形体。在准备三维形体的模型时,需要指定各个部分所要使用的喷头/材料,即使用不同颜色来标示这些区域,才能确定如何打印。待打印的三维形体能够拥有的颜色数量受限于三维打印机喷头的数量:三维形体的模型上的颜色数量必须小于等于打印喷头数量,即颜色数量限定,若超过了这个限定,会导致三维打印机不能正常工作。
The multi-color three-dimensional shape can be printed by a plurality of nozzles, each of which corresponds to a material of a different color or a material of a different material. When preparing a three-dimensional model, you need to specify the nozzles/materials to be used for each part, that is, use different colors to mark these areas to determine how to print. The number of colors that the three-dimensional shape to be printed can be limited by the number of three-dimensional printer nozzles: the number of colors on the model of the three-dimensional shape must be less than or equal to the number of printing nozzles, that is, the number of colors is limited. If this limit is exceeded, the three-dimensional printer cannot be caused. normal work.
发明内容Summary of the invention
本发明的目的是提供一种新的三维打印方案,能够有助于在颜色数量限制下也能正常进行三维打印。It is an object of the present invention to provide a new three-dimensional printing scheme that can facilitate normal three-dimensional printing even under color limit.
根据本发明的一个方面,提供了一种三维模型处理方法,所述方法包括:According to an aspect of the present invention, a three-dimensional model processing method is provided, the method comprising:
响应于待打印的三维形体的第一三维模型具有的颜色数量超过一预设值,至少基于所述第一三维模型具有的颜色之间的相似性,确定与所述第一值个颜色对应的第二值个颜色,其中,所述第一值为所述第一三维模型具有的颜色数量,且所述第二值不超过所述第一值;Responding to the first three-dimensional model of the three-dimensional shape to be printed having a number of colors exceeding a preset value, determining, according to the similarity between the colors of the first three-dimensional model, determining the color corresponding to the first value a second value color, wherein the first value is a number of colors of the first three-dimensional model, and the second value does not exceed the first value;
至少依照所述第二值个颜色,将所述第一三维模型修改为第二三维模型。The first three-dimensional model is modified to a second three-dimensional model according to at least the second value color.
根据本发明的另一个方面,提供了一种三维打印方法,所述方法包括:According to another aspect of the present invention, a three-dimensional printing method is provided, the method comprising:
响应于待打印的三维形体的第一三维模型具有的颜色数量超过一预设值,至少基于所述第一三维模型具有的颜色之间的相似性,确定与所述第一值个颜色对应的第二值个颜色,其中,所述第一值为所述第一三维模型具有的颜色数量,且所述第二值不超过所述第一值;Responding to the first three-dimensional model of the three-dimensional shape to be printed having a number of colors exceeding a preset value, determining, according to the similarity between the colors of the first three-dimensional model, determining the color corresponding to the first value a second value color, wherein the first value is a number of colors of the first three-dimensional model, and the second value does not exceed the first value;
至少依照所述第二值个颜色,将所述第一三维模型修改为第二三维模型;Modifying the first three-dimensional model to a second three-dimensional model according to at least the second value color;
按照所述第二三维模型打印所述待打印的三维形体。Printing the three-dimensional shape to be printed according to the second three-dimensional model.
根据本发明的又一方面,提供了一种三维模型处理装置,所述装置包括:According to still another aspect of the present invention, a three-dimensional model processing apparatus is provided, the apparatus comprising:
一第一确定模块,用于响应于待打印的三维形体的第一三维模型具有的颜色数量超过一预设值,至少基于所述第一三维模型具有的颜色之间的相似性,确定与所述第一值个颜色对应的第二值个颜色,其中,所述第一值为所述第一三维模型具有的颜色数量,且所述第二值不超过所述第一值;a first determining module, configured to determine, according to the similarity between the colors of the first three-dimensional model, the first three-dimensional model of the three-dimensional shape to be printed has a color number exceeding a preset value a second value color corresponding to the first value color, wherein the first value is a quantity of colors that the first three-dimensional model has, and the second value does not exceed the first value;
一处理模块,用于至少依照所述第二值个颜色,将所述第一三维模型修改为第二三维模型。a processing module, configured to modify the first three-dimensional model to a second three-dimensional model according to at least the second value color.
根据本发明的再一方面,提供了一种三维打印设备,包括上述三维模型处理装置,还包括:According to a further aspect of the present invention, there is provided a three-dimensional printing apparatus, comprising the above three-dimensional model processing apparatus, further comprising:
一打印模块,用于按照所述三维模型处理装置修改得到的所述第二三维模型,打印待打印的三维形体。
a printing module, configured to print the three-dimensional shape to be printed according to the second three-dimensional model modified by the three-dimensional model processing device.
本申请各实施例的方法、装置及设备能够在三维模型所具有的颜色超过颜色数量限制时,自动对其进行处理,以减少三维模型所具有的颜色,有助于在颜色数量限制下实现正常的三维打印。The method, device and device of the embodiments of the present application can automatically process the color of the three-dimensional model when the color exceeds the limit of the number of colors, so as to reduce the color of the three-dimensional model and help to achieve normality under the limitation of the number of colors. 3D printing.
图1是根据本申请一种实施方式的三维模型处理方法的流程图;1 is a flow chart of a three-dimensional model processing method according to an embodiment of the present application;
图2是根据本申请一种实施方式的三维打印方法的流程图;2 is a flow chart of a three-dimensional printing method in accordance with an embodiment of the present application;
图3(a)至图3(f)示意性地示出了根据本申请一种实施方式的三维模型处理装置的多种结构框图;3(a) to 3(f) are schematic block diagrams showing various structures of a three-dimensional model processing apparatus according to an embodiment of the present application;
[根据细则91更正 13.07.2015]
图4示意性地示出了根据本申请一种实施方式的三维打印装置的两种结构框图。[Correct according to Rule 91 13.07.2015]
FIG. 4 schematically shows two structural block diagrams of a three-dimensional printing apparatus according to an embodiment of the present application.
图4示意性地示出了根据本申请一种实施方式的三维打印装置的两种结构框图。[Correct according to Rule 91 13.07.2015]
FIG. 4 schematically shows two structural block diagrams of a three-dimensional printing apparatus according to an embodiment of the present application.
为使本发明的目的、技术方案和优点更加清楚明了,下面结合具体实施方式并参照附图,对本发明进一步详细说明。应该理解,这些描述只是示例性的,而并非要限制本发明的范围。此外,在以下说明中,省略了对公知结构和技术的描述,以避免不必要地混淆本发明的概念。The present invention will be further described in detail below with reference to the specific embodiments thereof and the accompanying drawings. It is to be understood that the description is not intended to limit the scope of the invention. In addition, descriptions of well-known structures and techniques are omitted in the following description in order to avoid unnecessarily obscuring the inventive concept.
图1是根据本申请一种实施方式的三维模型处理方法的流程图。该方法可由构建三维形体的三维模型的设备执行,也可由三维打印设备执行,还可由任何具有处理能力的其他设备执行。如图1所示,该方法包括:1 is a flow chart of a three-dimensional model processing method in accordance with an embodiment of the present application. The method may be performed by a device that constructs a three-dimensional model of a three-dimensional shape, or by a three-dimensional printing device, and may be performed by any other device having processing capabilities. As shown in Figure 1, the method includes:
S120.响应于待打印的三维形体的第一三维模型具有的颜色数量超过一预设值,至少基于所述第一三维模型具有的颜色之间的相似性,确定与所述第一值个颜色对应的第二值个颜色,其中,所述第一值为所述第一三维模型具有的颜色数量,且所述第二值不超过所述第一值。S120. The first three-dimensional model in response to the three-dimensional shape to be printed has a number of colors exceeding a preset value, and determining the color with the first value based on at least the similarity between colors of the first three-dimensional model. Corresponding second value color, wherein the first value is a quantity of colors that the first three-dimensional model has, and the second value does not exceed the first value.
在本实施例的方法中,可根据三维打印设备的颜色数量限制设置预设值,可选地,将预设值设置为不超过三维打印设备所具有的喷头数量,更优选地,将该预设值设置为三维打印设备所具有的喷头数量。
In the method of the embodiment, the preset value may be set according to the number of colors of the three-dimensional printing device. Optionally, the preset value is set to not exceed the number of nozzles of the three-dimensional printing device, and more preferably, the pre- Set the value to the number of nozzles that the 3D printing device has.
S140.至少依照所述第二值个颜色,将所述第一三维模型修改为第二三维模型。S140. Modify the first three-dimensional model to a second three-dimensional model according to at least the second value color.
本实施方式的方法用于对不符合颜色数量限制的三维模型进行处理,使处理后的三维模型符合颜色数量限制。在本实施方式的方法中,将待打印的三维形体的初始三维模型称为第一三维模型。若该第一三维模型所具有的颜色数量符合颜色数量限制,则不对该第一三维模型进行任何处理;若该第一三维模型所具有的颜色数量不符合颜色数量限制,也即,超过该预设值,则需对其进行处理。在步骤S120中,基于各颜色之间的相似性将第一值个颜色修改为第二值个颜色,为了使得处理后的三维模型,也即第二三维模型,具有能够符合颜色数量限制的减少了的颜色数量,第二值小于第一值。在一种可能的实现方式中,可至少根据三维打印设备所具有的喷头的数量设置该第二值,例如,将该第二值设置为不超过该喷头数量的值。The method of the present embodiment is for processing a three-dimensional model that does not meet the color quantity limit, so that the processed three-dimensional model conforms to the color quantity limit. In the method of the present embodiment, the initial three-dimensional model of the three-dimensional shape to be printed is referred to as a first three-dimensional model. If the number of colors of the first three-dimensional model conforms to the color quantity limit, no processing is performed on the first three-dimensional model; if the number of colors of the first three-dimensional model does not meet the color quantity limit, that is, the pre-existence is exceeded Set the value and you need to process it. In step S120, the first value color is modified to the second value color based on the similarity between the colors, so that the processed three-dimensional model, that is, the second three-dimensional model, has a reduction in the number of colors that can be met. The number of colors, the second value is less than the first value. In a possible implementation, the second value may be set according to at least the number of nozzles that the three-dimensional printing device has, for example, the second value is set to a value that does not exceed the number of the nozzles.
综上,本实施例的方法能够在三维模型所具有的颜色超过颜色数量限制时,自动对其进行处理,以减少三维模型所具有的颜色,有助于在颜色数量限制下实现正常的三维打印。In summary, the method of the embodiment can automatically process the color of the three-dimensional model when it exceeds the limit of the number of colors, so as to reduce the color of the three-dimensional model, and help to achieve normal three-dimensional printing under the limitation of the number of colors. .
此外,本实施方式的方法还包括:In addition, the method of this embodiment further includes:
S112.获取所述第一三维模型。S112. Acquire the first three-dimensional model.
基于本实施方式方法的执行主体的不同角色,在一种可能的实现方式中,步骤S112中可由本实施方式方法的执行主体自己构建待打印的三维形体的初始三维模型,也即第一三维模型。在另一种可能的实现方式中,步骤S112中可从本实施例方式方法的执行主体外部获取已构建好的所述第一三维模型。Based on the different roles of the execution subject of the method of the present embodiment, in a possible implementation manner, the execution body of the method of the present embodiment may construct an initial three-dimensional model of the three-dimensional shape to be printed, that is, the first three-dimensional model. . In another possible implementation manner, the first three-dimensional model that has been constructed may be acquired from outside the execution body of the method of the embodiment mode in step S112.
S114.确定所述第一三维模型的颜色数量。S114. Determine a color quantity of the first three-dimensional model.
类似的,基于本实施方式方法的执行主体的不同角色,在一种可能的实现方式中,步骤S114中可由本实施方式方法的执行主体自己统计确定该第一三维形体的颜色数量。在另一种可能的实现方式中,步骤S114中可从本实施例方式方法的执行主体外部直接获知所述第一三维模型的颜色数量。在由本
实施方式方法的执行主体自己统计确定该第一三维形体的颜色数量的实现方式中,可通过本领域技术人员所熟知的任意技术来统计所述第一三维模型的颜色数量。以所述第一三维模型为三角网格模型为例:Similarly, based on the different roles of the execution subject of the method of the present embodiment, in a possible implementation manner, the number of colors of the first three-dimensional shape may be statistically determined by the execution body of the method of the present embodiment in step S114. In another possible implementation manner, the number of colors of the first three-dimensional model may be directly learned from the outside of the execution body of the method of the embodiment mode in step S114. In this
In an implementation in which the executive body of the embodiment method itself determines the number of colors of the first three-dimensional shape, the number of colors of the first three-dimensional model can be counted by any technique known to those skilled in the art. Taking the first three-dimensional model as a triangular mesh model as an example:
在一种可能的实现方式中,如果颜色值在三角面上,则可至少根据所述第一三维模型的各三角面的颜色,确定所述第一三维模型的颜色数量。In a possible implementation, if the color value is on a triangular surface, the number of colors of the first three-dimensional model may be determined according to at least the color of each triangular surface of the first three-dimensional model.
在另一种可能的实现方式中,如果颜色值定义在三角面各顶点上,则可至少根据所述第一三维模型的各三角面的每个顶点的颜色,确定所述第一三维模型的颜色数量。In another possible implementation manner, if the color value is defined on each vertices of the triangular face, the first three-dimensional model may be determined according to at least the color of each vertex of each triangular face of the first three-dimensional model. The number of colors.
在又一种可能的实现方式中,如果颜色值是从纹理贴图(texture)计算得出的,则可至少根据所述第一三维模型的各三角面对应的纹理贴图,确定所述第一三维模型的颜色数量。In still another possible implementation, if the color value is calculated from a texture, the first may be determined according to at least the texture map corresponding to each triangle of the first three-dimensional model. The number of colors in the 3D model.
令步骤S114中确定的第一三维模型所具有的颜色数量为第一值M,在步骤S120中,基于该M个颜色之间的相似性确定第二值N个颜色,N<M。可基于本领域的技术人员所熟知的任何技术,使用合适的指标来度量颜色之间的相似性,从而将M个颜色划分为N个子空间,并确定每个子空间对应的颜色。The number of colors of the first three-dimensional model determined in step S114 is set to a first value M, and in step S120, a second value N colors, N < M, is determined based on the similarity between the M colors. The appropriate metrics can be used to measure the similarity between colors based on any technique known to those skilled in the art, thereby dividing the M colors into N subspaces and determining the color corresponding to each subspace.
在一种可能的实现方式中,可基于预设的聚类算法将M个颜色聚类成N个颜色,具言之,步骤S120可包括:In a possible implementation, the M colors may be clustered into N colors based on a preset clustering algorithm. In other words, the step S120 may include:
S122.至少基于预设的聚类算法,将所述第一值(M)个颜色划分为第二值(N)个类。S122. The first value (M) colors are divided into second value (N) classes based on at least a preset clustering algorithm.
其中,所述预设的聚类算法包括但不限于:K均值算法(K-Means),期望最大化算法(EM)、BIRCH算法、OPTICS算法,等等。在每种聚类算法中,可采用任一种合适的指标,包括但不限于欧几里得距离、平方欧几里得距离,曼哈顿距离、最大距离或马氏距离,等等。The preset clustering algorithm includes but is not limited to: a K-means algorithm (K-Means), an expectation maximization algorithm (EM), a BIRCH algorithm, an OPTICS algorithm, and the like. In each clustering algorithm, any suitable index may be used, including but not limited to Euclidean distance, square Euclidean distance, Manhattan distance, maximum distance or Mahalanobis distance, and the like.
S124.至少基于所述每个类对应的M个颜色中的各颜色,确定每个类对应的颜色,进而确定N个颜色。S124. Determine, according to at least each of the M colors corresponding to each class, a color corresponding to each class, and further determine N colors.
可选地,步骤S124中可确定每个类所对应的M个颜色中各颜色的平均值为该类对应的颜色。本领域的技术人员能够理解的,在本申请实施例的方法
中,“平均值”为广义上的数学概念:包括算术平均值、中位数、众数、以及加权平均数等等。以红绿蓝(RGB)色彩空间为例(但不限于此),假设第一类颜色对应M个颜色中的两个颜色,则将该两个颜色对应的RGB值的平均值作为该第一类颜色最终的颜色值。Optionally, in step S124, an average value of each of the M colors corresponding to each class may be determined as a color corresponding to the class. Those skilled in the art can understand the method in the embodiments of the present application.
In the middle, the "average" is a mathematical concept in a broad sense: including arithmetic mean, median, mode, and weighted average. Taking the red, green and blue (RGB) color space as an example (but not limited thereto), assuming that the first type of color corresponds to two of the M colors, the average of the RGB values corresponding to the two colors is taken as the first The final color value of the class color.
在另一种可能的实现方式中,步骤S120可包括:In another possible implementation manner, step S120 may include:
S122’.至少基于所述第一值个颜色与第三值个参考颜色之间的相似性,将所述第一值个颜色映射到该第三值个参考颜色,其中,所述第三值不小于所述第二值。S122'. mapping the first value color to the third value reference color based on at least the similarity between the first value color and the third value reference color, wherein the third value Not less than the second value.
具体地,基于M个颜色值与第三值M’个参考颜色之间的接近程度,将M个颜色映射成M’个参考颜色,其中,M’≥N。Specifically, based on the degree of closeness between the M color values and the third value M' reference colors, M colors are mapped into M' reference colors, where M' ≥ N.
其中,可根据颜色空间模型中的主体颜色确定所述参考颜色,并根据打印材料提供的颜色等确定参考颜色的数量,也即第三值。参考颜色通常为固定值,可取颜色空间模型中的主体颜色,以RGB颜色空间为例,RGB颜色模型通常采用单位立方体来表示,该颜色空间模型中的主体颜色在立方体的八个顶点上,也即:红、绿、蓝、黄、水绿(Cyan)、洋红(Magenta)、白、黑。第一值个颜色与第三值个参考颜色之间的相似性也可采用各种度量指标确定,优选地,可以第一值个颜色与第三值个参考颜色在颜色空间模型上的距离来确定将分别将第一值个颜色映射到第三值个参考颜色中的哪一个。Wherein, the reference color may be determined according to the color of the subject in the color space model, and the number of reference colors, that is, the third value, is determined according to the color or the like provided by the printed material. The reference color is usually a fixed value, and the color of the subject in the color space model is taken. Taking the RGB color space as an example, the RGB color model is usually represented by a unit cube, and the color of the body in the color space model is on the eight vertices of the cube. Namely: red, green, blue, yellow, water green (Cyan), magenta (Magenta), white, black. The similarity between the first value color and the third value reference color may also be determined by various metrics, preferably, the distance between the first value color and the third value reference color on the color space model may be It is determined which of the third value reference colors will be mapped to the first value color, respectively.
S124’.至少基于映射后的第三值个参考颜色在颜色空间的分布特征,确定所述第二值个颜色。S124'. determining the second value color based on at least a distribution characteristic of the mapped third value reference color in the color space.
可选地,可依照将第一值个颜色映射成第三值个参考颜色后,第三值个参考颜色中的各颜色在颜色空间的出现概率从大到小的顺序确定所述第二值个颜色。例如,按照各M’个参考颜色中各颜色在颜色空间的出现概率从大到小的顺序确定N-1个颜色,其余颜色映射为第N种颜色,该第N种颜色可取所映射的各颜色(M’-(N-1))的平均值,同样,该“平均值”为广义上的数学概念:包括算术平均值、中位数、众数、以及加权平均数等等,从而将M’个组重新分成N个组,每个组对应的颜色可为该组中各颜色的平均值所对
应的颜色。Optionally, after the first value color is mapped to the third value reference color, the second value of each of the third value reference colors is determined in descending order of the appearance probability of the color space. Colors. For example, N-1 colors are determined in descending order of appearance probability of each color in each of the M′ reference colors in the color space, and the remaining colors are mapped to the Nth color, and the Nth color may take the mapped The average of the color (M'-(N-1)). Similarly, the "average" is a mathematical concept in a broad sense: including arithmetic mean, median, mode, and weighted average, etc., so that The M' groups are subdivided into N groups, and the corresponding color of each group can be the average of the colors in the group.
The color should be.
在一种可能的实现方式中,可通过颜色直方图来确定各颜色在颜色空间的分布特征。且根据本实施例方法的执行主体的角色不同,可从外部直接获取该颜色直方图,或由本实施例方法的执行主体自己来确定该颜色直方图,在这样的实现方式中,本实施方式的方法在步骤S122’之前还可包括:In a possible implementation, the color histogram can be used to determine the distribution characteristics of each color in the color space. The color histogram can be directly obtained from the outside, or the color histogram can be determined by the execution body of the method of the embodiment. In this implementation manner, the embodiment of the present embodiment is different. The method may further include before step S122':
S116.获取所述第一值个颜色的颜色直方图。S116. Obtain a color histogram of the first value color.
S118.至少基于所述颜色直方图,确定所述第一值个颜色中各颜色在颜色空间的分布特征。S118. Determine, according to the color histogram, a distribution feature of each color of the first value color in a color space.
综上,本实施方式的方法能够基于三维模型所具有的各颜色之间的相似性,实现减少三维模型具有的颜色数量,修改后的三维模型颜色更接近原三维模型。In summary, the method of the present embodiment can reduce the number of colors of the three-dimensional model based on the similarity between the colors of the three-dimensional model, and the modified three-dimensional model color is closer to the original three-dimensional model.
此外,为了进一步提高本实施方式方法的效率,进而有助于三维打印效率的提高,本实施方式的方法还可包括:In addition, in order to further improve the efficiency of the method of the present embodiment, and further contribute to the improvement of the three-dimensional printing efficiency, the method of the embodiment may further include:
S130.建立所述第一值个颜色到所述第二值个颜色的映射关系。S130. Establish a mapping relationship between the first value color and the second value color.
可选地,以颜色映射表的形式建立第一三维模型的M个颜色与第二三维模型的N个颜色值的映射关系,该映射表可长期保存,以供下一次处理中,能够在步骤S120中直接通过查找该映射表的形式确定N个颜色值,和/或在步骤S140中,可根据至少依据上述映射关系修改所述第一三维模型的颜色,得到所述第二三维模型。Optionally, the mapping relationship between the M colors of the first three-dimensional model and the N color values of the second three-dimensional model is established in a form of a color mapping table, and the mapping table can be saved for a long time for the next processing, and can be in the step In S120, N color values are directly determined by looking up the mapping table, and/or in step S140, the second three-dimensional model may be obtained according to at least the color of the first three-dimensional model according to the mapping relationship.
仍以三角网格模型为例,如果颜色值在三角面上,则替换每个三角面的颜色;如果颜色值定义在三角面各顶点上,则替换每个顶点的颜色;如果颜色值是从纹理贴图计算得出的,则替换纹理贴图上三维形体所对应的每个像素点的颜色。Still taking the triangular mesh model as an example, if the color value is on the triangular face, replace the color of each triangular face; if the color value is defined on each of the vertices of the triangular face, replace the color of each vertex; if the color value is from The texture map is calculated to replace the color of each pixel corresponding to the three-dimensional shape on the texture map.
综上,本实施方式的方法能够在三维模型不符合颜色数量限制时自动将其处理成符合颜色数量限制的三维模型,有助于在颜色数量限制下实现正常的三维打印,且效率较高。In summary, the method of the present embodiment can automatically process a three-dimensional model into a three-dimensional model conforming to the color quantity limit when the three-dimensional model does not meet the color quantity limit, and contribute to normal three-dimensional printing under the color quantity limitation, and the efficiency is high.
图2是根据本申请一种实施方式的三维打印方法的流程图。该方法可由
三维打印设备执行。如图2所示,该方法包括:2 is a flow chart of a three-dimensional printing method in accordance with an embodiment of the present application. The method can be
The 3D printing device is executed. As shown in Figure 2, the method includes:
S220.响应于待打印的三维形体的第一三维模型具有的颜色数量超过一预设值,至少基于所述第一三维模型具有的颜色之间的相似性,确定与所述第一值个颜色对应的第二值个颜色,其中,所述第一值为所述第一三维模型具有的颜色数量,且所述第二值不超过所述第一值。S220. The first three-dimensional model in response to the three-dimensional shape to be printed has a number of colors exceeding a preset value, and determining the color with the first value based on at least the similarity between colors of the first three-dimensional model. Corresponding second value color, wherein the first value is a quantity of colors that the first three-dimensional model has, and the second value does not exceed the first value.
在本实施例的方法中,可根据三维打印设备的颜色数量限制设置预设值,可选地,将预设值设置为不超过三维打印设备所具有的喷头数量,更优选地,将该预设值设置为三维打印设备所具有的喷头数量。In the method of the embodiment, the preset value may be set according to the number of colors of the three-dimensional printing device. Optionally, the preset value is set to not exceed the number of nozzles of the three-dimensional printing device, and more preferably, the pre- Set the value to the number of nozzles that the 3D printing device has.
S240.至少依照所述第二值个颜色,将所述第一三维模型修改为第二三维模型。S240. Modify the first three-dimensional model to a second three-dimensional model according to at least the second value color.
S260.按照所述第二三维模型打印所述待打印的三维形体。S260. Print the three-dimensional shape to be printed according to the second three-dimensional model.
本实施方式的方法用于在三维模型不符合颜色数量限制时实现正常的打印。如结合图1所讨论的,在本实施方式的方法中,将待打印的三维形体的初始三维模型称为第一三维模型。若该第一三维模型所具有的颜色数量符合颜色数量限制,则不对该第一三维模型进行任何处理;若该第一三维模型所具有的颜色数量不符合颜色数量限制,也即,超过该预设值,则需对其进行处理。在步骤S220中,基于各颜色之间的相似性将第一值个颜色修改为第二值个颜色,为了使得处理后的三维模型,也即第二三维模型,具有能够符合颜色数量限制的减少了的颜色数量,第二值小于第一值。在一种可能的实现方式中,可至少根据三维打印设备所具有的喷头的数量设置该第二值,例如,将该第二值设置为不超过该喷头数量的值。The method of the present embodiment is for achieving normal printing when the three-dimensional model does not meet the color number limit. As discussed in connection with FIG. 1, in the method of the present embodiment, the initial three-dimensional model of the three-dimensional shape to be printed is referred to as a first three-dimensional model. If the number of colors of the first three-dimensional model conforms to the color quantity limit, no processing is performed on the first three-dimensional model; if the number of colors of the first three-dimensional model does not meet the color quantity limit, that is, the pre-existence is exceeded Set the value and you need to process it. In step S220, the first value color is modified to the second value color based on the similarity between the colors, so that the processed three-dimensional model, that is, the second three-dimensional model, has a reduction in the number of colors that can be met. The number of colors, the second value is less than the first value. In a possible implementation, the second value may be set according to at least the number of nozzles that the three-dimensional printing device has, for example, the second value is set to a value that does not exceed the number of the nozzles.
综上,本实施例的方法能够在三维模型所具有的颜色超过颜色数量限制时,自动将其处理成具有减少了颜色的三维模型,从而能够在颜色数量限制下实现正常的三维打印。In summary, the method of the present embodiment can automatically process a three-dimensional model into a three-dimensional model having a reduced color when the color of the three-dimensional model exceeds the limit of the number of colors, thereby enabling normal three-dimensional printing under the limitation of the number of colors.
此外,本实施方式的方法还包括:In addition, the method of this embodiment further includes:
S212.获取所述第一三维模型。
S212. Acquire the first three-dimensional model.
基于本实施方式方法的执行主体的不同角色,在一种可能的实现方式中,步骤S212中可由本实施方式方法的执行主体自己构建待打印的三维形体的初始三维模型,也即第一三维模型。在另一种可能的实现方式中,步骤S212中可从本实施例方式方法的执行主体外部获取已构建好的所述第一三维模型。Based on the different roles of the execution subject of the method of the present embodiment, in a possible implementation manner, in step S212, the execution body of the method of the present embodiment can construct an initial three-dimensional model of the three-dimensional shape to be printed, that is, the first three-dimensional model. . In another possible implementation manner, the first three-dimensional model that has been constructed may be acquired from outside the execution body of the method of the embodiment mode in step S212.
S214.确定所述第一三维模型的颜色数量。S214. Determine a color quantity of the first three-dimensional model.
类似的,基于本实施方式方法的执行主体的不同角色,在一种可能的实现方式中,步骤S214中可由本实施方式方法的执行主体自己统计确定该第一三维形体的颜色数量。在另一种可能的实现方式中,步骤S214中可从本实施例方式方法的执行主体外部直接获知所述第一三维模型的颜色数量。在由本实施方式方法的执行主体自己统计确定该第一三维形体的颜色数量的实现方式中,可通过本领域技术人员所熟知的任意技术来统计所述第一三维模型的颜色数量。以所述第一三维模型为三角网格模型为例:Similarly, based on the different roles of the execution subject of the method of the present embodiment, in a possible implementation manner, the number of colors of the first three-dimensional shape may be statistically determined by the execution body of the method of the present embodiment in step S214. In another possible implementation manner, the number of colors of the first three-dimensional model may be directly learned from the outside of the execution body of the method of the embodiment mode in step S214. In an implementation in which the number of colors of the first three-dimensional shape is determined by the execution body of the method of the present embodiment, the number of colors of the first three-dimensional model can be counted by any technique known to those skilled in the art. Taking the first three-dimensional model as a triangular mesh model as an example:
在一种可能的实现方式中,如果颜色值定义在三角面上,则可至少根据所述第一三维模型的各三角面的颜色,确定所述第一三维模型的颜色数量。In a possible implementation manner, if the color value is defined on a triangular surface, the number of colors of the first three-dimensional model may be determined according to at least the color of each triangular surface of the first three-dimensional model.
在另一种可能的实现方式中,如果颜色值定义在三角面各顶点上,则可至少根据所述第一三维模型的各三角面的每个顶点的颜色,确定所述第一三维模型的颜色数量。In another possible implementation manner, if the color value is defined on each vertices of the triangular face, the first three-dimensional model may be determined according to at least the color of each vertex of each triangular face of the first three-dimensional model. The number of colors.
在又一种可能的实现方式中,如果颜色值是从纹理贴图计算得出的,则可至少根据所述第一三维模型的各三角面对应的纹理贴图,确定所述第一三维模型的颜色数量。In still another possible implementation, if the color value is calculated from the texture map, the first three-dimensional model may be determined according to at least the texture map corresponding to each triangular surface of the first three-dimensional model. The number of colors.
令第一三维模型所具有的颜色数量为第一值M,在步骤S220中,基于该M个颜色之间的相似性确定第二值N个颜色,N<M。可基于本领域的技术人员所熟知的任何技术,使用合适的指标来度量颜色之间的相似性,从而将M个颜色划分为N个子空间,并确定每个子空间对应的颜色。Let the first three-dimensional model have the first number M of colors, and in step S220, determine the second value N colors based on the similarity between the M colors, N < M. The appropriate metrics can be used to measure the similarity between colors based on any technique known to those skilled in the art, thereby dividing the M colors into N subspaces and determining the color corresponding to each subspace.
在一种可能的实现方式中,可基于预设的聚类算法将M个颜色聚类成N个颜色,具言之,步骤S220可包括:In a possible implementation, the M colors may be clustered into N colors based on a preset clustering algorithm. In other words, step S220 may include:
S222.至少基于预设的聚类算法,将所述第一值(M)个颜色划分为第二
值(N)个类。S222. Divide the first value (M) colors into second according to at least a preset clustering algorithm.
Value (N) classes.
其中,所述预设的聚类算法包括但不限于:K均值算法,期望最大化算法、BIRCH算法、OPTICS算法,等等。在每种聚类算法中,可采用任一种合适的指标,包括但不限于欧几里得距离、平方欧几里得距离,曼哈顿距离、最大距离或马氏距离,等等。The preset clustering algorithm includes but is not limited to: a K-means algorithm, an expectation maximization algorithm, a BIRCH algorithm, an OPTICS algorithm, and the like. In each clustering algorithm, any suitable index may be used, including but not limited to Euclidean distance, square Euclidean distance, Manhattan distance, maximum distance or Mahalanobis distance, and the like.
S224.至少基于所述每个类对应的M个颜色中的各颜色,确定每个类对应的颜色,进而确定N个颜色。S224. Determine, according to at least each of the M colors corresponding to each class, a color corresponding to each class, and further determine N colors.
可选地,步骤S224中可确定每个类所对应的M个颜色中各颜色的平均值为该类对应的颜色。本领域的技术人员能够理解的,在本申请实施例的方法中,“平均值”为广义上的数学概念:包括算术平均值、中位数、众数、以及加权平均数等等。以红绿蓝(RGB)色彩空间为例(但不限于此),假设第一类颜色对应M个颜色中的两个颜色,则将该两个颜色对应的RGB值的平均值作为该第一类颜色最终的颜色值。Optionally, in step S224, an average value of each of the M colors corresponding to each class may be determined as a color corresponding to the class. Those skilled in the art will appreciate that in the method of the embodiments of the present application, the "average value" is a mathematical concept in a broad sense: including arithmetic mean, median, mode, and weighted average, and the like. Taking the red, green and blue (RGB) color space as an example (but not limited thereto), assuming that the first type of color corresponds to two of the M colors, the average of the RGB values corresponding to the two colors is taken as the first The final color value of the class color.
在另一种可能的实现方式中,步骤S220可包括:In another possible implementation manner, step S220 may include:
S222’.至少基于所述第一值个颜色与第三值个参考颜色之间的相似性,将所述第一值个颜色映射到该第三值个参考颜色,其中,所述第三值不小于所述第二值。S222'. mapping the first value color to the third value reference color based on at least the similarity between the first value color and the third value reference color, wherein the third value Not less than the second value.
具体地,基于M个颜色值与第三值M’个参考颜色之间的接近程度,将M个颜色映射成M’个参考颜色,其中,M’≥N。Specifically, based on the degree of closeness between the M color values and the third value M' reference colors, M colors are mapped into M' reference colors, where M' ≥ N.
其中,可根据颜色空间模型中的主体颜色确定所述参考颜色,并根据打印材料提供的颜色等确定参考颜色的数量,也即第三值。参考颜色通常为固定值,可取颜色空间模型中的主体颜色,以RGB颜色空间为例,RGB颜色模型通常采用单位立方体来表示,该颜色空间模型中的主体颜色在立方体的八个顶点上,也即:红、绿、蓝、黄、水绿(Cyan)、洋红(Magenta)、白、黑。第一值个颜色与第三值个参考颜色之间的相似性也可采用各种度量指标确定,优选地,可以第一值个颜色与第三值个参考颜色在颜色空间模型上的距离来确定将分别将第一值个颜色映射到第三值个参考颜色中的哪一个。
Wherein, the reference color may be determined according to the color of the subject in the color space model, and the number of reference colors, that is, the third value, is determined according to the color or the like provided by the printed material. The reference color is usually a fixed value, and the color of the subject in the color space model is taken. Taking the RGB color space as an example, the RGB color model is usually represented by a unit cube, and the color of the body in the color space model is on the eight vertices of the cube. Namely: red, green, blue, yellow, water green (Cyan), magenta (Magenta), white, black. The similarity between the first value color and the third value reference color may also be determined by various metrics, preferably, the distance between the first value color and the third value reference color on the color space model may be It is determined which of the third value reference colors will be mapped to the first value color, respectively.
S224’.至少基于所述第三值中各颜色在颜色空间的分布特征,确定所述第二值个颜色。S224'. determining the second value color based on at least a distribution characteristic of each color in the color space in the third value.
可选地,可依照将第一值个颜色映射成第三值个参考颜色后,第三值个参考颜色中的各颜色在颜色空间的出现概率从大到小的顺序确定所述第二值个颜色。例如,按照各M’个参考颜色中各颜色在颜色空间的出现概率从大到小的顺序确定N-1个颜色,其余颜色映射为第N种颜色,该第N种颜色可取所映射的各颜色(M’-(N-1))的平均值,同样,该“平均值”为广义上的数学概念:包括算术平均值、中位数、众数、以及加权平均数等等,从而将M’个组重新分成N个组,每个组对应的颜色可为该组中各颜色的平均值所对应的颜色。Optionally, after the first value color is mapped to the third value reference color, the second value of each of the third value reference colors is determined in descending order of the appearance probability of the color space. Colors. For example, N-1 colors are determined in descending order of appearance probability of each color in each of the M′ reference colors in the color space, and the remaining colors are mapped to the Nth color, and the Nth color may take the mapped The average of the color (M'-(N-1)). Similarly, the "average" is a mathematical concept in a broad sense: including arithmetic mean, median, mode, and weighted average, etc., so that The M' groups are subdivided into N groups, and the color corresponding to each group may be the color corresponding to the average value of each color in the group.
在一种可能的实现方式中,可通过颜色直方图来确定各颜色在颜色空间的分布特征。且根据本实施例方法的执行主体的角色不同,可从外部直接获取该颜色直方图,或由本实施例方法的执行主体自己来确定该颜色直方图,在这样的实现方式中,本实施方式的方法还包括:In a possible implementation, the color histogram can be used to determine the distribution characteristics of each color in the color space. The color histogram can be directly obtained from the outside, or the color histogram can be determined by the execution body of the method of the embodiment. In this implementation manner, the embodiment of the present embodiment is different. The method also includes:
S216.获取所述第一值个颜色的颜色直方图。S216. Obtain a color histogram of the first value color.
S218.至少基于所述颜色直方图,确定所述第一值个颜色中各颜色在颜色空间的分布特征。S218. Determine, according to the color histogram, a distribution feature of each color of the first value color in a color space.
综上,本实施方式的方法能够基于三维模型所具有的各颜色之间的相似性,实现减少三维模型具有的颜色数量,修改后的三维模型颜色更接近原三维模型。In summary, the method of the present embodiment can reduce the number of colors of the three-dimensional model based on the similarity between the colors of the three-dimensional model, and the modified three-dimensional model color is closer to the original three-dimensional model.
此外,为了进一步提高三维打印的效率,本实施方式的方法还可包括:In addition, in order to further improve the efficiency of three-dimensional printing, the method of the embodiment may further include:
S230.建立所述第一值个颜色到所述第二值个颜色的映射关系。S230. Establish a mapping relationship between the first value color and the second value color.
可选地,以颜色映射表的形式建立第一三维模型的M个颜色与第二三维模型的N个颜色值的映射关系,该映射表可长期保存,以供下一次打印时,在步骤S220中能够直接通过查找该映射表的形式确定N个颜色值,和/或在步骤240中能够至少依据上述映射关系修改所述第一三维模型的颜色,得到所述第二三维模型。
Optionally, the mapping relationship between the M colors of the first three-dimensional model and the N color values of the second three-dimensional model is established in a form of a color mapping table, and the mapping table may be saved for a long time for printing, in step S220. The N color values can be determined directly by looking up the form of the mapping table, and/or the color of the first three-dimensional model can be modified according to the mapping relationship at least in step 240 to obtain the second three-dimensional model.
仍以三角网格模型为例,如果颜色值在三角面上,则替换每个三角面的颜色;如果颜色值定义在三角面顶点上,则替换每个顶点的颜色;如果颜色值是从纹理贴图计算得出的,则替换纹理贴图上三维形体所对应的每个像素点的颜色。Still taking the triangle mesh model as an example, if the color value is on the triangle face, replace the color of each triangle face; if the color value is defined on the triangle face vertex, replace the color of each vertex; if the color value is from the texture The texture is calculated to replace the color of each pixel corresponding to the three-dimensional shape on the texture map.
综上,本实施方式的方法能够在三维模型不符合颜色数量限制时自动将其处理成符合颜色数量限制的三维模型,进而在颜色数量限制下实现正常的三维打印,且效率较高。In summary, the method of the embodiment can automatically process the three-dimensional model into a three-dimensional model conforming to the color quantity limit when the three-dimensional model does not meet the color quantity limit, thereby realizing normal three-dimensional printing under the limitation of the number of colors, and the efficiency is high.
本领域技术人员可以理解,在本申请具体实施方式的上述方法中,各步骤的序号大小并不意味着执行顺序的先后,各步骤的执行顺序应以其功能和内在逻辑确定,而不应对本申请具体实施方式的实施过程构成任何限定。It should be understood by those skilled in the art that in the above method of the specific embodiments of the present application, the sequence number of each step does not mean the order of execution sequence, and the order of execution of each step should be determined by its function and internal logic, and should not be addressed. The implementation process of applying for a specific embodiment constitutes any limitation.
此外,本申请实施例还提供了一种计算机可读介质,包括在被执行时进行以下操作的计算机可读指令:执行上述图1所示实施方式中的方法的各步骤的操作。Furthermore, embodiments of the present application further provide a computer readable medium comprising computer readable instructions that, when executed, perform the operations of the steps of the method of the embodiment shown in FIG.
此外,本申请实施例还提供了一种计算机可读介质,包括在被执行时进行以下操作的计算机可读指令:执行上述图2所示实施方式中的方法的各步骤的操作。Furthermore, embodiments of the present application further provide a computer readable medium comprising computer readable instructions that, when executed, perform the operations of the steps of the method of the embodiment shown in FIG.
图3(a)是根据本申请一种实施方式的三维模型处理装置的一种示例的结构框图。该装置可属于构建三维形体的三维模型的设备,也可属于三维打印设备,还可为独立于的装置,且除了下面将描述的各组成部分外,本实施方式的装置还包括在需要时与其他外部设备通信的通信模块。如图3(a)所示,该装置300包括:FIG. 3(a) is a structural block diagram showing an example of a three-dimensional model processing apparatus according to an embodiment of the present application. The device may belong to a device for constructing a three-dimensional model of a three-dimensional shape, may also belong to a three-dimensional printing device, and may also be a device independent, and the device of the embodiment further includes, when necessary, in addition to the components to be described below. A communication module for communication with other external devices. As shown in FIG. 3(a), the apparatus 300 includes:
第一确定模块320,用于响应于待打印的三维形体的第一三维模型具有的颜色数量超过一预设值,至少基于所述第一三维模型具有的颜色之间的相似性,确定与所述第一值个颜色对应的第二值个颜色,其中,所述第一值为所述第一三维模型具有的颜色数量,且所述第二值不超过所述第一值。The first determining module 320 is configured to determine, according to the similarity between the colors of the first three-dimensional model, the first three-dimensional model of the three-dimensional shape to be printed has a color number exceeding a preset value, The second value color corresponding to the first value color, wherein the first value is a quantity of colors that the first three-dimensional model has, and the second value does not exceed the first value.
在本实施例的装置中,所述预设值可为根据三维打印设备的颜色数量设置的,可选地,将预设值设置为不超过三维打印设备所具有的喷头数量,更
优选地,将该预设值设置为三维打印设备所具有的喷头数量。In the apparatus of this embodiment, the preset value may be set according to the number of colors of the three-dimensional printing device, and optionally, the preset value is set to not exceed the number of nozzles of the three-dimensional printing device, and
Preferably, the preset value is set to the number of nozzles that the three-dimensional printing device has.
处理模块340,用于至少依照所述第二值个颜色,将所述第一三维模型修改为第二三维模型。The processing module 340 is configured to modify the first three-dimensional model to a second three-dimensional model according to at least the second value color.
本实施方式的装置用于对不符合颜色数量限制的三维模型进行处理,使处理后的三维模型符合颜色数量限制。在本实施方式的装置中,将待打印的三维形体的初始三维模型称为第一三维模型。若该第一三维模型所具有的颜色数量符合颜色数量限制,则不对该第一三维模型进行任何处理;若该第一三维模型所具有的颜色数量不符合颜色数量限制,也即,超过该预设值,则需对其进行处理。第一确定模块320基于各颜色之间的相似性将第一值个颜色修改为第二值个颜色,为了使得处理后的三维模型,也即第二三维模型,具有能够符合颜色数量限制的减少了的颜色数量,第二值小于第一值。在一种可能的实现方式中,可至少根据三维打印设备所具有的喷头的数量设置该第二值,例如,将该第二值设置为不超过该喷头数量的值。The apparatus of the present embodiment is for processing a three-dimensional model that does not meet the color quantity limit, so that the processed three-dimensional model conforms to the color quantity limit. In the apparatus of the present embodiment, the initial three-dimensional model of the three-dimensional shape to be printed is referred to as a first three-dimensional model. If the number of colors of the first three-dimensional model conforms to the color quantity limit, no processing is performed on the first three-dimensional model; if the number of colors of the first three-dimensional model does not meet the color quantity limit, that is, the pre-existence is exceeded Set the value and you need to process it. The first determining module 320 modifies the first value color to the second value color based on the similarity between the colors, so that the processed three-dimensional model, that is, the second three-dimensional model, has a reduction in the number of colors that can be met. The number of colors, the second value is less than the first value. In a possible implementation, the second value may be set according to at least the number of nozzles that the three-dimensional printing device has, for example, the second value is set to a value that does not exceed the number of the nozzles.
综上,本实施例的装置能够在三维模型所具有的颜色超过颜色数量限制时,自动对其进行处理,以减少三维模型所具有的颜色,有助于在颜色数量限制下实现正常的三维打印。In summary, the device of the embodiment can automatically process the color of the three-dimensional model when the color of the three-dimensional model exceeds the limit of the number of colors, thereby reducing the color of the three-dimensional model and facilitating normal three-dimensional printing under the limitation of the number of colors. .
此外,如图3(b)所示,本实施方式的装置300还可包括:In addition, as shown in FIG. 3(b), the apparatus 300 of the present embodiment may further include:
第一获取模块312,用于获取所述第一三维模型。The first obtaining module 312 is configured to acquire the first three-dimensional model.
基于本实施方式的装置的不同角色,在一种可能的实现方式中,第一获取模块312可通过自己构建的方式获取该待打印的三维形体的初始三维模型,也即第一三维模型。在另一种可能的实现方式中,第一获取模块312可从外部获取已构建好的所述第一三维模型。Based on the different roles of the device of the present embodiment, in a possible implementation manner, the first obtaining module 312 can obtain an initial three-dimensional model of the three-dimensional shape to be printed, that is, the first three-dimensional model, by means of a self-constructed manner. In another possible implementation manner, the first obtaining module 312 can obtain the first three-dimensional model that has been constructed from the outside.
第二确定模块314,用于确定第一获取模块312获取的所述第一三维模型的颜色数量。The second determining module 314 is configured to determine a color quantity of the first three-dimensional model acquired by the first acquiring module 312.
类似的,基于本实施方式的装置的不同角色,在一种可能的实现方式中,第二确定模块314可自己统计确定该第一三维形体的颜色数量。在另一种可能的实现方式中,第二确定模块314可从本实施例方式的外部直接获知所述
第一三维模型的颜色数量。在由本实施方式的装置自己统计确定该第一三维形体的颜色数量的实现方式中,第二确定模块314可通过本领域技术人员所熟知的任意技术来统计所述第一三维模型的颜色数量。以所述第一三维模型为三角网格模型,并以红绿蓝(RGB)色彩空间的颜色值表示所述颜色为例:Similarly, based on the different roles of the device of the present embodiment, in a possible implementation manner, the second determining module 314 may determine the color quantity of the first three-dimensional shape by itself. In another possible implementation manner, the second determining module 314 can directly learn the manner from the outside of the mode of the embodiment.
The number of colors in the first 3D model. In an implementation in which the device of the present embodiment itself determines the number of colors of the first three-dimensional shape, the second determining module 314 can count the number of colors of the first three-dimensional model by any technique known to those skilled in the art. The first three-dimensional model is a triangular mesh model, and the color is represented by a color value of a red, green, and blue (RGB) color space as an example:
在一种可能的实现方式中,如果颜色值在三角面上,则可至少根据所述第一三维模型的各三角面的颜色,确定所述第一三维模型的颜色数量。In a possible implementation, if the color value is on a triangular surface, the number of colors of the first three-dimensional model may be determined according to at least the color of each triangular surface of the first three-dimensional model.
在另一种可能的实现方式中,如果颜色值定义在三角面各顶点上,则可至少根据所述第一三维模型的各三角面的每个顶点的颜色,确定所述第一三维模型的颜色数量。In another possible implementation manner, if the color value is defined on each vertices of the triangular face, the first three-dimensional model may be determined according to at least the color of each vertex of each triangular face of the first three-dimensional model. The number of colors.
在又一种可能的实现方式中,如果颜色值是从纹理贴图(texture)计算得出的,则可至少根据所述第一三维模型的各三角面对应的纹理贴图,确定所述第一三维模型的颜色数量。In still another possible implementation, if the color value is calculated from a texture, the first may be determined according to at least the texture map corresponding to each triangle of the first three-dimensional model. The number of colors in the 3D model.
令第一三维模型所具有的颜色数量为第一值M,第一确定模块320基于该M个颜色之间的相似性确定第二值N个颜色,N<M。第一确定模块320可基于本领域的技术人员所熟知的任何技术,使用合适的指标来度量颜色之间的相似性,从而将M个颜色划分为N个子空间,并确定每个子空间对应的颜色。The first three-dimensional model has a first number M of colors, and the first determining module 320 determines a second value N colors based on the similarity between the M colors, N<M. The first determining module 320 can measure the similarity between the colors using suitable indicators based on any technique known to those skilled in the art, thereby dividing the M colors into N subspaces, and determining the color corresponding to each subspace. .
在一种可能的实现方式中,可基于预设的聚类算法将M个颜色聚类成N个颜色,具言之,如图3(c)所示的,第一确定模块320可包括:In a possible implementation, the M colors may be clustered into N colors based on a preset clustering algorithm. In other words, as shown in FIG. 3(c), the first determining module 320 may include:
划分单元322,用于至少基于预设的聚类算法,将所述第一值(M)个颜色划分为第二值(N)个类。The dividing unit 322 is configured to divide the first value (M) colors into second value (N) classes based on at least a preset clustering algorithm.
其中,所述预设的聚类算法包括但不限于:K均值算法(K-Means),期望最大化算法(EM)、BIRCH算法、OPTICS算法,等等。在每种聚类算法中,可采用任一种合适的指标,包括但不限于欧几里得距离、平方欧几里得距离,曼哈顿距离、最大距离或马氏距离,等等。The preset clustering algorithm includes but is not limited to: a K-means algorithm (K-Means), an expectation maximization algorithm (EM), a BIRCH algorithm, an OPTICS algorithm, and the like. In each clustering algorithm, any suitable index may be used, including but not limited to Euclidean distance, square Euclidean distance, Manhattan distance, maximum distance or Mahalanobis distance, and the like.
第一确定单元324,用于至少基于所述每个类对应的M个颜色中的各颜色,确定每个类对应的颜色,进而确定N个颜色。
The first determining unit 324 is configured to determine a color corresponding to each class based on at least each of the M colors corresponding to each class, and further determine N colors.
可选地,第一确定单元324可确定每个类所对应的M个颜色中各颜色的平均值为该类对应的颜色。本领域的技术人员能够理解的,在本申请实施例的装置中,“平均值”为广义上的数学概念:包括算术平均值、中位数、众数、以及加权平均数等等。以红绿蓝(RGB)色彩空间为例(但不限于此),假设第一类颜色对应M个颜色中的两个颜色,则将该两个颜色对应的RGB值的平均值作为该第一类颜色最终的颜色值。Optionally, the first determining unit 324 may determine that an average value of each of the M colors corresponding to each class is a color corresponding to the class. It will be understood by those skilled in the art that in the apparatus of the embodiments of the present application, the "average value" is a mathematical concept in a broad sense: an arithmetic mean, a median, a mode, a weighted average, and the like. Taking the red, green and blue (RGB) color space as an example (but not limited thereto), assuming that the first type of color corresponds to two of the M colors, the average of the RGB values corresponding to the two colors is taken as the first The final color value of the class color.
在另一种可能的实现方式中,如图3(d)所示的,第一确定模块320可包括:In another possible implementation manner, as shown in FIG. 3(d), the first determining module 320 may include:
映射单元322’,用于至少基于所述第一值个颜色与第三值个参考颜色之间的相似性,将所述第一值个颜色映射到该第三值个参考颜色,其中,所述第三值不小于所述第二值。The mapping unit 322' is configured to map the first value color to the third value reference color based on at least the similarity between the first value color and the third value reference color, where The third value is not less than the second value.
具体地,基于M个颜色值与第三值M’个参考颜色之间的接近程度,将M个颜色映射成M’个参考颜色,其中,M’≥N。Specifically, based on the degree of closeness between the M color values and the third value M' reference colors, M colors are mapped into M' reference colors, where M' ≥ N.
其中,可根据颜色空间模型中的主体颜色确定所述参考颜色,并根据打印材料提供的颜色等确定参考颜色的数量,也即第三值。参考颜色通常为固定值,可取颜色空间模型中的主体颜色,以RGB颜色空间为例,RGB颜色模型通常采用单位立方体来表示,该颜色空间模型中的主体颜色在立方体的八个顶点上,也即:红、绿、蓝、黄、水绿(Cyan)、洋红(Magenta)、白、黑。第一值个颜色与第三值个参考颜色之间的相似性也可采用各种度量指标确定,优选地,可以第一值个颜色与第三值个参考颜色在颜色空间模型上的距离来确定将分别将第一值个颜色映射到第三值个参考颜色中的哪一个。Wherein, the reference color may be determined according to the color of the subject in the color space model, and the number of reference colors, that is, the third value, is determined according to the color or the like provided by the printed material. The reference color is usually a fixed value, and the color of the subject in the color space model is taken. Taking the RGB color space as an example, the RGB color model is usually represented by a unit cube, and the color of the body in the color space model is on the eight vertices of the cube. Namely: red, green, blue, yellow, water green (Cyan), magenta (Magenta), white, black. The similarity between the first value color and the third value reference color may also be determined by various metrics, preferably, the distance between the first value color and the third value reference color on the color space model may be It is determined which of the third value reference colors will be mapped to the first value color, respectively.
第二确定单元324’,用于至少基于映射后的第三值个参考颜色在颜色空间的分布特征,确定所述第二值个颜色。The second determining unit 324' is configured to determine the second value color based on at least the distribution feature of the mapped third value reference color in the color space.
可选地,第二确定单元324’可依照将第一值个颜色映射成第三值个参考颜色后,第三值个参考颜色中的各颜色在颜色空间分布比例总和从大到小的顺序确定所述第二值个颜色。例如,按照各M’个参考颜色中各颜色在颜色空间的出现概率从大到小的顺序确定N-1个颜色,其余颜色映射为第N种
颜色,该第N种颜色可取所映射的各颜色(M’-(N-1))的平均值,同样,该“平均值”为广义上的数学概念:包括算术平均值、中位数、众数、以及加权平均数等等,从而将M’个组重新分成N个组,每个组对应的颜色可为该组中各颜色的平均值所对应的颜色。Optionally, the second determining unit 324 ′ may be configured to map the first value color to the third value reference color, and the color of the third color reference color in the color space distribution ratio is in descending order Determining the second value of the color. For example, N-1 colors are determined in descending order of appearance probability of each color in each of the M' reference colors in the color space, and the remaining colors are mapped to the Nth type.
Color, the Nth color may take the average of the mapped colors (M'-(N-1)), and similarly, the "average" is a mathematical concept in a broad sense: including arithmetic mean, median, The majority, as well as the weighted average, etc., thereby reclassifying the M' groups into N groups, the color corresponding to each group being the color corresponding to the average of the colors in the group.
在一种可能的实现方式中,可通过颜色直方图来确定各颜色在颜色空间的分布特征。且根据本实施例装置的角色不同,可从外部直接获取该颜色直方图,或由本实施例装置自己来确定该颜色直方图,在这样的实现方式中,如图3(e)所示的,本实施方式的装置300还可包括:In a possible implementation, the color histogram can be used to determine the distribution characteristics of each color in the color space. According to the different roles of the device in this embodiment, the color histogram can be directly obtained from the outside, or the color histogram can be determined by the device of the embodiment. In such an implementation, as shown in FIG. 3( e ), The apparatus 300 of this embodiment may further include:
第二获取模块316,用于获取所述第一值个颜色的颜色直方图。The second obtaining module 316 is configured to obtain a color histogram of the first value color.
第三确定模块318,用于至少基于所述颜色直方图,确定所述第一值个颜色中各颜色在颜色空间的分布特征。The third determining module 318 is configured to determine a distribution feature of each color of the first value color in the color space based on at least the color histogram.
综上,本实施方式的装置能够基于三维模型所具有的各颜色之间的相似性,实现减少三维模型具有的颜色数量,修改后的三维模型颜色更接近原三维模型。In summary, the apparatus of the present embodiment can reduce the number of colors of the three-dimensional model based on the similarity between the colors of the three-dimensional model, and the modified three-dimensional model color is closer to the original three-dimensional model.
此外,为了进一步提高本实施方式装置的效率,进而有助于三维打印效率的提高,如图3(f)所示的,本实施方式的装置300还可包括:In addition, in order to further improve the efficiency of the device of the present embodiment, and further contribute to the improvement of the three-dimensional printing efficiency, as shown in FIG. 3(f), the device 300 of the present embodiment may further include:
建立模块330,用于建立所述第一值个颜色到所述第二值个颜色的映射关系。The establishing module 330 is configured to establish a mapping relationship between the first value color and the second value color.
可选地,建立模块330以颜色映射表的形式建立第一三维模型的M个颜色与第二三维模型的N个颜色值的映射关系并保存该映射表,以供下一次处理中,第一确定模块320可直接通过查找该映射表的形式确定N个颜色值,和/或处理模块340可根据至少依据上述映射关系修改所述第一三维模型的颜色,得到所述第二三维模型。Optionally, the establishing module 330 establishes a mapping relationship between the M colors of the first three-dimensional model and the N color values of the second three-dimensional model in a form of a color mapping table, and saves the mapping table for the next processing, the first The determining module 320 may determine N color values directly by looking up the form of the mapping table, and/or the processing module 340 may modify the color of the first three-dimensional model according to at least the mapping relationship to obtain the second three-dimensional model.
仍以三角网格模型为例,如果颜色值在三角面上,则替换每个三角面的颜色;如果颜色值定义在三角面各顶点上,则替换每个顶点的颜色;如果颜色值是从纹理贴图计算得出的,则替换纹理贴图上三维形体所对应的每个像素点的颜色。
Still taking the triangular mesh model as an example, if the color value is on the triangular face, replace the color of each triangular face; if the color value is defined on each of the vertices of the triangular face, replace the color of each vertex; if the color value is from The texture map is calculated to replace the color of each pixel corresponding to the three-dimensional shape on the texture map.
综上,本实施方式的装置能够在三维模型不符合颜色数量限制时自动将其处理成符合颜色数量限制的三维模型,有助于在颜色数量限制下实现正常的三维打印,且效率较高。In summary, the device of the present embodiment can automatically process a three-dimensional model into a three-dimensional model that conforms to the color quantity limit when the three-dimensional model does not meet the color quantity limit, and contributes to normal three-dimensional printing under the color number limitation, and has high efficiency.
图4(a)是根据本申请一种实施方式的三维打印设备的一种示例的结构框图,且除了下面将描述的各组成部分外,本实施方式的装置还包括在需要时与其他外部设备通信的通信模块。如图4(a)所示的,该设备400包括图3(a)至图3(f)中所示的任意三维模型处理装置300,还包括打印模块420,用于按照三维模型处理装置300处理得到的第二三维模型打印待打印的三维形体。如图4(b)所示的,打印模块420包括至少两个喷头422-1,422-2,…,422n(n=1,2,…,N),其中,所述第二三维模型具有不超过喷头数量的第二值N个颜色。4(a) is a structural block diagram of an example of a three-dimensional printing apparatus according to an embodiment of the present application, and the apparatus of the present embodiment includes, when necessary, other external apparatuses, in addition to the components to be described below. Communication module for communication. As shown in FIG. 4(a), the apparatus 400 includes any three-dimensional model processing apparatus 300 shown in FIGS. 3(a) to 3(f), and further includes a printing module 420 for processing the apparatus 300 according to the three-dimensional model. The obtained second three-dimensional model prints the three-dimensional shape to be printed. As shown in FIG. 4(b), the printing module 420 includes at least two heads 422-1, 422-2, ..., 422n (n = 1, 2, ..., N), wherein the second three-dimensional model has no more than The second value of the number of nozzles is N colors.
本实施方式的三维打印设备能够在三维模型所具有的颜色超过颜色数量限制时,自动将其处理成具有减少了颜色的三维模型,从而能够在颜色数量限制下实现正常的三维打印,且效率较高。The three-dimensional printing apparatus of the present embodiment can automatically process a three-dimensional model into a three-dimensional model having a reduced color when the color of the three-dimensional model exceeds the limit of the number of colors, thereby enabling normal three-dimensional printing under the limitation of the number of colors, and the efficiency is relatively high. high.
应当理解的是,本发明的上述具体实施方式仅仅用于示例性说明或解释本发明的原理,而不构成对本发明的限制。因此,在不偏离本发明的精神和范围的情况下所做的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。此外,本发明所附权利要求旨在涵盖落入所附权利要求范围和边界、或者这种范围和边界的等同形式内的全部变化和修改例。
The above-described embodiments of the present invention are intended to be illustrative only and not to limit the invention. Therefore, any modifications, equivalent substitutions, improvements, etc., which are made without departing from the spirit and scope of the invention, are intended to be included within the scope of the invention. Rather, the scope of the appended claims is intended to cover all such modifications and modifications
Claims (39)
- 一种三维模型处理方法,其特征在于,所述方法包括:A three-dimensional model processing method, the method comprising:响应于待打印的三维形体的第一三维模型具有的颜色数量超过一预设值,至少基于所述第一三维模型具有的颜色之间的相似性,确定与第一值个颜色对应的第二值个颜色,其中,所述第一值为所述第一三维模型具有的颜色数量,且所述第二值不超过所述第一值;Responding to the first three-dimensional model of the three-dimensional shape to be printed having a number of colors exceeding a preset value, determining a second corresponding to the first value color based on at least a similarity between colors of the first three-dimensional model a value of a color, wherein the first value is a number of colors of the first three-dimensional model, and the second value does not exceed the first value;至少依照所述第二值个颜色,将所述第一三维模型修改为第二三维模型。The first three-dimensional model is modified to a second three-dimensional model according to at least the second value color.
- 根据权利要求1所述的方法,其中,所述方法还包括:The method of claim 1 wherein the method further comprises:获取所述第一三维模型;Obtaining the first three-dimensional model;确定所述第一三维形体的颜色数量。Determining the number of colors of the first three-dimensional shape.
- 根据权利要求2所述的方法,其中,所述第一三维模型为三角网格模型。The method of claim 2 wherein the first three dimensional model is a triangular mesh model.
- 根据权利要求3所述的方法,其中,所述确定所述第一三维形体的颜色数量中:The method of claim 3, wherein said determining the number of colors of said first three-dimensional shape is:至少根据所述第一三维模型的各三角面的颜色,确定所述第一三维模型的颜色数量。Determining the number of colors of the first three-dimensional model based on at least the color of each triangular face of the first three-dimensional model.
- 根据权利要求3所述的方法,其中,所述确定所述第一三维形体的颜色数量中:The method of claim 3, wherein said determining the number of colors of said first three-dimensional shape is:至少根据所述第一三维模型的各三角面的每个顶点的颜色,确定所述第一三维模型的颜色数量。Determining the number of colors of the first three-dimensional model based on at least the color of each vertex of each of the triangular faces of the first three-dimensional model.
- 根据权利要求3所述的方法,其中,所述确定所述第一三维形体当前的颜色数量中:The method of claim 3, wherein said determining the current number of colors of said first three-dimensional shape is:至少根据所述第一三维模型的各三角面对应的纹理贴图,确定所述第一三维模型的颜色数量。 Determining the number of colors of the first three-dimensional model based on at least the texture map corresponding to each triangular face of the first three-dimensional model.
- 根据权利要求1所述的方法,其中,所述至少基于所述第一值个颜色之间的相似性,确定与所述第一值个颜色对应的第二值个颜色包括:The method of claim 1, wherein the determining the second value color corresponding to the first value color based on at least the similarity between the first values of colors comprises:至少基于预设的聚类算法,将所述第一值个颜色划分为第二值个类;Decoding the first value color into a second value class based on at least a preset clustering algorithm;至少基于所述每个类对应的所述第一值个颜色中的各颜色,确定每个所述类的颜色。The color of each of the classes is determined based at least on each of the first value colors corresponding to each of the classes.
- 根据权利要求7所述的方法,其中,所述确定每个所述类的颜色中:The method of claim 7 wherein said determining the color of each of said classes:确定每个所述类对应的所述第一值个颜色中各颜色的平均值为所述类对应的颜色。Determining an average value of each of the first value colors corresponding to each of the classes is a color corresponding to the class.
- 根据权利要求1所述的方法,其中,所述方法还包括:The method of claim 1 wherein the method further comprises:获取所述第一值个颜色的颜色直方图;Obtaining a color histogram of the first value color;至少基于所述颜色直方图,确定所述第一值个颜色中各颜色在颜色空间的分布特征。A distribution characteristic of each of the first value colors in the color space is determined based at least on the color histogram.
- 根据权利要求9所述的方法,其中,所述至少基于所述第一值个颜色之间的相似性,确定与所述第一值个颜色对应的第二值个颜色包括:The method of claim 9, wherein the determining the second value color corresponding to the first value color based on at least the similarity between the first values of colors comprises:至少基于所述第一值个颜色与第三值个参考颜色之间的相似性,将所述第一值个颜色映射到所述第三值个参考颜色,其中,所述第三值不小于所述第二值;Mapping the first value color to the third value reference color based on at least a similarity between the first value color and the third value reference color, wherein the third value is not less than The second value;至少基于所述第三值个参考颜色在颜色空间的分布特征,确定所述第二值个颜色。The second value color is determined based on at least a distribution characteristic of the third value reference color in the color space.
- 根据权利要求10所述的方法,其中,所述确定所述第二值个颜色中:The method of claim 10 wherein said determining said second value of colors is:至少基于所述第三值个参考颜色在颜色空间的分布特征,依照所述第三值个参考颜色在颜色空间的出现概率从大到小的顺序,确定所述第二值个颜色。And determining, according to the distribution feature of the third value reference color in the color space, the second value color according to an order of occurrence of the third value reference color in the color space from large to small.
- 根据权利要求1所述的方法,其中,所述方法还包括:The method of claim 1 wherein the method further comprises:建立所述第一值个颜色到所述第二值个颜色的映射关系; Establishing a mapping relationship between the first value color and the second value color;在所述将所述第一三维模型修改为第二三维模型中:Modifying the first three-dimensional model into the second three-dimensional model:至少依据上述映射关系修改所述第一三维模型的颜色,得到所述第二三维模型。Modifying the color of the first three-dimensional model according to at least the mapping relationship to obtain the second three-dimensional model.
- 根据权利要求1至12中任一项所述的方法,其中,所述第二值不超过将用于打印所述待打印的三维形体的三维打印设备的喷头的数量。The method according to any one of claims 1 to 12, wherein the second value does not exceed the number of nozzles of the three-dimensional printing apparatus to be used for printing the three-dimensional shape to be printed.
- 一种三维打印方法,其特征在于,所述方法包括:A three-dimensional printing method, the method comprising:响应于待打印的三维形体的第一三维模型具有的颜色数量超过一预设值,至少基于所述第一三维模型具有的颜色之间的相似性,确定与所述第一值个颜色对应的第二值个颜色,其中,所述第一值为所述第一三维模型具有的颜色数量,且所述第二值不超过所述第一值;Responding to the first three-dimensional model of the three-dimensional shape to be printed having a number of colors exceeding a preset value, determining, according to the similarity between the colors of the first three-dimensional model, determining the color corresponding to the first value a second value color, wherein the first value is a number of colors of the first three-dimensional model, and the second value does not exceed the first value;至少依照所述第二值个颜色,将所述第一三维模型修改为第二三维模型;Modifying the first three-dimensional model to a second three-dimensional model according to at least the second value color;按照所述第二三维模型打印所述待打印的三维形体。Printing the three-dimensional shape to be printed according to the second three-dimensional model.
- 根据权利要求14所述的方法,其中,所述方法还包括:The method of claim 14, wherein the method further comprises:获取所述第一三维模型;Obtaining the first three-dimensional model;确定所述第一三维形体的颜色数量。Determining the number of colors of the first three-dimensional shape.
- 根据权利要求15所述的方法,其中,所述第一三维模型为三角网格模型。The method of claim 15 wherein the first three dimensional model is a triangular mesh model.
- 根据权利要求16所述的方法,其中,所述确定所述第一三维形体的颜色数量中:The method of claim 16 wherein said determining the number of colors of said first three-dimensional shape is:至少根据所述第一三维模型的各三角面的颜色,确定所述第一三维模型的颜色数量。Determining the number of colors of the first three-dimensional model based on at least the color of each triangular face of the first three-dimensional model.
- 根据权利要求16所述的方法,其中,所述确定所述第一三维形体的颜色数量中:The method of claim 16 wherein said determining the number of colors of said first three-dimensional shape is:至少根据所述第一三维模型的各三角面的每个顶点的颜色,确定所述第一三维模型的颜色数量。 Determining the number of colors of the first three-dimensional model based on at least the color of each vertex of each of the triangular faces of the first three-dimensional model.
- 根据权利要求16所述的方法,其中,所述确定所述第一三维形体当前的颜色数量中:The method of claim 16 wherein said determining said current number of colors of said first three-dimensional shape is:至少根据所述第一三维模型的各三角面对应的纹理贴图,确定所述第一三维模型的颜色数量。Determining the number of colors of the first three-dimensional model based on at least the texture map corresponding to each triangular face of the first three-dimensional model.
- 根据权利要求14所述的方法,其中,所述至少基于所述第一值个颜色之间的相似性,确定与所述第一值个颜色对应的第二值个颜色包括:The method of claim 14, wherein the determining the second value color corresponding to the first value color based on at least the similarity between the first values of colors comprises:至少基于预设的聚类算法,将所述第一值个颜色划分为第二值个类;Decoding the first value color into a second value class based on at least a preset clustering algorithm;至少基于所述每个类对应的所述第一值个颜色中的各颜色,确定每个所述类的颜色。The color of each of the classes is determined based at least on each of the first value colors corresponding to each of the classes.
- 根据权利要求20所述的方法,其中,所述确定每个所述类的颜色中:The method of claim 20 wherein said determining the color of each of said classes:确定每个所述类对应的所述第一值个颜色中各颜色的平均值为所述类对应的颜色。Determining an average value of each of the first value colors corresponding to each of the classes is a color corresponding to the class.
- 根据权利要求14所述的方法,其中,所述方法还包括:The method of claim 14, wherein the method further comprises:获取所述第一值个颜色的颜色直方图;Obtaining a color histogram of the first value color;至少基于所述颜色直方图,确定所述第一值个颜色中各颜色在颜色空间的分布特征。A distribution characteristic of each of the first value colors in the color space is determined based at least on the color histogram.
- 根据权利要求22所述的方法,其中,所述至少基于所述第一值个颜色之间的相似性,确定与所述第一值个颜色对应的第二值个颜色包括:The method of claim 22, wherein the determining the second value color corresponding to the first value color based on at least the similarity between the first values of colors comprises:至少基于所述第一值个颜色与参考颜色之间的相似性,将所述第一值个颜色映射到所述第三值个参考颜色,其中,所述第三值不小于所述第二值;Mapping the first value color to the third value reference color based on at least the similarity between the first value color and the reference color, wherein the third value is not less than the second value;至少基于所述第三值个参考颜色在颜色空间的分布特征,确定所述第二值个颜色。The second value color is determined based on at least a distribution characteristic of the third value reference color in the color space.
- 根据权利要求23所述的方法,其中,所述确定所述第二值个颜色中:The method of claim 23 wherein said determining said second value of colors is:至少基于所述第三值个参考颜色在颜色空间的分布特征,依照所述第 三个值参考颜色在颜色空间的出现概率从大到小的顺序,确定所述第二值个颜色。At least based on the distribution characteristics of the third value reference color in the color space, according to the The second value is determined by the order in which the three value reference colors appear in the color space from large to small.
- 根据权利要求14所述的方法,其中,所述方法还包括:The method of claim 14, wherein the method further comprises:建立所述第一值个颜色到所述第二值个颜色的映射关系;Establishing a mapping relationship between the first value color and the second value color;在所述将所述第一三维模型修改为第二三维模型中:Modifying the first three-dimensional model into the second three-dimensional model:至少依据上述映射关系将所述第一三维模型修改为第二三维模型Modifying the first three-dimensional model to a second three-dimensional model according to at least the above mapping relationship
- 根据权利要求13至25中任一项所述的方法,其中,所述第二值不超过将用于打印所述待打印的三维形体的三维打印设备的喷头的数量。The method according to any one of claims 13 to 25, wherein the second value does not exceed the number of nozzles of the three-dimensional printing apparatus to be used for printing the three-dimensional body to be printed.
- 一种三维模型处理装置,其特征在于,所述装置包括:A three-dimensional model processing device, characterized in that the device comprises:一第一确定模块,用于响应于待打印的三维形体的第一三维模型具有的颜色数量超过一预设值,至少基于所述第一三维模型具有的颜色之间的相似性,确定与所述第一值个颜色对应的第二值个颜色,其中,所述第一值为所述第一三维模型具有的颜色数量,且所述第二值不超过所述第一值;a first determining module, configured to determine, according to the similarity between the colors of the first three-dimensional model, the first three-dimensional model of the three-dimensional shape to be printed has a color number exceeding a preset value a second value color corresponding to the first value color, wherein the first value is a quantity of colors that the first three-dimensional model has, and the second value does not exceed the first value;一处理模块,用于至少依照所述第二值个颜色,将所述第一三维模型修改为第二三维模型。a processing module, configured to modify the first three-dimensional model to a second three-dimensional model according to at least the second value color.
- 根据权利要求27所述的装置,其中,所述装置还包括:The device of claim 27, wherein the device further comprises:一第一获取模块,用于获取所述第一三维模型;a first acquiring module, configured to acquire the first three-dimensional model;一第二确定模块,用于确定所述第一三维形体的颜色数量。A second determining module is configured to determine the number of colors of the first three-dimensional shape.
- 根据权利要求28所述的装置,其中,所述第二确定模块用于至少根据所述第一三维模型的各三角面的颜色,确定所述第一三维模型的颜色数量。The apparatus according to claim 28, wherein said second determining module is configured to determine a color number of said first three-dimensional model based on at least a color of each triangular face of said first three-dimensional model.
- 根据权利要求28所述的装置,其中,所述第二确定模块用于至少根据所述第一三维模型的各三角面的每个顶点的颜色,确定所述第一三维模型的颜色数量。The apparatus according to claim 28, wherein said second determining module is configured to determine a color number of said first three-dimensional model based on at least a color of each vertex of each triangular face of said first three-dimensional model.
- 根据权利要求28所述的装置,其中,所述第二确定模块用于至少根据所述第一三维模型的各三角面对应的纹理贴图,确定所述第一三维 模型的颜色数量。The apparatus according to claim 28, wherein said second determining module is configured to determine said first three-dimensional image based on at least a texture map corresponding to each triangular face of said first three-dimensional model The number of colors in the model.
- 根据权利要求27所述的装置,其中,所述第一确定模块包括:The apparatus of claim 27, wherein the first determining module comprises:一划分单元,用于至少基于预设的聚类算法,将所述第一值个颜色划分为第二值个类;a dividing unit, configured to divide the first value color into a second value class based on at least a preset clustering algorithm;一第一确定单元,用于至少基于所述每个类对应的所述第一值个颜色中的各颜色,确定每个所述类的颜色。a first determining unit, configured to determine a color of each of the classes based on at least each of the first value colors corresponding to each of the classes.
- 根据权利要求32所述的装置,其中,所述第一确定单元用于确定每个所述类对应的所述第一值个颜色中各颜色的平均值为所述类对应的颜色。The apparatus according to claim 32, wherein said first determining unit is configured to determine an average value of each of said first value colors corresponding to each of said classes is a color corresponding to said class.
- 根据权利要求27所述的装置,其中,所述装置还包括:The device of claim 27, wherein the device further comprises:一第二获取模块,用于获取所述第一值个颜色的颜色直方图;a second acquiring module, configured to acquire a color histogram of the first value color;一第三确定模块,用于至少基于所述颜色直方图,确定所述第一值个颜色中各颜色在颜色空间的分布特征。a third determining module, configured to determine, according to the color histogram, a distribution feature of each color of the first value color in a color space.
- 根据权利要求34所述的装置,其中,所述第一确定模块包括:The apparatus of claim 34, wherein the first determining module comprises:一映射单元,用于至少基于所述第一值个颜色与第三值个参考颜色之间的相似性,将所述第一值个颜色映射到所述第三值个参考颜色,其中,所述第三值不小于所述第二值;a mapping unit, configured to map the first value color to the third value reference color based on at least a similarity between the first value color and the third value reference color, wherein Said third value is not less than said second value;一第二确定单元,用于至少基于所述第三值个参考颜色在颜色空间的分布特征,确定所述第二值个颜色。a second determining unit, configured to determine the second value color based on at least a distribution feature of the third value reference color in the color space.
- 根据权利要求35所述的装置,其中,所述第二确定单元用于至少基于所述第三值个参考颜色在颜色空间的分布特征,依照所述第三值个参考颜色在颜色空间的出现概率从大到小的顺序,确定所述第二值个颜色。The apparatus according to claim 35, wherein said second determining unit is configured to generate an appearance in a color space according to said third value reference color based on at least a distribution characteristic of said third value reference color in a color space The second value color is determined in descending order of probability.
- 根据权利要求27所述的装置,其中,所述装置还包括:The device of claim 27, wherein the device further comprises:一建立模块,用于建立所述第一值个颜色到所述第二值个颜色的映射关系;a establishing module, configured to establish a mapping relationship between the first value color and the second value color;所述处理模块用于至少依据上述映射关系修改所述第一三维模型的颜色,得到所述第二三维模型。 The processing module is configured to modify a color of the first three-dimensional model according to at least the mapping relationship to obtain the second three-dimensional model.
- 一种三维打印设备,其特征在于,所述设备包括权利要求27至37中任一项所述的三维模型处理装置,还包括:A three-dimensional printing apparatus, comprising: the three-dimensional model processing apparatus according to any one of claims 27 to 37, further comprising:一打印模块,用于按照所述三维模型处理装置修改得到的所述第二三维模型,打印待打印的三维形体。a printing module, configured to print the three-dimensional shape to be printed according to the second three-dimensional model modified by the three-dimensional model processing device.
- 根据权利要求38所述的方法,其中,所述打印模块包括至少两个喷头,所述第二三维模型具有不超过所述喷头数量的颜色。 The method of claim 38, wherein the printing module comprises at least two showerheads, the second three-dimensional model having a color that does not exceed the number of the showerheads.
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510217283.X | 2015-04-30 | ||
CN201510217283.XA CN105150530B (en) | 2015-04-30 | 2015-04-30 | Threedimensional model processing method and its device, 3 D-printing method and 3 D-printing equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2016173069A1 true WO2016173069A1 (en) | 2016-11-03 |
Family
ID=54791714
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2015/080193 WO2016173069A1 (en) | 2015-04-30 | 2015-05-29 | Three-dimensional model processing method and apparatus thereof, three-dimensional printing method, and three-dimensional printing device |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN105150530B (en) |
WO (1) | WO2016173069A1 (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108257205B (en) * | 2016-12-29 | 2021-11-12 | 阿里巴巴集团控股有限公司 | Three-dimensional model construction method, device and system |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101662567A (en) * | 2008-08-27 | 2010-03-03 | 佳能株式会社 | Color chart, its data and generating method, printer device and method, its calibration method and color calibration system |
CN102982577A (en) * | 2011-06-14 | 2013-03-20 | 三星电子株式会社 | Image processing apparatus and method |
CN104574486A (en) * | 2013-10-28 | 2015-04-29 | 南京财经大学 | On-line three-dimensional quick visualization algorithm based on texture compression |
CN104553422A (en) * | 2013-10-11 | 2015-04-29 | 中国印刷科学技术研究所 | 3D color surface ink-jet printing method |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
GB2502295B (en) * | 2012-05-22 | 2015-12-09 | Mcor Technologies Ltd | Colour 3-dimensional printing with 3D gamut mapping |
-
2015
- 2015-04-30 CN CN201510217283.XA patent/CN105150530B/en active Active
- 2015-05-29 WO PCT/CN2015/080193 patent/WO2016173069A1/en active Application Filing
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101662567A (en) * | 2008-08-27 | 2010-03-03 | 佳能株式会社 | Color chart, its data and generating method, printer device and method, its calibration method and color calibration system |
CN102982577A (en) * | 2011-06-14 | 2013-03-20 | 三星电子株式会社 | Image processing apparatus and method |
CN104553422A (en) * | 2013-10-11 | 2015-04-29 | 中国印刷科学技术研究所 | 3D color surface ink-jet printing method |
CN104574486A (en) * | 2013-10-28 | 2015-04-29 | 南京财经大学 | On-line three-dimensional quick visualization algorithm based on texture compression |
Also Published As
Publication number | Publication date |
---|---|
CN105150530B (en) | 2017-09-08 |
CN105150530A (en) | 2015-12-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9833948B2 (en) | 3D printing of colored models on multi-head printers | |
JP6859288B2 (en) | Color 3D printing method and 3D printing equipment | |
US10401834B2 (en) | Generating control data for sub-objects | |
US20050254073A1 (en) | Determining sets of n-dimensional colorant control signals | |
EP3313057A1 (en) | A method and a computer product for joint color and translucency 3d printing, a joint color and translucency 3d printing device and a printing object | |
CN110696351A (en) | Inkjet position adjustment method and three-dimensional printing apparatus | |
TWI674977B (en) | Color three-dimensional printing method and three-dimensional printing equipment | |
EP3250973A1 (en) | Control data for generation of 3d objects | |
WO2024179065A1 (en) | Three-dimensional printing method and apparatus, device, and storage medium | |
CN110253889A (en) | A multi-material 3D printing method based on digital raster image processor | |
TW201825262A (en) | Method of Slicing and Printing Multi-Colour 3D Object | |
TWI681310B (en) | Image file transform method and three-dimensional printing system | |
WO2016173069A1 (en) | Three-dimensional model processing method and apparatus thereof, three-dimensional printing method, and three-dimensional printing device | |
CN108437440B (en) | 3D printing color rendering method, device and system based on color management | |
WO2018107652A1 (en) | Full-color data processing method and apparatus applicable to 3d objects | |
CN110696350A (en) | Inkjet width adjustment method and three-dimensional printing apparatus | |
JP2018065293A (en) | Data processing device, solid molding system and program | |
US10943384B2 (en) | Utilizing smooth shading patches in image rendering | |
US20210197486A1 (en) | Determining property mapping resources with property constraints | |
US20230205171A1 (en) | System and method for printing a three-dimensional object | |
TWI716704B (en) | Inkjet width adjustment method and three-dimensional printing equiment | |
TWI716703B (en) | Inkjet position adjustment method and three-dimensional printing equiment | |
CN116766597A (en) | Three-dimensional printing method, device, equipment and storage medium | |
JP6926715B2 (en) | 3D modeling data generation device, 3D modeling device, and 3D modeling data generation program | |
Zhao et al. | A printer reverse characterization model based on BP neural network |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 15890448 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 15890448 Country of ref document: EP Kind code of ref document: A1 |