CN114202642A - Method and device for filling oversized holes in three-dimensional triangulation network model - Google Patents
Method and device for filling oversized holes in three-dimensional triangulation network model Download PDFInfo
- Publication number
- CN114202642A CN114202642A CN202111447276.0A CN202111447276A CN114202642A CN 114202642 A CN114202642 A CN 114202642A CN 202111447276 A CN202111447276 A CN 202111447276A CN 114202642 A CN114202642 A CN 114202642A
- Authority
- CN
- China
- Prior art keywords
- vertex
- boundary
- newly added
- priority
- cavity
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T19/00—Manipulating 3D models or images for computer graphics
- G06T19/20—Editing of 3D images, e.g. changing shapes or colours, aligning objects or positioning parts
Landscapes
- Engineering & Computer Science (AREA)
- Architecture (AREA)
- Computer Graphics (AREA)
- Computer Hardware Design (AREA)
- General Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Image Generation (AREA)
Abstract
The embodiment of the invention provides a method and equipment for filling an oversized cavity in a three-dimensional triangulation network model, wherein the method comprises the following steps: s1, detecting a hole boundary vertex sequence, and evaluating the priority of each vertex; s2, acquiring a newly added vertex associated with the vertex with the maximum priority, and adding the newly added vertex and the corresponding triangle into the triangulation network model; and S3, re-entering S1 until the hole is filled. According to the embodiment of the invention, the coordinates of the inserted vertex in the cavity are calculated by combining the local boundary information and the global boundary information, so that the problem of divergence in the cavity filling process is successfully solved, and a large number of experimental results prove that the method can obtain a better filling effect.
Description
Technical Field
The invention relates to the field of three-dimensional modeling or three-dimensional graphic data editing, in particular to a filling method and filling equipment for an oversized cavity in a three-dimensional triangulation network model.
Background
The technology for automatically reconstructing the three-dimensional model based on the image or the laser point cloud is mature day by day and the application of the technology is wide day by day, however, due to the fact that shooting angles, textures and other reasons are lack, a large number of holes inevitably exist in the initially generated three-dimensional model, and in order to meet data production specifications, the holes in the model must be eliminated.
At present, a great deal of research is carried out on the problem, and a representative method is as follows: firstly, directly connecting non-adjacent vertexes on the boundary of the cavity to obtain a topological complete triangulation network, then continuously inserting the vertexes, and finally obtaining a smooth and uniform triangulation network by means of interpolation fitting and the like. Another practical method is to insert new vertices and add triangles in the cavity near the boundary based on the boundary of the cavity, so that the cavity is continuously reduced and finally closed. For holes with simple shapes, the existing hole filling method can achieve the purpose, but for super-large complex holes, the two methods have poor effects, the first method is easy to generate a large number of self-intersecting triangles, and the second method can be dispersed to cause filling failure.
Disclosure of Invention
In order to solve the above problems, embodiments of the present invention provide a method and an apparatus for filling an oversized hole in a three-dimensional triangulation network model, which overcome the above problems or at least partially solve the above problems.
According to a first aspect of the embodiments of the present invention, a method for filling an oversized hole in a three-dimensional triangulation network model is provided, where the method includes: s1, detecting a hole boundary vertex sequence, and evaluating the priority of each vertex; s2, acquiring a newly added vertex associated with the vertex with the maximum priority, and adding the newly added vertex and the corresponding triangle into the triangulation network model; and S3, re-entering S1 until the hole is filled.
According to a second aspect of the embodiments of the present invention, there is provided an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor executes the computer program to implement a method for filling up a super-large hole in a three-dimensional triangulation network model provided in any one of various possible implementation manners of the first aspect.
The filling method of the oversized cavity in the three-dimensional triangulation network model provided by the embodiment of the invention comprises the steps of detecting a cavity boundary vertex sequence and evaluating the priority of each vertex; and acquiring a newly added vertex associated with the vertex with the maximum priority, adding the newly added vertex and a corresponding triangle into the triangulation network model, and calculating coordinates of the inserted vertex inside the cavity by combining local and global boundary information, thereby successfully solving the problem of divergence in the cavity filling process.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below. It is obvious that the drawings in the following description are only some embodiments of the invention, and that for a person skilled in the art, other drawings can be derived from these without inventive effort.
Fig. 1 is a schematic flow chart of a filling method for an oversized cavity in a three-dimensional triangulation network model according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a model provided in an embodiment of the present invention;
FIG. 3 is a schematic diagram of a hole filling result according to an embodiment of the present invention;
fig. 4 is a schematic physical structure diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some embodiments, but not all embodiments, of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Aiming at the problems in the prior art, the embodiment of the invention provides a method for filling an oversized cavity in a three-dimensional triangulation network model. Referring to fig. 1, the method includes, but is not limited to, the following steps:
s1, detecting the vertex sequence of the hole boundary, and evaluating the priority of each vertex.
Specifically, a hole in the three-dimensional model is detected, and this step can be implemented by using an open source library OpenMesh. As an alternative embodiment, detecting the vertex sequence of the hole boundary in S1 includes:
arranging vertexes on the boundary of the cavity in an array according to the sequence;
the method comprises the following steps of converting a hole containing a plurality of rings into a single-ring hole by bridging.
Specifically, the vertices on the hole boundary are sequentially captured into an array. The hollow may be formed of a single ring or a plurality of rings, and for a hollow including a plurality of rings, the hollow may be converted into a single-ring hollow by means of a bridge or the like, for the convenience of handling.
As an alternative embodiment, the step of evaluating the priority of each vertex in S1 includes:
and acquiring the priority of the vertex according to the opening angle of the boundary line at the vertex, wherein the smaller the opening angle is, the larger the priority is.
As an alternative embodiment, the obtaining of the priority of the vertex according to the opening angle of the boundary line at the vertex further comprises:
and taking the average value of included angles between the vertex and a plurality of connecting lines on two sides of the vertex as the field angle.
As an alternative embodiment, the step of evaluating the priority of each vertex in S1 includes:
and for the area with the inward sunken boundary, reducing the priority of the vertex in the area according to a preset amplitude.
Specifically, by narrowing a hole by inserting vertices near the hole boundary, the boundary vertices must be processed in a certain order, otherwise self-intersection is likely to occur. The priority of the vertex is mainly measured by the flare angle of the boundary line at the vertex (as < alpha in fig. 2), the mean value of the included angles of the boundary vertex and the connecting lines of a plurality of boundary vertices at two sides of the boundary vertex is used for representing that the flare angle is better than a single included angle, and the smaller the flare angle is, the larger the priority is. Special cases need to be considered, for example, for a region with a border that is concave inward (e.g., vertex A, B, C in fig. 2), the priority should be greatly reduced so as not to fill the hole in the opposite direction.
S2, acquiring a newly added vertex associated with the vertex with the maximum priority, and adding the newly added vertex and the corresponding triangle into the triangulation network model.
First, when the included angle between two edges of the boundary vertex is large, a vertex needs to be inserted into the cavity, and the newly added vertex should be located on the bisector of the boundary vertex (as shown in fig. 2, the bisector of the boundary vertex E passes through the vertex E and is equal to the included angle between the edge DE and the edge EF).
As an alternative embodiment, the obtaining of the newly added vertex associated with the vertex with the highest priority in S2 includes:
calculating the direction of the newly added peak and the distance of the newly added peak; wherein the direction of the newly added vertex is based on the following factors: minimizing the maximum of the three dihedral angles affected by the newly added vertex direction, and enabling the newly added vertex direction to point to the opposite side of the cavity boundary as far as possible;
and determining the coordinates of the newly added vertexes according to the direction and the distance.
Wherein, for the calculation of the direction, calculating the direction of the newly added vertex comprises:
calculating all intersection points of the angle bisector of the vertex and the cavity boundary line, and fitting a three-dimensional linear equation by using the intersection points;
and sequencing according to the projection positions of the intersection points on the straight line, obtaining intersection points of opposite sides of the boundary after odd-even pairing, and taking the intersection points of the opposite sides as opposite side directions.
Specifically, two factors need to be considered in determining the direction of the newly added vertex: one is to minimize the maximum of the three dihedral angles (e.g., the three dihedral angles between the four triangles 1, 2, 3, and 4 in fig. 2) affected by the new vertex direction, and the other is to make the new vertex direction point to the opposite side of the cavity boundary as much as possible. Because the newly added vertex is limited on the angular bisector of the boundary vertex, the vertex direction for minimizing the dihedral angle by calculation becomes a univariate optimization problem, and the requirement on the calculation precision is not high, so that a relatively better solution can be calculated by utilizing a variable step length direct search method. The method for calculating the opposite-side direction of the cavity boundary comprises the steps of firstly calculating all intersection points of an angle bisection plane of the boundary vertex and the cavity boundary line, fitting a three-dimensional linear equation by using the intersection points, then sequencing according to the projection positions of the intersection points on a straight line, and obtaining the intersection point of the opposite side of the boundary (such as the boundary opposite-side vertex S corresponding to the boundary vertex E in the figure 2) through odd-even pairing. And finally, calculating the weighted average value of the two directions to be used as the final vertex direction.
Wherein, aiming at the calculation of the distance, the calculation of the distance of the newly added vertex comprises the following steps:
determining the distance of the newly added vertex according to the average side length of the cavity boundary;
and adopting a distance threshold value to constrain the distance of the newly added vertex, wherein the distance threshold value is obtained by the following method: and calculating the intersection point of the boundary vertex and the angle bisector of the two adjacent boundary vertices along the direction of the newly added vertex, and taking the distance between the vertex and the two intersection points as the distance threshold.
Specifically, the distance of the newly added vertex is determined by the average side length of the boundary of the hole, but a maximum threshold is used for constraint so as to avoid the appearance of a long and narrow or intersected triangle, the method is to calculate the intersection point of the boundary vertex to the bisector of two adjacent boundary vertices along the direction, and the distance between the boundary vertex and the two intersection points is used as the maximum distance threshold of the newly added vertex (for example, the distance of the newly added vertex of the vertex E is limited by the bisector of the vertex D and the vertex F in fig. 2).
It should be noted that, in the embodiment of the present invention, if the new vertex direction is not ideal, divergence is likely to occur, that is, a program falls into an infinite loop and a hole cannot be closed all the time, by combining local and global boundary information, a dihedral angle of an adjacent triangle is made as large as possible, and the vertex direction is made as toward the other side of the boundary line as much as possible, so that the filled triangulation network is smooth in transition at a position close to the hole boundary, and is relatively flat at the middle position of the hole.
As an optional embodiment, in S2, adding the newly added vertex and the corresponding triangle into the triangulation network model, further includes:
if the included angle between two edges on the cavity boundary related to the boundary vertex is smaller than the preset angle, adding a triangle without adding the vertex to the grid model, and deleting the boundary vertex from the cavity boundary vertex sequence; otherwise, adding the vertex and two triangles into the mesh model, and replacing the original boundary vertex in the hole boundary vertex sequence with the newly added vertex.
Specifically, when the included angle between two edges located on the cavity boundary and associated with the boundary vertex is small (the appropriate threshold is 60 degrees), the steps of obtaining a new vertex in S1 and S2 should be skipped, a triangle is directly added without adding a vertex to the mesh model, and then the boundary vertex is deleted from the cavity boundary vertex sequence; otherwise, a vertex and two triangles need to be added to the mesh model, and the original boundary vertices in the hole boundary vertex sequence are replaced by the newly added vertices (for vertex E in fig. 2, vertex G and triangles 2 and 3 need to be added, and vertex G is used to replace vertex E in the hole boundary).
And S3, re-entering S1 until the hole is filled.
Specifically, the priority of the affected boundary vertex (vertex D, G, F in fig. 2) needs to be recalculated, and the next loop is entered, and when the hole boundary has only three vertices left at last, a triangle is directly added and the process is ended. The gray triangles in fig. 2 are void fill results.
The filling method of the oversized cavity in the three-dimensional triangulation network model provided by the embodiment of the invention comprises the steps of detecting a cavity boundary vertex sequence and evaluating the priority of each vertex; and acquiring a newly added vertex associated with the vertex with the maximum priority, adding the newly added vertex and a corresponding triangle into the triangulation network model, and calculating coordinates of the inserted vertex inside the cavity by combining local and global boundary information, thereby successfully solving the problem of divergence in the cavity filling process.
An embodiment of the present invention provides an electronic device, as shown in fig. 4, the electronic device includes: a processor (processor)501, a communication Interface (Communications Interface)502, a memory (memory)503, and a communication bus 504, wherein the processor 501, the communication Interface 502, and the memory 503 are configured to communicate with each other via the communication bus 504. The processor 501 may call a computer program running on the memory 503 and on the processor 501 to execute the method for filling a super-large hole in the three-dimensional triangulation network model provided by the foregoing embodiments, for example, the method includes: s1, detecting a hole boundary vertex sequence, and evaluating the priority of each vertex; s2, acquiring a newly added vertex associated with the vertex with the maximum priority, and adding the newly added vertex and the corresponding triangle into the triangulation network model; and S3, re-entering S1 until the hole is filled.
An embodiment of the present invention further provides a non-transitory computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, is implemented to perform the method for filling a super-large hole in a three-dimensional triangulation network model provided in the foregoing embodiments, and the method includes: s1, detecting a hole boundary vertex sequence, and evaluating the priority of each vertex; s2, acquiring a newly added vertex associated with the vertex with the maximum priority, and adding the newly added vertex and the corresponding triangle into the triangulation network model; and S3, re-entering S1 until the hole is filled.
It should be noted that, in the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to relevant descriptions of other embodiments for parts that are not described in detail in a certain embodiment.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, apparatus, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (devices), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.
Claims (10)
1. A filling method of an oversized cavity in a three-dimensional triangulation network model is characterized by comprising the following steps:
s1, detecting a hole boundary vertex sequence, and evaluating the priority of each vertex;
s2, acquiring a newly added vertex associated with the vertex with the maximum priority, and adding the newly added vertex and the corresponding triangle into the triangulation network model;
and S3, re-entering S1 until the hole is filled.
2. The method of claim 1, wherein detecting the sequence of hole boundary vertices in S1 comprises:
arranging vertexes on the boundary of the cavity in an array according to the sequence;
the method comprises the following steps of converting a hole containing a plurality of rings into a single-ring hole by bridging.
3. The method according to claim 1, wherein the evaluating the priority of each vertex in S1 comprises:
and acquiring the priority of the vertex according to the opening angle of the boundary line at the vertex, wherein the smaller the opening angle is, the larger the priority is.
4. The method of claim 3, wherein the obtaining the priority of the vertex according to the opening angle of the boundary line at the vertex further comprises:
and taking the average value of included angles between the vertex and a plurality of connecting lines on two sides of the vertex as the field angle.
5. The method according to claim 1 or 3, wherein the evaluating the priority of each vertex in S1 comprises:
and for the area with the inward sunken boundary, reducing the priority of the vertex in the area according to a preset amplitude.
6. The method according to claim 1, wherein the obtaining of the newly added vertex associated with the vertex with the highest priority in S2 includes:
calculating the direction of the newly added peak and the distance of the newly added peak; wherein the direction of the newly added vertex is based on the following factors: minimizing the maximum of the three dihedral angles affected by the newly added vertex direction, and enabling the newly added vertex direction to point to the opposite side of the cavity boundary as far as possible;
and determining the coordinates of the newly added vertexes according to the direction and the distance.
7. The method of claim 6, wherein calculating the direction of the newly added vertex comprises:
calculating all intersection points of the angle bisector of the vertex and the cavity boundary line, and fitting a three-dimensional linear equation by using the intersection points;
and sequencing according to the projection positions of the intersection points on the straight line, obtaining intersection points of opposite sides of the boundary after odd-even pairing, and taking the intersection points of the opposite sides as opposite side directions.
8. The method of claim 6, wherein calculating the distance of the newly added vertex comprises:
determining the distance of the newly added vertex according to the average side length of the cavity boundary;
and adopting a distance threshold value to constrain the distance of the newly added vertex, wherein the distance threshold value is obtained by the following method: and calculating the intersection point of the boundary vertex and the angle bisector of the two adjacent boundary vertices along the direction of the newly added vertex, and taking the distance between the vertex and the two intersection points as the distance threshold.
9. The method according to claim 1, wherein the adding the new vertices and the corresponding triangles into the triangulation model in S2 further comprises:
if the included angle between two edges on the cavity boundary related to the boundary vertex is smaller than the preset angle, adding a triangle without adding the vertex to the grid model, and deleting the boundary vertex from the cavity boundary vertex sequence; otherwise, adding the vertex and two triangles into the mesh model, and replacing the original boundary vertex in the hole boundary vertex sequence with the newly added vertex.
10. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the steps of the method for filling up the super-large holes in the three-dimensional triangulation network model according to any of claims 1 to 9 when executing the program.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111447276.0A CN114202642A (en) | 2021-11-26 | 2021-11-26 | Method and device for filling oversized holes in three-dimensional triangulation network model |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111447276.0A CN114202642A (en) | 2021-11-26 | 2021-11-26 | Method and device for filling oversized holes in three-dimensional triangulation network model |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114202642A true CN114202642A (en) | 2022-03-18 |
Family
ID=80649882
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111447276.0A Pending CN114202642A (en) | 2021-11-26 | 2021-11-26 | Method and device for filling oversized holes in three-dimensional triangulation network model |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114202642A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115115743A (en) * | 2022-07-06 | 2022-09-27 | 华能明台电力有限责任公司 | Method for filling cavity in three-dimensional reconstruction process |
CN115953503A (en) * | 2022-10-27 | 2023-04-11 | 北京城市网邻信息技术有限公司 | Hole texture filling method, equipment, device and storage medium |
-
2021
- 2021-11-26 CN CN202111447276.0A patent/CN114202642A/en active Pending
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115115743A (en) * | 2022-07-06 | 2022-09-27 | 华能明台电力有限责任公司 | Method for filling cavity in three-dimensional reconstruction process |
CN115953503A (en) * | 2022-10-27 | 2023-04-11 | 北京城市网邻信息技术有限公司 | Hole texture filling method, equipment, device and storage medium |
CN115953503B (en) * | 2022-10-27 | 2023-06-27 | 北京城市网邻信息技术有限公司 | Hole texture filling method, device, apparatus and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11361503B2 (en) | Systems and methods for generating volumetric models | |
JP5890105B2 (en) | Designing parts modeled by parallel geodesic lines | |
CN110167756B (en) | Build direction based partitioning for building solid objects by additive manufacturing | |
CN114202642A (en) | Method and device for filling oversized holes in three-dimensional triangulation network model | |
US8810571B2 (en) | Methods and systems for generating continuous surfaces from polygonal data | |
US9349216B2 (en) | Sketch-based generation and editing of quad meshes | |
KR20150093391A (en) | Method for rendering terrain | |
US20150127301A1 (en) | Updating A CAD Model To Reflect Global Or Local Shape Changes | |
CN113724401B (en) | Three-dimensional model cutting method and device, computer equipment and storage medium | |
CN109461209B (en) | Novel structural grid generation method | |
CN112733318A (en) | Self-adaptive mesh subdivision method, device, equipment and storage medium | |
JP2017111821A (en) | Topological change in constrained asymmetrical subdivision mesh | |
US10650586B2 (en) | Automated mesh generation | |
US10373373B2 (en) | Systems and methods for reducing the stimulation time of physics based garment simulations | |
CN113792458B (en) | Optimization method and device for finite element triangle mesh | |
CN114429535A (en) | Smooth cutting method and device for triangular mesh curved surface | |
CN111295695B (en) | Three-dimensional grid data simplifying method and device | |
US8994724B2 (en) | Methods and systems for generating continuous surfaces from polygonal data | |
CN113538695A (en) | Method and device for quickly discretizing complex curved surface with arbitrary boundary and storage medium | |
CN111985014A (en) | Modeling method and system based on standard atlas | |
CN109101674B (en) | Regularization modeling method and system for complex linear model | |
US20220414986A1 (en) | Segmenting three-dimensional meshes in graphical applications based on detection of elongated shapes | |
CN113674294A (en) | 3D model slice processing method and device | |
CN111833452B (en) | Cutting method and system for polyhedral cutting triangular net | |
CN114549795A (en) | Parameterization reconstruction method, parameterization reconstruction system, parameterization reconstruction medium and parameterization reconstruction equipment for shoe tree curved surface |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |