A 3D model slicing processing method and device

By adjusting the direction of the cut intersection line by using the target normal and the direction reference amount of the cut intersection line in the 3D model slice processing, the problem of large calculations in the prior art is solved, the slice processing efficiency is improved, and it is suitable for a variety of application scenarios .

CN113674294BActive Publication Date: 2025-01-14BEIJING BOE TECH DEV CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110969629.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-23
Publication Date
2025-01-14
Estimated Expiration
2041-08-23

AI Technical Summary

Technical Problem

The existing 3D model slice processing method has a large amount of calculation when judging the intersection direction of the cutting surface and the model surface element, resulting in low slice processing efficiency.

Method used

By obtaining the three-dimensional model, based on the preset slice parameters and the line segments where the surface elements intersect the cutting surface, the direction reference quantity of the target normal and the cutting intersection line are determined, the vector direction of the cutting intersection line is adjusted to determine the cutting area, and then the slice result is generated , reduce multi-condition judgment and reduce calculation overhead.

Benefits of technology

It significantly improves slice processing efficiency, simplifies the complexity of logical judgment, improves stability and processing efficiency, and is suitable for different application scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113674294B_ABST
    Figure CN113674294B_ABST
Patent Text Reader

Abstract

The present invention discloses a 3D model slicing processing method and device, wherein the method comprises: obtaining a three-dimensional model; obtaining multiple cutting intersection lines according to preset slicing parameters and the three-dimensional model; the cutting intersection line is a line segment where a face element of the three-dimensional model intersects with a cutting surface; determining a direction reference according to a target normal and a target cutting intersection line; the target normal is the normal of any face element, and the target cutting intersection line is the cutting intersection line of any face element; determining a cutting area according to a direction reference amount and the vector directions of multiple cutting intersection lines; generating a slicing result according to the cutting area and the three-dimensional model. The method of the present invention can greatly reduce the computational overhead of the entire slicing processing process and significantly improve the efficiency of slicing processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of computer graphics, and in particular to a 3D model slicing processing method and device. Background Art

[0002] With the continuous expansion and vertical integration of the application fields of computer graphics, the 3D model processing algorithms are also constantly updated and iterated. Among them, the slicing algorithm is a tool that can be applied to most mainstream application scenarios such as 3D model analysis, visual arts, 3D printing, etc., and its update and optimization will be very meaningful. However, when slicing a 3D model, it is necessary to judge the direction of the intersection between the cutting surface and the 3D model face element. The existing technology needs to make multiple condition judgments when making judgments, and finally determine the direction of the intersection. This judgment method has a large amount of calculation, which leads to low efficiency in slicing processing. Summary of the invention

[0003] In view of the above problems, the present invention proposes a 3D model slicing processing method and device, which can greatly reduce the computational overhead of the entire slicing processing process and significantly improve the slicing processing efficiency.

[0004] In the first aspect, the present application provides the following technical solution through an embodiment:

[0005] A 3D model slicing processing method, comprising:

[0006] Acquire a three-dimensional model; obtain multiple cutting intersection lines according to preset slicing parameters and the three-dimensional model; the cutting intersection line is a line segment where a face element of the three-dimensional model intersects with a cutting surface; determine a direction reference according to a target normal and a target cutting intersection line; the target normal is the normal of any face element, and the target cutting intersection line is the cutting intersection line of any face element; determine a cutting area according to the direction reference amount and the vector directions of the multiple cutting intersection lines; generate a slicing result according to the cutting area and the three-dimensional model.

[0007] Optionally, determining the direction reference amount according to the target normal and the target cutting intersection line includes:

[0008] The deflection amount of the vector direction of the target cutting intersection line relative to the normal direction is determined as the direction reference amount.

[0009] Optionally, determining the cutting area according to the direction reference amount and the vector directions of the plurality of cutting intersection lines includes:

[0010] For each cutting intersection line, determine whether the vector direction of the cutting intersection line matches the direction reference; if so, determine the vector direction of the cutting intersection line as the connection direction; if not, determine the connection direction as the opposite direction of the vector direction of the cutting intersection line; determine the cutting area according to the connection directions of the multiple cutting intersection lines.

[0011] Optionally, determining the cutting area according to the connection directions of the plurality of cutting intersection lines includes:

[0012] The cutting area is obtained by connecting the multiple cutting intersection lines according to their connection directions.

[0013] Optionally, the connecting the plurality of cutting intersection lines according to the connection directions of the plurality of cutting intersection lines to obtain the cutting area includes:

[0014] According to the preset initial cutting intersection line, the first adjacent face element is obtained; the first adjacent face element is a face element with overlapping endpoints in the preset direction of the initial face element, and the initial face element is the face element corresponding to the initial cutting intersection line; according to the connection direction of the first adjacent intersection line, the initial cutting intersection line and the first adjacent intersection line are connected to obtain the first fold line; the first adjacent intersection line is the cutting intersection line corresponding to the first adjacent face element; according to the first fold line, the second adjacent face element is obtained; the second adjacent face element is a face element with overlapping endpoints in the preset direction of the first adjacent face element; according to the connection direction of the second adjacent intersection line, the first fold line is connected to the second adjacent intersection line to obtain the second fold line; the second adjacent intersection line is the cutting intersection line corresponding to the second adjacent face element; according to the second fold line, the remaining cutting intersection lines are continued to be connected until they are connected to the initial cutting intersection line to obtain the cutting area.

