Method of repairing three-dimensional model and method of manufacturing three-dimensional object

By analyzing and processing the self-intersecting shells of the 3D model, determining the external shell and repairing the internal shell, the problem of redundant facets caused by non-manifold structures in the existing technology is solved, and the repair effect and quality of the 3D printed model are improved.

CN120807849APending Publication Date: 2025-10-17GUANGZHOU HEIGE ZHIZAO INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510882668.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-27
Publication Date
2025-10-17

AI Technical Summary

Technical Problem

Existing 3D printing model repair technology fails to effectively handle non-manifold structures, resulting in the addition of redundant facets when filling holes in the model and poor repair effect.

Method used

By obtaining a 3D model, analyzing the self-intersection of multiple shells, determining the external and internal shells, retaining the external shell and removing or repairing the internal shell, processing non-manifold holes and edges, ensuring the manifold nature of the model, and using slicing technology for 3D printing.

Benefits of technology

It realizes the specialized treatment of non-manifold structures, improves the effect of model repair, avoids the generation of redundant patches, and ensures the integrity and printing quality of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120807849A_ABST
    Figure CN120807849A_ABST
Patent Text Reader

Abstract

The invention discloses a method for repairing a three-dimensional model and a method for manufacturing a three-dimensional object. The method comprises the steps that a three-dimensional model is obtained, the three-dimensional model comprises a plurality of shells, and the shells intersect at the non-flow edge; de-self-intersecting the plurality of housings, determining an outer housing and an inner housing of the plurality of housings, the outer housing surrounding the inner housing; and reserving the outer shell and removing or repairing the inner shell to obtain a repaired three-dimensional model. According to the method and the device, the technical problems that the repairing effect is poor and the requirements of a user are not met due to the fact that redundant surface patches are newly added during hole filling of the model because the repairing of the current 3D model does not relate to processing of a non-manifold structure are solved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of 3D printing, and in particular, to a method for repairing a three-dimensional model and a method for manufacturing a three-dimensional object. BACKGROUND

[0002] The model in 3D printing is usually from various 3D creation software. Since various software has different creation methods, the slt model exported from these software cannot be directly used for printing. They may have various defects, such as holes, self-intersection, reverse normal, and some non-manifold structures. These defects need to be repaired before printing.

[0003] At present, most of the repair functions provided by the pre-processing software do not involve the processing of non-manifold structures. The existence of non-manifold structures may lead to the addition of redundant patches in the hole filling process of the model. Finally, the repaired model may not meet the user's requirements.

[0004] In view of the above problems, no effective solution has been proposed so far. SUMMARY

[0005] The embodiments of the present application provide a method for repairing a three-dimensional model and a method for manufacturing a three-dimensional object, to at least solve the technical problem that the current 3D model repair does not involve the processing of non-manifold structures, resulting in the addition of redundant patches when the model is hole-filled, the repair effect is not good, and the repaired model does not meet the user's requirements.

[0006] According to an aspect of an embodiment of the present application, a method for repairing a three-dimensional model is provided, comprising: obtaining a three-dimensional model, wherein the three-dimensional model comprises a plurality of shells, and the plurality of shells intersect at a non-manifold edge; resolving self-intersection of the plurality of shells, to determine an external shell and an internal shell in the plurality of shells, wherein the external shell encloses the internal shell; retaining the external shell and removing or repairing the internal shell, to obtain a repaired three-dimensional model.

[0007] In some embodiments, the plurality of shells comprises a first shell, a second shell, and a third shell, and a first patch of the first shell, a second patch of the second shell, and a third patch of the third shell share the non-manifold edge.

[0008] In some embodiments, resolving self-intersection of the plurality of shells comprises: modifying the non-manifold edge of the first patch of the first shell to a boundary edge of the first patch of the first shell; modifying the non-manifold edge of the second patch of the second shell to a boundary edge of the second patch of the second shell; and modifying the non-manifold edge of the third patch of the third shell to a boundary edge of the third patch of the third shell.

[0009] In some embodiments, determining the external shell and the internal shell in the plurality of shells comprises: determining the external shell and the internal shell using a bounding box.

[0010] In some embodiments, determining the outer shell and the inner shell from the plurality of shells comprises: disentangling the plurality of shells from self-intersections to obtain disentangled shells; identifying and discarding noise shells from the disentangled shells to obtain the outer shell and the inner shell from the plurality of shells, wherein the noise shells comprise shells with a volume less than a preset volume threshold.

[0011] In some embodiments, determining the outer shell and the inner shell from the plurality of shells comprises: establishing a three-dimensional coordinate system based on the three-dimensional model; determining coordinate values corresponding to each point on the disentangled shells based on the three-dimensional coordinate system; and determining the outer shell and the inner shell from the plurality of shells based on the coordinate values corresponding to each point on the disentangled shells.

[0012] In some embodiments, retaining the outer shell and removing or repairing the inner shell to obtain a repaired three-dimensional model comprises: identifying non-manifold holes in the three-dimensional model based on the outer shell and the inner shell, wherein edges of the non-manifold holes comprise at least one non-manifold edge; and in a case where two face patches in a shell part associated with a first non-manifold hole belong to the same shell, extracting the shell to which the two face patches belong and separately repairing the shell to obtain the repaired three-dimensional model.

[0013] In some embodiments, retaining the outer shell and removing or repairing the inner shell to obtain a repaired three-dimensional model comprises: identifying non-manifold holes in the three-dimensional model based on the outer shell and the inner shell, wherein edges of the non-manifold holes comprise at least one non-manifold edge; and in a case where a plurality of face patches in a shell part associated with a second non-manifold hole belong to the outer shell, removing a portion of the inner shell corresponding to the shell part associated with the second non-manifold hole to obtain the repaired three-dimensional model.

[0014] In some embodiments, retaining the outer shell and removing or repairing the inner shell to obtain a repaired three-dimensional model comprises: identifying non-manifold holes in the three-dimensional model based on the outer shell and the inner shell, wherein edges of the non-manifold holes comprise at least one non-manifold edge; and in a case where a target face patch in a shell part associated with a third non-manifold hole belongs to the outer shell, calculating a normal corresponding to each of a plurality of face patches in the shell part associated with the third non-manifold hole; determining a cross product of a normal corresponding to a face patch other than the target face patch and a normal of the target face patch to obtain a cross product corresponding to the face patch; and removing the face patch whose cross product does not meet a preset condition to obtain the repaired three-dimensional model.

[0015] According to another aspect of the embodiments of the present application, a method for manufacturing a three-dimensional object is also provided, comprising: obtaining a repaired three-dimensional model according to any one of the above methods for repairing a three-dimensional model; slicing the repaired three-dimensional model to obtain a plurality of slice maps of the repaired three-dimensional model; and performing three-dimensional printing based on the plurality of slice maps to obtain the three-dimensional object.

[0016] According to still another aspect of the embodiments of the present application, a non-volatile storage medium is also provided, which comprises a stored program, wherein when the program is running, the non-volatile storage medium controls a device in which the non-volatile storage medium is located to perform any one of the above methods for repairing a three-dimensional model and / or the method for manufacturing a three-dimensional object.

[0017] In the embodiments of the present application, the method for repairing a three-dimensional model is adopted, and the three-dimensional model is obtained, wherein the three-dimensional model comprises a plurality of shells, and the plurality of shells intersect at a non-manifold edge; the plurality of shells are disentangled from the intersection, and an external shell and an internal shell in the plurality of shells are determined, wherein the external shell surrounds the internal shell; the internal shell is removed or repaired, and the repaired three-dimensional model is obtained, thereby achieving the purpose of processing the non-manifold structure alone, and realizing the technical effect of improving the repairing effect, and further solving the technical problem that the repairing of the current 3D model does not involve the processing of the non-manifold structure, resulting in the addition of redundant patches when the model is repaired, the repairing effect is not good, and the user's requirements are not met. BRIEF DESCRIPTION OF DRAWINGS

