Three-dimensional model slicing method, printing method and related equipment

文档序号:1898584 发布日期:2021-11-30 浏览:7次 中文

阅读说明:本技术 三维模型的切片方法、打印方法及相关设备 (Three-dimensional model slicing method, printing method and related equipment ) 是由 刘鹏 于 2021-08-30 设计创作,主要内容包括:本发明提供一种三维模型的切片方法、打印方法及相关设备,涉及3D打印技术领域,所述方法包括:确定三维模型的目标层切片对应的三角形裙带集合,其中,所述三角形裙带集合包括与所述目标层切片的切平面相交的至少两个所述三角面片;获取所述三角形裙带集合中所述三角面片的半边数据结构;依据所述三角面片的半边数据结构生成所述三角形裙带集合对应的所述目标层切片的轮廓图片。本发明实施例能够提高三维模型切片的效率。(The invention provides a slicing method, a printing method and related equipment of a three-dimensional model, and relates to the technical field of 3D printing, wherein the method comprises the following steps: determining a triangular skirt set corresponding to a target layer slice of a three-dimensional model, wherein the triangular skirt set comprises at least two triangular patches intersected with a tangent plane of the target layer slice; acquiring a half data structure of the triangular patch in the triangular skirt set; and generating a contour picture of the target layer slice corresponding to the triangular skirt strip set according to the half data structure of the triangular patch. The embodiment of the invention can improve the efficiency of three-dimensional model slicing.)

1. A method of slicing a three-dimensional model, the method comprising:

determining a triangular skirt set corresponding to a target layer slice of a three-dimensional model, wherein the triangular skirt set comprises at least two triangular patches intersected with a tangent plane of the target layer slice;

acquiring a half data structure of the triangular patch in the triangular skirt set;

and generating a contour picture of the target layer slice corresponding to the triangular skirt strip set according to the half data structure of the triangular patch.

2. The method for slicing a three-dimensional model according to claim 1, wherein the generating a contour picture of the target layer slice corresponding to the triangular skirt strip set according to the half data structure of the triangular patch comprises:

determining all intersection points of the triangular surface patch in the triangular skirt strip set and the tangent plane of the target layer slice according to the half data structure of the triangular surface patch;

determining a directed line segment set formed by all the intersection points, wherein the directed line segment set comprises a plurality of directed line segments;

determining the contour picture of the target layer slice corresponding to the triangular skirt strip set based on the plurality of directed line segments corresponding to the triangular skirt strip set.

3. The method of slicing a three-dimensional model according to claim 2, wherein said determining all intersection points of a triangular patch of said set of triangular skirts and a tangent plane of said target slice from a half-edge data structure of said triangular patch comprises:

determining whether a first directed edge, a second directed edge and a third directed edge of a target triangular patch in the triangular skirt strip set exist an intersection point with a tangent plane of the target slice, wherein the target triangular patch is any one of the triangular patches in the triangular skirt strip set, a half-edge data structure of the target triangular patch comprises the first directed edge, the second directed edge and the third directed edge, a next half edge of the first directed edge is the second directed edge, a next half edge of the second directed edge is the third directed edge, and a next half edge of the third directed edge is the first directed edge;

under the condition that two intersection points exist between the target triangular patch and the tangent plane of the target layer slice, acquiring a first intersection point and a second intersection point between the target triangular patch and the tangent plane of the target layer slice;

the determining a set of directed line segments formed by all the intersections includes:

determining a first directed line segment according to the first intersection point and the second intersection point, wherein the direction of the first directed line segment is that the first intersection point points to the second intersection point, and the determination time of the first intersection point is earlier than that of the second intersection point;

wherein the set of directed line segments includes the first directed line segment.

4. The method of slicing a three-dimensional model according to claim 2, wherein the plurality of directed line segments form at least two continuous line segments;

the determining the contour picture of the target layer slice corresponding to the triangular skirt strip set based on the plurality of directed line segments corresponding to the triangular skirt strip set includes:

determining the coordinate positions of all line heads of the at least two continuous line segments, and shaping the coordinate positions of all line heads, wherein the line heads are end points of the continuous line segments;

acquiring at least two target line heads with the same coordinate position obtained after the reshaping treatment;