[0015] Optionally, generating a slicing result according to the cutting area and the three-dimensional model includes:

[0016] According to the cutting area, the face elements corresponding to the cutting area are cut to obtain cutting units; whether the shape of each cutting unit is a triangle is determined; if so, a visualized cutting unit is generated according to a preset generation rule; if not, a sub-unit of the cutting unit is generated based on the diagonal vertices of the cutting unit; wherein the shape of the sub-unit is a triangle; the visualized sub-unit is generated according to a preset generation rule; and the slicing result is generated according to the visualized cutting unit and the visualized sub-unit.

[0017] Optionally, obtaining a plurality of cutting intersection lines according to preset slicing parameters and the three-dimensional model includes:

[0018] According to preset slicing parameters, a cutting plane is determined; and according to the positional relationship between the cutting plane and the face element, the plurality of cutting intersection lines are determined.

[0019] Optionally, determining the plurality of cutting intersection lines according to the positional relationship between the cutting surface and the facet includes:

[0020] For each face element, determine whether the face element intersects with the cutting surface; when the face element intersects with the cutting surface, determine that the face element has a cutting intersection line; and obtain the cutting intersection line of the face element according to the vertex coordinates of the face element and the cutting surface.

[0021] Optionally, the face element intersects with the cutting surface, including any one or more of the following intersection situations:

[0022] The first vertex of the face element is located on the first side of the cutting surface, and the second vertex of the face element is located on the second side of the cutting surface; the first vertex of the face element is located on the first side of the cutting surface, and the second and third vertices of the face element are located on the cutting surface.

[0023] Optionally, before determining the direction reference amount according to the target normal and the target cutting intersection line, the method further includes:

[0024] Delete the facets that coincide with the cutting surface.

[0025] In the second aspect, based on the same inventive concept, the present application provides the following technical solution through an embodiment:

[0026] A 3D model slicing processing device, characterized by comprising:

[0027] A generation module is used to obtain a three-dimensional model; a first processing module is used to obtain multiple cutting intersection lines according to preset slicing parameters and the three-dimensional model; the cutting intersection line is a line segment where a face element of the three-dimensional model intersects with a cutting surface; a second processing module is used to determine a direction reference according to a target normal and a target cutting intersection line; the target normal is the normal of any face element, and the target cutting intersection line is the cutting intersection line of any face element; a third processing module is used to determine a cutting area according to the direction reference amount and the vector directions of the multiple cutting intersection lines; a slicing generation module is used to generate a slicing result according to the cutting area and the three-dimensional model.

[0028] In the third aspect, based on the same inventive concept, the present application provides the following technical solution through an embodiment:

[0029] A computer-readable storage medium having a computer program stored thereon, characterized in that when the program is executed by a processor, the steps of the method described in any one of the first aspects above are implemented.

[0030] In the fourth aspect, based on the same inventive concept, the present application provides the following technical solution through an embodiment:

[0031] A 3D printing system comprises a processor and a memory, wherein the memory is coupled to the processor and stores instructions, and when the instructions are executed by the processor, the 3D printing system executes the steps of any one of the methods described in the first aspect.

[0032] A 3D model slicing processing method and device provided in an embodiment of the present invention obtains a three-dimensional model; then, according to preset slicing parameters and the three-dimensional model, obtains multiple cutting intersection lines; the cutting intersection line is a line segment where a face element of the three-dimensional model intersects with a cutting surface; then, according to a target normal and a target cutting intersection line, a direction reference is determined; the target normal is the normal of any face element, and the target cutting intersection line is the cutting intersection line of any face element; then, according to the direction reference amount and the vector direction of multiple cutting intersection lines, a cutting area is determined; finally, according to the cutting area and the three-dimensional model, a slicing result is generated. In this embodiment, during the entire slicing process, when obtaining the cutting area, the vector direction of the cutting intersection line is judged and adjusted based on the direction reference amount, and there is no need to judge multiple conditions; therefore, the computational overhead of the entire slicing process is greatly reduced, the efficiency of slicing processing is significantly improved, and it can be applied to different scenarios with high universality.

[0033] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for describing the embodiments. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:

[0035] Figure 1 A flow chart of a 3D model slicing method provided in an embodiment of the present invention is shown;

[0036] Figure 2 A schematic diagram showing the situation where a facet element intersects with a cutting surface in an embodiment of the present invention is shown;

[0037] Figure 3 A schematic diagram showing the principle of solving the cutting intersection line in an embodiment of the present invention is shown;

[0038] Figure 4 A schematic diagram of the slice edge effect when the slice precision is low in the embodiment of the present invention is shown;

[0039] Figure 5 A schematic diagram of slice segmentation when the slice accuracy is high-precision is shown in an embodiment of the present invention;

[0040] Figure 6 A schematic structural diagram of a 3D model slicing processing device provided in an embodiment of the present invention is shown. DETAILED DESCRIPTION

[0041] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.

[0042] The present invention provides a 3D model slicing processing method, which can be applied to any scenario that requires slicing of 3D models; for example: 3D model analysis, visual art, 3D printing, etc. The method can be loaded as a functional module or integrated into the 3D processing software of the above-mentioned scenarios; for example, it can be stored in a computer storage medium in the form of code, and read and executed by a processor to realize the functional role of the above-mentioned functional module. The method and device of the present invention will be described in detail below in the form of specific examples.

[0043] See also Figure 1 , shows a flow chart of a 3D model slicing processing method provided by an embodiment of the present invention. The 3D model slicing processing method comprises:

[0044] Step S10: Acquire a three-dimensional model.

[0045] In step S10, the three-dimensional model (3D model) can be made by existing 3D software, for example, CAD (CAD-Computer Aided Design) software can be used to make it, and a 3D model file in STL format can be obtained; then, the STL format file is imported into the slicing processing pipeline in the 3D software that can perform slicing to obtain the three-dimensional model. At the same time, the three-dimensional model data can also be structurally optimized; for example, after the structural optimization is performed, after the face data storage of the three-dimensional model is completed, it can be determined whether two face elements are adjacent by finding whether there are overlapping points between the face elements, thereby saving computing resources and improving processing efficiency. In addition, in this embodiment, the type of 3D software is not limited, for example, it can be software for 3D model analysis, 3D software for visual art creation, 3D software for 3D printing, etc.; in addition, the three-dimensional model can also be generated by a computer graphics library (i.e., a graphics library used in self-programming); for example, (OpenGraphics Library, open graphics library), DirectX (Direct eXtension), etc.

[0046] Next, in this embodiment, the above three-dimensional model can also be constructed into a complete, visual three-dimensional model to facilitate real-time observation by the user and subsequent adjustment of slice parameters, and the construction process is not limited.

[0047] Step S20: obtaining a plurality of cutting intersection lines according to preset slicing parameters and the three-dimensional model; the cutting intersection lines are line segments where face elements of the three-dimensional model intersect with cutting surfaces.

[0048] In step S20, the preset slicing parameters are determined by the user according to the needs, and different slicing parameters can be used in different application scenarios. Slicing parameters include cutting direction, slicing position, slicing thickness, number of slices, slicing accuracy, etc. Among them, the cutting direction is the direction perpendicular to the cutting surface, or other specified directions; the slicing position is the position of the cutting surface; the size of the slicing thickness is the vertical distance between two adjacent slicing positions; the slicing accuracy is the visual display of the roughness and flatness of the slice after obtaining the slicing result. The slicing accuracy can be selected as high precision or low precision; when the slicing accuracy is selected as low precision, the cutting area is not optimized before generating the slicing result; when the slicing accuracy is selected as high precision, the cutting area can be optimized before generating the slicing result. The specific method of optimization will be explained in the subsequent step S40.

[0049] For example, in 3D model analysis, users can determine the slice position, slice quantity, slice accuracy, etc. according to the position of the 3D model analysis. In the 3D printing process, users can determine the slice thickness and slice accuracy according to the printing accuracy of the 3D printer and the required printing accuracy.

[0050] In some implementations, the implementation process of step S20 may be as follows:

[0051] First, the cutting surface is determined according to the preset slicing parameters.

[0052] For example, in the application scenarios of 3D model analysis or visual art display, the cutting surface can be determined according to the slicing position and cutting direction, and the number of cutting surfaces can be one or more; in addition, the user can specify the corresponding plane function or surface function to generate the cutting surface, and the cutting surface can be a plane or a surface without limitation. In the application scenario of 3D printing, the cutting surface can be determined according to any one or more of the cutting direction, slicing thickness and cutting accuracy; specifically, when the cutting direction is perpendicular to the Z axis of the three-dimensional model, that is, the cutting surface is perpendicular to the Z axis of the three-dimensional model, multiple cutting surfaces can be taken at equal intervals along the Z axis.

[0053] It should be noted that the subsequent description in this embodiment is based on an example of a cutting surface.

[0054] Then, multiple cutting intersection lines are determined according to the positional relationship between the cutting surface and the face element.

[0055] Specifically, for each face element, it is determined whether the face element intersects with the cutting surface; when the face element intersects with the cutting surface, it is determined that the face element has a cutting intersection line; at this time, the cutting intersection line can be further calculated. The cutting intersection line of the face element can be obtained according to the vertex coordinates of the face element and the cutting surface.

[0056] The face element intersects with the cutting surface, including any one or more of the following intersection situations:

[0057] 1. The first vertex of the facet is located on the first side of the cutting surface, and the second vertex of the facet is located on the second side of the cutting surface; Figure 2 Case 1 and Case 2 shown in .

[0058] 2. The first vertex of the face element is located on the first side of the cutting surface, and the second vertex and the third vertex of the face element are located on the cutting surface; Figure 2 The case shown in 3.

[0059] By judging the intersection according to the above-mentioned positional relationship characteristics 1 and 2, the judgment efficiency can be significantly improved.

[0060] In addition, in some embodiments, there may be surface elements that coincide with the cutting surface, such as Figure 2Case 4 shown in ; that is, the face element whose normal is perpendicular to the cutting surface. These face elements are invalid data when forming the slicing result, and can be deleted before step S30 to reduce the data size of the final model and save calculation. For example, in a 3D printing scenario, the face element that coincides with the cutting surface does not need to form contour information or print, that is, the face element is invalid information and can be deleted before step S30 to improve the efficiency of slicing processing.

[0061] The specific process of calculating the cutting intersection line can be referred to as follows:

[0062] Take the above-mentioned case 1 as an example for explanation, and other intersection cases can be handled by analogy. Among them, the line segment EF formed by the intersection of the cutting surface and the face element is as follows: Figure 3 As shown, the line segment EF is the cutting intersection line to be solved, and z=h is the cutting surface.

[0063] According to the general straight line analytical formula, the joint cutting surface z = h can be obtained:

[0064]

[0065] Therefore, the X and Y coordinates of the intersection points E and F can be obtained as follows:

[0066]

[0067]

[0068] The analytical expression of the cutting intersection line EF can be obtained according to the intersection points E and F. By calculating all the face elements corresponding to the intersection situations 1, 2, and 3, all the cutting intersection lines corresponding to the cutting surface can be obtained.

[0069] Step S30: determining a direction reference according to a target normal direction and a target cutting intersection line; the target normal direction is the normal direction of any face element, and the target cutting intersection line is the cutting intersection line of any face element.

[0070] In step S30, after obtaining multiple cutting intersections, in order to obtain slices, the cutting intersections need to be reorganized and connected. When connecting, it is necessary to connect according to a unified vector direction to ensure that the graphics rendering pipeline draws the face elements in a specific order, such as connecting the three vertices of the face element counterclockwise or clockwise; after drawing, the normal vectors of each face element are all in the same direction. For example, if the normal vectors of the face element are all facing outward relative to the three-dimensional model, then the face element is visible, otherwise it is invisible. The graphics rendering pipeline can be a graphics rendering pipeline in OpenGL (Open Graphics Library) or DirectX (Direct eXtension); wherein, when the graphics rendering pipeline in OpenGL performs drawing, the face element generated counterclockwise has a visible normal vector; when the graphics rendering pipeline in DirectX performs drawing, the face element generated clockwise has a visible normal vector.

[0071] Therefore, in this embodiment, the vector direction of each cutting intersection line can be adjusted by determining a direction reference amount. The face element selected for determining the direction reference amount can be arbitrarily specified by the user or randomly determined without limitation. Specifically, the deflection amount of the vector direction of the target cutting intersection line relative to the normal direction can be determined as the direction reference amount. The deflection amount can be a deflection direction, or it can include a deflection direction and a deflection angle.

[0072] Step S40: determining a cutting area according to the direction reference amount and the vector directions of the plurality of cutting intersection lines.

[0073] In step S40, the following implementation process may be included:

[0074] First, for each cutting intersection:

[0075] Determine whether the vector direction of the cutting intersection matches the direction reference; wherein, the deflection direction or deflection angle between the vector direction of the cutting intersection and the corresponding face element normal can be recorded as the deviation. At this time, whether it matches can be divided into the following two implementation methods: 1. If the deviation of the cutting intersection is the same as the direction reference, it can be considered that the vector direction of the current cutting intersection matches the direction reference; otherwise, it is considered that the vector direction of the current cutting intersection does not match the direction reference. 2. If the deviation of the cutting intersection is opposite to the direction reference, it can be considered that the vector direction of the current cutting intersection matches the direction reference; otherwise, it is considered that the vector direction of the current cutting intersection does not match the direction reference. It should be noted that both the deviation and the direction reference can be vectors. Then, when the vector direction of the cutting intersection matches the direction reference, the vector direction of the cutting intersection is determined as the connection direction; when the vector direction of the cutting intersection does not match the direction reference, that is, it is opposite, the opposite direction of the vector direction of the cutting intersection can be used to determine the connection direction; that is, the vector direction of the cutting intersection is reversed. This ensures that the vector direction (connection direction) of each cutting intersection line is the same when connected.

[0076] In this embodiment, the vector direction of the cutting intersection line is adjusted by matching the cutting intersection line with the direction reference amount, thereby obtaining the connection direction. Compared with the prior art that determines six groups of conditions by drawing the vertex order of the face element, and then calls the corresponding logic to adjust the vector direction of the cutting intersection line to obtain the connection direction, this process only needs to perform one condition judgment for each cutting intersection line to determine the connection direction of a cutting intersection line, which greatly reduces the amount of calculation, simplifies the complexity of logical judgment, and improves stability, parallelism, ease of use, maintainability and processing efficiency.

[0077] For each cutting intersection line, the above matching and adjustment process is performed to obtain the connection direction of all cutting intersection lines.

[0078] The cutting area, i.e., the position of the visualized part when the three-dimensional model is cut, can be an area surrounded by a closed polygon. Specifically, the cutting area can be determined based on the connection direction of multiple cutting intersections. In order to form the cutting area, multiple cutting intersections can be connected, that is, multiple cutting intersections can be connected according to the connection direction of the multiple cutting intersections to obtain the cutting area. When connecting, each cutting intersection can be connected end to end according to its connection direction, and multiple cutting intersections can be connected simultaneously or sequentially in the order of adjacency without limitation.

[0079] For example, when connecting each cutting intersection line in sequence according to the adjacency order, it can be implemented as follows:

[0080] First, a preset initial cutting intersection line is determined. The initial cutting intersection line is any cutting intersection line selected from a plurality of cutting intersection lines, and is used as a basis to connect other cutting intersection lines.

[0081] Then, according to the preset initial cutting intersection line, the first adjacent face element is obtained; the first adjacent face element is the face element with the endpoints overlapping in the preset direction of the initial face element, and the initial face element is the face element corresponding to the initial cutting intersection line; when searching for the first adjacent face element, all face elements cut by the cutting surface can be read, and then the face element with the endpoints overlapping with the initial face element can be determined, and finally, the face element in the preset direction is determined from the face elements with the endpoints overlapping, which is the first adjacent face element. The preset direction can be the same as the connection direction of the cutting intersection line, or it can be opposite to the connection direction of the cutting intersection line, without limitation.

[0082] Next, according to the connection direction of the first adjacent intersection line, the initial cutting intersection line and the first adjacent intersection line are connected to obtain the first broken line; the first adjacent intersection line is the cutting intersection line corresponding to the first adjacent face element. Next, according to the first broken line, the second adjacent face element is obtained; the acquisition process of the second adjacent face element can refer to the above-mentioned acquisition process of the first adjacent face element, and will not be repeated. The second adjacent face element is a face element with overlapping endpoints in the preset direction of the first adjacent face element; then according to the connection direction of the second adjacent intersection line, the first broken line and the second adjacent intersection line are connected to obtain the second broken line, and the second adjacent intersection line is the cutting intersection line corresponding to the second adjacent face element. And so on, the iteration is repeated continuously, that is, according to the second broken line, the remaining cutting intersection lines are continued to be connected until they are connected to the initial cutting intersection line, and finally a closed polygonal area is formed to obtain the cutting area.

[0083] Step S50: generating a slicing result according to the cutting area and the three-dimensional model.

[0084] In step S50, after obtaining the cutting area, the three-dimensional model can be cut and separated according to the calculation processing of the cutting area; when all the cutting is completed, the required slicing result is formed. In this embodiment, the following two specific implementation methods for obtaining the slicing result are provided:

[0085] 1. For high-precision 3D models or 3D models with low cutting precision requirements, you can choose to slice with low precision. In this case, the face element where the cutting intersection line is located will not be modified. For example, when the 3D model is separated along the cutting area A, slice 1 and slice 2 can be formed, and the face element containing the cutting intersection line can be separated into slice 1 or slice 2 without restriction. The specific separation of face elements is as follows:

[0086] 1) On the face element containing the cutting intersection line, obtain the vertex farthest from the cutting intersection line; assign the face element to the slice corresponding to the farthest vertex. This method can ensure that the cutting surface of the slice is smoother.

[0087] 2) Preset a positive direction and assign the face element containing the cutting intersection line to the slice pointed by the positive direction. This method has low computational complexity and high segmentation efficiency. Figure 4 As shown, all the face elements containing cutting intersection lines are assigned to slice 1 pointed to by the positive direction.

[0088] 3) On the face element containing the cutting intersection, obtain the distances between the three vertices of the face element and the cutting intersection; then determine the average distance between the two vertices on the same side of the face element (including the vertex that coincides with the cutting intersection) and the cutting intersection. Then, set a distance threshold to allocate the face element. If the average distance is less than the distance threshold, the face element can be allocated to the slice where the two vertices are located. For example: the user sets a distance threshold r. If the average distance between the two vertices in the same direction of the segmented face element and the cutting intersection is less than r, the face element is allocated to the slice where the two vertices are located.

[0089] 2. For low-precision 3D models or 3D models with high cutting accuracy requirements, you can select high-precision slicing accuracy. At this time, the face element where the cutting intersection line is located can be modified. This embodiment specifically has the following processing methods:

[0090] First, the facets corresponding to the cutting area are cut according to the cutting area to obtain cutting units; wherein the cutting process is to calculate the facets through which the cutting intersection line passes, and obtain two cutting units formed by the facets separated by the cutting intersection line. At this time, the cutting unit is invisible, that is, no visible slices have been generated.

[0091] Then, it is determined whether the shape of each cutting unit is a triangle.

[0092] When the cutting unit is a triangle, a visual cutting unit can be generated according to a preset generation rule; that is, the cutting unit is drawn after the slice reorganization is completed. The cutting unit does not need additional optimization processing and can still ensure a smooth slice edge.

[0093] When the cutting unit is not a triangle, a subunit of the cutting unit is generated based on the diagonal vertices of the cutting unit; wherein the shape of the subunit is a triangle. Specifically, when determining the diagonal vertices of the cutting unit, a set of diagonal vertices can be randomly determined, and the cutting unit can be divided into two subunits according to the determined diagonal vertices. Then, according to the preset generation rules, a visualized subunit is generated, that is, after the slice reorganization is completed, the subunit is drawn. Finally, according to the visualized cutting unit and the visualized subunit, the 3D model data is reorganized to generate a slice result, such as Figure 5As shown, the edges of slices 1 and 2 are both flatly segmented. Through this optimization process, the facets can be cut and reorganized to ensure the flatness of the slice edges and reduce the roughness, thereby avoiding the unevenness problem after low-precision mode slicing.

[0094] In this embodiment, a judgment step of the slicing result can also be added to judge whether the slicing result meets the preset requirement. The requirement means that the flatness and roughness required by the user are achieved. After the judgment, if the preset condition is met, the slicing result is used as the final result; if the final condition cannot be met, the slicing parameters are adjusted, and the process returns to step S20, and steps S20-S50 are re-executed until the final result that meets the requirement is obtained. The user can transcode the final result according to the requirements, and the transcoding method is not limited.

[0095] In order to make the technical solution of this embodiment easier to understand, the following is explained by taking multiple application scenarios as examples:

[0096] Take the 3D model analysis application scenario as an example:

[0097] This scenario can occur in industrial manufacturing processes, and the method is embedded in 3D design software. For example, a factory design manager needs to evaluate the design of a mechanical component in principle. The component has some internal structures embedded in it, and the internal structures are not visible from the outside of the model. At this time, it is necessary to slice the 3D model of the mechanical component to expose the internal structure. The core operation process can be referred to as follows:

[0098] A. Load the data file of the designed component into the 3D design software;

[0099] B. The design software will analyze the invisible design data and present it in the work area as a visual 3D model;

[0100] C. The user selects the design part and chooses the cutting position to be cut or uses a preset slicing method; for example, cutting in half, cutting 1 / 4 longitudinally or transversely, etc.

[0101] D. The user clicks the slicing function start key; for example, the user can use the software toolbar icon, menu selection, automatic pop-up confirmation, and other methods;

[0102] E. The 3D design software internally calls the 3D model slicing processing method disclosed in this embodiment to perform slicing processing according to preset slicing parameters, and finally obtains a slicing result, that is, a cut model;

[0103] F. After cutting, the model data is updated in real time by the 3D design software to the work area for users to view and evaluate. At this time, the user can choose to save or export the slice results, and can choose the required saving format for export.

[0104] Take the visual arts application scenario as an example:

[0105] The visual art mentioned in this embodiment specifically refers to the artistic processing of existing 3D models to present various artistic effects. Different from the above-mentioned 3D model analysis application scenario, after the 3D model is sliced ​​by calling the method of this embodiment, the model generally needs to be artistically processed. Among them, when slicing, it includes any one or more of the following: slicing by part, slicing by distance, slicing by specific function, etc., without restriction; when artistic processing, it may include any one or more of the following: reorganization, dyeing, material transformation, light and shadow effects, mapping, adding space background, adding action, etc., without restriction; so that the final product shows artistry. Another difference is that the processing of 3D models in the art industry is usually multi-platform and cross-platform operation, often modeling and preliminary improvement in one software, and then importing it into another comprehensive engine for richer content operations. Especially after the advent of the cross-platform cloud cooperation platform, it has added support for multi-person online editing. The data files can be uniformly transcoded to ensure mutual compatibility and ensure real-time sharing and viewing of cooperative design content.

[0106] Take 3D printing application scenarios as an example:

[0107] In the 3D printing process, the designed 3D model data needs to be read into a special printer to achieve three-dimensional printing of the 3D model itself. With the development of technology, 3D printing has expanded from the initial model and toy printing to various fields such as mechanical parts production, house construction, and high-precision structure manufacturing. When 3D printing, the processing flow of the 3D model is as follows:

[0108] A. Read the 3D model data file into the 3D printing design software; for example, STL file (a 3D printing data file format);

[0109] B. The printing design software analyzes the model data in the STL file and constructs it into a visual 3D model to be presented in the work area;

[0110] C. Slice the 3D model along a certain direction, such as the Z-axis direction of the 3D model, and call the 3D model slicing processing method of this embodiment according to different process requirements to select slicing accuracy and perform equidistant slicing processing to obtain a series of two-dimensional plane information;

[0111] D. Couple the two-dimensional plane information in step C with the processing parameters of the 3D printer and transcode it into a *.gcode file (a 3D printer execution instruction file) that can be recognized by the 3D printer;

[0112] E. The printer performs 3D printing according to the instructions of the *.gcode file.

[0113] In summary, a 3D model slicing processing method provided in this embodiment obtains a three-dimensional model; then, according to the preset slicing parameters and the three-dimensional model, multiple cutting intersection lines are obtained; the cutting intersection line is the line segment where the face element of the three-dimensional model intersects with the cutting surface; then, according to the target normal and the target cutting intersection line, the direction reference is determined; the target normal is the normal of any face element, and the target cutting intersection line is the cutting intersection line of any face element; then, according to the direction reference amount and the vector direction of the multiple cutting intersection lines, the cutting area is determined; finally, according to the cutting area and the three-dimensional model, the slicing result is generated. In the entire slicing process, this embodiment judges and adjusts the vector direction of the cutting intersection line based on the direction reference amount when obtaining the cutting area, without the need for multiple condition judgments; therefore, the computational overhead of the entire slicing process is greatly reduced, the efficiency of slicing processing is significantly improved, and it can be applied to different scenarios with high universality.

[0114] See also Figure 6 In another embodiment of the present invention, a 3D model slicing processing device 300 is provided, comprising:

[0115] A generation module 301 is used to obtain a three-dimensional model; a first processing module 302 is used to obtain multiple cutting intersection lines according to preset slicing parameters and the three-dimensional model; the cutting intersection line is a line segment where a face element of the three-dimensional model intersects with a cutting surface; a second processing module 303 is used to determine a direction reference according to a target normal and a target cutting intersection line; the target normal is the normal of any face element, and the target cutting intersection line is the cutting intersection line of any face element; a third processing module 304 is used to determine a cutting area according to the direction reference amount and the vector directions of the multiple cutting intersection lines; a slicing generation module 305 is used to generate a slicing result according to the cutting area and the three-dimensional model.

[0116] As an optional implementation manner, the second processing module 303 is further specifically configured to:

[0117] The deflection amount of the vector direction of the target cutting intersection line relative to the normal direction is determined as the direction reference amount.

[0118] As an optional implementation manner, the third processing module 304 is further specifically configured to:

[0119] For each cutting intersection line, determine whether the vector direction of the cutting intersection line matches the direction reference; if so, determine the vector direction of the cutting intersection line as the connection direction; if not, determine the connection direction as the opposite direction of the vector direction of the cutting intersection line; determine the cutting area according to the connection directions of the multiple cutting intersection lines.

[0120] As an optional implementation manner, the third processing module 304 is further specifically configured to:

[0121] The cutting area is obtained by connecting the multiple cutting intersection lines according to their connection directions.

[0122] As an optional implementation manner, the third processing module 304 is further specifically configured to:

[0123] According to the preset initial cutting intersection line, the first adjacent face element is obtained; the first adjacent face element is a face element with overlapping endpoints in the preset direction of the initial face element, and the initial face element is the face element corresponding to the initial cutting intersection line; according to the connection direction of the first adjacent intersection line, the initial cutting intersection line and the first adjacent intersection line are connected to obtain the first fold line; the first adjacent intersection line is the cutting intersection line corresponding to the first adjacent face element; according to the first fold line, the second adjacent face element is obtained; the second adjacent face element is a face element with overlapping endpoints in the preset direction of the first adjacent face element; according to the connection direction of the second adjacent intersection line, the first fold line is connected to the second adjacent intersection line to obtain the second fold line; the second adjacent intersection line is the cutting intersection line corresponding to the second adjacent face element; according to the second fold line, the remaining cutting intersection lines are continued to be connected until they are connected to the initial cutting intersection line to obtain the cutting area.

[0124] As an optional implementation manner, the slice generation module 305 is specifically configured to:

[0125] According to the cutting area, the face elements corresponding to the cutting area are cut to obtain cutting units; whether the shape of each cutting unit is a triangle is determined; if so, a visualized cutting unit is generated according to a preset generation rule; if not, a sub-unit of the cutting unit is generated based on the diagonal vertices of the cutting unit; wherein the shape of the sub-unit is a triangle; the visualized sub-unit is generated according to a preset generation rule; and the slicing result is generated according to the visualized cutting unit and the visualized sub-unit.

[0126] As an optional implementation manner, the first processing module 302 is specifically configured to:

[0127] According to preset slicing parameters, a cutting plane is determined; and according to the positional relationship between the cutting plane and the face element, the plurality of cutting intersection lines are determined.

[0128] As an optional implementation manner, the first processing module 302 is specifically configured to:

[0129] For each face element, determine whether the face element intersects with the cutting surface; when the face element intersects with the cutting surface, determine that the face element has a cutting intersection line; and obtain the cutting intersection line of the face element according to the vertex coordinates of the face element and the cutting surface.

[0130] As an optional implementation manner, the intersection of the face element and the cutting surface includes any one or more of the following intersection situations:

[0131] The first vertex of the face element is located on the first side of the cutting surface, and the second vertex of the face element is located on the second side of the cutting surface; the first vertex of the face element is located on the first side of the cutting surface, and the second and third vertices of the face element are located on the cutting surface.

[0132] As an optional implementation, it further includes: a deleting module, which is used to delete the face elements overlapping with the cutting surface before determining the direction reference amount according to the target normal and the target cutting intersection line.

[0133] It should be noted that the specific implementation and technical effects of a 3D model slicing processing device 300 provided in an embodiment of the present invention are the same as those of the aforementioned method embodiment. For the sake of brief description, for matters not mentioned in the device embodiment, reference may be made to the corresponding contents in the aforementioned method embodiment.

[0134] In another embodiment of the present invention, a computer-readable storage medium is provided, on which a computer program is stored. When the program is executed by a processor, any step in the above method embodiment is implemented.

[0135] It should be noted that the computer-readable storage medium provided in an embodiment of the present invention has the same steps of implementation and technical effects produced when its program is executed by a processor as those in the aforementioned method embodiment. For the sake of brief description, for parts not mentioned in this embodiment, reference may be made to the corresponding contents in the aforementioned method embodiment.

[0136] In another embodiment of the present invention, a 3D printing system is provided, including a processor and a memory, wherein the memory is coupled to the processor and stores instructions, and when the instructions are executed by the processor, the 3D printing system executes any step in the aforementioned method embodiment.

[0137] It should be noted that the specific implementation and technical effects of the 3D printing system provided in the embodiment of the present invention are the same as those of the aforementioned method embodiment. For the sake of brief description, for matters not mentioned in the embodiment of the present device, reference may be made to the corresponding contents in the aforementioned method embodiment.

[0138] The term "and / or" that appears in this article is only a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the objects associated before and after are in an "or" relationship; the word "comprising" does not exclude the existence of elements or steps that are not listed in the claims. The word "one" or "an" placed before an element does not exclude the existence of multiple such elements. The present invention can be implemented with the aid of hardware including several different elements and with the aid of appropriately programmed computers. In a unit claim that lists several devices, several of these devices may be embodied by the same hardware item. The use of the words first, second, and third, etc. does not indicate any order. These words can be interpreted as names.

[0139] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0140] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0141] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0142] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0143] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.

[0144] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.

Claims

1. A 3D model slicing processing method, wherein the 3D model slicing processing method is applied to 3D printing, and the 3D printing software performs 3D printing based on input 3D model data, characterized in that: include: Obtaining a three-dimensional model; According to the preset slice parameters and the three-dimensional model, a plurality of cutting intersection lines are obtained; The cutting intersection line is a line segment where the face element of the three-dimensional model intersects with the cutting surface; Determine a direction reference according to a target normal direction and a target cutting intersection line; the target normal direction is the normal direction of any face element, and the target cutting intersection line is the cutting intersection line of any face element; Determine a cutting area according to the direction reference amount and the vector directions of the plurality of cutting intersection lines; Generate a slicing result according to the cutting area and the three-dimensional model; The step of determining the cutting area according to the direction reference amount and the vector directions of the plurality of cutting intersection lines comprises: For each of the cutting intersection lines, determining whether the vector direction of the cutting intersection line matches the direction reference value; If yes, the vector direction of the cutting intersection line is determined as the connection direction; If not, the connection direction is determined by taking the opposite direction of the vector direction of the cutting intersection line; The cutting area is determined according to the connection directions of the plurality of cutting intersection lines.