[0018] The accompanying drawings, which are included to provide a further understanding of the present application and constitute a part of this application, illustrate certain illustrative embodiments of the present application and together with the description serve to explain the present application. In the drawings:

[0019] Figure 1 is a schematic diagram of a three-dimensional mesh model provided according to an embodiment of the present application;

[0020] Figure 2 is a schematic diagram of a three-dimensional mesh provided according to an embodiment of the present application;

[0021] Figure 3 is a schematic diagram of a non-manifold edge provided according to an embodiment of the present application;

[0022] Figure 4 is a schematic diagram of a manifold edge provided according to an embodiment of the present application;

[0023] Figure 5 is a schematic diagram of a non-manifold edge and a non-manifold hole provided according to an embodiment of the present application;

[0024] Figure 6 is a partial internal view of Figure 5 provided according to an embodiment of the present application;

[0025] Figure 7 is a schematic diagram of a non-manifold vertex according to an embodiment of the application;

[0026] Figure 8 is a hardware structure block diagram of a computer terminal for implementing the method of repairing a three-dimensional model according to an embodiment of the application;

[0027] Figure 9 is a flowchart of the method of repairing a three-dimensional model according to an embodiment of the application;

[0028] Figure 10 is a non-manifold structure cross-sectional view according to some embodiments of the application;

[0029] Figure 11 is a self-intersecting shell diagram according to some embodiments of the application;

[0030] Figure 12A is a shell repair diagram according to some embodiments of the application;

[0031] Figure 12B is another shell repair diagram according to some embodiments of the application;

[0032] Figure 13 is a shell merging diagram according to some embodiments of the application;

[0033] Figure 14 is a non-manifold vertex in a single hole diagram according to some embodiments of the application;

[0034] Figure 15 is a non-manifold vertex in multiple holes diagram according to some embodiments of the application;

[0035] Figure 16 is a shell normal diagram according to some embodiments of the application;

[0036] Figure 17 is a flowchart of the method of repairing a three-dimensional model according to some embodiments of the application;

[0037] Figure 18 is a flowchart of the method of manufacturing a three-dimensional object according to an embodiment of the application;

[0038] Figure 19 is a structure block diagram of an apparatus for repairing a three-dimensional model according to an embodiment of the application. DETAILED DESCRIPTION

[0039] In order to better understand the technical scheme of the present application, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings of the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative efforts should fall within the scope of the present application.

[0040] It should be noted that the terms "first", "second", and the like in the specification and claims of the present application and the above-described drawings are used to distinguish similar objects, and do not necessarily have to be used to describe a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units does not have to be limited to only those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to the process, method, product or device.

[0041] First, some of the nouns or terms appearing in the process of describing the embodiments of the present application are applicable to the following explanations:

[0042] A three-dimensional mesh model is a basic method for representing the surface of a three-dimensional object in three-dimensional computer graphics and computational geometry. It is composed of vertices, edges and faces, forming polyhedral shapes. Figure 1 is a schematic diagram of a three-dimensional mesh model provided according to an embodiment of the present application, as shown in Figure 1 The vertices are point clouds in three-dimensional space, the edges connect pairs of vertices, and the faces (usually triangles or quadrilaterals) are defined by edges connecting three or more vertices.

[0043] A three-dimensional mesh is a set of polygons composed of adjacent point clouds of an object. Figure 2 is a schematic diagram of a three-dimensional mesh provided according to an embodiment of the present application. A three-dimensional mesh is usually composed of triangles, quadrilaterals or other simple convex polygons. This can simplify the rendering process and allow efficient calculation of surface properties such as normals and curvature, which are essential for realistic rendering and physical simulation.

[0044] Non-manifold edges refer to the case where multiple (3 or more) faces share an edge in a mesh model. Figure 3 is a schematic diagram of a non-manifold edge provided according to an embodiment of the present application, as shown in Figure 3As shown, this local region cannot be flattened into a plane due to self-intersection, thus it is called a non-manifold. A manifold is a space that locally has the properties of Euclidean space. Figure 4 is a schematic diagram of a manifold edge provided by an embodiment of the present application, as shown in Figure 4 A manifold edge refers to a shared edge of two faces in a mesh model.

[0045] A non-manifold vertex refers to a vertex in a three-dimensional model that is irregular or does not conform to the geometric characteristics of a manifold. Specifically, if a mesh model has multiple faces sharing a vertex or edge, a non-manifold vertex refers to a vertex that is shared by three or more edges that do not completely belong to two faces. Figure 7 is a schematic diagram of a non-manifold vertex provided by an embodiment of the present application, as shown in Figure 7 For example, the vertex where two triangular pyramids meet is a non-manifold vertex. This situation often causes problems in rendering or processing of the model, and thus needs to be avoided in modeling.

[0046] A boundary edge refers to an edge that belongs to only one triangular face, and the two vertices of the boundary edge are boundary points; the triangular face to which the boundary edge belongs is a boundary triangular mesh. By searching the triangular mesh of the entire model according to the definition, all boundary edges that meet the definition can be obtained. A boundary is a closed polygon formed by a certain number of boundary edges connected to each other.

[0047] A shell is a group of triangular faces connected to each other, and cannot have non-manifold vertices or non-manifold edges. The shell includes a plurality of polygonal faces obtained by mesh topology. According to another definition, the edges of the polygonal faces of the shell are composed of boundary edges and manifold edges.

[0048] Figure 5 is a schematic diagram of a non-manifold edge and a non-manifold hole provided by an embodiment of the present application, as shown in Figure 5 A non-manifold hole is a closed combination surrounded by non-manifold edges, wherein, Figure 6 is a partial internal view of Figure 5 provided by an embodiment of the present application. As can be seen from Figure 5 and Figure 6 , the three-dimensional model includes a shell 1, a shell 2, and a shell 3, the triangular faces of the shell 1, the shell 2, and the shell 3 share non-manifold edges (a single non-manifold edge is indicated by Figure 6 ), and the non-manifold edges shared by the triangular faces of the shell 1, the shell 2, and the shell 3 form a non-manifold hole after being closed at the beginning and the end.

[0049] In 3D modeling and computer graphics, a mesh is a data structure used to represent the surface of a three-dimensional object. It is a collection of vertices, edges, and faces that define the shape and structure of an object.

[0050] Polygon Soup is an unstructured representation of 3D geometric data. It consists of a set of independent polygonal patches (Polygons). Each patch records the indices of its constituent vertices, but does not explicitly define the topological connections between vertices, edges, and faces. In Polygon Soup, the relationships between vertices, edges, and faces are implicit and determined by iterating through the vertex index lists of all patches.

[0051] Repair soup is often used to describe the process of repairing a collection of polygons that do not have clear topological connections (PolygonSoup) to make it a manifold and watertight mesh (Mesh).

[0052] Reorienting faces involves adjusting the orientation of individual or polygonal facets in a 3D model to ensure that all facet normals point consistently, typically outward (i.e., toward the exterior of the model). In 3D model processing, the orientation of facet normals is crucial for lighting, rendering, and physics simulations. If a facet normal is misoriented, it can cause rendering anomalies, such as parts of the surface being misidentified as interior and incorrectly displayed.

[0053] Watertight, in 3D modeling and computer graphics, refers to a 3D model surface that is completely closed and continuous, without holes, gaps, or non-manifold structures.

[0054] According to an embodiment of the present invention, an embodiment of a method for repairing a three-dimensional model is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0055] The method embodiment provided in the first embodiment of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Figure 8 1 is a hardware structure block diagram of a computer terminal for implementing a method for repairing a three-dimensional model according to an embodiment of the present invention. Figure 8As shown, the computer terminal 10 can include one or more processors (processors can include, but are not limited to, processing devices such as microprocessor MCU or programmable logic device FPGA, etc.), a memory 104 for storing data. In addition, it can also include a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which can be included as one of the ports of the BUS bus), a network interface, a power supply and / or a camera. Those skilled in the art can understand that Figure 8 The structure shown is only schematic, which does not limit the structure of the above-mentioned electronic device. For example, the computer terminal 10 can also include more or fewer components than those shown in the figure, or have a different configuration than that shown in the figure. Figure 8 In the figure, the computer terminal 10 can include one or more processors (processors can include, but are not limited to, processing devices such as microprocessor MCU or programmable logic device FPGA, etc.), a memory 104 for storing data. In addition, it can also include a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which can be included as one of the ports of the BUS bus), a network interface, a power supply and / or a camera. Those skilled in the art can understand that Figure 8 The structure shown is only schematic, which does not limit the structure of the above-mentioned electronic device. For example, the computer terminal 10 can also include more or fewer components than those shown in the figure, or have a different configuration than that shown in the figure.

[0056] It should be noted that the one or more processors and / or other data processing circuits described above can be referred to herein as "data processing circuits" in general. The data processing circuit can be embodied in whole or in part as software, hardware, firmware or any other combination. In addition, the data processing circuit can be a single independent processing module, or all or part of any one of the other elements combined into the computer terminal 10. As referred to in the embodiments of the present application, the data processing circuit serves as a processor to control (for example, selection of a variable resistance terminal path connected to an interface).

[0057] The memory 104 can be used to store software programs and modules of application software, such as program instructions / data storage devices corresponding to the method for repairing a three-dimensional model of the embodiments of the present application. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, implements the above-mentioned application program method for repairing a three-dimensional model. The memory 104 can include a high-speed random access memory, and can also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 can further include a memory remotely arranged with respect to the processor, which can be connected to the computer terminal 10 through a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0058] The display can be, for example, a touch screen type liquid crystal display (LCD), which can enable a user to interact with the user interface of the computer terminal 10.

[0059] Figure 9 is a flowchart of the method for repairing a three-dimensional model according to the embodiments of the present application, as shown in Figure 9 the method includes the following steps:

[0060] In step S902, a three-dimensional model is obtained, wherein the three-dimensional model comprises a plurality of shells, and the plurality of shells intersect at a non-manifold edge.

[0061] Reference is made to Figure 5 and as shown in FIG. 6, the three-dimensional model comprises shell 1, shell 2 and shell 3, and the triangular facets of shell 1, shell 2 and shell 3 share a non-manifold edge (indicated by the arrow) at which the shell 1, shell 2 and shell 3 intersect. Figure 5 and Figure 6 As can be seen from FIG. 6, the three-dimensional model comprises shell 1, shell 2 and shell 3, and the triangular facets of shell 1, shell 2 and shell 3 share a non-manifold edge (indicated by the arrow) at which the shell 1, shell 2 and shell 3 intersect. Figure 6 The single non-manifold edge is indicated.

[0062] In this step, the obtained three-dimensional model can be a model created by various 3D creation software. Such a model can have various defects, such as holes, non-manifold structures, etc., and cannot be directly used for printing. Therefore, it is necessary to repair these defects. When processing a three-dimensional model, especially a model comprising a plurality of shells intersecting at a non-manifold edge, the steps of obtaining and analyzing the model can be slightly more complex. A non-manifold edge refers to an edge in a model that is shared by three or more facets of different shells. The existence of such an edge can destroy the manifold property of the model, leading to complex problems in geometry and topology. All edges in the model can be traversed to check whether each edge is shared by three or more facets. The existence of a non-manifold edge can indicate the presence of complex or incorrect geometric connections in the model. For each non-manifold edge, the shells associated therewith are analyzed and then processed separately.

[0063] Through the above steps, the problem of shells intersecting at a non-manifold edge in a three-dimensional model can be effectively processed, and the model can be repaired to make it more suitable for further rendering, simulation or 3D printing, etc.

[0064] In step S904, the plurality of shells are resolved from self-intersection, and an external shell and an internal shell in the plurality of shells are determined, wherein the external shell encloses the internal shell.

[0065] Please continue to check Figure 5 and Figure 6 FIG. 6, the shell 1 and shell 2 of the three-dimensional model are external shells, and the shell 3 is an internal shell. The plurality of non-manifold edges shared by the triangular facets of the shell 1, shell 2 and shell 3 will form a non-manifold hole after being closed at the beginning and end.

[0066] In this step, the multiple shells are dis-self-intersected to determine the outer shell and the inner shell in the multiple shells, so as to remove the geometric conflicts in the model and create conditions for subsequent hole repairing and model optimization. A non-manifold hole is associated with multiple shells, and the dis-self-intersection operation is to detect and correct the incorrect face intersection or coincidence in the shell or between multiple shells, so as to ensure that each part of the model is manifold, that is, each edge is connected with two faces, and no face intersects in the model.

[0067] In some embodiments, all edges of the initial 3D model can be traversed to identify those edges without a dual edge (i.e., open boundary edges), which usually indicate the existence of a hole. For each boundary edge, all boundary edges around it are tracked until a complete hole boundary is formed. The identification can be performed by a depth-first search (DFS) or a breadth-first search (BFS) algorithm. It can be checked whether each edge in the model is shared by three or more faces. If there is, it indicates that there may be a non-manifold edge, and the hole enclosed by these non-manifold edges is a non-manifold hole. For the detected non-manifold edge, the geometry of its periphery is analyzed to identify the involved hole. The identified hole can be classified according to its size, shape and position into normal holes and non-manifold holes. The identification of non-manifold holes is based on their special edge and face sharing structure. Once the holes are identified and classified, the non-manifold holes should be specially marked for subsequent separate extraction for targeted processing.

[0068] Figure 10 is a non-manifold structure cross-sectional view provided according to some embodiments of the present application, as shown in Figure 10 wherein the vertex pointed by the arrow is shared by more than three different edges belonging to one face, and thus belongs to a non-manifold vertex.

[0069] Identifying holes in a 3D model, especially non-manifold holes, requires a deep understanding of the geometry and topology of the model, as well as the use of appropriate algorithms and tools to process these holes, ultimately ensuring the printing quality of the model.

[0070] Figure 11 is a dis-self-intersection shell schematic view provided according to some embodiments of the present application, as shown in Figure 11 wherein the left side is the original shell, and the right side is the shell after dis-self-intersection, and six shells (shell 1 to shell 6) are obtained from the original two intersecting shells (shell 1 and shell 2) after dis-self-intersection.

[0071] Specifically, all self-intersections in the model can be detected by calculating the relative position and orientation of all facets in the model, particularly checking the distance between facets and the overlapping area. Common detection methods include using ray projection, distance calculation between facets, or geometry-based analysis. All shell bodies associated with non-manifold holes are identified and separated. This is done by traversing all edges to detect non-manifold edges (i.e., edges shared by three or more facets) and tracking these edges to determine which facets and shell bodies are associated. The separated non-manifold shell bodies are de-self-intersected, i.e., all overlaps and intersections between facets are corrected. This can be achieved through various algorithms, such as Delaunay triangulation or custom geometry algorithms.

[0072] The de-self-intersection operation may involve modifying the position, shape, or number of facets to ensure that the facets inside each shell body no longer intersect. This typically includes creating new vertices, edges, and facets, or adjusting the positions of existing geometric elements to avoid facet overlaps. After handling self-intersections, the topology of the shell bodies needs to be reconstructed. It is ensured that all parts of the model meet the manifold property, i.e., the structure of edges and facets around each vertex is continuous and non-intersecting.

