Method for generating 3D printing data, path planning method, system and storage medium
A method for generating 3D printing data, a method for planning a path, a system and a storage medium are provided; the method for generating 3D printing data comprises: generating at least one slice pattern based on a projected contour of a model of a to-be-printed object, wherein each slice pattern comprises one or more texture lines, and the one or more texture lines comprise non-closed texture lines whose endpoints are located on the projected contour; and generating 3D printing data based on spatial positions of printing lines of cross-sectional patterns, with the cross-sectional patterns determined based on the at least one slice pattern. wherein the printing lines comprise texture lines. The present disclosure adopts 3D printing to realize structural designs that cannot be achieved using conventional fabrics, thereby increasing design freedom of fabrics in terms of both appearance and functionality.
1 . A method for generating 3D printing data, comprising:
slicing a model of a to-be-printed object into multiple horizontal layers;
for each of the horizontal layers: projecting the to-be-printed object onto a plane corresponding to said layer to obtain a projected contour of said layer, wherein, the projected contour refers to a projection of a contour of the to-be-printed object;
generating at least two single-layer texture planes, wherein each single-layer texture plane includes at least one texture line;
adjusting spatial positions of the at least two single-layer texture planes so that their projections onto a same plane partially overlap, to obtain a multi-layer texture plane;
generating at least one slice pattern through cutting the texture plane by the projected contour, wherein each slice pattern comprises one or more texture lines, and the one or more texture lines comprise non-closed texture lines whose endpoints are located on the projected contour;
generating the 3D printing data based on spatial positions of printing lines of cross-sectional patterns, with the cross-sectional patterns determined based on the at least one slice pattern, wherein a first cross-sectional pattern is determined based on a first slice pattern of the at least one slice pattern, the first cross-sectional pattern comprises one or more printing lines, and the first slice pattern comprises first texture lines; wherein the printing lines comprise the first texture lines;
generating G-codes based on the 3D printing data; and
printing the to-be-printed object layer by layer by a 3D-printer using the G-codes.
2 . The method for generating 3D printing data according to claim 1 , further comprising:
generating at least two texture patterns, wherein each texture pattern comprises a plurality of straight lines and/or at least one curved line; and
adjusting horizontal positions of the at least two texture patterns such that their projections onto a same plane partially overlap, to obtain the single-layer texture plane.
3 . The method for generating 3D printing data according to claim 1 , wherein the step of generating the 3D printing data based on the spatial positions of the printing lines of the cross-sectional patterns comprises: connecting non-closed texture lines in the first slice pattern by auxiliary path lines outside the projected contour to obtain the first cross-sectional pattern.
4 . The method for generating 3D printing data according to claim 1 , wherein the step of generating the 3D printing data based on the spatial positions of the printing lines of the cross-sectional patterns comprises: connecting non-closed texture lines in the first slice pattern by auxiliary path lines along the projected contour to obtain the first cross-sectional pattern.
5 . The method for generating 3D printing data according to claim 4 , wherein the step of connecting the non-closed texture lines in the first slice pattern by the auxiliary path lines along the projected contour to obtain the first cross-sectional pattern comprises:
classifying the first texture lines in the first slice pattern into different groups according to spatial positions of the first texture lines;
connecting endpoints of non-closed texture lines in a first group by auxiliary path lines along the projected contour so that the non-closed texture lines in the first group form a continuous texture line of the first group; and
connecting continuous texture lines of different groups by auxiliary path lines so that the continuous texture lines of the different groups form a continuous printing line.
6 . The method for generating 3D printing data according to claim 4 , wherein the step of connecting the non-closed texture lines in the first slice pattern by the auxiliary path lines along the projected contour to obtain the first cross-sectional pattern comprises:
assigning a serial number to each non-closed texture line of the first slice pattern according to a spatial position of the respective non-closed texture line; and
connecting endpoints of non-closed texture lines with adjacent serial numbers by auxiliary path lines along the projected contour so that the non-closed texture lines in the first slice pattern together form a continuous printing line.
7 . A non-transitory computer-readable storage medium, wherein at least one program is stored on the storage medium, and when the at least one program is called by a processor, the at least one program executes and realizes a method for generating 3D printing data, wherein the method comprises:
slicing a model of a to-be-printed object into multiple horizontal layers;
for each of the horizontal layers:
projecting the to-be-printed object onto a plane corresponding to said layer to obtain a projected contour of said layer, wherein, the projected contour refers to a projection of a contour of the to-be-printed object;
generating at least two single-layer texture planes, wherein each single-layer texture plane includes at least one texture line;
adjusting spatial positions of the at least two single-layer texture planes so that their projections onto a same plane partially overlap, to obtain a multi-layer texture plane;
generating at least one slice pattern through cutting the texture plane by the projected contour, wherein each slice pattern comprises one or more texture lines, and the one or more texture lines comprise non-closed texture lines whose endpoints are located on the projected contour;
generating the 3D printing data based on spatial positions of printing lines of cross-sectional patterns, with the cross-sectional patterns determined based on the at least one slice pattern, wherein a first cross-sectional pattern is determined based on a first slice pattern of the at least one slice pattern, the first cross-sectional pattern comprises one or more printing lines, and the first slice pattern comprises first texture lines; wherein the printing lines comprise the first texture lines;
generating G-codes based on the 3D printing data; and
printing the to-be-printed object layer by layer by a 3D-printer using the G-codes.
8 . The non-transitory computer-readable storage medium according to claim 7 , wherein the method for generating 3D printing data further comprises:
generating at least two texture patterns, wherein each texture pattern comprises a plurality of straight lines and/or at least one curved line; and
adjusting horizontal positions of the at least two texture patterns such that their projections onto a same plane partially overlap, to obtain the single-layer texture plane.
9 . The non-transitory computer-readable storage medium according to claim 7 , wherein the step of generating the 3D printing data based on the spatial positions of the printing lines of the cross-sectional patterns comprises: connecting non-closed texture lines in the first slice pattern by auxiliary path lines outside the projected contour to obtain the first cross-sectional pattern.
10 . The non-transitory computer-readable storage medium according to claim 7 , wherein the step of generating the 3D printing data based on the spatial positions of the printing lines of the cross-sectional patterns comprises: connecting non-closed texture lines in the first slice pattern by auxiliary path lines along the projected contour to obtain the first cross-sectional pattern.
11 . The non-transitory computer-readable storage medium according to claim 10 , wherein the step of connecting the non-closed texture lines in the first slice pattern by the auxiliary path lines along the projected contour to obtain the first cross-sectional pattern comprises:
classifying the first texture lines in the first slice pattern into different groups according to spatial positions of the first texture lines;
connecting endpoints of non-closed texture lines in a first group by auxiliary path lines along the projected contour so that the non-closed texture lines in the first group form a continuous texture line of the first group; and
connecting continuous texture lines of different groups by auxiliary path lines so that the continuous texture lines of the different groups form a continuous printing line.
12 . The non-transitory computer-readable storage medium according to claim 10 , wherein the step of connecting the non-closed texture lines in the first slice pattern by the auxiliary path lines along the projected contour to obtain the first cross-sectional pattern comprises:
assigning a serial number to each non-closed texture line of the first slice pattern according to a spatial position of the respective non-closed texture line; and
connecting endpoints of non-closed texture lines with adjacent serial numbers by auxiliary path lines along the projected contour so that the non-closed texture lines in the first slice pattern together form a continuous printing line.