establishing line segments between the target line heads to obtain the contour lines of the target layer slices corresponding to the triangular skirt strip set;

and determining the contour picture of the target layer slice corresponding to the triangular skirt strip set based on the contour line of the target layer slice.

5. The method for slicing a three-dimensional model according to claim 4, wherein the determining the contour picture of the target layer slice corresponding to the triangular skirt strip set based on the contour line of the target layer slice comprises:

determining the direction of the contour line of the target layer slice according to the plurality of directed line segments corresponding to the triangular skirt strip set;

and rendering the contour line according to the direction of the contour line to obtain a contour picture of the target layer slice corresponding to the triangular skirt strip set.

6. The method for slicing the three-dimensional model according to claim 5, wherein the determining the direction of the contour line of the target layer slice according to the plurality of directional line segments corresponding to the set of triangular skirts comprises:

determining a first vector of each directed line segment in the plurality of directed line segments corresponding to the triangular skirt strip set, wherein the first vector is a geometric representation of the directed line segment;

determining a second vector corresponding to each directional line segment according to normal vectors of two triangular patches corresponding to the starting point of each directional line segment, wherein the second vector is the sum of the normal vectors of the two triangular patches, and the intersection point of each triangular patch of the two triangular patches corresponding to the starting point and the tangent plane of the target layer slice comprises the starting point;

and determining the direction of the contour line of the target layer slice according to the cross multiplication result of the first vector of each directed line segment and the second vector corresponding to each directed line segment.

7. A method of printing, the method comprising:

acquiring a file to be printed, and printing a model according to the file to be printed; wherein the file to be printed is a contour picture generated by a slicing method of the three-dimensional model according to any one of claims 1 to 6.

8. A printing system, comprising: a slicing device and a printing apparatus;

the slicing apparatus for performing a slicing method of the three-dimensional model according to any one of claims 1 to 6;

and the printing equipment uses the contour picture output by the slicing device and obtains the model to be printed according to the contour picture.

9. A printing apparatus, comprising: memory, processor and program stored on the memory and executable on the processor, which when executed by the processor implements the steps in the method of slicing of a three-dimensional model according to any of claims 1-6.

10. A readable storage medium, characterized in that it stores thereon a program or instructions which, when executed by a processor, implement the steps in the method of slicing of a three-dimensional model according to any one of claims 1-6.

Technical Field

The invention relates to the technical field of 3D printing, in particular to a slicing method, a printing method and related equipment of a three-dimensional model.

Background

3D printing belongs to a rapid prototyping technology, which takes a digital model as a base, and utilizes materials such as metal powder, ceramic powder, plastic or liquid photosensitive resin and the like to print out a whole three-dimensional object layer by layer. The 3D printing process comprises the steps of firstly designing a 3D model through computer 3D modeling software, then slicing the three-dimensional model into sections layer by layer, obtaining a processing path according to analysis section information, and accordingly guiding a 3D printer to print layer by layer, and finally forming a three-dimensional object through layer-by-layer superposition. The 3D printing technology is more applied to photocuring 3D printing, materials used for the photocuring 3D printing are photosensitive resin generally, are liquid generally, and a certain photoinitiator is prepared in a ratio and is subjected to polymerization reaction under light irradiation to realize fixation. Before photocuring 3D printing, slicing of a three-dimensional model needs to be performed on a model to be printed, and at present, when the three-dimensional model is sliced, all triangular patches of the model to be printed are subjected to centralized analysis, so that the efficiency of slicing the three-dimensional model is low.

Disclosure of Invention

The embodiment of the invention provides a slicing method, a printing method and related equipment of a three-dimensional model, and aims to solve the problem that the slicing efficiency of the three-dimensional model is low in the prior art.

In order to solve the technical problem, the invention is realized as follows:

in a first aspect, an embodiment of the present invention provides a method for slicing a three-dimensional model, where the method includes:

determining a triangular skirt set corresponding to a target layer slice of a three-dimensional model, wherein the triangular skirt set comprises at least two triangular patches intersected with a tangent plane of the target layer slice;

acquiring a half data structure of the triangular patch in the triangular skirt set;

and generating a contour picture of the target layer slice corresponding to the triangular skirt strip set according to the half data structure of the triangular patch.

In a second aspect, an embodiment of the present invention provides a printing method, where the method includes:

acquiring a file to be printed, and printing a model according to the file to be printed; wherein the file to be printed is a contour picture generated by the slicing method of the three-dimensional model according to the first aspect.

In a third aspect, an embodiment of the present invention provides a printing system, including: a slicing device and a printing apparatus;

the slicing apparatus is configured to perform the slicing method of the three-dimensional model according to the first aspect;

and the printing equipment uses the contour picture output by the slicing device and obtains the model to be printed according to the contour picture.

In a fourth aspect, an embodiment of the present invention provides a printing apparatus, including: a memory, a processor and a program stored on the memory and executable on the processor, which program, when executed by the processor, performs the steps in the method of slicing a three-dimensional model according to the first aspect.

In a fifth aspect, the embodiments of the present invention provide a readable storage medium, on which a program or instructions are stored, which when executed by a processor implement the steps in the method for slicing a three-dimensional model according to the first aspect.

In the embodiment of the invention, a triangular skirt set corresponding to a target layer slice of a three-dimensional model is determined, wherein the triangular skirt set comprises at least two triangular patches intersected with a tangent plane of the target layer slice; acquiring a half data structure of the triangular patch in the triangular skirt set; and generating a contour picture of the target layer slice corresponding to the triangular skirt strip set according to the half data structure of the triangular patch. In this way, the contour picture of the target layer slice corresponding to the triangular skirt set is determined through the half data structure of the triangular patch in the triangular skirt set in the slicing process of the three-dimensional model, and the slicing efficiency of the three-dimensional model can be improved.

Drawings

In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments of the present invention will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to these drawings without inventive exercise.

FIG. 1 is a flow chart of a method for slicing a three-dimensional model according to an embodiment of the present invention;

FIG. 2 is a schematic diagram of a three-dimensional model slice according to an embodiment of the present invention;

FIG. 3 is a diagram illustrating a half-edge data structure according to an embodiment of the present invention;

FIG. 4 is a second schematic diagram of a three-dimensional model slice according to an embodiment of the present invention;

FIG. 5 is a third schematic diagram of a three-dimensional model slice according to an embodiment of the present invention;

FIG. 6 is a fourth schematic diagram of a three-dimensional model slice according to an embodiment of the present invention;

fig. 7 is a schematic structural diagram of a printing apparatus according to an embodiment of the present invention.

Detailed Description

The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.

Referring to fig. 1, fig. 1 is a flowchart of a method for slicing a three-dimensional model according to an embodiment of the present invention, and as shown in fig. 1, the method includes the following steps:

step 101, determining a triangular skirt set corresponding to a target layer slice of the three-dimensional model, wherein the triangular skirt set comprises at least two triangular patches intersected with a tangent plane of the target layer slice.

Wherein the target slice may be one slice or all slices of the three-dimensional model. Illustratively, the target layer slice is any one layer slice of the three-dimensional model. All triangular patches of the three-dimensional model to be processed can be traversed, and a triangular skirt set corresponding to the target layer slice is determined. All triangular patches in the three-dimensional model to be processed can be traversed by multiple threads, as shown in fig. 2, a triangular patch intersecting with a tangent plane P of the target layer slice can be obtained, and a triangular skirt gather corresponding to the target layer slice is established.

And 102, acquiring a half data structure of the triangular patch in the triangular skirt set.

The half data structure of the triangular patch may include a vertex, a half, and a patch of the triangular patch. And for the triangular patch in the triangular skirt set, removing redundant vertexes, removing a degenerated triangle, establishing a topological data structure of a point-line surface of the triangular patch, and acquiring a half-edge data structure of the triangular patch.

Exemplarily, taking triangular patches fA and fB as an example, as shown in fig. 3, the triangular patch fA is composed of points {0, 1, 2}, half sides {0, 1}, {1, 2}, {2, 0 }; the triangular patch fB consists of points {0, 2, 3}, half sides {0, 2}, {2, 3}, and {3, 0 }; fA and fB are adjacent to each other, and the half {0, 2} of fB and the half {2, 0} of fA form a complete line segment.

And 103, generating a contour picture of the target layer slice corresponding to the triangular skirt strip set according to the half data structure of the triangular patch.