[0073] Through these steps, self-intersection problems in non-manifold shell bodies can be effectively handled, providing a more standardized and easy-to-handle model for subsequent hole repair and other repair operations, greatly improving the accuracy and quality of 3D printing models.

[0074] Based on the de-self-intersected shell bodies, it can be determined which shell bodies belong to the outer shell, where the outer shell refers to the shell that directly contacts the external environment of the model and constitutes the outer surface of the model. In the presence of non-manifold structures and multiple shell bodies, it is necessary to correctly identify the outer shell to maintain the shape and structure of the model. A convex hull of all shell points can be calculated to obtain a closed convex set. The facets of this set constitute the outermost layer of the model, i.e., the outer shell. Then all vertices of the shell bodies are combined to form a large vertex set. Run a convex hull algorithm, such as Graham scan, Jarvis step, or incremental convex hull algorithm, to generate a minimum convex polyhedron containing all vertices. Identify and mark the shell bodies to which the facets generated by the convex hull belong as the outer shell. The ray projection method can also be used, i.e., a ray is emitted from a point outside the model to the interior of the model, and the number of facets penetrated by the ray is counted. The facets of the outer shell will be penetrated by the ray an even number of times, while the facets of the inner shell will be penetrated an odd number of times.

[0075] Wherein, in the processing of non-manifold structure, it may be necessary to apply the above method several times, because the geometry and topological relationship of the model will change after each processing. After identifying the outer shell, subsequent steps such as hole repair, internal shell processing, mesh simplification, etc. are also needed to ensure the integrity of the model and the printing quality.

[0076] Through the above method, it can be accurately determined which shells are external shells, and this step is basic for the repair and further processing of the model, which helps to ensure the correctness of the model and provides high-quality geometric data for 3D printing.

[0077] Step S906, retaining the outer shell and removing or repairing the internal shell to obtain the repaired three-dimensional model.

[0078] In this step, after the preliminary non-manifold shell separation and self-intersection removal operation is completed, corresponding operations can be performed on the outer shell and the internal shell, such as retaining the outer shell, removing or repairing the internal shell, to obtain the repaired three-dimensional model.

[0079] Figure 12A is a shell repair schematic diagram provided according to some embodiments of the present application. As shown in Figure 12A , the left side is the original shell, and the right side is the shell after self-intersection removal. From the original two intersecting shells (shell 1 and shell 2), six shells (shell 1 to shell 6) are obtained after self-intersection removal. The external shell (shell 1 and shell 2) is retained and the internal shell (shell 1 to shell 6) is removed to obtain the repaired three-dimensional model. Figure 12B is another schematic diagram of shell repair according to some embodiments of the present application. As shown in Figure 12B , the external shell (shell 1 and shell 2) is retained, and then the internal shell is repaired, i.e. shell 5 and shell 6 are deleted, and shells 1 to 4 are retained, to obtain the repaired three-dimensional model.

[0080] Figure 13 is a shell merging schematic diagram provided according to an optional embodiment of the present application, as shown in Figure 13 , wherein after determining the external shell, the internal shell can be removed, i.e. the two shells are merged into one shell. Since the shell merging uses infinite precision floating point numbers, after the merging is completed, it needs to be converted to float type, and this process will lose precision, causing some points that are very close to each other to become one point. Therefore, after recombining the shell, there will be many noise shells and some holes. Therefore, it is necessary to remove the noise shells again and repair the holes. After shell merging, the internal shell can be processed, first find out the internal shell, if its volume is small, it is discarded as a noise shell, if its volume is large, it is treated as a hollow inner wall, and its normal is reversed.

[0081] In some embodiments, the outer shell of the model can be re-evaluated after the self-intersections are resolved. Because new non-manifold holes can be created. Analyze the geometry on the surface of the model to find all the holes formed by edges shared by more than two triangles. For each newly detected non-manifold hole, it can be repaired. Different processing methods can be chosen according to the type of non-manifold hole. For example, when there are duplicate triangles in a non-manifold hole within the shell, and they belong to the same internal shell, the redundant triangles can be deleted or merged together to form a unified surface. If the non-manifold hole involves multiple different shells, and at least two of them belong to the outer shell, the outer shell is retained and the other irrelevant internal shells are removed. This is because the outer shell represents the outer surface of the model, while the internal shell can be a non-manifold structure that is incorrectly extracted. For non-manifold holes that are only related to one outer shell, a reference direction can be determined by calculating the normal of the relevant triangles, and then the direction can be used to determine how to handle the shells adjacent to the hole. Usually involves removing, rotating or replacing triangles to restore the manifold property. In addition to non-manifold holes, other non-manifold structures in the model, such as non-manifold vertices, can also be repaired. Figure 14 is a schematic diagram of a single non-manifold vertex within a hole according to some embodiments of the present application, as Figure 14 shows a single non-manifold vertex within a hole, where the hole can be split into two simple holes by finding two edges e1 and e2 and adding a triangle between them. Figure 15 is a schematic diagram of multiple non-manifold vertices within a hole according to some embodiments of the present application, as Figure 15 shows multiple non-manifold vertices between holes, where there are two non-manifold vertices in the figure, and two pairs of edges e1, e2 and e3, e4 can be found. Add a triangle between these edges to eliminate the non-manifold vertex.

[0082] After the repair is complete, the entire model is again checked for any remaining non-manifold holes or self-intersections. This usually requires re-running the hole detection and self-intersection test algorithms to ensure that the model meets the manifold requirements in all aspects.

[0083] Once all non-manifold holes have been repaired, the shells can be recombined to form a complete, manifold 3D model. Targeted processing of non-manifold holes can reduce the generation of duplicate triangles and improve the effectiveness of model repair.

[0084] After the non-manifold hole repair is completed, ordinary holes can be processed. Ordinary holes are also divided into different types, and different repair methods exist accordingly. For example, for small or regular holes, new faces can be directly generated to fill the holes. For larger or irregular holes, curve fitting or surface reconstruction algorithms may be needed to generate more natural and more consistent with the original structure of the model patch. For complex holes, more advanced algorithms such as alpha-wrapping, voxelization or using complex geometric constraints may be needed to generate patches.

[0085] Different repair algorithms have their own advantages and disadvantages, for example, using the alpha wrap algorithm to repair these non-closed shells, the resulting shell is watertight, but some places may be relatively rough compared to the previous shell. The advantage is that the restoration degree of the model can still be achieved, but the disadvantage is that if the shell is large, the repair speed may be slow. If the voxelization method is used to repair these shells, the resulting shell is more delicate than the alpha-wrap method, and the speed is very fast, and the restoration degree of the original model is very high, but the generated model may be larger and needs to be simplified.

[0086] New faces can be generated according to the selected algorithm to fill the holes, ensuring smooth transition of the patch to the surrounding faces, avoiding sharp corners or unnatural protrusions. Update the mesh structure of the model, including vertex, edge and face information, to reflect the state after the hole filling operation. Use ray projection, model integrity check and other tools to verify whether the model after hole filling is completely closed without new holes or self-intersection. Check if the normal direction of the newly added face is correct, which usually needs to be consistent with the normal direction of the original face. In order to improve the quality of the model, mesh optimization can also be performed, including mesh simplification, smoothing processing, etc., to reduce the number of face patches and improve the visual effect.

[0087] Through the above steps, holes in 3D models can be effectively repaired to obtain a complete, closed and reasonable structure model, which is ready for 3D printing, rendering or simulation applications.

[0088] Through the above steps, the purpose of separately processing non-manifold results is achieved, thereby achieving the technical effect of improving the repair effect, and further solving the technical problem that the current 3D model repair does not involve the processing of non-manifold structures, resulting in the addition of redundant face patches when repairing the model, poor repair effect, and not meeting the user's requirements.

