Channel identification method and apparatus for three-dimensional model, and electronic device and storage medium
By updating the hole array and determining the channel, the problem of low accuracy of channel recognition of three-dimensional model is solved, and more efficient channel recognition and processing is achieved.
Patent Information
- Application Number
- PCT/CN2024/109610
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-09-22
- Filing Date
- 2024-08-02
- Publication Date
- 2025-03-27
AI Technical Summary
In the prior art, the accuracy of three-dimensional model channel recognition is low, resulting in some channels being missed.
By determining the relationship between holes and triangular sheets in the model, update the hole array, and determine the channel based on the updated array. The specific steps include obtaining the hole array corresponding to the target triangle face sheet, updating the hole array, determining the largest hole as the starting point of the channel, and repeating the above steps until there are no holes.
Improves the accuracy and efficiency of 3D model channel recognition, ensuring that all channels are identified and processed.
Smart Images

Figure CN2024109610_27032025_PF_FP_ABST
Abstract
Description
Three-dimensional model channel identification method, device, electronic device and storage medium
[0001] This disclosure claims priority to a Chinese patent application filed with the Patent Office of China on September 22, 2023, with application number 202311233605.0 and titled “Channel Identification Method, Device, Electronic Device and Storage Medium for Three-Dimensional Models,” the entire contents of which are incorporated herein by reference. Technical Field
[0002] The present disclosure relates to the field of computer technology, and in particular to a channel identification method, device, electronic device, and storage medium for a three-dimensional model. Background Art
[0003] With the development of laser technology, high-precision computer models can be obtained by scanning objects. These models often contain topological noise such as holes, channels, small components, and spikes, which complicates subsequent model processing and requires topological noise removal. During this process, certain channels in the model's topological structure are inherent features that should not be removed, so channel identification is necessary.
[0004] In related technologies, a certain number of seed patches (approximately 1%) are randomly selected from the original model. Channels on the model are then identified using triangular patches within a specified radius based on the selected seed patches. However, the random selection of seed patches and the specified search radius can lead to some channels being missed, resulting in low channel identification accuracy.
[0005] Summary of the Invention
[0006] The present disclosure provides a three-dimensional model channel identification method, device, electronic device and storage medium to solve the problem of low accuracy of channel identification in the prior art.
[0007] The present disclosure provides a channel identification method for a three-dimensional model, comprising:
[0008] determining a first hole in the first model;
[0009] If there is a triangular facet in the first model that shares the hole edge with the first hole, updating the hole array based on the triangular facets in the first model that share the hole edge with the first hole and the traversed triangular facets;
[0010] When the updated hole array includes at least two holes, a first channel is determined based on a first target hole; the first target hole is the largest hole in the updated hole array; and the first channel is obtained based on two holes connected by two triangular facets.
[0011] According to a channel identification method for a three-dimensional model provided by the present disclosure, when the first hole is acquired for the first time, determining the first hole in the first model includes:
[0012] Obtain a hole array corresponding to a target triangular face in the first model; the hole array includes a first hole corresponding to the target triangular face; and a hole edge of the first hole is an edge of the target triangular face.
[0013] According to a channel identification method for a three-dimensional model provided by the present disclosure, after obtaining a first hole for the first time, determining the first hole in the first model includes:
[0014] The largest hole is selected from the updated hole array as the new first hole.
[0015] According to a channel identification method for a three-dimensional model provided by the present disclosure, updating the hole array based on the triangular facets in the first model that share the hole edge with the first hole includes:
[0016] determining the number of holes based on triangular facets in the first model that share the hole edge with the first hole;
[0017] Based on the number of holes, the hole array is updated.
[0018] According to a channel identification method for a three-dimensional model provided by the present disclosure, updating the hole array based on the number of holes includes:
[0019] When the number of the holes increases, determining at least two second holes; and updating the hole array based on the at least two second holes;
[0020] When the number of holes decreases, determining closed holes; and updating the hole array based on the closed holes;
[0021] When the number of holes remains unchanged, an updated first hole is determined; and based on the updated first hole, the hole array is updated.
[0022] According to a channel identification method for a three-dimensional model provided by the present disclosure, determining a first channel based on a first target hole includes:
[0023] Determine a second target hole that shares the same hole edge with the first target hole after the first target hole is updated based on the newly traversed triangle patch;
[0024] The first channel is determined based on the first target hole and the second target hole.
[0025] According to a channel identification method of a three-dimensional model provided by the present disclosure, the method further includes:
[0026] Determining a channel closure line of the first channel; the channel closure line is a closure line corresponding to the shortest path around the first channel;
[0027] Determining the length of the channel closure line;
[0028] When the length of the channel closed line is less than a preset threshold, the first channel is repaired.
[0029] According to a channel identification method for a three-dimensional model provided by the present disclosure, determining a channel closed line of the first channel includes:
[0030] copying the first model to form a second model;
[0031] On the second model, all processed triangular facets in the first model are deleted, the triangular facets at the intersection of the first target hole and the second target hole are retained, the two triangular facets connected to the first channel are deleted, and the shortest path algorithm is executed to obtain the channel closed line of the first channel.
[0032] According to a channel identification method for a three-dimensional model provided by the present disclosure, repairing the first channel includes:
[0033] Based on the channel closed line, deleting triangular facets within a preset range corresponding to the channel closed line to obtain two unconnected third target holes;
[0034] A hole filling algorithm is used to fill each of the third target holes.
[0035] According to a channel identification method for a three-dimensional model provided by the present disclosure, executing the shortest path algorithm to obtain a channel closure line of the first channel includes:
[0036] Based on the shared edge between a triangle patch last traversed by the first model and the first target hole before the boundary edge is updated, a shortest path algorithm is executed to obtain the shortest channel closed line around the first channel.
[0037] According to a channel identification method for a three-dimensional model provided by the present disclosure, triangular facets adjacent to the first hole in the first model are traversed one by one to search for triangular facets that share the hole edge with the first hole.
[0038] According to the present disclosure, a channel identification method of a three-dimensional model further includes:
[0039] If there is no untraversed triangle in the first model that shares a hole edge with the first hole, deleting the first hole from the hole array;
[0040] Reselecting the largest hole from the hole array as the new first hole, and returning to execute, when there is a triangle in the first model that shares the hole edge with the first hole, updating the hole array based on the triangles in the first model that share the hole edge with the first hole, until there are no holes in the hole array.
[0041] The present disclosure provides a channel identification method for a three-dimensional model, comprising:
[0042] Step A: Obtain a hole array corresponding to a target triangular face in a first model; the hole array includes a first hole corresponding to the target triangular face; a hole edge of the first hole is an edge of the target triangular face;
[0043] Step B: if there is a triangular facet in the first model that shares the hole edge with the first hole, updating the hole array based on the triangular facets in the first model that share the hole edge with the first hole and the traversed triangular facets;
[0044] Step C: When the updated hole array includes at least two holes, determine a first channel based on a first target hole; the first target hole is the largest hole in the updated hole array; and the first channel is obtained based on two holes connected by two triangles.
[0045] Step D: using the first target hole in the updated hole array as a new first hole, and repeating steps B to D until there are no holes in the updated hole array;
[0046] Step E: Based on all the first channels, determine the channel identification result of the first model.
[0047] According to a channel identification method for a three-dimensional model provided by the present disclosure, updating the hole array based on triangular facets in the first model that share the hole edge with the first hole includes:
[0048] determining the number of holes based on triangular facets in the first model that share the hole edge with the first hole;
[0049] Based on the number of holes, the hole array is updated.
[0050] According to a channel identification method for a three-dimensional model provided by the present disclosure, updating the hole array based on the number of holes includes:
[0051] When the number of the holes increases, determining at least two second holes; and updating the hole array based on the at least two second holes;
[0052] When the number of holes decreases, determining closed holes; and updating the hole array based on the closed holes;
[0053] When the number of holes remains unchanged, an updated first hole is determined; and based on the updated first hole, the hole array is updated.
[0054] According to a channel identification method for a three-dimensional model provided by the present disclosure, determining a first channel based on a first target hole includes:
[0055] Determine a second target hole that shares the same hole edge with the first target hole after the first target hole is updated based on the newly traversed triangle patch;
[0056] The first channel is determined based on the first target hole and the second target hole.
[0057] According to a channel identification method of a three-dimensional model provided by the present disclosure, the method further includes:
[0058] For each of the first channels, determining a channel closed line of the first channel; the channel closed line is a closed line corresponding to the shortest path around the first channel;
[0059] Determining the length of the channel closure line;
[0060] When the length of the channel closed line is less than a preset threshold, the first channel is repaired.
[0061] According to a channel identification method for a three-dimensional model provided by the present disclosure, determining a channel closed line of each first channel includes:
[0062] copying the first model to form a second model;
[0063] For each of the first channels, all processed triangular facets in the first model are deleted on the second model, the triangular facets at the intersection of the first target hole and the second target hole are retained, the two triangular facets connected by the first channel are deleted, and the shortest path algorithm is executed to obtain the channel closed line of the first channel.
[0064] According to a channel identification method for a three-dimensional model provided by the present disclosure, repairing the first channel includes:
[0065] Based on the channel closed line, deleting triangular facets within a preset range corresponding to the channel closed line to obtain two unconnected third target holes;
[0066] A hole filling algorithm is used to fill each of the third target holes.
[0067] According to a channel identification method for a three-dimensional model provided by the present disclosure, executing the shortest path algorithm to obtain a channel closure line of the first channel includes:
[0068] Based on the shared edge between a triangle patch last traversed by the first model and the first target hole before the boundary edge is updated, a shortest path algorithm is executed to obtain the shortest channel closed line around the first channel.
[0069] According to a channel identification method for a three-dimensional model provided by the present disclosure, triangular facets adjacent to the first hole in the first model are traversed one by one to search for triangular facets that share the hole edge with the first hole.
[0070] According to the present disclosure, a channel identification method of a three-dimensional model further includes:
[0071] If there is no untraversed triangle in the first model that shares a hole edge with the first hole, deleting the first hole from the hole array;
[0072] Reselect the largest hole from the hole array as the new first hole, and return to step B to step D.
[0073] The present disclosure also provides a three-dimensional model channel identification device, comprising:
[0074] An acquisition module, configured to acquire and determine a first hole in the first model;
[0075] A first updating module is configured to update the hole array based on the triangles in the first model that share the hole edge with the first hole and the traversed triangles, if there are triangles in the first model that share the hole edge with the first hole;
[0076] The first determination module is used to determine a first channel based on a first target hole when the updated hole array includes at least two holes; the first target hole is the largest hole in the updated hole array; and the first channel is obtained based on two holes connected by two triangular facets.
[0077] The present disclosure also provides a three-dimensional model channel identification device, comprising:
[0078] An acquisition module, configured to acquire a hole array corresponding to a target triangular facet in a first model; the hole array includes a first hole corresponding to the target triangular facet; a hole edge of the first hole is an edge of the target triangular facet;
[0079] a first updating module, configured to update the hole array based on the triangles in the first model that share the hole edge with the first hole and the traversed triangles, if there are triangles in the first model that share the hole edge with the first hole;
[0080] a first determining module configured to determine a first channel based on a first target hole when the updated hole array includes at least two holes; the first target hole being the largest hole in the updated hole array;
[0081] an execution module, configured to use the first target hole in the updated hole array as a new first hole, and repeat the above steps until there are no holes in the updated hole array;
[0082] The second determining module is configured to determine a channel identification result of the first model based on all the first channels.
[0083] The present disclosure also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the channel identification method of the three-dimensional model as described above is implemented.
[0084] The present disclosure also provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the channel identification method of the three-dimensional model as described in any one of the above is implemented.
[0085] The present disclosure also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements any one of the above-mentioned three-dimensional model channel identification methods.
[0086] The present disclosure provides a channel identification method, device, electronic device and storage medium for a three-dimensional model, which obtains a hole array corresponding to a target triangular facet in a first model; the hole array includes a first hole corresponding to the target triangular facet; the hole edge of the first hole is the edge of the target triangular facet; when there is a triangular facet in the first model that shares a hole edge with the first hole, the hole array is updated based on the triangular facets in the first model that share a hole edge with the first hole; when the updated hole array includes at least two holes, the first channel is determined based on the first target hole; the first target hole is the largest hole in the updated hole array; the first channel is obtained based on two holes connected by two triangular facets; the first target hole in the updated hole array is used as the new first hole, and the above steps are repeated until all holes in the hole array have no shared triangular facets; and the channel identification result of the first model is determined based on all the first channels. By traversing all triangles on the model that share the hole edge with the first hole, and each triangle is traversed only once, the recognition of all first channels on the first model can be guaranteed, thereby improving the accuracy and efficiency of channel recognition.
[0087] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0088] In order to more clearly illustrate the technical solutions in the present disclosure or the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0089] FIG1 is a flow chart of a channel identification method for a three-dimensional model according to an embodiment of the present disclosure.
[0090] FIG2 is a flow chart of a channel identification method for a three-dimensional model according to an embodiment of the present disclosure.
[0091] FIG3 is a schematic diagram of increasing the number of holes according to an embodiment of the present disclosure.
[0092] FIG4 is a schematic diagram of reducing the number of holes according to an embodiment of the present disclosure.
[0093] FIG5 is a schematic diagram of an embodiment of the present disclosure in which the number of holes is not changed.
[0094] FIG6 is a schematic diagram of a first channel according to an embodiment of the present disclosure.
[0095] FIG7 is a schematic structural diagram of a channel identification device for a three-dimensional model according to an embodiment of the present disclosure.
[0096] FIG8 is a schematic structural diagram of a channel identification device for a three-dimensional model according to an embodiment of the present disclosure.
[0097] FIG9 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0098] To make the objectives, technical solutions, and advantages of this disclosure more clear, the technical solutions of this disclosure will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the embodiments described are only part of the embodiments of this disclosure, not all of them. All other embodiments obtained by persons of ordinary skill in the art based on the embodiments of this disclosure without creative effort shall fall within the scope of protection of this disclosure.
[0099] In order to facilitate a clearer understanding of the embodiments of the present disclosure, the key terms provided in the embodiments of the present disclosure are introduced as follows.
[0100] Model: A three-dimensional model is a polygonal representation of an object, typically displayed on a computer or other video device. The displayed object can be a real-world entity or a fictional object. Anything that exists in the physical world can be represented by a three-dimensional model. The model in this disclosure refers to a three-dimensional model composed of multiple triangular facets. Models composed of other polygonal facets can be converted to triangular facets before applying the methods of this disclosure.
[0101] Triangle patch: A single triangular face that makes up a model.
[0102] Edges, boundary edges: Each triangle that makes up the model has three edges, called the edges of the model. Two adjacent triangles have a common edge; if an edge is only used by one triangle, it is called a boundary edge.
[0103] Mesh: Defined by a collection of polygons, it represents the topology and spatial structure of the surface contour of a 3D model.
[0104] The mesh in this disclosure is composed of a collection of triangular facets.
[0105] Hole: A closed polygon formed by a set of boundary edges connected end to end. The hole edges are the boundary edges that make up the hole.
[0106] Channel: Connecting the boundary edges of two unconnected holes with triangles forms a channel.
[0107] Hole filling algorithm: an algorithm used to fill holes in a model to close them.
[0108] Topology: refers to the structure of a model consisting of vertices, edges, and faces.
[0109] Model No. 1: The original model. Hereinafter referred to as the first model.
[0110] Model No. 2: Starting from a triangle copied from the original model, the model is enlarged by continuously copying adjacent triangles from the original model.
[0111] Model No. 3: A replica of the original model. Hereinafter referred to as the second model.
[0112] In order to identify channels in a three-dimensional model, as shown in FIG1 , an embodiment of the present disclosure provides an identification method, including:
[0113] 101 , determining a first hole in a first model.
[0114] In the embodiment of the present disclosure, any hole can be selected from the first model as the first hole.
[0115] In order to facilitate finding the initial point as quickly as possible, in the embodiment of the present disclosure, when the first hole is obtained for the first time, the determination of the first hole in the first model can be implemented as follows: obtaining a hole array corresponding to the target triangular face in the first model; the hole array includes the first hole corresponding to the target triangular face; the hole edge of the first hole is the edge of the target triangular face. That is, starting from any triangular face when traversing the first model, the hole constructed by any triangular face is the first hole. This method can determine the first first hole as quickly as possible, so that the channel in the first model can be identified by traversing the surrounding triangular faces later.
[0116] Accordingly, after the first hole is obtained, the first hole needs to be continuously updated to accurately and quickly find all channels. Specifically, as the first model is traversed, the hole array is continuously updated. Accordingly, determining the first hole in the first model can be implemented by selecting the largest hole from the updated hole array as the new first hole. Thus, the operation shown in Figure 1 is repeatedly performed for each first hole, thereby finding the first channel in the first model by traversing the first model.
[0117] 102. If there are triangular facets in the first model that share the hole edge with the first hole, update the hole array based on the triangular facets in the first model that share the hole edge with the first hole and the traversed triangular facets.
[0118] 103. When the updated hole array includes at least two holes, determine a first channel based on a first target hole; the first target hole is the largest hole in the updated hole array; and the first channel is obtained based on two holes connected by two triangular facets.
[0119] In the disclosed embodiment, the first hole in the first model is first located. Based on the first hole, adjacent triangles sharing the hole's edges are searched to traverse the triangles in the first model, thereby identifying potential first channels. This method is simple to implement and can identify all first channels in the first model through traversal, without missing channels due to setting the radius range of the seed patch, thereby improving the accuracy of channel identification.
[0120] For ease of understanding, the specific method of identifying channels is described below with reference to FIG. 2 .
[0121] FIG2 is a flow chart of a channel identification method for a three-dimensional model according to an embodiment of the present disclosure. As shown in FIG2 , the method includes steps 201 to 205, wherein:
[0122] Step 201 : Obtain a hole array corresponding to a target triangular face in a first model; the hole array includes a first hole corresponding to the target triangular face; and a hole edge of the first hole is an edge of the target triangular face.
[0123] It should be noted that the 3D model channel identification method provided in this disclosure is applicable to scenarios involving 3D model channel identification. For example, channel identification in a 3D oral cavity model. The method can be performed by a 3D model channel identification device, such as an electronic device, or a control module within the 3D model channel identification device that is configured to perform the 3D model channel identification method.
[0124] Specifically, the first model is the original three-dimensional model, i.e., model No. 1. The first model may have at least one channel or no channel. The first model may include multiple sub-models. These sub-models are independent of each other, such as two independent spheres. Each sub-model is composed of multiple triangular facets. Each sub-model may have at least one channel or no channel.
[0125] For each sub-model, randomly select a target triangle F from the sub-model in the first model. The three edges of the target triangle F can form a first hole, denoted as hole 0. The hole edge of the first hole is the edge of the target triangle. Based on the target triangle, create a hole array corresponding to the target triangle. The hole information of the first hole is added to the hole array. The hole information may include the edge identifiers of the three edges of the target triangle and the hole identifier of the first hole.
[0126] Step 202 : If there are triangular facets in the first model that share the hole edge with the first hole, update the hole array based on the triangular facets in the first model that share the hole edge with the first hole and the traversed triangular facets.
[0127] Specifically, the first model is traversed for triangles that share a hole edge with the first hole, and a determination is made as to whether any triangles in the first model share a hole edge with the first hole exist. If any triangles in the first model share a hole edge with the first hole, the triangles in the first model that share a hole edge with the first hole are selected, i.e., the triangles adjacent to the target triangle F. The hole array can be updated based on the triangles in the first model that share a hole edge with the first hole.
[0128] During implementation, the triangular facets adjacent to the first hole are traversed one by one in the first model to search for triangular facets that share a hole edge with the first hole, thereby dynamically updating the hole array.
[0129] It can be understood that the triangular facets traversed from the first model are constructed as the aforementioned model No. 2. As the triangular facets of the first model are traversed, the triangular facets in the No. 2 model are gradually added and updated, and the hole array is updated based on the updated No. 2 model.
[0130] It is understandable that in actual implementation, it is not necessary to construct Model No. 2. Model No. 2 here is only used as an example to help understand that the hole array changes dynamically as the number of traversed triangles increases.
[0131] Step 203: When the updated hole array includes at least two holes, determine a first channel based on a first target hole; the first target hole is the largest hole in the updated hole array; and the first channel is obtained based on two holes connected by two triangular facets.
[0132] Specifically, if the updated hole array includes at least two holes, a first channel can be determined based on the largest hole in the updated hole array. Triangles that share a hole edge with the first hole are traversed one by one, resulting in the first channel being derived from the two holes connected by the two triangles. It should be noted that after determining the first channel, the hole connected to the first target hole is deleted from the hole array.
[0133] Step 204 , using the first target hole in the updated hole array as a new first hole, and repeating steps 202 to 204 until the updated hole array finally has no holes.
[0134] Specifically, the first target hole in the updated hole array is used as the new first hole, and steps 202 through 204 are repeated until there are no holes in the updated hole array, indicating that all triangles in the sub-model have been processed. This means that there are no triangles in the sub-model that share a hole edge with the first hole, or all triangles that share a hole edge with the first hole have been traversed.
[0135] Step 205: Determine a channel identification result of the first model based on all first channels.
[0136] Specifically, all first channels are determined respectively according to each sub-model, and a channel identification result of the first model can be determined, where the channel identification result includes the first channels of all sub-models.
[0137] The present disclosure provides a channel identification method for a three-dimensional model. First, a hole array corresponding to a target triangle in a first model is obtained. The hole array includes a first hole corresponding to the target triangle, and the hole edge of the first hole is the edge of the target triangle. Then, if there is a triangle in the first model that shares a hole edge with the first hole, the hole array is updated based on the triangle in the first model that shares a hole edge with the first hole. If the updated hole array includes at least two holes, a first channel is determined based on the first target hole. The first target hole is the largest hole in the updated hole array. The first channel is obtained based on two holes connected by two triangles. The first target hole in the updated hole array is used as the new first hole, and the above steps are repeated until all holes in the hole array do not have any untraversed shared triangles. Based on all the first channels, the channel identification result of the first model is determined. By traversing all triangles on the first model that share the hole edge with the first hole, and each triangle is traversed only once, it is possible to ensure that all first channels on the first model are identified, thereby improving the accuracy and efficiency of channel identification.
[0138] Optionally, a specific implementation of step 202 includes:
[0139] (1) Determine the number of holes based on the triangular facets in the first model that share the hole edge with the first hole.
[0140] Specifically, the triangular facets in the first model that share a hole edge with the first hole are traversed. When the triangular facets in the first model that share a hole edge with the first hole are traversed, the number of holes may change or remain unchanged due to the triangular facets that share a hole edge with the first hole and the traversed triangular facets, thereby determining the number of holes.
[0141] That is, the currently traversed triangles are added to the already traversed triangles, and these triangles are connected according to their relative positions in the first model. Because of the addition of new triangles, the number of holes may change.
[0142] (2) Based on the number of holes, update the hole array.
[0143] Specifically, the hole array may be updated according to the number of holes.
[0144] Optionally, updating the hole array based on the number of holes includes:
[0145] (a) When the number of the holes increases, determining at least two second holes; and updating the hole array based on the at least two second holes.
[0146] Specifically, when the number of holes increases, that is, a hole is split into two holes, resulting in at least two second holes. The split hole is deleted from the hole array, and the hole information of the at least two second holes obtained by the split is added to the hole array. Different numbers are assigned to the at least two second holes, thereby updating the hole array.
[0147] This means that when traversing the first model based on the first hole, if a triangle that shares a hole edge with the first hole is encountered, the first hole may be split into two second holes due to the addition of this triangle. Therefore, the first hole can be deleted from the hole array, and the hole information of the two second holes obtained by the split can be added to the hole array.
[0148] Figure 3 is a schematic diagram of increasing the number of holes in one embodiment of the present disclosure. As shown in Figure 3, triangles are added to the boundary of the three-dimensional model by traversing the triangles that share the edges of the holes (for example, the triangles with a solid black background in Figure 3 are the newly traversed triangles). Based on Figure 3, it can be seen that the original hole is split into two holes due to the newly added triangles, namely the two holes shown in the dotted box in Figure 3.
[0149] It should be noted that when two triangles are connected by only one point, the two triangles are not considered connected, but when the two triangles have a common edge, the two triangles are considered connected.
[0150] (b) when the number of holes decreases, determining closed holes; and updating the hole array based on the closed holes.
[0151] Specifically, when the number of holes decreases, that is, a certain hole is closed, the closed hole is determined and deleted from the hole array, thereby updating the hole array.
[0152] That is, when traversing the triangular facets in the first model based on the first hole, the addition of the newly traversed triangular facets closes the first hole. Therefore, the first hole needs to be deleted from the hole array to complete the update of the hole array.
[0153] Figure 4 is a schematic diagram of reducing the number of holes in one embodiment of the present disclosure. As shown in Figure 4, after adding triangular facets (i.e., triangular facets with a black background) to the boundary of the three-dimensional model, the original hole (i.e., the first hole) is closed, thus reducing one hole.
[0154] (c) determining an updated first hole while the number of holes remains unchanged; and updating the hole array based on the updated first hole.
[0155] Specifically, when the number of holes remains unchanged, that is, the first hole is enlarged, the updated first hole is determined, that is, the edge identifier and hole identifier of the hole edge of the enlarged first hole are added to the hole array, thereby updating the hole array.
[0156] It can also be understood that, when traversing the triangular faces in the first model that share the same hole edge with the first hole, the addition of the newly traversed triangular faces does not change the number of holes, but the hole edge of the first hole has changed, so the hole information of the first hole in the hole array needs to be updated.
[0157] Figure 5 is a schematic diagram of an embodiment of the present disclosure in which the number of holes is not changed. As shown in Figure 5, adding triangular facets (i.e., triangular facets with a black background) to the boundary of the three-dimensional model does not change the number of holes, but the boundaries of the holes are changed.
[0158] In the present disclosure, if the number of holes increases, at least two second holes are identified. If the number of holes decreases, closed holes are identified. If the number of holes remains unchanged, updated first holes are determined. This updates the hole array, and then, based on the largest hole in the updated hole array, all first channels on the first model are identified, improving the accuracy and efficiency of channel identification.
[0159] Alternatively, if no triangles in the first model share the hole edge with the first hole, the first hole is deleted from the hole array and the hole array is updated. Thereafter, the largest hole is reselected from the hole array as the new first hole, and the process returns to steps 202-204.
[0160] Specifically, if there are no triangles in the first model that share a hole edge with the first hole, that is, if the first hole currently being operated on cannot find any adjacent triangles in the first model that share a hole edge with the first hole, then the first hole has reached the boundary of the first model. If there are multiple sub-models, this indicates that the first hole has reached the boundary of its sub-model. Therefore, the first hole is deleted from the hole array, thereby updating the hole array.
[0161] Optionally, a specific implementation of step 203 includes:
[0162] A second target hole sharing the same hole edge as the first target hole is determined; and the first channel is determined based on the first target hole and the second target hole.
[0163] Specifically, after obtaining the first target hole, a second target hole sharing the same hole edge as the first target hole is determined, that is, the first target hole and the second target hole are connected, and then the first channel can be determined based on the first target hole and the second target hole.
[0164] It is understandable that the hole naming in different operations in the embodiments of this disclosure may differ. For example, when updating the hole array based on the first hole, the first hole may be split into two holes due to the newly traversed triangle facets. The two resulting holes are called second holes. As the traversal progresses, the number of second holes may gradually increase, exceeding two.
[0165] In some embodiments, after the first hole is split into two second holes, the first target hole may be one of the two second holes, the first target hole is the largest of the two second holes, and the second target hole is the hole connected to the first target hole.
[0166] In the embodiment of the present disclosure, a second target hole that shares the same hole edge with the first target hole is determined after the first target hole is updated based on the newly traversed triangle patch.
[0167] The so-called second target hole that shares the same hole edge with the first target hole after the first target hole is updated based on the newly traversed triangle facet can be understood as an exemplary case that among the multiple second holes split from the first hole, the largest one is always found as the new first hole (also called the first target hole) and the first target hole is continuously traversed and updated until the second target hole that shares the boundary edge with it is found, that is, the two holes are independent before being based on the newly traversed triangle facet, but after the first target hole in the hole array is updated based on the newly traversed triangle facet, the updated first target hole and the non-updated second target hole are connected based on the edge of the newly traversed triangle facet, that is, based on the newly traversed triangle facet, the updated first target hole and the second target hole have the same hole edge.
[0168] Exemplarily, there are multiple methods for updating the hole array, which may include the following steps: 1. Traverse the triangles that share a boundary edge with a certain boundary edge of the first target hole as a new triangle; 2. Update the boundary edge of the first target hole based on the new triangle; 3. Check whether the updated boundary edge shares a boundary edge with the second target hole. If not, complete the update of the hole array and continue to traverse the next triangle. If so, delete the boundary edge; 4. After deleting the boundary edge, connect the remaining boundary edges of the first target hole with the remaining boundary edges of the second target hole in order to determine a merged hole, that is, the new first target hole; 5. Delete the second target hole. In layman's terms, after traversing to a triangle that shares a boundary edge with a certain boundary edge of the first target hole, it is found that the new boundary edge is the boundary edge of the second target hole, then it means that the first target hole and the second target hole are now a channel. In other words, the size of the first target hole is dynamic. Before step 2 begins, the first target hole and the second target hole are connected by a single triangle. When step 2 ends, the first target hole and the second target hole share a common hole edge, meaning they are connected by two triangles.
[0169] Since the first target hole is the largest hole in the updated hole array, steps 202 to 204 are always performed on the largest hole, that is, the continuously updated first hole. Therefore, the hole edges of the second target hole are all at the first channel. The first channel has been identified, and after the hole array update is completed, the first target hole and the second target hole are merged into one hole. Therefore, the second target hole can be deleted from the updated hole array, and the first target hole is traversed to find the next channel.
[0170] Figure 6 is a schematic diagram of a first channel according to an embodiment of the present disclosure. As shown in Figure 6, after adding triangular facets (i.e., the black-shaded triangular facets in Figure 6) to the boundary of the three-dimensional model, the first target hole and the second target hole are connected, creating a channel. Before adding the black-shaded triangular facets, the two holes above and below the channel were independent. The addition of the new triangular facets connects the two holes, meaning that the first target hole and the second target hole have the same hole edge, and a channel is now identified between the two holes.
[0171] In the present disclosure, after updating the hole array, that is, each time a hole is split, merged, or the hole information is updated, the largest hole in the updated hole array is used as the first target hole. In other words, the largest hole is selected and traversed to determine the second target hole connected to the first target hole. Based on the first target hole and the second target hole, the first channel is determined, that is, the channel position is located until it merges with another small hole, so that the positioning point is located inside the channel. In addition, the method of the present disclosure can cover all channels on the first model without missing any channels, thereby improving the comprehensiveness and accuracy of channel identification.
[0172] Optionally, for each first channel, a channel closure line of the first channel is determined; the channel closure line is a closure line corresponding to the shortest path around the first channel; the length of the channel closure line is determined; and when the length of the channel closure line is less than a preset threshold, the first channel is repaired.
[0173] Specifically, for each first channel on the first model (the first channel is obtained based on two holes connected by two triangular facets), the channel closing line of the first channel can be determined; the channel closing line is the closed line corresponding to the shortest path around the first channel; based on the channel closing line of the first channel, the length of the channel closing line can be determined; the length of the channel closing line is compared with a preset threshold. When the length of the channel closing line is less than the preset threshold, it means that the first channel is relatively small and the first channel needs to be repaired.
[0174] In the present disclosure, for each first channel, the channel closing line of the first channel is determined, and then the length of the channel closing line is determined. When the length of the channel closing line is less than a preset threshold, the first channel is repaired. By judging the channel size by the length of the channel closing line after the channel closing line is found, instead of specifying the search radius when searching, narrow and long channels can also be found, which improves the accuracy of channel identification, and can repair channels whose channel closing line length is less than a preset threshold, thereby improving the efficiency of channel repair. Therefore, the present disclosure provides a clear standard to distinguish which channels are noise and which channels can be safely removed. In addition, the channel closing line determined based on the embodiment of the present disclosure is likely to be located inside the channel, and the appearance of the model can be not destroyed during suturing, thereby improving the repair effect.
[0175] Optionally, determining a channel closure line of each first channel includes:
[0176] The first model is copied to form a second model. For each of the first channels, all processed triangular facets in the first model are deleted from the second model, the triangular facets at the intersection of the first target hole and the second target hole are retained, the two triangular facets connected by the first channel are deleted, and a shortest path algorithm is executed to obtain a channel closed line of the first channel.
[0177] Specifically, the first model is copied to form a second model. For each first channel, all processed triangles in the first model are deleted from the second model, that is, the traversed triangles are deleted. The unprocessed triangles at the intersection of the first target hole and the second target hole are retained, and the two traversed triangles at the intersection that connect the first target hole and the second target hole are deleted. Any edge of the two connected triangles can be selected as two endpoints to determine the channel closing line.
[0178] For example, based on the shared edge of a triangle facet traversed last by the first model and the first target hole before updating the boundary edge (endpoint 1 and endpoint 2 as shown in FIG6 ), the shortest path algorithm is executed to obtain the shortest channel closure line around the first channel. For example, the two endpoints of the shared edge are used as the starting and ending points of the channel closure line, and the shortest path around the first channel is obtained as the channel closure line of the first channel. In the embodiment of the present disclosure, the second model is used to ensure that when the shortest path algorithm is executed to obtain the channel closure line, the purpose of not selecting the triangle facets that have been traversed is to exclude those triangle facets that are relatively close to the last traversed triangle facet, so that the channel closure line is located inside the first channel as much as possible, and to ensure that the appearance of the model is not destroyed when the channel closure line is deleted.
[0179] Optionally, repairing the first channel includes:
[0180] Based on the channel closed line, the triangular facets within a preset range corresponding to the channel closed line are deleted to obtain two unconnected third target holes; and a hole filling algorithm is used to fill each of the third target holes.
[0181] Specifically, based on the determined channel closure line of the first channel, triangles within a preset range corresponding to the channel closure line are deleted, resulting in two unconnected third target holes. This involves finding triangles connected to the channel closure line on the first model and expanding a certain number of adjacent triangles outward from the corresponding position in the first model. Deleting these triangles creates two unconnected third target holes in the first channel. A hole-filling algorithm is then used to fill each third target hole separately, repairing the first channel.
[0182] In the present disclosure, when repairing the first channel, the channel closing line is expanded outward by a specified number of adjacent triangular facets, so that two unconnected holes are separated, and no self-intersection of the triangular facets will occur during the repair, thereby improving the efficiency of the repair.
[0183] The channel identification device of the three-dimensional model provided by the present disclosure is described below. The channel identification device of the three-dimensional model described below and the channel identification method of the three-dimensional model described above can be referred to each other.
[0184] FIG7 is a schematic diagram of the structure of a channel identification device for a three-dimensional model according to an embodiment of the present disclosure. As shown in FIG7 , the channel identification device 700 for a three-dimensional model includes: an acquisition module 701, a first updating module 702, and a first determining module 703; wherein,
[0185] An acquisition module 701 is configured to acquire and determine a first hole in a first model;
[0186] A first updating module 702 is configured to update the hole array based on the triangles in the first model that share the hole edge with the first hole and the traversed triangles, if there are triangles in the first model that share the hole edge with the first hole;
[0187] The first determination module 703 is used to determine a first channel based on a first target hole when the updated hole array includes at least two holes; the first target hole is the largest hole in the updated hole array; and the first channel is obtained based on two holes connected by two triangular facets.
[0188] Optionally, the acquisition module is specifically used to
[0189] When the first hole is obtained for the first time, a hole array corresponding to the target triangular face in the first model is obtained; the hole array includes the first hole corresponding to the target triangular face; the hole edge of the first hole is the edge of the target triangular face.
[0190] Optionally, the acquisition module is specifically configured to:
[0191] After obtaining the first hole for the first time, the largest hole is selected from the updated hole array as the new first hole.
[0192] Optionally, the first update module is specifically configured to:
[0193] determining the number of holes based on triangular facets in the first model that share the hole edge with the first hole;
[0194] Based on the number of holes, the hole array is updated.
[0195] Optionally, the first update module is specifically configured to:
[0196] When the number of the holes increases, determining at least two second holes; and updating the hole array based on the at least two second holes;
[0197] When the number of holes decreases, determining closed holes; and updating the hole array based on the closed holes;
[0198] When the number of holes remains unchanged, an updated first hole is determined; and based on the updated first hole, the hole array is updated.
[0199] Optionally, the first determining module is specifically configured to:
[0200] Determine a second target hole that shares the same hole edge with the first target hole after the first target hole is updated based on the newly traversed triangle patch;
[0201] The first channel is determined based on the first target hole and the second target hole.
[0202] Optionally, the device further includes:
[0203] A third determining module is configured to determine a channel closed line of the first channel; the channel closed line is a closed line corresponding to the shortest path around the first channel;
[0204] a fourth determining module, configured to determine the length of the channel closing line;
[0205] A repair module is used to repair the first channel when the length of the channel closed line is less than a preset threshold.
[0206] Optionally, the third determining module is specifically configured to:
[0207] copying the first model to form a second model;
[0208] On the second model, all processed triangular facets in the first model are deleted, the triangular facets at the intersection of the first target hole and the second target hole are retained, the two triangular facets connected to the first channel are deleted, and the shortest path algorithm is executed to obtain the channel closed line of the first channel.
[0209] Optionally, the repair module is specifically configured to:
[0210] Based on the channel closed line, deleting triangular facets within a preset range corresponding to the channel closed line to obtain two unconnected third target holes;
[0211] A hole filling algorithm is used to fill each of the third target holes.
[0212] Optionally, the third determining module is specifically configured to:
[0213] Based on the shared edge between a triangle patch last traversed by the first model and the first target hole before the boundary edge is updated, a shortest path algorithm is executed to obtain the shortest channel closed line around the first channel.
[0214] Optionally, the first updating module is specifically configured to traverse the triangular facets adjacent to the first hole in the first model one by one to search for a triangular facet that shares the hole edge with the first hole.
[0215] Optionally, the first update module is further configured to:
[0216] If there is no untraversed triangle in the first model that shares a hole edge with the first hole, deleting the first hole from the hole array;
[0217] Reselecting the largest hole from the hole array as the new first hole, and returning to execute, when there is a triangle in the first model that shares the hole edge with the first hole, updating the hole array based on the triangles in the first model that share the hole edge with the first hole, until there are no holes in the hole array.
[0218] FIG8 is a schematic structural diagram of a channel identification device for a three-dimensional model according to an embodiment of the present disclosure. As shown in FIG8 , the channel identification device 800 for a three-dimensional model includes: an acquisition module 801, a first updating module 802, a first determining module 803, an execution module 804, and a second determining module 805; wherein,
[0219] An acquisition module 801 is configured to acquire a hole array corresponding to a target triangular face in a first model; the hole array includes a first hole corresponding to the target triangular face; and a hole edge of the first hole is an edge of the target triangular face.
[0220] A first updating module 802 is configured to update the hole array based on the triangles in the first model that share the hole edge with the first hole and the traversed triangles, if there are triangles in the first model that share the hole edge with the first hole;
[0221] A first determining module 803 is configured to determine a first channel based on a first target hole when the updated hole array includes at least two holes; the first target hole is the largest hole in the updated hole array; and the first channel is obtained based on two holes connected by two triangles.
[0222] An execution module 804 is configured to use the first target hole in the updated hole array as a new first hole and repeat the above steps until there are no holes in the updated hole array.
[0223] The second determination module 805 is configured to determine a channel identification result of the first model based on all first channels.
[0224] The channel identification device of the three-dimensional model provided by the present disclosure obtains the hole array corresponding to the target triangular facet in the first model; the hole array includes the first hole corresponding to the target triangular facet; the hole edge of the first hole is the edge of the target triangular facet; when there is a triangular facet in the first model that shares a hole edge with the first hole, the hole array is updated based on the triangular facet in the first model that shares a hole edge with the first hole; when the updated hole array includes at least two holes, the first channel is determined based on the first target hole; the first target hole is the largest hole in the updated hole array; the first channel is obtained based on two holes connected by two triangular facets; the first target hole in the updated hole array is used as the new first hole, and the above steps are repeated until all holes in the hole array have no shared triangular facets; the channel identification result of the first model is determined based on all the first channels. By traversing all triangles on the model that share the hole edge with the first hole, and each triangle is traversed only once, the recognition of all first channels on the first model can be guaranteed, thereby improving the accuracy and efficiency of channel recognition.
[0225] Optionally, the first updating module 802 is specifically configured to:
[0226] determining the number of holes based on triangular facets in the first model that share the hole edge with the first hole;
[0227] Based on the number of holes, the hole array is updated.
[0228] Optionally, the first updating module 802 is further configured to:
[0229] When the number of the holes increases, determining at least two second holes; and updating the hole array based on the at least two second holes;
[0230] When the number of holes decreases, determining closed holes; and updating the hole array based on the closed holes;
[0231] When the number of holes remains unchanged, an updated first hole is determined; and based on the updated first hole, the hole array is updated.
[0232] Optionally, the first determining module 803 is specifically configured to:
[0233] Determine a second target hole that shares the same hole edge with the first target hole after the first target hole is updated based on the newly traversed triangle patch;
[0234] The first channel is determined based on the first target hole and the second target hole.
[0235] Optionally, the three-dimensional model channel identification device 800 further includes:
[0236] A third determining module is configured to determine, for each of the first channels, a channel closure line of the first channel; the channel closure line is a closure line corresponding to the shortest path around the first channel;
[0237] a fourth determining module, configured to determine the length of the channel closing line;
[0238] A repair module is used to repair the first channel when the length of the channel closed line is less than a preset threshold.
[0239] Optionally, the third determining module is specifically configured to:
[0240] copying the first model to form a second model;
[0241] For each of the first channels, all processed triangular facets in the first model are deleted on the second model, the triangular facets at the intersection of the first target hole and the second target hole are retained, the two triangular facets connected by the first channel are deleted, and the shortest path algorithm is executed to obtain the channel closed line of the first channel.
[0242] Optionally, the repair module is specifically configured to:
[0243] Based on the channel closed line, deleting triangular facets within a preset range corresponding to the channel closed line to obtain two unconnected third target holes;
[0244] A hole filling algorithm is used to fill each of the third target holes.
[0245] Optionally, the third determining module is specifically configured to:
[0246] Based on the shared edge between a triangle patch last traversed by the first model and the first target hole before the boundary edge is updated, a shortest path algorithm is executed to obtain the shortest channel closed line around the first channel.
[0247] Optionally, the first updating module is specifically configured to traverse the triangular facets adjacent to the first hole in the first model one by one to search for a triangular facet that shares the hole edge with the first hole.
[0248] Optionally, the first update module is further configured to:
[0249] If there is no untraversed triangle in the first model that shares a hole edge with the first hole, deleting the first hole from the hole array;
[0250] Reselect the largest hole from the hole array as the new first hole, and return to step B to step D.
[0251] FIG9 is a schematic diagram of the physical structure of an electronic device according to an embodiment of the present disclosure. As shown in FIG9 , the electronic device may include: a processor 910, a communications interface 720, a memory 730, and a communication bus 940. The processor 910, the communications interface 920, and the memory 930 communicate with each other via the communication bus 940. The processor 910 may call logic instructions in the memory 930 to execute a channel identification method for a three-dimensional model. The method includes:
[0252] 101 , determining a first hole in a first model.
[0253] 102. If there are triangular facets in the first model that share the hole edge with the first hole, update the hole array based on the triangular facets in the first model that share the hole edge with the first hole.
[0254] 103. When the updated hole array includes at least two holes, determine a first channel based on a first target hole; the first target hole is the largest hole in the updated hole array; and the first channel is obtained based on two holes connected by two triangular facets.
[0255] Alternatively, the method comprises:
[0256] Step A: Obtain a hole array corresponding to a target triangular face in a first model; the hole array includes a first hole corresponding to the target triangular face; a hole edge of the first hole is an edge of the target triangular face;
[0257] Step B: if there is a triangular facet in the first model that shares the hole edge with the first hole, updating the hole array based on the triangular facet in the first model that shares the hole edge with the first hole;
[0258] Step C: When the updated hole array includes at least two holes, determine a first channel based on a first target hole; the first target hole is the largest hole in the updated hole array; and the first channel is obtained based on two holes connected by two triangles.
[0259] Step D: using the first target hole in the updated hole array as a new first hole, and repeating steps B to D until there are no holes in the updated hole array;
[0260] Step E: Based on all the first channels, determine the channel identification result of the first model.
[0261] In addition, the logic instructions in the above-mentioned memory 930 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0262] On the other hand, the present disclosure further provides a computer program product, comprising a computer program. The computer program may be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can perform the channel identification method of the three-dimensional model provided by the above methods, the method comprising:
[0263] 101 , determining a first hole in a first model.
[0264] 102. If there is a triangle in the first model that shares the hole edge with the first hole, update the hole array based on the triangles in the first model that share the hole edge with the first hole and the traversed triangles.
[0265] 103. When the updated hole array includes at least two holes, determine a first channel based on a first target hole; the first target hole is the largest hole in the updated hole array; and the first channel is obtained based on two holes connected by two triangular facets.
[0266] Alternatively, the method comprises:
[0267] Step A: Obtain a hole array corresponding to a target triangular face in a first model; the hole array includes a first hole corresponding to the target triangular face; a hole edge of the first hole is an edge of the target triangular face;
[0268] Step B: if there is a triangular facet in the first model that shares the hole edge with the first hole, updating the hole array based on the triangular facets in the first model that share the hole edge with the first hole and the traversed triangular facets;
[0269] Step C: When the updated hole array includes at least two holes, determine a first channel based on a first target hole; the first target hole is the largest hole in the updated hole array; and the first channel is obtained based on two holes connected by two triangles.
[0270] Step D: using the first target hole in the updated hole array as a new first hole, and repeating steps B to D until there are no holes in the updated hole array;
[0271] Step E: Based on all the first channels, determine the channel identification result of the first model.
[0272] In another aspect, the present disclosure further provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the method for identifying a channel of a three-dimensional model provided by the above methods is implemented, the method comprising:
[0273] 101 , determining a first hole in a first model.
[0274] 102. If there is a triangle in the first model that shares the hole edge with the first hole, update the hole array based on the triangles in the first model that share the hole edge with the first hole and the traversed triangles.
[0275] 103. When the updated hole array includes at least two holes, determine a first channel based on a first target hole; the first target hole is the largest hole in the updated hole array; and the first channel is obtained based on two holes connected by two triangular facets.
[0276] Alternatively, the method comprises:
[0277] Step A: Obtain a hole array corresponding to a target triangular face in a first model; the hole array includes a first hole corresponding to the target triangular face; a hole edge of the first hole is an edge of the target triangular face;
[0278] Step B: if there is a triangular facet in the first model that shares the hole edge with the first hole, updating the hole array based on the triangular facets in the first model that share the hole edge with the first hole and the traversed triangular facets;
[0279] Step C: When the updated hole array includes at least two holes, determine a first channel based on a first target hole; the first target hole is the largest hole in the updated hole array; and the first channel is obtained based on two holes connected by two triangles.
[0280] Step D: using the first target hole in the updated hole array as a new first hole, and repeating steps B to D until there are no holes in the updated hole array;
[0281] Step E: Based on all the first channels, determine the channel identification result of the first model.
[0282] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, i.e., they may be located in one location or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of the present embodiment. Persons of ordinary skill in the art will be able to understand and implement the present invention without inventive effort.
[0283] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, or of course, by hardware. Based on this understanding, the essence of the above technical solution or the part that contributes to the existing technology can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or certain parts of the embodiments.
[0284] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present disclosure, rather than to limit them. Although the present disclosure has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present disclosure.
Claims
1. A channel identification method for a three-dimensional model, comprising: determining a first hole in the first model; If there is a triangular facet that shares the hole edge with the first hole in the first model, updating the hole array based on the triangular facet that shares the hole edge with the first hole in the first model and the traversed triangular facets; In a case where the updated hole array includes at least two holes, determining a first channel based on the first target hole; The first target hole is the largest hole in the updated hole array; and the first channel is obtained based on two holes connected by two triangular facets.
2. The method according to claim 1, wherein: In the case where the first hole is acquired for the first time, determining the first hole in the first model includes: Obtain a hole array corresponding to a target triangular facet in the first model; the hole array includes a first hole corresponding to the target triangular facet; and a hole edge of the first hole is an edge of the target triangular facet.
3. The method according to claim 1, wherein: After acquiring the first hole for the first time, determining the first hole in the first model includes: The largest hole is selected from the updated hole array as the new first hole.
4. A channel identification method for a three-dimensional model, comprising: Step A: obtaining a hole array corresponding to a target triangular facet in a first model; the hole array includes a first hole corresponding to the target triangular facet; The hole edge of the first hole is the edge of the target triangle face; Step B: when there is a triangular facet that shares the hole edge with the first hole in the first model, based on the triangular facet that shares the hole edge with the first hole in the first model and the traversed triangular facets, updating the hole array; Step C: when the updated hole array includes at least two holes, determining a first channel based on a first target hole; the first target hole is the largest hole in the updated hole array; and the first channel is obtained based on two holes connected by two triangular facets; Step D: taking the first target hole in the updated hole array as a new first hole, and repeating steps B to D until there are no holes in the updated hole array; Step E: Based on all the first channels, determine the channel identification result of the first model.
5. The method according to claim 4, wherein: The updating of the hole array based on the triangular facets in the first model that share the hole edge with the first hole comprises: Determine the number of holes based on triangular facets in the first model that share the hole edge with the first hole; Based on the number of holes, the hole array is updated.
6. The method according to claim 5, wherein: The updating of the hole array based on the number of holes comprises: In the case where the number of holes increases, determining at least two second holes; and updating the hole array based on the at least two second holes; When the number of holes decreases, determining closed holes; and updating the hole array based on the closed holes; When the number of holes remains unchanged, an updated first hole is determined; and based on the updated first hole, the hole array is updated.
7. The method according to claim 4, wherein: The step of determining the first channel based on the first target hole includes: Determine a second target hole that shares the same hole edge with the first target hole after the first target hole is updated based on the newly traversed triangle patch; The first channel is determined based on the first target hole and the second target hole.
8. The method according to any one of claims 4 to 7, further comprising: For each of the first channels, determining a channel closure line of the first channel; The channel closed line is a closed line corresponding to the shortest path around the first channel; Determining the length of the channel closure line; When the length of the channel closed line is less than a preset threshold, the first channel is repaired.
9. The method according to claim 8, wherein: The step of determining a channel closure line of each of the first channels includes: Copying the first model to form a second model; For each of the first channels, all processed triangular facets in the first model are deleted on the second model, the triangular facets at the intersection of the first target hole and the second target hole are retained, the two triangular facets connected by the first channel are deleted, and the shortest path algorithm is executed to obtain the channel closed line of the first channel.
10. The method according to claim 8, wherein: The repairing of the first channel includes: Based on the channel closed line, deleting the triangular facets within a preset range corresponding to the channel closed line to obtain two unconnected third target holes; A hole filling algorithm is used to fill each of the third target holes.
11. The method according to claim 9, wherein: The executing the shortest path algorithm to obtain the channel closure line of the first channel includes: Based on the common edge between a triangular facet traversed last by the first model and the first target hole before the boundary edge is updated, a shortest path algorithm is executed to obtain the shortest channel closed line around the first channel.
12. The method according to claim 4, wherein: In the first model, triangular facets adjacent to the first hole are traversed one by one to search for triangular facets that share the hole edge with the first hole.
13. The method according to claim 4, further comprising: If there is no untraversed triangular facet that shares a hole edge with the first hole in the first model, deleting the first hole from the hole array; Reselect the largest hole from the hole array as the new first hole, and return to execute step B-step D.
14. A channel identification device for a three-dimensional model, comprising: An acquisition module, used for acquiring and determining a first hole in a first model; A first updating module, configured to update the hole array based on the triangular facets that share the hole edge with the first hole in the first model and the traversed triangular facets, if there is a triangular facet that shares the hole edge with the first hole in the first model; A first determination module, configured to determine a first channel based on a first target hole when the updated hole array includes at least two holes; The first target hole is the largest hole in the updated hole array; and the first channel is obtained based on two holes connected by two triangular facets.
15. A channel identification device for a three-dimensional model, comprising: An acquisition module, used for acquiring a hole array corresponding to a target triangular facet in a first model; the hole array includes a first hole corresponding to the target triangular facet; a hole edge of the first hole is an edge of the target triangular facet; A first updating module, configured to update the hole array based on the triangular facets that share the hole edge with the first hole in the first model and the traversed triangular facets, if there is a triangular facet that shares the hole edge with the first hole in the first model; A first determination module, configured to determine a first channel based on a first target hole when the updated hole array includes at least two holes; The first target hole is the largest hole in the updated hole array; the first channel is obtained based on two holes connected by two triangular facets; An execution module, configured to use the first target hole in the updated hole array as a new first hole, and repeatedly execute the above steps until there are no holes in the updated hole array; The second determination module is used to determine the channel identification result of the first model based on all the first channels.
16. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the channel identification method of the three-dimensional model as claimed in any one of claims 1 to 13 is implemented.
17. A non-transitory computer-readable storage medium having a computer program stored thereon, wherein: When the computer program is executed by a processor, the channel identification method of the three-dimensional model as claimed in any one of claims 1 to 13 is implemented.
Citation Information
Patent Citations
Iterative repair method for holes of false tooth triangular mesh model
CN104504663A
Gas tightness detection method and gas tightness detection system for digital models
CN105760616A
Three-dimensional model channel identification method and device, electronic equipment and storage medium
CN117292373A
Computer implemented methods for identifying channels in a 3D volume and computer program product implementing the methods
US20150356742A1
Automatic recognition and suppression of complex interacting holes
US6597355B1