All intersection points of the tangent plane of the triangular patch in the triangular skirt set and the target layer slice corresponding to the triangular skirt set can be determined according to the half-edge data structure of the triangular patch, and the contour picture of the target layer slice corresponding to the triangular skirt set is generated according to all the intersection points. Specifically, the generating of the sliced contour picture of the target layer corresponding to the triangular skirt strip set according to all the intersection points may be determining a directional line segment set formed by all the intersection points, where the directional line segment set includes a plurality of directional line segments, and determining the sliced contour picture of the target layer corresponding to the triangular skirt strip set based on the plurality of directional line segments corresponding to the triangular skirt strip set.

In addition, after generating the contour picture of the target layer slice corresponding to the triangular skirt strip set, a slice file of the three-dimensional model may be generated based on the contour picture. And under the condition that the target layer slice is any one layer slice of the three-dimensional model, packing and compressing the contour pictures corresponding to all the layer slices of the three-dimensional model to obtain a slice file of the three-dimensional model. For example, the slice file of the three-dimensional model may be a zip-type compressed file obtained by packing and compressing all the outline pictures.

It should be noted that the slicing method of the three-dimensional model in the embodiment of the present invention may be applied to the photocuring slicing process of the three-dimensional model.

In the embodiment of the invention, a triangular skirt set corresponding to a target layer slice of a three-dimensional model is determined, wherein the triangular skirt set comprises at least two triangular patches intersected with a tangent plane of the target layer slice; acquiring a half data structure of the triangular patch in the triangular skirt set; and generating a contour picture of the target layer slice corresponding to the triangular skirt strip set according to the half data structure of the triangular patch. In this way, the contour picture of the target layer slice corresponding to the triangular skirt set is determined through the half data structure of the triangular patch in the triangular skirt set in the slicing process of the three-dimensional model, and the slicing efficiency of the three-dimensional model can be improved.

Optionally, the generating the contour picture of the target layer slice corresponding to the triangular skirt strip set according to the half-side data structure of the triangular patch includes:

determining all intersection points of the triangular surface patch in the triangular skirt strip set and the tangent plane of the target layer slice according to the half data structure of the triangular surface patch;

determining a directed line segment set formed by all the intersection points, wherein the directed line segment set comprises a plurality of directed line segments;

determining the contour picture of the target layer slice corresponding to the triangular skirt strip set based on the plurality of directed line segments corresponding to the triangular skirt strip set.

Wherein the plurality of directed line segments corresponding to the triangular skirt strip set can form at least two continuous line segments corresponding to the triangular skirt strip set, the determining, based on the plurality of directional line segments, a contour picture of the target layer slice corresponding to the set of triangular skirts, the coordinate positions of all the line heads of the at least two continuous line segments are determined, and the coordinate positions of all the line heads are shaped, the line heads are end points of the continuous line segments, at least two target line heads with the same coordinate position are obtained after the reshaping treatment, a line segment between the target line heads is established to obtain a contour line of the target layer slice corresponding to the triangular skirt strip set, and a contour picture of the target layer slice corresponding to the triangular skirt strip set is determined based on the contour line of the target layer slice corresponding to the triangular skirt strip set; or, the coordinate positions of all line heads of the at least two continuous line segments corresponding to the triangular skirt set are determined, multiple pairs of line heads in all line heads are determined according to the coordinate positions of all line heads, each pair of line heads in the multiple pairs of line heads comprises two line heads with the closest positions, the two line heads are connected to obtain the contour line of the target layer slice corresponding to the triangular skirt set, and the contour picture of the target layer slice corresponding to the triangular skirt set is determined based on the contour line of the target layer slice. This embodiment does not limit this.

Illustratively, as shown in fig. 4, the triangle patch fa consists of points {2, 0, 1}, half sides {2, 0}, {0, 1}, {1, 2 }; the triangular patch fb consists of points {2, 1, 3}, half sides {2, 1}, {1, 3}, and {3, 2 }; the triangular patch fc consists of points 3, 4, 2, half sides 3, 4, 2, and 2, 3. When the intersection point of the triangular patch and the tangent plane is determined, fa {0, 1} is not intersected with the tangent plane, and then fa {1, 2} is switched; fa {1, 2} intersects with the tangent plane to obtain an intersection seg [0], and meanwhile, an adjacent edge fb {2, 1} of fa {1, 2} can be found; fb {2, 1} is the same line segment as fa {1, 2} and goes to fb {1, 3 }; fb {1, 3} does not intersect the tangent plane, going to fb {3, 2 }; fb {3, 2} intersects with the tangent plane to obtain an intersection seg [1], and meanwhile, an adjacent surface fc {2, 3} of fb {3, 2} can be found; fc {2, 3} and fb {3, 2} are the same line segment, go to fc {3, 4}, fc {3, 4} does not intersect with the tangent plane, go to fc {4, 2 }; fc {4, 2} intersects the tangent plane, resulting in the intersection seg [2 ].