[0089] As an optional embodiment, the plurality of shells includes a first shell, a second shell, and a third shell, and a first face sheet of the first shell, a second face sheet of the second shell, and a third face sheet of the third shell share a non-manifold edge.

[0090] In some embodiments, the plurality of shells of the three-dimensional model includes a first shell, a second shell, and a third shell share a non-manifold edge (also referred to as a non-popular edge), which indicates that the topology of the model has complexity and potential discontinuity. The non-manifold edge in this case means that there are three or more edges connecting at least three shells, which violates the basic rule of manifold models that each edge connects two face sheets and each vertex has a finite number of edges around it. For non-manifold structures, the topology of these shells can be analyzed and measures can be taken to repair the problems caused by non-manifold edges. Finally, the repaired shells need to be re-integrated to ensure that the entire model regains the manifold property and water tightness. Each edge of the model can be traversed to check the number of face sheets adjacent to it. If the number of adjacent face sheets of an edge exceeds 2, then this edge is a non-manifold edge. For example, the edge shared by the first face sheet of the first shell, the second face sheet of the second shell, and the third face sheet of the third shell.

[0091] As an optional embodiment, the self-intersection of the plurality of shells is resolved by modifying the non-manifold edge of the first face sheet of the first shell to be a boundary edge of the first face sheet of the first shell, modifying the non-manifold edge of the second face sheet of the second shell to be a boundary edge of the second face sheet of the second shell, and modifying the non-manifold edge of the third face sheet of the third shell to be a boundary edge of the third face sheet of the third shell.

[0092] In some embodiments, the self-intersection resolution operation reorganizes the face sheets of the 3D model through a series of geometric and topological operations to eliminate intersecting regions inside or on the surface of the model. Self-intersection in a 3D model is manifested as one or more face sheets passing through themselves or overlapping with other face sheets, which can destroy the manifold property and water tightness of the model, and thus affect the visual presentation and practicality of the model, such as material accumulation or breakage failure when 3D printing.

[0093] In certain embodiments, when the first shell, the second shell, and the third shell are self-intersecting on non-manifold edges, it is necessary to modify these non-manifold edges to boundary edges to ensure the manifoldness and geometric integrity of each shell. All faces of each shell can be traversed to detect if two or more triangles are intersecting using ray-casting, triangle collision detection, or other techniques. Once a self-intersection is detected, all faces and edges involved are marked for later processing. For the problems found in self-intersection detection, especially those involving non-manifold edges, it is necessary to convert these non-manifold edges to boundary edges. For example, the non-manifold edge between the first face of the first shell, the second face of the second shell, and the third face of the third shell is broken, i.e., the edge is split at the self-intersection point, resulting in new vertices and edges, so that the original non-manifold edge is converted to multiple boundary edges. After modifying the non-manifold edges to boundary edges, the topology of the shells can be reconstructed. In this process, the connections of faces-edges-vertices are updated, and the maintenance of the half-edge data structure can be involved. All shells connected by non-manifold edges in the model can be separated, so that these shells can be processed one by one without affecting each other. For the separated shells, the self-intersection problem can be further processed. For example, the self-intersection region is solved, and for each shell, all self-intersecting triangles are found, which can involve calculating the intersection point and intersection line of triangles, and possibly the polygon intersection region. For another example, the self-intersection region is triangulated, and the self-intersection region is re-triangulated using constrained Delaunay triangulation (CDT) or other triangulation algorithms to generate new self-intersection-free triangles. The shells are reconstructed using the modified triangles, and each shell is ensured to be closed and manifold. This can include re-connecting the boundary edges and possibly hole filling.

[0094] For example, in the case of constrained Delaunay triangulation, it can guarantee that the triangulation mesh has good geometric properties (such as maximum minimum angle, i.e., the Delaunay condition) while protecting user-specified constraints (such as the boundaries and split lines of the model). The algorithm flow is as follows:

[0095] 1. Initialize CDT: Initialize the constrained Delaunay triangulation data structure according to the existing geometric information of the model and the constraints.

[0096] 2. Insert vertices and constraints: Insert the processed vertices and constraints (such as new edges or line segments) one by one.

[0097] 3. Triangulation: Perform triangulation based on existing vertices and constraints, generate a triangulation mesh that satisfies Delaunay condition.

[0098] 4. Conflict detection and resolution: Check and resolve possible triangle conflicts due to constraint insertion, ensure that each triangle does not intersect with other triangles.

[0099] 5. Output optimized mesh: After processing, output an optimized mesh structure without self-intersection, i.e., a shell after self-intersection resolution.

[0100] It should be noted that during the process of handling self-intersection and non-manifold edges, additional vertices and faces may be introduced, so after processing, geometry optimization and topology verification need to be performed again to ensure that the model has no topology error and maintains good geometric quality.

[0101] As an optional embodiment, determining the outer shell and the inner shell in the plurality of shells comprises: determining the outer shell and the inner shell using a bounding box.

[0102] Determining the exterior and interior shells in a three-dimensional model is a critical step to ensure the correctness and printability of the model. Using a bounding box as an auxiliary tool, it is possible to effectively distinguish which shells are located outside the model and which are inside. By iterating through the coordinates of all vertices in the model, the maximum and minimum values of the X, Y, and Z dimensions can be found to construct an axis-aligned bounding box. Using the above coordinates to create a bounding box ensures that all shells are located inside the box. Select a point outside the bounding box as the starting point for the ray detection. This point should be far from the model to ensure that any ray can penetrate the outermost shell of the model. From the external probe point, a ray is emitted towards the model. Since the exterior shell is the outermost structure of the model, the ray will not encounter other shells before reaching the model, so the ray emitted from the external point will contact the exterior shell when it first hits the model. Each time the ray passes through a shell's face, the intersection counter is incremented by 1. If the value of the counter is odd, it means that the ray is currently located in an external shell. By the results of the ray detection, all shells with an odd intersection count can be identified as external shells. The external shells usually constitute the visible surface of the model and are the part of the model that interacts with the external environment, so they must be ensured to be watertight before 3D printing. From the inside of the already determined external shells, select multiple points and emit rays in various directions. Unlike external detection, the purpose of internal detection is to determine which shells are located inside the model. Similar to the detection of external shells, record the number of times the ray passes through each shell face. However, in the detection of internal shells, the intersection count should be even when the ray passes through an internal shell for the second time after first passing through an external shell. If the number of times the ray passes through a particular shell is even and this shell has not been identified as an external shell, then this shell is an internal shell. Internal shells may represent cavities or internal structures of the model. Ensure that the external shells have no holes, self-intersections, or non-manifold edges. Internal shells require special handling, such as adjusting the normal direction to ensure they do not conflict with external shells, or if the shell volume is too small, it may be considered noise and removed.

[0103] After completing the classification and correction of shells, geometric verification tools can be used to ensure the overall manifold and watertightness of the model to meet the requirements of 3D printing.

[0104] Using the bounding box and ray detection method, it is possible to efficiently determine the exterior and interior shells in a three-dimensional model. The exterior shells need to maintain good geometric properties to ensure the appearance of the model, while the interior shells require additional processing to ensure that they correctly represent the internal features or structures of the model.

[0105] As an optional embodiment, the determining the outer shell and the inner shell from the plurality of shells after the self-intersection resolving comprises: resolving the self-intersection of the plurality of shells to obtain a plurality of shells after the self-intersection resolving; and identifying and discarding a noise shell from the plurality of shells after the self-intersection resolving, to obtain the outer shell and the inner shell, wherein the noise shell comprises a shell with a volume less than a preset volume threshold.

