Surface treatment method, device, storage medium and equipment for 3D printing model
By acquiring the contours of a 3D model in different directions, determining the grayscale values of pixels, and performing interpolation, the problem of stepped jagged edges on the surface of photopolymer 3D printed models is solved, resulting in a smoother model surface suitable for various models.
Patent Information
- Application Number
- CN202310249142.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-14
- Publication Date
- 2026-02-27
- Estimated Expiration
- 2043-03-14
AI Technical Summary
The surface of photopolymer 3D printed models has stepped serrations that cannot be effectively treated, especially the serrations in the Z direction, which affect the surface quality of the model.
By acquiring the contours of the 3D model in the first and second directions, confirming the contour type, and determining the first and second gray values of the pixels based on the contour type, the target gray value is calculated using interpolation and piecewise linear interpolation methods, and then 3D printing is performed to eliminate the stepped jagged edges.
It effectively eliminates the stepped jagged edges on the surface of the printed model, making the model surface smoother. It is suitable for different models without changing the slicing parameters and has wide applicability.
Smart Images

Figure CN116277981B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of 3D printing, in particular to a surface processing method and device of a 3D printing model, a storage medium and equipment. BACKGROUND
[0002] Photo-curing 3D printing is to slice a set of three-dimensional objects through a certain algorithm and generate slice images, and then output the images to the matching curing material by a projection device. The curing material is converted from liquid to solid after photo-curing reaction, so that the printing is completed by layer-by-layer curing. Photo-curing 3D printing has the advantages of small energy consumption, low cost, good repeatability, etc., and is widely used in aerospace, automobile, mold manufacturing, medical treatment and other fields.
[0003] However, photo-curing 3D printing inevitably causes the existence of ladder-shaped sawtooth on the surface of the printed model, affecting the surface quality of the model. The processing scheme in the related art is mainly to perform blur processing on the edge of a single layer slice to achieve anti-sawtooth effect. However, this way can only process the sawtooth in the XY direction, and cannot effectively process the ladder-shaped sawtooth in the Z direction. SUMMARY
[0004] The purpose of the embodiments of the present application is to provide a surface processing method and device of a 3D printing model, a storage medium and equipment, aiming to solve the problem that the anti-sawtooth method for the surface of the photo-curing 3D printing model in the related art cannot effectively process the ladder-shaped sawtooth in the stacking direction.
[0005] In a first aspect, a surface processing method of a 3D printing model is provided, comprising:
[0006] obtaining a profile of a three-dimensional model in a first direction and a profile of the three-dimensional model in a second direction; wherein the first direction is perpendicular to the second direction;
[0007] respectively confirming the profile type of each profile, and determining the first gray value and the second gray value of each pixel point in the three-dimensional model according to the profile type; wherein the first gray value corresponds to the first direction, and the second gray value corresponds to the second direction;
[0008] determining the target gray value of each pixel point based on the first gray value and the second gray value of the pixel point; wherein each target gray value is used for 3D printing of the three-dimensional model.
[0009] In the implementation process, the respective profiles of the three-dimensional model in the first direction and the respective profiles in the second direction are obtained, the first gray value corresponding to the first direction and the second gray value corresponding to the second direction of each pixel point in the three-dimensional model are determined according to the profile type after confirming the profile type of each profile, then the target gray value of the pixel point is determined based on the first gray value and the second gray value of the pixel point, and the target three-dimensional model is printed based on the target gray value of each pixel point. In this way, the stepped sawtooth on the surface of the printed model can be effectively eliminated, and the surface of the final printed model is smoother.
[0010] Further, in some embodiments, the respective profile types of the profiles are respectively confirmed, including:
[0011] If the gray value of the first adjacent pixel point and the gray value of the second adjacent pixel point are both the first specified gray value, the profile type of the profile is confirmed as the first type of profile; wherein the first adjacent pixel point is the adjacent pixel point of the pixel point at one end of the edge in the profile; and the second adjacent pixel point is the adjacent pixel point of the pixel point at the other end of the edge in the profile.
[0012] If the gray value of the first adjacent pixel point is the first pixel value, and the gray value of the second adjacent pixel point is the second specified gray value, the profile type of the profile is confirmed as the second type of profile; wherein the first specified gray value is less than the second specified gray value.
[0013] If the gray value of the first adjacent pixel point is the second specified gray value, and the gray value of the second adjacent pixel point is the first specified gray value, the profile type of the profile is confirmed as the third type of profile.
[0014] If the gray value of the first adjacent pixel point and the gray value of the second adjacent pixel point are both the second specified gray value, the profile type of the profile is confirmed as the fourth type of profile.
[0015] In the implementation process, a specific way of classifying the profile according to the pixel types adjacent to the two ends of the profile is provided.
[0016] Further, in some embodiments, the first gray value and the second gray value of each pixel point in the three-dimensional model are determined according to the profile type, including:
[0017] If the profile type of the profile is the first type of profile, the gray values of the respective pixel points corresponding to the profile are adjusted according to a first rule; the first rule is that the gray values of the pixel points of the profile increase from both ends to the middle.
[0018] if the profile type of the profile is the second type of profile and the third type of profile, adjusting the gray scale value of each pixel point corresponding to the profile according to a second rule; the second rule is that the gray scale value of the pixel point of the profile is sequentially increased from one end adjacent to the first adjacent pixel point to one end adjacent to the second adjacent pixel point;
[0019] if the profile type of the profile is the fourth type of profile, adjusting the gray scale value of each pixel point corresponding to the profile according to a third rule; the third rule is that the gray scale value of the pixel point of the profile is increased from the middle to both ends.
[0020] In the above implementation process, different profile types achieve different smoothing effects, so that the finally printed model surface is smoother and more reasonable.
[0021] Further, in some embodiments, the first rule further includes that the maximum gray scale value of the pixel point of the adjusted profile is a first value; the second rule further includes that the maximum gray scale value of the pixel point of the adjusted profile is a second value; and the third rule further includes that the minimum gray scale value of the pixel point of the adjusted profile is the first value and the maximum gray scale value is the second value.
[0022] In the above implementation process, the maximum value and / or the minimum value of the adjusted first gray scale value and the second gray scale value are pre-set to further improve the anti-aliasing effect.
[0023] Further, in some embodiments, the determining of the target gray scale value of each pixel point based on the first gray scale value and the second gray scale value of the pixel point includes:
[0024] interpolating the first gray scale value and the second gray scale value of the pixel point to obtain the target gray scale value.
[0025] In the above implementation process, a specific way of obtaining a target gray scale value is provided, that is, the first gray scale value and the second gray scale value are processed by interpolation.
[0026] Further, in some embodiments, the second direction is the stacking direction of each slice image of the three-dimensional model; and the interpolating of the first gray scale value and the second gray scale value of the pixel point includes:
[0027] if the second gray scale value is less than a first preset value, determining the target gray scale value of the pixel point as the second gray scale value;
[0028] if the second gray scale value is greater than or equal to the first preset value, determining the target gray scale value of the pixel point based on the difference between the first gray scale value and the second gray scale value of the pixel point.
[0029] In the implementation process, the target gray value is determined by using a piecewise linear difference method, so that the final printed model is closer to the ideal smooth effect.
[0030] Further, in some embodiments, the target gray value of the pixel point is determined based on a difference between the first gray value and the second gray value of the pixel point, including:
[0031] If the second gray value is greater than or equal to the first preset value and less than a second preset value, a difference between the first gray value and the second gray value is obtained, a product of the difference and a first constant value is obtained, and a sum of the product and the first gray value is determined as the target gray value of the pixel point;
[0032] If the second gray value is greater than or equal to the second preset value and less than a third preset value, a difference between the first gray value and the second gray value is obtained, a product of the difference and a second constant value is obtained, and a sum of the product and the first gray value is determined as the target gray value of the pixel point; wherein the first constant value is less than the second constant value;
[0033] If the second gray value is greater than or equal to the third preset value, a difference between the first gray value and the second gray value is obtained, a product of the difference and a third constant value is obtained, and a sum of the product and the first gray value is determined as the target gray value of the pixel point; wherein the second constant value is less than the third constant value.
[0034] In the implementation process, a specific way of determining the target gray value by using a piecewise linear difference method is provided.
[0035] In a second aspect, a surface processing device for a 3D printed model is provided, including:
[0036] A contour obtaining module is configured to obtain a contour of the three-dimensional model in a first direction and a contour of the three-dimensional model in a second direction; wherein the first direction is perpendicular to the second direction;
[0037] A gray value determining module is configured to determine a first gray value and a second gray value of each pixel point in the three-dimensional model according to a contour type of each contour; wherein the first gray value corresponds to the first direction, and the second gray value corresponds to the second direction;
[0038] An interpolation printing module is configured to determine a target gray value of each pixel point based on the first gray value and the second gray value of the pixel point; wherein each target gray value is used for 3D printing of the three-dimensional model.
[0039] In a third aspect, an electronic device is provided and includes a memory, a processor, and a computer program stored in the memory and capable of running on the processor. The processor implements the steps of the method of any one of the first aspect when executing the computer program.
[0040] In a fourth aspect, a computer readable storage medium is provided and has instructions stored thereon. The instructions, when run on a computer, cause the computer to perform the method of any one of the first aspect.
[0041] In a fifth aspect, a computer program product is provided and, when run on a computer, causes the computer to perform the method of any one of the first aspect.
[0042] Other features and advantages of the present application will be further described in the following description with reference to the drawings.
[0043] In order to make the above objectives, features and advantages of the present application more apparent, the following will specifically describe preferred embodiments in conjunction with the accompanying drawings, and make a detailed description as follows. BRIEF DESCRIPTION OF DRAWINGS
[0044] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiments of the present application. It should be understood that the following drawings only show some embodiments of the present application, and therefore should not be regarded as a limitation to the scope, and for those skilled in the art, other related drawings can also be obtained without creative labor on the basis of these drawings.
[0045] Figure 1 A flow chart of a surface processing method of a 3D printing model provided by the embodiments of the present application;
[0046] Figure 2 A schematic diagram of a first type of contour provided by the embodiments of the present application;
[0047] Figure 3 A schematic diagram of a second type of contour and a third type of contour provided by the embodiments of the present application, wherein the left diagram is a schematic diagram of the second type of contour, and the right diagram is a schematic diagram of the third type of contour;
[0048] Figure 4 A schematic diagram of a fourth type of contour provided by the embodiments of the present application;
[0049] Figure 5 A schematic diagram of a contour of a slice model in a stacking direction provided by the embodiments of the present application;
[0050] Figure 6 A schematic diagram of profile 1 before and after the gray scale smoothing processing provided by the embodiment of the present application is shown in the following figure:
[0051] Figure 7 A schematic diagram of profile 2 before and after the gray scale smoothing processing provided by the embodiment of the present application is shown in the following figure:
[0052] Figure 8 A schematic diagram of profile 3 before and after the gray scale smoothing processing provided by the embodiment of the present application is shown in the following figure:
[0053] Figure 9 A schematic diagram of profile 4 before and after the gray scale smoothing processing provided by the embodiment of the present application is shown in the following figure:
[0054] Figure 10 A block diagram of a surface processing device for a 3D printing model provided by the embodiment of the present application is shown in the following figure:
[0055] Figure 11 A structural block diagram of an electronic device provided by the embodiment of the present application is shown in the following figure. DETAILED DESCRIPTION
[0056] The technical solutions in the embodiments of the present application will be described below with reference to the accompanying drawings.
[0057] It should be noted that: similar reference numerals and letters represent similar items in the following drawings, therefore, once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings. Meanwhile, in the description of the present application, the terms "first", "second", etc. are only used for distinguishing description, and cannot be understood as indicating or implying relative importance.
[0058] As described in the background, the anti-aliasing method for the surface of the light-cured 3D printing model in the related art has the problem of being unable to effectively process the stepped aliasing in the stacking direction. Based on this, the embodiments of the present application provide a 3D printing model processing scheme to solve the above problem.
[0059] Next, the embodiments of the present application will be introduced:
[0060] As shown in the following figure, Figure 1 Figure 1 is a flowchart of a 3D printing model processing method provided by the embodiment of the present application, the method can be applied in desktop computers, notebook computers and other devices, the method includes:
[0061] In step 101, the profile of the three-dimensional model in the first direction and the profile of the three-dimensional model in the second direction are obtained; wherein the first direction is perpendicular to the second direction;
[0062] The three-dimensional model mentioned in this step can refer to a 3D model ready to be printed using the light-curing 3D printing technology. In implementation, the three-dimensional model can be established by the user on the current device or imported by the user after downloading.
[0063] The slicing of the light-curing 3D printing is actually a process of discretizing the three-dimensional model into pictures. The coordinate system of the three-dimensional model is composed of three axes of XYZ, and the complete sliced model is formed by stacking the single-layer sliced images in the Z direction, i.e., the stacking direction. If the sliced model is printed, the surface of the printed model will have obvious ladder-shaped sawteeth. The purpose of the embodiment scheme is mainly to eliminate the ladder-shaped sawteeth and make the surface of the printed model smoother.
[0064] In the embodiment scheme, the first direction can refer to the XY direction, and the second direction can refer to the Z direction. Specifically, the device can slice the three-dimensional model in the Z direction according to a predetermined plurality of target layers to obtain an image of the three-dimensional model on each sliced layer, i.e., a sliced image. Then, the contours of the sliced images and the contour of the three-dimensional model in the stacking direction are obtained. The contour of the sliced image is the contour in the XY direction, i.e., the outermost edge of the sliced image, and the contour of the three-dimensional model in the stacking direction is the contour in the Z direction, i.e., the edge formed when the sliced images are stacked.
[0065] In step 102, the contour types of the contours are respectively confirmed, and the first gray value and the second gray value of each pixel point in the three-dimensional model are determined according to the contour types. The first gray value corresponds to the first direction, and the second gray value corresponds to the second direction. According to the contour types of the contours, the first gray value and the second gray value of the pixel points corresponding to the contours are determined. The first gray value corresponds to the direction of the sliced image, and the second gray value corresponds to the stacking direction. The first gray value or the second gray value of the pixel points corresponding to the contours changes linearly, and the difference between the first gray value or the second gray value of the pixel points corresponding to one end point of the contour and the first gray value or the second gray value of the pixel points corresponding to the adjacent end point of the adjacent contour is less than a preset value.
[0066] The step refers to: classifying each contour in the XY direction and the Z direction, respectively performing smooth grayscale processing according to different contour types, and realizing the smooth effect. The model surface obtained by light curing 3D printing will have obvious ladder-shaped sawtooth, generally speaking, the ladder-shaped is caused by the edge protrusion, the protruding edge is 255 grayscale value higher than the two sides, and thus the printing will present ladder-shaped. Based on this, the embodiment calculates the first grayscale value and the second grayscale value of each contour corresponding to the pixel point, to perform grayscale smoothing processing. Optionally, the first grayscale value or the second grayscale value of each contour corresponding to the pixel point changes linearly, the difference between the first grayscale value or the second grayscale value of one end point of each contour corresponding to the pixel point and the first grayscale value or the second grayscale value of the adjacent end point of the adjacent contour corresponding to the pixel point is less than a preset value, the preset value is not greater than 255, which can be set according to the specific scene requirement, for example, the preset value can be set to 126. In this way, by reducing the grayscale value difference of the adjacent edges, the sawtooth can be effectively eliminated.
[0067] In some embodiments, the respective confirmation of the contour type of each contour mentioned in this step can include: if the grayscale value of the first adjacent pixel point and the grayscale value of the second adjacent pixel point are both the first specified grayscale value, the contour type of the contour is confirmed to be the first type of contour; wherein the first adjacent pixel point is the adjacent pixel point of the pixel point at one end of the edge in the contour; the second adjacent pixel point is the adjacent pixel point of the pixel point at the other end of the edge in the contour; if the grayscale value of the first adjacent pixel point is the first pixel value and the grayscale value of the second adjacent pixel point is the second specified grayscale value, the contour type of the contour is confirmed to be the second type of contour; wherein the first specified grayscale value is less than the second specified grayscale value; if the grayscale value of the first adjacent pixel point is the second specified grayscale value and the grayscale value of the second adjacent pixel point is the first specified grayscale value, the contour type of the contour is confirmed to be the third type of contour; if the grayscale value of the first adjacent pixel point and the grayscale value of the second adjacent pixel point are both the second specified grayscale value, the contour type of the contour is confirmed to be the fourth type of contour. The first specified grayscale value can be 0, and the second specified grayscale value can be (2 n -1), here n can be determined according to the bit depth of the image of the three-dimensional model, for example, if it is an 8-bit image, that is, it can represent 256 gray levels, each pixel point of the target three-dimensional model is regarded as a pixel point with a grayscale value of 255, and the area other than this is regarded as a pixel point with a grayscale value of 0. The first specified grayscale value is a, and the second specified grayscale value is b, the first type of contour is as shown in Figure 2 Figure 3 As shown, the left image represents the second type of contour, which can be considered as a contour whose edges are adjacent to pixels with gray values of 0 and 255 at both ends. Contour 41 and its adjacent contours 42 and 43 form a stepped shape. The right image represents the third type of contour, which can also be considered as a contour whose edges are adjacent to pixels with gray values of 0 and 255 at both ends. Contour 44 and its adjacent contours 45 and 46 form a stepped shape. The fourth type of contour is as follows: Figure 4 As shown, it can be considered as the contours at both ends of the edge adjacent to pixels with a grayscale value of 255. This contour 31 and its adjacent contours 32 and 33 are concave. For ease of explanation, the example of 256 grayscale levels will continue to be used. The endpoint adjacent to a pixel with a grayscale value of 0 will be called the "0" pixel endpoint, and the endpoint adjacent to a pixel with a grayscale value of 255 will be called the "255" pixel endpoint. It should be noted that when the bit depth of each pixel in the 3D model is 16, the "0" pixel represents the endpoint adjacent to the pixel with a grayscale value of 0, and the "255" pixel endpoint represents the endpoint adjacent to the pixel with a grayscale value of 65535.
[0068] Furthermore, regarding the aforementioned contour types, determining the first and second grayscale values of each pixel in the 3D model based on the contour type mentioned in this step may include: if the contour type is a first type contour, then adjusting the grayscale values of each pixel corresponding to the contour according to a first rule; the first rule includes that the grayscale values of the pixels of the contour increase from both ends towards the middle; if the contour type is a second or third type contour, then adjusting the grayscale values of each pixel corresponding to the contour according to a second rule; the second rule includes that the grayscale values of the pixels of the contour increase sequentially from the end adjacent to the first adjacent pixel to the end adjacent to the second adjacent pixel; if the contour type is a fourth type contour, then adjusting the grayscale values of each pixel corresponding to the contour according to a third rule; the third rule includes that the grayscale values of the pixels of the contour increase from the middle towards both ends. In other words, for the first type of contour, the grayscale value of its pixels is adjusted to increase linearly from both ends towards the middle. For the second and third types of contours, the grayscale value of its pixels is adjusted to increase linearly from the "0" pixel end towards the "255" pixel end. For the fourth type of contour, the grayscale value of its pixels is adjusted to decrease linearly from both ends towards the middle. The adjusted grayscale value is the first or second grayscale value of that pixel. In this way, different contour types achieve different smoothing effects, making the surface of the final printed model smoother and more realistic.
[0069] Further, in some embodiments, the first rule further comprises that the maximum gray value of the pixel point of the adjusted contour is a first value; the second rule further comprises that the maximum gray value of the pixel point of the adjusted contour is a second value; and the third rule further comprises that the minimum gray value of the pixel point of the adjusted contour is the first value and the maximum gray value is the second value. That is, the maximum value and / or the minimum value of the first gray value and the second gray value of the adjusted contour can be pre-set during the adjustment, so as to further improve the anti-aliasing effect. For example, the middle maximum gray value of the first type of contour can be set as a first value a, if the pixel point corresponding to the contour has n, then the gray value at the edge of both ends is 2a / (n+1), which is linearly increased from both ends to the middle, and the gray value is increased by 2a / (n+1) each time; the gray value at the “255” pixel end of the third type of contour and the fourth type of contour is set as a second value b, if the pixel point corresponding to the contour has n, then the gray value at the “0” pixel end is b / n, which is linearly increased from the “0” pixel end to the “255” pixel end, and the gray value is increased by b / n each time; the middle minimum gray value of the fourth type of contour is set as the first value a, and the gray value at the edge of both ends is the second value b, which is linearly decreased from both ends to the middle, if the pixel point corresponding to the contour has n, then the gray value is decreased by 2(b-a) / (n+1) each time. Optionally, the first value can be 126 and the second value can be 253. It is found through experiments that better anti-aliasing effect can be achieved by setting the values.
[0070] In step 103, based on the first gray value and the second gray value of the pixel point, the target gray value of each pixel point is determined; wherein each target gray value is used for 3D printing of the three-dimensional model.
[0071] This step is to obtain the final gray value used for 3D printing of the three-dimensional model based on the calculated first gray value and second gray value after the first gray value and the second gray value of the pixel point corresponding to each contour are calculated, so that the smoothing effect can be achieved.
[0072] In some embodiments, the step can include: performing interpolation processing on the first gray value and the second gray value of the pixel point to obtain the target gray value. That is, the first gray value and the second gray value can be processed in an interpolation manner to determine the target gray value of the pixel point. Specifically, if the second direction is the stacking direction of the slice images of the three-dimensional model, the interpolation processing manner can include: if the second gray value is less than a first preset value, determining the target gray value of the pixel point as the second gray value; if the second gray value is greater than or equal to the first preset value, determining the target gray value of the pixel point based on the difference between the first gray value and the second gray value of the pixel point. That is, the target gray value can be determined in a piecewise linear difference manner, when the second gray value of the pixel point is less than the first preset value, the second gray value is directly determined as the target gray value of the pixel point, and when the second gray value of the pixel point is greater than or equal to the first preset value, the target gray value of the pixel point is determined based on the difference between the first gray value and the second gray value. In this way, the model finally printed is closer to the ideal smooth effect, that is, the sawtooth is surrounded by smoothness.
[0073] Further, in some embodiments, the aforementioned determination of the target gray value of the pixel point based on the difference between the first gray value and the second gray value of the pixel point can include: if the second gray value is greater than or equal to the first preset value and less than a second preset value, obtaining the difference between the first gray value and the second gray value, and obtaining the product of the difference and a first constant value, and then determining the sum of the product and the first gray value as the target gray value of the pixel point; if the second gray value is greater than or equal to the second preset value and less than a third preset value, obtaining the difference between the first gray value and the second gray value, and obtaining the product of the difference and a second constant value, and then determining the sum of the product and the first gray value as the target gray value of the pixel point; wherein the first constant value is less than the second constant value; if the second gray value is greater than or equal to the third preset value, obtaining the difference between the first gray value and the second gray value, and obtaining the product of the difference and a third constant value, and then determining the sum of the product and the first gray value as the target gray value of the pixel point; wherein the second constant value is less than the third constant value. That is, the target gray value of the pixel point can be calculated based on the following formula:
[0074]
[0075] wherein Gray(Z, XY) is the target gray value of the pixel point; G xy is the first gray value of the pixel point; G zis a second preset value; M3 is a third preset value; N1 is a first constant value; N2 is a second constant value; N3 is a third constant value. Optionally, the first preset value can be any value between 40 and 45, such as 42; the second preset value can be any value between 60 and 65, such as 63; the third preset value can be any value between 120 and 130, such as 126; the first constant value can be 0.25, 0.3 or 0.35; the second constant value can be 0.45, 0.5 or 0.55; and the third constant value can be 0.75, 0.8 or 0.85. It has been found through experiments that, by setting the above values, the surface of the final printed model has a better smoothing effect. Of course, similarly, in other embodiments, these values can also be set differently according to the actual needs of the scene, including the printer and the printing material.
[0076] The device adjusts the pixel points of each slice image according to the calculated target gray value, inputs the adjusted slice image into the 3D printer for printing, and thus obtains the final printed model. Since the slice images are respectively smoothed in the XY direction and the Z direction, the stepped sawtooth on the surface of the printed model can be effectively processed, and since the embodiment does not change the slice parameters, different parameters do not need to be set for different models, and the embodiment has wide applicability.
[0077] In the embodiment, the contours of the three-dimensional model in the first direction and the contours in the second direction are obtained, the first gray value corresponding to the first direction and the second gray value corresponding to the second direction of each pixel point in the three-dimensional model are determined according to the contour types of the contours after the contour types are confirmed, the target gray value of the pixel point is determined based on the first gray value and the second gray value of the pixel point, and the target three-dimensional model is printed based on the target gray value of each pixel point. In this way, the stepped sawtooth on the surface of the printed model can be effectively eliminated, and the surface of the final printed model is smoother.
[0078] In order to make a more detailed description of the scheme of the present application, a specific embodiment will be introduced as follows:
[0079] In the light-curing 3D printing scene, there are often ladder-shaped sawteeth on the surface of the printed model, affecting the surface quality of the model. By performing blur processing on the edges of a single layer of slices, the anti-sawtooth effect can be achieved to some extent, but it can only handle the sawteeth in the XY direction, and cannot handle the sawteeth in the Z direction well. Prior to this embodiment, in the related art, by setting thinner and smaller slice layer parameters in the slice layer, the ladder teeth feeling of the model surface in the Z direction after printing is weaker. However, this way increases the slice time, and different models need to be set with different parameters to achieve the anti-sawtooth effect, limiting its scope of use. Based on this, the present embodiment provides an anti-sawtooth scheme for the surface of a light-curing 3D printed model to solve this problem. The workflow of the scheme includes:
[0080] S201, slicing the imported model to obtain a complete slice model; wherein a single layer of slice pictures is stacked in the Z direction, as shown in Figure 5 The white part in the figure represents a pixel value of "255", and the black part represents a pixel value of "0";
[0081] S202, calculating the gray value of the pixel point corresponding to the contour in the Z direction according to the type of the contour in the Z direction;
[0082] Specifically, for the contour 1 (denoted as 51 in Figure 5 ), both ends of which are adjacent to the "255" pixel, the gray value calculation strategy thereof includes: the minimum gray value in the middle is 126, and the end point gray value is 253, which gradually decreases linearly from both ends to the middle. Since the contour length is 17, the gray value decreases by 127 / 9 each time. The comparison between the contour 1 before and after the gray value smoothing processing is shown in Figure 6 ;
[0083] For the contour 2 (denoted as 52 in Figure 5 ), both ends of which are adjacent to the "0" pixel, the gray value calculation strategy thereof includes: the maximum gray value in the middle is 126, which gradually increases linearly from both ends to the middle. Since the contour length is 7, the end point gray value is 31.5, and the gray value increases by 31.5 each time. The comparison between the contour 2 before and after the gray value smoothing processing is shown in Figure 7 ;
[0084] For the contour 3 (denoted as 53 in Figure 5 ) and the contour 4 (denoted as 54 in Figure 5 ), both ends of which are adjacent to the "0" pixel and the "255" pixel respectively, the gray value calculation strategy thereof includes: setting the maximum gray value to 253, the "0" pixel end gray value to 253 / n, and linearly increasing from the "0" pixel end to the "255" pixel end, with the gray value increasing by 253 / n each time, wherein n is the contour length. The comparison between the contour 3 and the contour 4 before and after the gray value smoothing processing is shown in Figure 8 and Figure 9 respectively;
[0085] S203, calculating the gray value of the pixel point corresponding to the XY direction profile according to the type of the XY direction profile; specifically, the calculation method is consistent with S202, the difference is that the XY direction profile type and the gray calculation are performed in a single slice graph, while the Z direction profile type and the gray calculation are performed on a slice model stacked by multiple single slice graphs;
[0086] S204, calculating the final gray value of each pixel point according to the piecewise linear interpolation method; specifically, the final gray value of each pixel point is calculated based on the following formula:
[0087]
[0088] wherein, Gray(Z, XY) is the final gray value of the pixel point; Gxy is the gray value of the pixel point calculated in the XY direction; Gz is the gray value of the pixel point calculated in the Z direction; midPix is the set intermediate gray value, which is set to 126 in this embodiment; z
[0089] S205, printing the model based on the final gray value of each pixel point.
[0090] The scheme of the embodiment of the application can effectively eliminate the ladder-shaped sawtooth, so that the surface of the printed model is smoother; and the slice parameters are not changed in the whole process, different parameters do not need to be set for different models, and the slice time consumption is not increased.
[0091] Corresponding to the foregoing method embodiments, the application further provides 3D printed model surface processing device and terminal application embodiments thereof:
[0092] As shown in Figure 10 , the device comprises: Figure 10 a profile acquisition module 1001 for acquiring the profile of a three-dimensional model in a first direction and the profile of the three-dimensional model in a second direction; wherein the first direction is perpendicular to the second direction;
[0093] a gray determination module 1002 for determining the profile type of each profile respectively, and determining the first gray value and the second gray value of each pixel point in the three-dimensional model according to the profile type; wherein the first gray value corresponds to the first direction, and the second gray value corresponds to the second direction;
[0094]
[0095] The interpolation printing module 1003 is configured to determine target gray scale values of the pixel points based on the first gray scale values and the second gray scale values of the pixel points, wherein the target gray scale values are used for 3D printing of the three-dimensional model.
[0096] The functions and effects of the modules in the device are described in detail in the implementation process of the corresponding steps in the above method, and will not be repeated here.
[0097] The present application also provides an electronic device, please see Figure 11 , Figure 11 The present application provides a structural block diagram of an electronic device. The electronic device can include a processor 1110, a communication interface 1120, a memory 1130, and at least one communication bus 1140. The communication bus 1140 is used to realize the direct connection communication of these components. The communication interface 1120 of the electronic device in the present application is used for signaling or data communication with other node devices. The processor 1110 can be an integrated circuit chip with signal processing capability.
[0098] The processor 1110 described above can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a ready-to-program gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component. It can implement or execute the disclosed methods, steps and logic block diagrams in the present application. The general-purpose processor can be a microprocessor or the processor 1110 can be any conventional processor.
[0099] The memory 1130 can be, but is not limited to, a random access memory (RAM), a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), etc. The memory 1130 stores computer readable instructions, which when executed by the processor 1110, the electronic device can execute the above Figure 1 The method embodiments involve each step.
[0100] Optionally, the electronic device can further include a storage controller, an input / output unit.
[0101] The memory 1130, the storage controller, the processor 1110, the peripheral interface, and the input / output unit are electrically connected with each other directly or indirectly to realize data transmission or interaction. For example, these elements can be electrically connected with each other through one or more communication buses 1140. The processor 1110 is configured to execute executable modules stored in the memory 1130, for example, software function modules or computer programs included in the electronic device.
[0102] The input / output unit is configured to provide a user with a creation task and create an optional time period or a preset execution time for the task to realize interaction between the user and the server. The input / output unit can be, but is not limited to, a mouse, a keyboard, and the like.
[0103] It can be understood that Figure 11 The structure shown is only schematic, and the electronic device can further include more or fewer components than those shown in the figures, or have a different configuration from that shown in the figures. Figure 11 The components shown in the figures can be implemented in hardware, software, or a combination thereof. Figure 11 The components shown in the figures can be implemented in hardware, software, or a combination thereof. Figure 11 The components shown in the figures can be implemented in hardware, software, or a combination thereof.
[0104] The embodiments of the present application further provide a storage medium, and the storage medium stores instructions. When the instructions run on a computer, the computer program is executed by a processor to implement the method in the method embodiments. To avoid repetition, details are not described here.
[0105] The present application further provides a computer program product, which, when running on a computer, causes the computer to execute the method in the method embodiments.
[0106] In several embodiments provided in the present application, it should be understood that the disclosed apparatus and method can also be implemented by other means. The apparatus embodiments described above are only illustrative, for example, the flowcharts and block diagrams in the drawings show the possible implementation architecture, function and operation of the apparatus, method and computer program product according to the embodiments of the present application. In this regard, each block in the flowchart or block diagram can represent a module, a program segment or a part of code, which contains one or more executable instructions for implementing the specified logic function. It should also be noted that in some alternative implementations, the functions noted in the blocks can occur in different order from that shown in the drawings. For example, two consecutive blocks can actually be executed substantially in parallel, and sometimes they can be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and the combination of blocks in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system for performing the specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions.
[0107] In addition, the functional modules in the embodiments of the present application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0108] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various program code storage media.
[0109] The above merely provides an example of the present application and is not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application. It should be noted that similar reference numerals and letters represent similar items in the following drawings, and thus, once an item is defined in one drawing, it need not be further defined and explained in subsequent drawings.
[0110] The above merely provides an example of the present application and is not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application. It should be noted that similar reference numerals and letters represent similar items in the following drawings, and thus, once an item is defined in one drawing, it need not be further defined and explained in subsequent drawings.
[0111] It should be noted that the relational terms herein such as first and second and the like are used solely to distinguish one from another entity or action without necessarily requiring or implying any actual relationship or order between such entities or actions. Moreover, the terms "comprises", "comprising", or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus. An element proceeded by "comprises... a" does not, without more constraints, exclude the existence of additional identical elements in the process, method, article, or apparatus that comprises the element.
Claims
1. A method of surface treatment of a 3D printed model, characterized in that, The method comprises: obtaining a profile of a three-dimensional model in a first direction and a profile of the three-dimensional model in a second direction; wherein the first direction is perpendicular to the second direction, and the second direction is a stacking direction of the three-dimensional model; respectively identifying a profile type of each profile, and determining a first gray value and a second gray value of each pixel point in the three-dimensional model according to the profile type; wherein the first gray value corresponds to the first direction, and the second gray value corresponds to the second direction; determining a target gray value of each pixel point based on the first gray value and the second gray value of the pixel point; wherein each target gray value is used for 3D printing of the three-dimensional model; the respective identification of the profile type of each profile comprises: if the gray value of a first adjacent pixel point and the gray value of a second adjacent pixel point are both a first specified gray value, then the profile type of the profile is identified as a first type of profile; wherein the first adjacent pixel point is an adjacent pixel point of a pixel point at one end of the edge in the profile, and the second adjacent pixel point is an adjacent pixel point of a pixel point at the other end of the edge in the profile; if the gray value of the first adjacent pixel point is the first specified gray value, and the gray value of the second adjacent pixel point is a second specified gray value, then the profile type of the profile is identified as a second type of profile; wherein the first specified gray value is less than the second specified gray value; if the gray value of the first adjacent pixel point is the second specified gray value, and the gray value of the second adjacent pixel point is the first specified gray value, then the profile type of the profile is identified as a third type of profile; if the gray value of the first adjacent pixel point and the gray value of the second adjacent pixel point are both the second specified gray value, then the profile type of the profile is identified as a fourth type of profile; the determination of the first gray value and the second gray value of each pixel point in the three-dimensional model according to the profile type comprises: if the profile type of the profile is the first type of profile, then the gray values of each pixel point corresponding to the profile are adjusted according to a first rule; the first rule comprises that the gray values of the pixel points of the profile increase from both ends to the middle; if the profile type of the profile is the second type of profile and the third type of profile, then the gray values of each pixel point corresponding to the profile are adjusted according to a second rule; the second rule comprises that the gray values of the pixel points of the profile increase sequentially from the end adjacent to the first adjacent pixel point to the end adjacent to the second adjacent pixel point; if the profile type of the profile is the fourth type of profile, then the gray values of each pixel point corresponding to the profile are adjusted according to a third rule; the third rule comprises that the gray values of the pixel points of the profile increase from the middle to both ends.
2. The method of claim 1, wherein, the first rule further comprises that the maximum gray value of the pixel points of the adjusted profile is a first value; the second rule further comprises that the maximum gray value of the pixel points of the adjusted profile is a second value; and the third rule further comprises that the minimum gray value of the pixel points of the adjusted profile is the first value, and the maximum gray value is the second value.
3. The method of claim 1, wherein, The target gray value of each pixel point is determined based on the first gray value and the second gray value of the pixel point, including: The first gray value and the second gray value of the pixel point are subjected to interpolation processing to obtain the target gray value.
4. The method of claim 3, wherein, The interpolation processing of the first gray value and the second gray value of the pixel point includes: If the second gray value is less than a first preset value, the target gray value of the pixel point is determined as the second gray value; If the second gray value is greater than or equal to the first preset value, the target gray value of the pixel point is determined based on the difference between the first gray value and the second gray value of the pixel point.
5. The method of claim 4, wherein, The target gray value of each pixel point is determined based on the first gray value and the second gray value of the pixel point, including: If the second gray value is greater than or equal to the first preset value and less than a second preset value, the difference between the first gray value and the second gray value is obtained, and the product of the difference and a first constant value is obtained, and the sum of the product and the first gray value is determined as the target gray value of the pixel point; If the second gray value is greater than or equal to the second preset value and less than a third preset value, the difference between the first gray value and the second gray value is obtained, and the product of the difference and a second constant value is obtained, and the sum of the product and the first gray value is determined as the target gray value of the pixel point; wherein the first constant value is less than the second constant value; If the second gray value is greater than or equal to the third preset value, the difference between the first gray value and the second gray value is obtained, and the product of the difference and a third constant value is obtained, and the sum of the product and the first gray value is determined as the target gray value of the pixel point; wherein the second constant value is less than the third constant value.
6. A surface processing apparatus of a 3D printed model, characterized by, Including: The profile acquisition module is configured to acquire a profile of a three-dimensional model in a first direction and a profile of the three-dimensional model in a second direction; wherein the first direction is perpendicular to the second direction, and the second direction is a stacking direction of the three-dimensional model; The gray value determination module is configured to determine a first gray value and a second gray value of each pixel point in the three-dimensional model according to the profile type of each profile; wherein the first gray value corresponds to the first direction, and the second gray value corresponds to the second direction; The interpolation printing module is configured to determine a target gray value of each pixel point based on the first gray value and the second gray value of the pixel point; wherein each target gray value is used for 3D printing of the three-dimensional model. The gray scale determination module is specifically configured to: if the gray scale value of the first adjacent pixel point and the gray scale value of the second adjacent pixel point are both the first specified gray scale value, it is determined that the contour type of the contour is a first contour type; the first adjacent pixel point is an adjacent pixel point of a pixel point at one end of an edge in the contour; the second adjacent pixel point is an adjacent pixel point of a pixel point at the other end of the edge in the contour; if the gray scale value of the first adjacent pixel point is the first specified gray scale value and the gray scale value of the second adjacent pixel point is a second specified gray scale value, it is determined that the contour type of the contour is a second contour type; the first specified gray scale value is smaller than the second specified gray scale value; if the gray scale value of the first adjacent pixel point is the second specified gray scale value and the gray scale value of the second adjacent pixel point is the first specified gray scale value, it is determined that the contour type of the contour is a third contour type; and if the gray scale value of the first adjacent pixel point and the gray scale value of the second adjacent pixel point are both the second specified gray scale value, it is determined that the contour type of the contour is a fourth contour type. The gray scale determination module is specifically configured to: if the contour type of the contour is the first contour type, the gray scale values of the pixel points corresponding to the contour are adjusted according to a first rule; the first rule includes that the gray scale values of the pixel points of the contour increase from both ends to the middle; if the contour type of the contour is the second contour type and the third contour type, the gray scale values of the pixel points corresponding to the contour are adjusted according to a second rule; the second rule includes that the gray scale values of the pixel points of the contour increase from one end adjacent to the first adjacent pixel point to one end adjacent to the second adjacent pixel point; and if the contour type of the contour is the fourth contour type, the gray scale values of the pixel points corresponding to the contour are adjusted according to a third rule; the third rule includes that the gray scale values of the pixel points of the contour increase from the middle to both ends.
7. A computer readable storage medium characterized by A computer program is stored thereon, and the computer program is executed by a processor to implement the method in any one of claims 1 to 5.
8. An electronic device, comprising: A computer program is stored thereon, and the computer program is executed by a processor to implement the method in any one of claims 1 to 5.
Citation Information
Patent Citations
High-precision smooth printing method of DLP (Digital Light Processing) photocuring 3D (Three-dimensional) printer
CN107972266A
3D printing model processing method and system
CN112008980A