In this embodiment, all the intersection points of the tangent plane of the target layer slice corresponding to the triangular patch and the triangular skirt set in the triangular skirt set are determined according to the half-edge data structure of the triangular patch, and a directed line segment set formed by all the intersection points is determined, so that the directed line segment set can be determined relatively quickly, and thus the contour picture of the target layer slice can be determined based on the directed line segment set.

Optionally, determining all intersection points of the triangular patch in the triangular skirt gather and the tangent plane of the target layer slice according to the half-edge data structure of the triangular patch includes:

determining whether a first directed edge, a second directed edge and a third directed edge of a target triangular patch in the triangular skirt strip set exist an intersection point with a tangent plane of the target slice, wherein the target triangular patch is any one of the triangular patches in the triangular skirt strip set, a half-edge data structure of the target triangular patch comprises the first directed edge, the second directed edge and the third directed edge, a next half edge of the first directed edge is the second directed edge, a next half edge of the second directed edge is the third directed edge, and a next half edge of the third directed edge is the first directed edge;

under the condition that two intersection points exist between the target triangular patch and the tangent plane of the target layer slice, acquiring a first intersection point and a second intersection point between the target triangular patch and the tangent plane of the target layer slice;

the determining a set of directed line segments formed by all the intersections includes:

determining a first directed line segment according to the first intersection point and the second intersection point, wherein the direction of the first directed line segment is that the first intersection point points to the second intersection point, and the determination time of the first intersection point is earlier than that of the second intersection point;

wherein the set of directed line segments includes the first directed line segment.

In addition, whether an intersection point exists in a tangent plane of the target slice corresponding to the triangular skirt set so as to obtain a third intersection point between the triangular patch adjacent to the target triangular patch and the tangent plane may be sequentially determined, where a half-edge data structure of the triangular patch adjacent to the target triangular patch includes the fourth directed edge, the fifth directed edge, and a sixth directed edge, the sixth directed edge and the third directed edge are the same line segment, a next half of the sixth directed edge is the fourth directed edge, a next half of the fourth directed edge is the fifth directed edge, and a next half of the fifth directed edge is the sixth directed edge; a second directed line segment may be determined according to the third intersection point and the second intersection point, where the direction of the second directed line segment is that the second intersection point points to the third intersection point, and the determination time of the second intersection point is earlier than the determination time of the third intersection point; wherein the set of directed line segments further comprises the second directed line segment.

In this embodiment, whether an intersection exists in a tangent plane of the target layer slice corresponding to the triangular skirt gather is determined in sequence, and a directed line segment gather is obtained according to the determined intersection, so that the directed line segment gather can be determined orderly and efficiently.

According to the embodiment of the invention, the slices of the three-dimensional model are subjected to hierarchical filtering, and subsequently reused data are prepared in advance in each processing of the slices of the three-dimensional model, so that data set elements required by the subsequent processing are reduced, and the slicing efficiency can be greatly improved.

Optionally, the multiple directional line segments form at least two continuous line segments;

the determining the contour picture of the target layer slice corresponding to the triangular skirt strip set based on the plurality of directed line segments corresponding to the triangular skirt strip set includes:

determining the coordinate positions of all line heads of the at least two continuous line segments, and shaping the coordinate positions of all line heads, wherein the line heads are end points of the continuous line segments;

acquiring at least two target line heads with the same coordinate position obtained after the reshaping treatment;

establishing line segments between the target line heads to obtain the contour lines of the target layer slices corresponding to the triangular skirt strip set;

and determining the contour picture of the target layer slice corresponding to the triangular skirt strip set based on the contour line of the target layer slice.