[0106] In some embodiments, after the self-intersection resolving operation on the non-manifold shell, a plurality of shells are indeed obtained, which may contain various parts of the original model and some additional structures generated by the self-intersection resolving process. In order to ensure the quality and applicability of the final model, noise shells can be identified and discarded, wherein the noise shell mainly refers to those unnecessary shells with too small volume, which have little effect on the overall model structure, or which are generated due to errors in the calculation process. A reasonable volume threshold can be set according to the characteristics and application requirements of the model. For example, for a model of a large mechanical part, the volume threshold of the noise shell can be set to 0.01% or less of the total model volume. This threshold should be small enough to exclude all insignificant small structures, but not too small to avoid deleting important small features. The volume of each shell is calculated. This can be achieved by regarding the shell as a closed body composed of a series of face patches, and then applying the Gaussian formula, integral method or other volume calculation algorithm. Compare the volume of each shell with the preset volume threshold. If the volume of a shell is less than the set threshold, it is marked as a noise shell. Remove all shells marked as noise from the model. In addition to the volume threshold, other criteria can be used to identify noise shells, such as the number of face patches, a shell with too few face patches may mean it is an isolated, non-continuous structure that does not contribute to the overall model. The connectivity with the main shell can also be considered, if a shell has no substantial connection with the main model, but is indirectly associated through a non-manifold edge, it can also be identified as a noise shell. Specifically, a shell with less than 4 triangular face patches, an area less than 0.1, a volume less than 0.1, and a planar sheet can be defined as a noise shell.

[0107] Identifying and discarding noise shells helps to remove small, insignificant parts that are accidentally generated during the self-intersection process, thereby optimizing the model to make it closer to the design goal, while also reducing the complexity of subsequent processing. Ensuring that only meaningful geometric structures are included in the model is crucial for improving the practicality and aesthetics of the model.

[0108] As an optional embodiment, the determining the outer shell and the inner shell from the plurality of shells after the self-intersection resolving comprises: establishing a three-dimensional coordinate system based on the three-dimensional model; determining the coordinate values of each point on the plurality of shells after the self-intersection resolving based on the three-dimensional coordinate system; and determining the outer shell and the inner shell from the plurality of shells after the self-intersection resolving based on the coordinate values of each point on the plurality of shells after the self-intersection resolving.

[0109] In some embodiments, a three-dimensional coordinate system can be defined. This is usually a Cartesian coordinate system, containing three axes X, Y, Z. The choice of coordinate system should take into account the characteristics of the 3D model and the needs of subsequent processing, usually the center of gravity or some obvious feature point of the model is selected as the origin, to simplify the coordinate calculation and model analysis. For each shell obtained after self-intersection resolution, the coordinates of each vertex in the three-dimensional coordinate system can be calculated. Based on the coordinate values, determine the shell in which all convex hull extreme points are located, and then determine which shell is the outer shell.

[0110] It can also be detected by the method of ray detection. A ray can be emitted from a point other than the origin. When selecting this point, it should be ensured that it is not inside any shell, and it can be a point on the line connecting the origin and the farthest point of the model. Count the total number of times the ray passes through each shell. Ideally, the outer shell will pierce the ray once (if the model is center-symmetric or the ray direction passes through the center point, it may pierce twice). The number of ray piercings of the inner shell will be even. The shell with an odd number of piercings is considered an outer shell. This is because once the ray passes through the outermost shell, it enters the interior of the model, and after passing through all the inner shells, the moment it exits the model, it again passes through the outermost shell, resulting in an odd number of piercings.

[0111] The convex hull extraction method can also be used. CGAL or other geometry processing libraries can be used to calculate the convex hull of each shell. The convex hull is the smallest convex polyhedron that contains all the points of the model. Among all the convex hulls of the shells, find a convex hull that can wrap all other shells. This convex hull will correspond to the outer shell of the model. Further verify whether the outermost shell indeed wraps all other structures by ray testing or other similar detection methods on the remaining shells.

[0112] As an optional embodiment, the outer shell is retained and the inner shell is removed or repaired to obtain a repaired three-dimensional model, including: identifying a non-manifold hole in the three-dimensional model based on the outer shell and the inner shell, wherein the edge of the non-manifold hole has at least one non-manifold edge; in the case where two face sheets belonging to the same shell exist in the shell part associated with the first non-manifold hole, the shell to which the two face sheets belong is extracted and repaired separately to obtain a repaired three-dimensional model.

[0113] In some embodiments, in the case that there are two or more faces belonging to the same shell in the shell associated with the non-manifold hole, it indicates that the shell has a complex topology at the hole, and there may be redundant or erroneous faces. It can be extracted and saved for subsequent repair processing. Among them, the extracted shell may contain self-intersecting faces, and all intersecting triangles are detected. For self-intersecting regions, calculate the intersection points and intersection lines, use constrained Delaunay triangulation (CDT) to reconstruct these regions, and generate new triangular faces. Replace the intersecting triangles in the original model with the triangulated triangles to ensure the manifold of the shell. For the holes that may exist in the extracted shell, use hole filling algorithms (such as alpha-wrap or voxelization method) to close these holes to ensure the continuity and water tightness of the model surface.

[0114] As an optional embodiment, the external shell is retained and the internal shell is removed or repaired to obtain a repaired three-dimensional model, comprising: identifying a non-manifold hole in the three-dimensional model based on the external shell and the internal shell, wherein the edge of the non-manifold hole has at least one non-manifold edge; in the case that there are multiple faces belonging to the external shell in the shell part associated with the second non-manifold hole, removing the part of the internal shell in the shell part associated with the second non-manifold hole to obtain the repaired three-dimensional model.

[0115] In some embodiments, if there are two different shells belonging to the external shell at a certain non-manifold hole, all shells except the external shell are discarded, except for the phenomenon that two faces belonging to the same shell are extracted. Then, based on the structure of the hole, the most appropriate repair strategy is selected. For example, if there are two or more faces belonging to the same shell at the hole, techniques such as merging faces, hole filling, or re-triangulation can be tried.

[0116] Through the above steps, the shell associated with the non-manifold hole in the external shell can be effectively processed to ensure the manifold and water tightness of the model, and provide high-quality geometric data for subsequent 3D printing or physical simulation applications.

[0117] As an optional embodiment, the external shell is retained and the internal shell is removed or repaired to obtain a repaired three-dimensional model, comprising: identifying a non-manifold hole in the three-dimensional model based on the external shell and the internal shell, wherein the edge of the non-manifold hole has at least one non-manifold edge; in the case that there are multiple faces belonging to the external shell in the shell part associated with the second non-manifold hole, removing the part of the internal shell in the shell part associated with the second non-manifold hole to obtain the repaired three-dimensional model.