2. The method according to claim 1, characterized in that Determining the direction reference amount according to the target normal and the target cutting intersection line includes: The deflection amount of the vector direction of the target cutting intersection line relative to the normal direction is determined as the direction reference amount.

3. The method according to claim 1, characterized in that The step of determining the cutting area according to the connection directions of the plurality of cutting intersection lines comprises: The cutting area is obtained by connecting the multiple cutting intersection lines according to their connection directions.

4. The method according to claim 3, characterized in that The step of connecting the plurality of cutting intersection lines according to the connection directions of the plurality of cutting intersection lines to obtain the cutting area comprises: According to a preset initial cutting intersection line, a first adjacent face element is obtained; the first adjacent face element is a face element whose endpoints overlap in a preset direction of the initial face element, and the initial face element is a face element corresponding to the initial cutting intersection line; According to the connection direction of the first adjacent intersection line, the initial cutting intersection line and the first adjacent intersection line are connected to obtain a first fold line; the first adjacent intersection line is a cutting intersection line corresponding to the first adjacent face element; According to the first fold line, a second adjacent face element is acquired; the second adjacent face element is a face element whose endpoints overlap in a preset direction of the first adjacent face element; According to the connection direction of the second adjacent intersection line, the first fold line and the second adjacent intersection line are connected to obtain a second fold line; the second adjacent intersection line is a cutting intersection line corresponding to the second adjacent face element; According to the second fold line, the remaining cutting intersection lines are continuously connected until they are connected to the initial cutting intersection line to obtain the cutting area.

5. The method according to claim 1, characterized in that The step of generating a slicing result according to the cutting area and the three-dimensional model includes: According to the cutting area, a cutting process is performed on the facets corresponding to the cutting area to obtain a cutting unit; Determining whether the shape of each cutting unit is a triangle; If yes, generating a visualized cutting unit according to a preset generation rule; If not, then based on the diagonal vertices of the cutting unit, a sub-unit of the cutting unit is generated; wherein the shape of the sub-unit is a triangle; and according to a preset generation rule, a visualized sub-unit is generated; The slicing result is generated according to the visualized cutting unit and the visualized sub-unit.

6. The method according to claim 1, characterized in that The step of obtaining a plurality of cutting intersection lines according to the preset slicing parameters and the three-dimensional model comprises: Determine the cutting surface according to the preset slicing parameters; The plurality of cutting intersection lines are determined according to the positional relationship between the cutting surface and the face element.

7. The method according to claim 6, characterized in that The step of determining the plurality of cutting intersection lines according to the positional relationship between the cutting surface and the facets comprises: For each face element, determining whether the face element intersects with the cutting surface; When the face element intersects with the cutting surface, it is determined that the face element has a cutting intersection line; According to the vertex coordinates of the face element and the cutting surface, a cutting intersection line of the face element is obtained.

8. The method according to claim 7, characterized in that The intersection of the face element and the cutting surface includes any one or more of the following intersection situations: The first vertex of the facet is located on a first side of the cutting surface, and the second vertex of the facet is located on a second side of the cutting surface; The first vertex of the facet is located on a first side of the cutting surface, and the second vertex and the third vertex of the facet are located on the cutting surface.

9. The method according to claim 7, characterized in that: Before determining the direction reference amount according to the target normal and the target cutting intersection line, the method further includes: Delete the facets that coincide with the cutting surface.

10. A 3D model slicing processing device, the 3D model slicing processing device is applied to 3D printing, and the 3D printing software performs 3D printing based on the input 3D model data, characterized in that: include: A generation module for obtaining a three-dimensional model; A first processing module, used for obtaining a plurality of cutting intersection lines according to preset slicing parameters and the three-dimensional model; The cutting intersection line is a line segment where the face element of the three-dimensional model intersects with the cutting surface; A second processing module is used to determine a direction reference according to a target normal direction and a target cutting intersection line; the target normal direction is the normal direction of any face element, and the target cutting intersection line is the cutting intersection line of any face element; A third processing module, configured to determine a cutting area according to the direction reference amount and the vector directions of the plurality of cutting intersection lines; The third processing module specifically includes: For each of the cutting intersection lines, determining whether the vector direction of the cutting intersection line matches the direction reference value; If yes, the vector direction of the cutting intersection line is determined as the connection direction; If not, the connection direction is determined by taking the opposite direction of the vector direction of the cutting intersection line; Determining the cutting area according to the connection directions of the plurality of cutting intersection lines; The slice generation module is used to generate a slice result according to the cutting area and the three-dimensional model.

11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method described in any one of claims 1 to 9 are implemented.

12. A 3D printing system, characterized in that: The 3D printing system comprises a processor and a memory, wherein the memory is coupled to the processor and stores instructions, and when the instructions are executed by the processor, the 3D printing system performs the steps of the method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Cutting method based on integrated three-dimensional GIS model

    CN103413297A

  • Embossed grid representation and 3D printing slicing method and system based on bump mapping

    CN106875495A