The reshaping process may be to directly remove the last bit or the last two bits of the coordinate positions of all the thread ends; alternatively, the last bit, or the last two bits, of the coordinate position are rounded. For example, as shown in fig. 5, all the stubs include stubs A, B, C, D, E, F, G, H, O and Q, taking the stub a and the stub B as an example, the coordinate position of the stub a is (1.085, 2.065), the coordinate position of the stub B is (1.086, 2.068), after the coordinate positions of the stub a and the stub B are reshaped, the coordinate position of the stub a is (1.09, 2.07), the coordinate position of the stub B is (1.09, 2.07), the coordinate position of the stub a after the reshaping is the same as the coordinate position of the stub B, and the stub a and the stub B can be connected.

In addition, after the line segments between the target line heads are established, the most adjacent points can be adopted for searching the rest line heads, the rest line heads are connected with the most adjacent line heads, and the contour lines of the target layer slices corresponding to the triangular skirt strip set are obtained.

In the embodiment, at least two target line heads with the same coordinate position obtained after the integer processing are obtained, and a line segment between the target line heads is established to obtain the contour line of the target layer slice corresponding to the triangular skirt strip set, so that the directed line segment set can be determined relatively quickly, and the number of the line heads can be reduced; and the contour line of the target layer slice corresponding to the triangular skirt strip set is obtained by establishing the line segment between the target line heads, so that the problem of low efficiency caused by the fact that a large number of line heads need to be connected manually due to damage or self-intersection of an original model can be solved.

Optionally, the determining, based on the contour line of the target layer slice, the contour picture of the target layer slice corresponding to the triangular skirt strip set includes:

determining the direction of the contour line of the target layer slice according to the plurality of directed line segments corresponding to the triangular skirt strip set;

and rendering the contour line according to the direction of the contour line to obtain a contour picture of the target layer slice corresponding to the triangular skirt strip set.

The method includes determining a first vector of each directional line segment in the multiple directional line segments corresponding to the triangular skirt set, where the first vector is a geometric representation of the directional line segment, determining a second vector corresponding to each directional line segment according to normal vectors of two triangular patches corresponding to starting points of each directional line segment, where the second vector is a sum of vectors of normal vectors of the two triangular patches, an intersection point of a tangent plane of each triangular patch of the two triangular patches corresponding to the starting points and the target slice includes the starting point, and determining a direction of a contour line of the target slice corresponding to the triangular skirt set according to the first vector corresponding to each directional line segment corresponding to the triangular skirt set and the second vector corresponding to each directional line segment. Specifically, the direction of the contour line of the target layer slice corresponding to the triangular skirt strip set may be determined according to a cross product result of a first vector of each directional line segment corresponding to the triangular skirt strip set and a second vector of each directional line segment.

The direction of the contour lines may be inward or outward, where inward means a region surrounded by the contour lines, and outward means a region other than the region surrounded by the contour lines. In one embodiment, if the direction of the contour line is inward, rendering the region formed by enclosing the contour line as a hollow region; if the contour lines are directed outward, the region surrounded by the contour lines is rendered as a solid region.

In this embodiment, the direction of the contour line of the target layer slice corresponding to the triangular skirt set is determined according to the directional line segments corresponding to the triangular skirt set, and the contour line is rendered according to the direction of the contour line to obtain the contour picture of the target layer slice corresponding to the triangular skirt set, so that the contour picture of the target layer slice can be rendered more accurately.

Optionally, the determining the direction of the contour line of the target layer slice according to the plurality of directional line segments corresponding to the triangular skirt strip set includes:

determining a first vector of each directed line segment in the plurality of directed line segments corresponding to the triangular skirt strip set, wherein the first vector is a geometric representation of the directed line segment;

determining a second vector corresponding to each directional line segment according to normal vectors of two triangular patches corresponding to the starting point of each directional line segment, wherein the second vector is the sum of the normal vectors of the two triangular patches, and the intersection point of each triangular patch of the two triangular patches corresponding to the starting point and the tangent plane of the target layer slice comprises the starting point;

and determining the direction of the contour line of the target layer slice according to the cross multiplication result of the first vector of each directed line segment and the second vector corresponding to each directed line segment.