[0118] In some embodiments, if at a certain non-manifold hole, only one patch belongs to the outermost shell, then the normal vectors of all patches encountered at the non-manifold hole need to be calculated. The normal vector is a unit vector perpendicular to a patch, which is used to represent the orientation of the patch. The normal of the first patch is chosen as the reference normal. For each patch that is not the first patch, the cross product of its normal and the reference normal is calculated. The Z-axis component (in the model's coordinate system) of the cross product vector is analyzed. Generally, if the Z-axis component is close to zero, it indicates that the patches are almost parallel; if the Z-axis component is large and positive or negative, it indicates that there is a significant angular deviation between the patches. A threshold or condition is set to determine which cross products do not meet the requirement. For example, it can be set that if the Z-axis component of the cross product is less than a certain value, then the patch is considered not to match the first patch and should be deleted. According to the pre-set condition, those patches whose cross products do not meet the requirement are deleted. The purpose of this is to reduce redundant geometry while ensuring that the model maintains its original appearance and functionality. Figure 16 is a schematic diagram of the shell normals provided according to some embodiments of the present application, as shown in Figure 16 where the normal of the patch on the outer shell is denoted as n1, and the normals of the other patches are denoted as n2, n3, n4. The cross products of n2, n3, n4 and the normal n1 are calculated respectively, resulting in vectors. The one with the smallest z value among these vectors is taken, as shown in Figure 16 n4 will be the one with the smallest z value among the corresponding cross product vectors, leaving the shell corresponding to this vector. The other shells can be discarded.

[0119] After the above deletion operation, the remaining shell part is considered as the second target shell, which maintains the necessary geometry at the non-manifold hole while removing redundant patches. Then the non-manifold hole on the second target shell is repaired, and appropriate hole filling algorithms (such as alpha-wrap, voxelization, or reconstruction techniques based on local geometric information) can be used to close the non-manifold hole. Ensure that the repaired structure is not only water-tight, but also maintains the original shape and details of the model as much as possible. The repaired shell can be checked for self-intersection and processed using corresponding algorithms, such as using constrained Delaunay triangulation (CDT) to reconstruct the intersection region. Ensure that the normal direction of all patches is correct, pointing to the outside of the shell.

[0120] Through the above steps, the shell closely related to the non-manifold hole can be effectively processed and repaired, the geometry of the model is optimized, the manifold property is ensured, and good preparation is provided for subsequent 3D printing or simulation.

[0121] Figure 17 is a flowchart of a method for repairing a three-dimensional model according to some embodiments of the present application, as shown in Figure 17As shown, an optional method for repairing a three-dimensional model is provided, which has the following specific steps:

[0122] 1. Read in the 3D model, wherein reading in the model can give each vertex of the read-in x, y, z coordinates, and do a reduction precision processing, only keeping 4 decimal places;

[0123] 2. Analyze all the holes in the model;

[0124] 3. Determine the non-manifold holes, i.e. analyze whether there are more than two identical holes in the model;

[0125] 4. Extract the non-manifold shell;

[0126] 5. Perform self-intersection resolution on the non-manifold shell, after which the intersection points of the shell will be broken, forming more shells;

[0127] 6. Analyze the non-manifold holes again: because after self-intersection resolution, new non-manifold holes may appear, so analysis needs to be performed again;

[0128] 7. Extract the outermost shell, which can extract the convex hull of the extreme points of these shells, and then collect all the shells where the convex hull extreme points are located to determine the outermost shell;

[0129] 8. Take an edge at a non-manifold hole to analyze the Target and remove unnecessary shells, and perform a loop operation until all non-manifold holes are processed, wherein Target refers to the shell or face group directly associated with the edge, which contains the geometric information that needs to be focused on during hole repair. For a non-manifold hole, take one of its edges E, and get all the faces connected to this edge. Obviously, each face belongs to a certain shell. There are several cases:

[0130] Case 1:

[0131] If two faces belong to the same shell, then extract the shell and save it for subsequent repair processing.

[0132] Case 2:

[0133] If there are two different shells belonging to the outermost shell at a non-manifold hole, then discard the other shells (except those extracted in case 1).

[0134] Case 3:

[0135] If there is only one face sheet belonging to the outermost shell at a non-manifold hole, the normal of these face sheets is calculated, the edge E is taken as the Z axis, a rotation matrix is constructed, and the normal is transformed to a plane by using the matrix. The normal of the face sheet on the outermost shell is denoted as n1, and the normals of the other face sheets are denoted as n2, n3, n4, and the like. The cross products of the normals of the other face sheets and the normal n1 are calculated respectively to obtain a vector respectively. The vector with the minimum z value is taken, and the shell corresponding to the vector is left. The other shells can be discarded.

[0136] 9. End.

[0137] It should be noted that, for the foregoing method embodiments, in order to simply describe, they are all expressed as a series of action combinations, but those skilled in the art should know that the present application is not limited to the action sequence described, because according to the present application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should know that the embodiments described in the specification all belong to preferred embodiments, and the actions and modules involved are not necessarily necessary for the present application.

[0138] Through the above description of the embodiments, those skilled in the art can clearly understand that the method for repairing a three-dimensional model according to the above embodiments can be realized by means of software and a necessary general hardware platform, and of course, it can also be realized by hardware, but in many cases, the former is a better embodiment. Based on such understanding, the technical solutions of the present application can be embodied in the form of a software product, which is stored in a storage medium (such as a ROM / RAM, a magnetic disk, an optical disk), and includes a plurality of instructions for causing a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the method described in each embodiment of the present application.

[0139] According to the embodiments of the present application, a method for manufacturing a three-dimensional object is also provided, Figure 18 which is a flowchart of the method for manufacturing a three-dimensional object according to the embodiments of the present application, as shown in Figure 18 , comprising:

[0140] In step S1802, the repaired three-dimensional model is obtained according to any one of the above methods for repairing a three-dimensional model.

[0141] In step S1804, the repaired three-dimensional model is sliced to obtain a plurality of slice images of the repaired three-dimensional model.

[0142] In step S1806, the three-dimensional object is obtained by three-dimensional printing based on the plurality of slice images.

[0143] Based on the above method of repairing a three-dimensional model, the problems of non-manifold edges, self-intersections, holes, etc. in the model have been handled, and the external shell and the internal shell are distinguished. The repaired three-dimensional model should be watertight and have no topological errors. Then the repaired three-dimensional model can be sliced, and the layer height can be determined first, because the layer height determines the printing accuracy, and smaller layer height will increase the printing time, but will improve the printing quality. Import the repaired three-dimensional model into the 3D slicing software, and the slicing software will divide the model into a series of parallel two-dimensional slices or layers, each layer corresponding to a layer of 3D printing. This process is carried out according to the set layer height. After slicing, the relevant files can be sent to the connected 3D printer. In the printer control interface, confirm the printing parameters such as printing material, temperature, bed temperature, etc. Start the 3D printing task, and the printer will extrude the material layer by layer to build a three-dimensional object.

[0144] Repairing a three-dimensional model, slicing it, and then 3D printing is a complete conversion process from a digital model to a physical object. Ensure that the model is watertight and has no topological errors after repair. Through the above steps, accurate and reliable 3D printing products can be obtained from the repaired three-dimensional model, which can be applied to various industries and fields.

[0145] According to the embodiments of the present application, a device for repairing a three-dimensional model is also provided, Figure 19 is a structural block diagram of the device for repairing a three-dimensional model provided by the embodiments of the present application, as Figure 19 shown, the device for repairing a three-dimensional model includes an acquisition module 1902, a self-intersection resolving module 1904 and a repair module 1906, which will be described below.

[0146] The acquisition module 1902 is configured to acquire a three-dimensional model, wherein the three-dimensional model includes a plurality of shells, and the plurality of shells intersect at a non-popular edge.

[0147] The self-intersection resolving module 1904 is connected with the acquisition module 1902 and is configured to resolve self-intersections of the plurality of shells and determine an external shell and an internal shell in the plurality of shells, wherein the external shell encloses the internal shell.

[0148] The repair module 1906 is connected with the self-intersection resolving module 1904 and is configured to retain the external shell and remove or repair the internal shell to obtain a repaired three-dimensional model.

[0149] It should be noted that the above obtaining module 1902, self-intersection resolving module 1904 and repairing module 1906 correspond to steps S902 to S906 in the embodiments, and the plurality of modules have the same instances and application scenarios as the corresponding steps, but are not limited to the above disclosed embodiments. It should be noted that the above modules can run in the computer terminal 10 provided in the embodiments as part of the device.

[0150] Embodiments of the present application can provide a computer device. Optionally, in the present embodiment, the computer device can be located in at least one of a plurality of network devices of a computer network. The computer device comprises a memory and a processor.

[0151] The memory can be used to store software programs and modules, such as program instructions / modules corresponding to the method and device for repairing a three-dimensional model in the embodiments of the present application. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, i.e. implements the above-mentioned method for repairing a three-dimensional model. The memory can include a high-speed random access memory, and can also include a non-volatile memory, such as one or more magnetic storage devices, flash memories, or other non-volatile solid-state memories. In some examples, the memory can further include remotely located memories relative to the processor, which can be connected to the computer terminal through a network. Examples of the above-mentioned network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0152] The processor can call information and applications stored in the memory through the transmission device to perform the following steps: obtaining a three-dimensional model, wherein the three-dimensional model comprises a plurality of shells, and the plurality of shells intersect at non-manifold edges; resolving self-intersections of the plurality of shells to determine external shells and internal shells in the plurality of shells, wherein the external shells enclose the internal shells; retaining the external shells and removing or repairing the internal shells to obtain a repaired three-dimensional model.

[0153] By adopting the embodiments of the present application, a scheme of a method for repairing a three-dimensional model is provided. By obtaining a three-dimensional model, wherein the three-dimensional model comprises a plurality of shells, and the plurality of shells intersect at non-manifold edges; resolving self-intersections of the plurality of shells to determine external shells and internal shells in the plurality of shells, wherein the external shells enclose the internal shells; retaining the external shells and removing or repairing the internal shells to obtain a repaired three-dimensional model, the purpose of separately processing non-manifold results is achieved, thereby realizing the technical effect of improving the repairing effect, and further solving the technical problem that the current repairing of a 3D model does not involve processing of non-manifold structures, resulting in addition of redundant patches when the model is repaired, poor repairing effect, and non-compliance with user requirements.

[0154] Those skilled in the art can understand that all or part of the steps of various methods in the above embodiments can be completed by instructing the terminal device related hardware through a program, and the program can be stored in a non-volatile storage medium, which can include a flash disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0155] The embodiments of the present application also provide a non-volatile storage medium. Optionally, in the present embodiment, the non-volatile storage medium can be used to save the program code executed by the method for repairing a three-dimensional model provided in the above embodiments.

[0156] Optionally, in the present embodiment, the non-volatile storage medium can be located in any one of the computer terminals in the computer terminal group in the computer network, or in any one of the mobile terminals in the mobile terminal group.

[0157] Optionally, in the present embodiment, the non-volatile storage medium is configured to store program code for performing the following steps: obtaining a three-dimensional model, wherein the three-dimensional model comprises a plurality of shells, and the plurality of shells intersect at a non-popular edge; resolving self-intersection of the plurality of shells, and determining an external shell and an internal shell in the plurality of shells, wherein the external shell encloses the internal shell; retaining the external shell and removing or repairing the internal shell, to obtain a repaired three-dimensional model.

[0158] Optionally, in the present embodiment, the non-volatile storage medium is configured to store program code for performing the following steps: obtaining a repaired three-dimensional model according to any one of the methods for repairing a three-dimensional model; slicing the repaired three-dimensional model to obtain a plurality of slice images of the repaired three-dimensional model; and performing three-dimensional printing based on the plurality of slice images to obtain a three-dimensional object.

[0159] The embodiments of the present application also provide a computer program product, comprising a computer program. Optionally, in the present embodiment, the computer program can be executed by a processor to achieve the following: obtaining a three-dimensional model, wherein the three-dimensional model comprises a plurality of shells, and the plurality of shells intersect at a non-popular edge; resolving self-intersection of the plurality of shells, and determining an external shell and an internal shell in the plurality of shells, wherein the external shell encloses the internal shell; retaining the external shell and removing or repairing the internal shell, to obtain a repaired three-dimensional model.

[0160] The above serial numbers of the embodiments of the present application are only for description, and do not represent the advantages and disadvantages of the embodiments.

[0161] In the above embodiments of the present application, the description of each embodiment has its own focus, and the parts not described in detail in a certain embodiment can be referred to the related description of other embodiments.

[0162] In several embodiments provided in the present application, it should be understood that the disclosed technology can be implemented in other manners. For example, the described unit embodiments are merely schematic, and the division of units can be different from the above. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections can be indirect couplings or communication connections through some interfaces, and electrical or other forms.

[0163] The units described as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, i.e., can be located in one place, or can be distributed on multiple units. Some or all of the units can be selected according to actual needs to achieve the purposes of the embodiments.

[0164] In addition, each functional unit in each embodiment of the present application can be integrated into a processing unit, or each unit can exist physically, or two or more units can be integrated into one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit.

[0165] The integrated unit, if realized in the form of a software functional unit and sold or used as an independent product, can be stored in a non-volatile storage medium. Based on this understanding, the technical solutions of the present application, essentially or the part that contributes to the prior art, or all or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: a U disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a mobile hard disk, a magnetic disk or an optical disk, and various media that can store program codes.

[0166] The above is only the preferred embodiment of the present application, and it should be pointed out that for ordinary skilled in the art, without departing from the principles of the present application, several improvements and refinements can be made, and these improvements and refinements should be considered as the protection scope of the present application.

Claims

1. A method for repairing a three-dimensional model, characterized in that: include: Acquire a three-dimensional model, wherein the three-dimensional model includes a plurality of shells, and the plurality of shells intersect at a non-popular edge; Solving self-intersections for the plurality of shells to determine an outer shell and an inner shell among the plurality of shells, wherein the outer shell surrounds the inner shell; The outer shell is retained and the inner shell is removed or repaired to obtain a repaired three-dimensional model.

2. The method according to claim 1, characterized in that The plurality of shells include a first shell, a second shell, and a third shell, and a first face piece of the first shell, a second face piece of the second shell, and a third face piece of the third shell share the non-popular edge.

3. The method according to claim 2, characterized in that Solving the self-intersection of the plurality of shells includes: Modify the non-popular edge of the first face of the first shell into a boundary edge of the first face of the first shell; Modify the non-popular edge of the second face of the second shell into a boundary edge of the second face of the second shell; The non-popular edge of the third face of the third shell is modified into the boundary edge of the third face of the third shell.

4. The method according to claim 2, characterized in that The determining of the outer shell and the inner shell among the plurality of shells includes: determining the outer shell and the inner shell using a bounding box.

5. The method according to claim 1, wherein Solving the self-intersection of the plurality of shells to determine an outer shell and an inner shell among the plurality of shells includes: Solving the self-intersection of the multiple shells to obtain shells after the self-intersection is solved; Noise shells among the shells after the self-intersection are solved are identified and discarded to obtain outer shells and inner shells among the multiple shells, wherein the noise shells include shells whose volumes are smaller than a preset volume threshold.

6. The method according to claim 5, characterized in that The determining of the outer shell and the inner shell among the plurality of shells comprises: Based on the three-dimensional model, establishing a three-dimensional coordinate system; Determining, based on the three-dimensional coordinate system, coordinate values ​​corresponding to each point on the shell after the self-intersection of the solution; Based on the coordinate values ​​corresponding to each point on the shell after the self-intersection solution, an outer shell and an inner shell among the multiple shells are determined.

7. A method for manufacturing a three-dimensional object, characterized in that: include: Obtaining a repaired three-dimensional model according to the method for repairing a three-dimensional model according to any one of claims 1 to 6; Slicing the repaired three-dimensional model to obtain a plurality of slice images of the repaired three-dimensional model; Three-dimensional printing is performed based on the multiple slice images to obtain a three-dimensional object.

8. A non-volatile storage medium, characterized in that: The non-volatile storage medium includes a stored program, wherein, when the program is running, the device where the non-volatile storage medium is located is controlled to execute the method for repairing a three-dimensional model as described in any one of claims 1 to 6 and / or the method for manufacturing a three-dimensional object as described in claim 7.