As shown in fig. 4, taking the triangular patches fa, fb, and fc as examples, the directional line segment may include a line segment formed by an intersection seg [0] and seg [1], and the direction of the line segment is that the intersection seg [0] points to seg [1 ]; the directional line segments may also include a line segment formed by the intersection seg [1] and seg [2], and the direction of the line segment is that the intersection seg [1] points to seg [2 ]. The starting point of the directional line segment formed by seg [1] and seg [2] is seg [1], and the two triangular patches corresponding to seg [1] are fb and fc.

In addition, the cross product result of the first vector of the directed line segment and the second vector corresponding to the directed line segment is greater than 0, and the directed line segment can be considered to vote for approval; a directional line segment may be considered to vote against a cross product of a first vector of directional line segments and a second vector of directional line segments that corresponds to the directional line segment that is less than or equal to 0. If the vote-casting directional line segments are more than the vote-casting directional line segments, determining the direction represented by the second vector corresponding to the vote-casting directional line segments as the direction of the contour line; if the number of the directional line segments which are voted for negatively is larger than that of the directional line segments which are voted for positively, the orientation represented by the second vector corresponding to the directional line segments which are voted for negatively can be determined as the direction of the contour line.

It should be noted that, a cross product result of a first vector and a second vector corresponding to a directed line segment is greater than 0, and the directed line segment can be considered to vote for approval; and the cross multiplication result of the first vector and the second vector corresponding to the directed line segment is less than or equal to 0, the directed line segment is considered to be subjected to objection vote, and the direction of the second vector corresponding to the majority of directed line segments is determined as the direction of the contour line by a minority-compliant principle. Since the triangle patch may be reversed, if the direction of the contour line is determined only according to the two line segments with the smallest x-axis, the direction of the contour line may be determined incorrectly, and a large amount of resources are consumed to correct the direction of the contour line in the later period. As shown in fig. 6, nor is the second vector corresponding to the directional line segment, and seg is the first vector corresponding to the directional line segment, even if the direction of nor1 is incorrect due to the reverse direction of a certain triangular patch, the direction of the contour line will not be incorrect when the second vectors corresponding to most of the directional line segments are correct by the voting mechanism decision.

In this embodiment, the direction of the contour line of the target layer slice corresponding to the triangular skirt strip set is determined according to the cross product result of the first vector of each directional line segment corresponding to the triangular skirt strip set and the second vector of each directional line segment, so that the direction of the contour line can be determined by adopting a voting mechanism, and the direction of the contour line can be accurately and efficiently determined; moreover, the conditions of some face patches in the model, such as reverse direction and small hole breakage, can be effectively repaired, and the fault-tolerant robustness of the slice is improved.

The embodiment of the invention also provides a printing method, which comprises the following steps:

acquiring a file to be printed, and printing a model according to the file to be printed; the file to be printed is a contour picture generated by the three-dimensional model slicing method in the embodiment of the invention.

An embodiment of the present invention further provides a printing system, including: a slicing device and a printing apparatus;

the slicing device is used for executing the slicing method of the three-dimensional model;

and the printing equipment uses the contour picture output by the slicing device and obtains the model to be printed according to the contour picture.

As shown in fig. 7, an embodiment of the present invention also provides a printing apparatus 200 including: the memory 202, the processor 201, and the program stored in the memory 202 and capable of running on the processor 201, when executed by the processor 201, implement the processes of the above-mentioned embodiment of the slicing method for a three-dimensional model, and can achieve the same technical effects, and are not described herein again to avoid repetition.

The embodiment of the present invention further provides a readable storage medium, where a program or an instruction is stored on the readable storage medium, and when the program or the instruction is executed by a processor, the program or the instruction implements each process of the above embodiment of the three-dimensional model slicing method, and can achieve the same technical effect, and in order to avoid repetition, details are not repeated here. The computer-readable storage medium may be a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk.

It should be noted that, in this document, 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 may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.

Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present disclosure.

While the disclosed embodiments have been described in connection with the appended drawings, the present invention is not limited to the specific embodiments described above, which are intended to be illustrative rather than limiting, and it will be appreciated by those of ordinary skill in the art that, in light of the teachings of the present invention, many modifications may be made without departing from the spirit and scope of the invention as set forth in the appended claims.

14页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种提高二维运动重复精度的方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!