Triangular mesh construction method and device, electronic equipment and storage medium

By combining geographic information systems with digital twins, and utilizing the mapping relationship between geographic space and 3D space to transform coordinates and perform polygon subdivision, the accuracy and complexity issues in 3D model construction are solved, and efficient and accurate triangular mesh generation is achieved.

CN120976478APending Publication Date: 2025-11-18CHINA MOBILE (XIONGAN) ICT CO LTD +3
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511007386.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-22
Publication Date
2025-11-18

AI Technical Summary

Technical Problem

Existing technologies suffer from low accuracy and high computational complexity when constructing 3D models, especially in large-scale geographic areas. Directly using geographic coordinates or spatial rectangular coordinates to construct meshes introduces errors and incurs large computational costs. Furthermore, inconsistent spatial references of geographic coordinate data from different sources lead to complex data integration.

Method used

By obtaining the first coordinate of geographic information, the mapping relationship between geographic space and three-dimensional space is used to convert it into the second coordinate. In the case of nested polygons, the polygons are subdivided to construct a set of convex polygon points, and finally a triangular mesh is generated, which reduces the computational complexity and improves the accuracy.

Benefits of technology

It improves the accuracy of coordinate transformation and the efficiency of triangular mesh construction, reduces computational complexity, and enhances compatibility with different data sources and ease of data integration.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120976478A_ABST
    Figure CN120976478A_ABST
Patent Text Reader

Abstract

The invention discloses a triangular mesh construction method and device, electronic equipment and a storage medium, and belongs to the technical field of position, infrastructure and IT support. The method comprises the following steps: acquiring a first coordinate for indicating geographic information; converting the first coordinates into second coordinates in a three-dimensional space according to a mapping relation between a geographic space where the first coordinates are located and the three-dimensional space; under the condition that polygons corresponding to the second coordinates are nested, the polygons are subdivided, at least one first polygon point set corresponding to the polygons is obtained, and one first polygon point set is used for representing one convex polygon; and constructing a triangular mesh corresponding to the polygon according to the at least one first polygon point set. Through the above mode, the precision can be improved, and the calculation complexity can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of location, infrastructure and IT support, and in particular to a triangular mesh construction method and device, electronic equipment and storage medium. BACKGROUND

[0002] In recent years, the application and research of the combination of geographic information systems and digital twin fields have become a hot spot.

[0003] The related art mainly relies on directly using coordinates in a geographic coordinate system or converting spatial rectangular coordinates under a certain plane coordinate system as three-dimensional vertex coordinates, using the point set of the original polygon as the vertex set, and using a general polygon triangulation algorithm to construct a Mesh. Although these algorithms have relatively high universality, directly using geographic coordinates or spatial rectangular coordinates to construct a model will introduce a large error, and for large-scale geographic areas, the calculation amount of directly constructing a Mesh is very large and the computational complexity is high. SUMMARY

[0004] The present application provides a triangular mesh construction method, device, electronic equipment and storage medium, which can at least solve one of the problems of low precision and high computational complexity.

[0005] To solve the above technical problems, the present application is implemented as follows: In a first aspect, the embodiments of the present application provide a triangular mesh construction method, which comprises: acquiring a first coordinate, wherein the first coordinate is used to indicate geographic information; converting the first coordinate into a second coordinate in a three-dimensional space according to the mapping relationship between the geographic space where the first coordinate is located and the three-dimensional space; in the case that a polygon corresponding to the second coordinate is nested, performing dissection on the polygon to obtain at least one first polygon point set corresponding to the polygon, wherein one first polygon point set is used to represent a convex polygon; and constructing a triangular mesh corresponding to the polygon according to the at least one first polygon point set. In a second aspect, the embodiments of the present application provide a triangular mesh construction device, which comprises: a first acquisition module configured to acquire a first coordinate, wherein the first coordinate is used to indicate geographic information; a conversion module configured to convert the first coordinate into a second coordinate in a three-dimensional space according to the mapping relationship between the geographic space where the first coordinate is located and the three-dimensional space; a second acquisition module configured to, in the case that a polygon corresponding to the second coordinate is nested, perform dissection on the polygon to obtain at least one first polygon point set corresponding to the polygon, wherein one first polygon point set is used to represent a convex polygon; and a construction module configured to construct a triangular mesh corresponding to the polygon according to the at least one first polygon point set.

[0006] In a third aspect, an electronic device is provided, which includes a processor and a memory. The memory stores programs or instructions executable on the processor. When the programs or instructions are executed by the processor, the steps of the method according to the first aspect are implemented.

[0007] In a fourth aspect, a computer readable storage medium is provided, which stores programs or instructions. When the programs or instructions are executed by a processor, the steps of the method according to the first aspect are implemented.

[0008] In a fifth aspect, a computer program product is provided, which includes a computer program stored on a non-transitory computer readable storage medium. The computer program includes program instructions. When the program instructions are executed by a computer, the computer performs the steps of the method according to the first aspect.

[0009] The technical solutions provided in the present application can include the following beneficial effects: In the embodiments of the present application, a first coordinate indicating geographic information can be obtained. The first coordinate is converted into a second coordinate in a three-dimensional space according to a mapping relationship between a geographic space where the first coordinate is located and the three-dimensional space. In the case where a polygon corresponding to the second coordinate exists in a nested manner, the polygon is divided to obtain at least one first polygon point set for representing a convex polygon corresponding to the polygon. Finally, a triangular mesh corresponding to the polygon is constructed according to the at least one first polygon point set. Through the above manner of converting geographic latitude and longitude space data (the first coordinate) into three-dimensional scene space coordinate data (the second coordinate), the accuracy of coordinate conversion can be improved, and thus the accuracy of triangular mesh construction can be improved. Moreover, the polygon is divided based on a concave polygon to divide it into at least one convex polygon (a convex polygon is easier to generate a triangle than a concave polygon), and then a triangular mesh is constructed. In this way, not only the computational complexity can be reduced, but also the calculation efficiency can be improved while ensuring the accuracy of the spatial position.

[0010] In the embodiments of the present application, it should be understood that the foregoing general description and the following detailed description are only exemplary and explanatory, and cannot limit the present application. BRIEF DESCRIPTION OF DRAWINGS

[0011] The accompanying drawings, which are incorporated into and form part of the specification, illustrate embodiments consistent with the present application and, together with the specification, serve to explain the principles of the present application.

[0012] Figure 1 FIG. 1 shows a flowchart of a triangular mesh construction method according to an embodiment of the present application; Figure 2 Fig. 2 shows a flow diagram of another method for constructing a triangular mesh according to an embodiment of the present application; Figure 3 Fig. 3 shows a structural diagram of a device for constructing a triangular mesh according to an embodiment of the present application; Figure 4 Fig. 4 shows a structural diagram of an electronic device according to an embodiment of the present application; Figure 5 Fig. 5 shows a structural diagram of another electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0013] The exemplary embodiments will be described in detail herein below with reference to the drawings. In the following description, the same numbers in different drawings represent the same or similar elements unless otherwise represented. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they only represent examples of apparatuses and methods consistent with some aspects of the present application, as detailed in the appended claims.

[0014] In recent years, the application and research of the combination of geographic information systems and the field of digital twins have become a hot spot, especially in the field of City Information Modeling (CIM) proposed by China. There are two key problems to be solved in this combination process, one is how to effectively convert geographic information coordinates into three-dimensional scene coordinates and improve the accuracy as much as possible, and the other is to efficiently construct geographic information objects into three-dimensional scene mesh and other two-dimensional and three-dimensional objects.

[0015] In the related technical solutions, more attention is paid to the process of constructing Mesh from ordinary polygons, including ear cutting method, Delaunay triangulation method, and monotonic polygon division method, etc. Although these algorithms have relatively high universality, they have low time efficiency and do not combine the characteristics of the authenticity of geographic information data. In addition, there is less research on how to effectively convert geographic information coordinates into ordinary three-dimensional space coordinates. Most of the geographic coordinates are directly used as three-dimensional space coordinates after simple linear transformation, which loses the data accuracy and important metadata information such as topological information of geographic data, and can only be applied to local or single element scenarios, lacking or losing the most important authenticity of geographic information data, making it difficult to realize the effective conversion and application of geographic information.

[0016] The related technical solutions mainly rely on directly using the coordinates in the geographic coordinate system or converting the space rectangular coordinates under a certain plane coordinate system as three-dimensional vertex coordinates, using the point set of the original polygon as the vertex set, and using the general polygon triangulation algorithm to construct Mesh. Such a method has the following problems: (1) Precision problem: when directly using geographic coordinates or spatial rectangular coordinates to construct a model, a large error will be introduced.

[0017] (2) Computational complexity: for a large geographic area, the calculation of directly constructing a Mesh is very large, and the computational complexity is too high.

[0018] (3) Data compatibility: different sources of geographic coordinate data use different spatial references, resulting in complex data integration and conversion process.

[0019] To solve the above technical problems, the present application provides a triangular mesh construction scheme.

[0020] Figure 1 Fig. 1 shows a flowchart of a triangular mesh construction method provided by an example embodiment of the present application, which can be executed by an electronic device. The electronic device can be a mobile phone, a computer, or the like. As shown in Fig. 1, the method mainly includes the following steps: Figure 1 S101: Obtain a first coordinate.

[0021] The first coordinate is used to indicate geographic information.

[0022] In actual application, the first coordinate includes the latitude and longitude coordinates of the coordinate point, and can also include elevation data (the distance of the point along the vertical line to the reference surface).

[0023] S102: According to the mapping relationship between the geographic space where the first coordinate is located and the three-dimensional space, convert the first coordinate into a second coordinate in the three-dimensional space.

[0024] In the present application, according to the mapping relationship between the geographic space (geographic latitude and longitude space) where the first coordinate is located and the three-dimensional space (three-dimensional scene space), the conversion of geographic latitude and longitude space data to three-dimensional scene space coordinate data can be realized, and the first coordinate can be converted into a second coordinate in the three-dimensional space. In this way, not only the result precision of the conversion of geographic coordinates to spatial coordinates in the Mesh construction process can be improved, but also the representation precision of the Mesh construction result can be indirectly improved.

[0025] S103: In the case where the polygon corresponding to the second coordinate exists in a nested manner, the polygon is divided to obtain at least one first polygon point set corresponding to the polygon.

[0026] One of the first polygon point sets is used to represent a convex polygon.

[0027] ​In practical applications, the polygon is a polygon represented by geographic spatial latitude and longitude coordinates that meets topological rules and can be used to describe geographic information. In practical applications, a polygon is composed of a set of discrete points (vertices), and the point set is usually represented by an ordered sequence, for example, the points can be sorted in a counterclockwise or clockwise direction, which is not limited in the embodiments of the present application. In the embodiments of the present application, the converted second coordinates can be used to determine the polygon. In the case where the polygon has nesting, the polygon can be divided to obtain at least one second polygon point set corresponding to the polygon for representing a convex polygon. That is, the polygon with nesting is divided into at least one convex polygon. Since the convex polygon is easier to be divided into triangles, the computational complexity can be reduced, and the efficiency is higher.

[0028] In the case where the polygon does not have nesting and is a convex polygon, the polygon can be directly triangulated to construct a triangular mesh corresponding to the polygon. The specific steps are not limited in the embodiments of the present application.

[0029] S104: Construct a triangular mesh corresponding to the polygon according to the at least one first polygon point set.

[0030] In the embodiments of the present application, the at least one second polygon point set can be used to construct a triangular mesh corresponding to the polygon. The triangular mesh constructed by the above method is a relatively simple triangular mesh for describing polygon data, and the work efficiency of construction is significantly improved.

[0031] In the embodiments of the present application, the first coordinates for indicating geographic information can be obtained, and the first coordinates are converted into second coordinates in a three-dimensional space according to the mapping relationship between the geographic space where the first coordinates are located and the three-dimensional space. In the case where the polygon corresponding to the second coordinates has nesting, the polygon is divided to obtain at least one first polygon point set corresponding to the polygon for representing a convex polygon. Finally, the triangular mesh corresponding to the polygon is constructed according to the at least one first polygon point set. Through the above method for converting geographic latitude and longitude space data (first coordinates) into three-dimensional scene space coordinate data (second coordinates), the accuracy of coordinate conversion can be improved, and the accuracy of triangular mesh construction can be improved. Moreover, the polygon is divided based on a concave polygon to divide it into at least one convex polygon (a convex polygon is easier to generate a triangle than a concave polygon), and then a triangular mesh is constructed. In this way, the computational complexity can be reduced, and the calculation efficiency can be improved while ensuring the accuracy of the spatial position.

[0032] In the process of applying the combination of geographic information and digital twin, the basic map of the three-dimensional scene is usually directly derived from the vector map (usually a polygon type geometric object) in the GIS field, and geographic information data produced by different regions and different production methods may use different spatial references. In order to correctly preserve and use accurate geographic information in the same space, it is necessary to ensure that all geographic information is in the same spatial reference. Therefore, in actual application, the original geographic information data can be preprocessed.

[0033] In an optional implementation, the obtaining the first coordinate can include the following steps: Step 1011, obtaining a third coordinate set of different sources.

[0034] In actual application, the third coordinate can represent the original geographic information data.

[0035] Step 1012, converting the third coordinate into a first coordinate under a preset spatial reference.

[0036] In the embodiments of the present application, the third coordinates of different sources can be uniformly converted into the first coordinates under the preset spatial reference. For example, the preset spatial reference can be China Geodetic Coordinate System 2000 (CGCS2000) spatial reference. The type of the preset spatial reference is not limited in the embodiments of the present application.

[0037] In the case where the preset spatial reference is CGCS2000 spatial reference, the third coordinates under the multi-source spatial reference can be converted into the first coordinates under the unified CGCS2000 spatial reference by using two middleware of NetTopologySuite and Proj6.

[0038] By converting the third coordinates under different spatial references into the first coordinates under the preset spatial reference through the above steps, the compatibility of different data sources can be enhanced, and the process of data integration and conversion can be simplified.

[0039] In an optional implementation, the converting the first coordinate into a second coordinate in the three-dimensional space according to the mapping relationship between the geographic space where the first coordinate is located and the three-dimensional space can include the following steps: Step 1021, determining the mapping relationship between the geographic space where the first coordinate is located and the three-dimensional space according to the spatial boundary range of the geographic space and the scaling ratio between the geographic space and the three-dimensional space; Step 1022, performing normalization processing on the first coordinate to obtain a fourth coordinate corresponding to the first coordinate; At step 1023, the second coordinate corresponding to the first coordinate in the three-dimensional space is obtained according to the mapping relationship and the fourth coordinate.

[0040] In the embodiments of the present application, when determining the mapping relationship between the geographical space and the three-dimensional space, the range of the coordinate in the three-dimensional space can be calculated. For example, the data range corresponding to the spatial coordinate in the three-dimensional scene can be calculated according to the envelope range (the range of the geographical space where the first coordinate is located) of the original space coordinate latitude and longitude, and the calculation steps are realized by the following formula:

[0041]

[0042]

[0043]

[0044]

[0045]

[0046]

[0047]

[0048] wherein, represents the maximum latitude, represents the minimum latitude, represents the maximum longitude, represents the minimum longitude, ER (full name EarthR) represents the radius of the earth (unit: km), represents the maximum height, represents the minimum height, SBase represents the basic scaling ratio (for example, in actual application, it can be 1000), represents the scaling ratio in the height direction, represents the scaling ratio in the x-axis direction (for example, in actual application, it can be 1), represents the scaling ratio in the y-axis direction, represents the scaling ratio in the z-axis direction.

[0049] The calculation idea of the above formula is that firstly, the minimum / maximum longitude ( / ) and the minimum / maximum latitude ( / ), and further calculate the X-axis size of the target region after projection and scaling . The original minimum / maximum latitude is converted to the Z-axis size of the target region after projection and scaling . The formula for calculating the minimum / maximum z-axis coordinate value in the spatial range of the target region (three-dimensional space) is not described here / . The original minimum / maximum height is converted to the Y-axis size of the target region after projection and scaling .

[0050] Finally, the size of the target region is declared using the self-defined three-dimensional description type (the self-defined class based on three double types), i.e. . In this way, the specific size of the target region in the geometric shape can be specified, including the X-axis size, the Z-axis size, and the Y-axis size. According to and the original input spatial description information (the range of original spatial coordinates latitude, longitude, and height), the application scale of the target region is calculated for subsequent calculations.

[0051] The conversion process describes the standard latitude, longitude, and height information of the three-dimensional space as a spatial clipping region. The description of the region uses two self-defined three-dimensional description types and , which can describe any size and position of the region space without losing precision, serving as the basis for subsequent calculations.

[0052] In actual applications, the spatial boundary range of the geographic space where the first coordinate is located and the scaling ratio of the geographic space and the three-dimensional space can be used to determine the corresponding data range of the three-dimensional space, and further determine the mapping relationship between the geographic space and the three-dimensional space. The main purpose of the above steps is to prevent the geographic coordinates (first coordinates) from being directly used as three-dimensional space coordinates (second coordinates) after simple linear transformation, in order to prevent loss of data precision and important metadata information such as topological information of geographic data.

[0053] In actual applications, for step 1022, due to the characteristics of latitude and longitude coordinates and the effective number of bits of coordinate data in a three-dimensional space scenario, and in order to preserve the precision of coordinate data as much as possible, the data can be dimensionless by normalization. The first coordinate is normalized to obtain the fourth coordinate corresponding to the first coordinate. Since the maximum and minimum values of latitude and longitude coordinates are always determined, in actual applications, the maximum and minimum normalization method can be used for normalization of geographic space latitude and longitude coordinates.

[0054] For the longitude coordinate, the normalized longitude value mx is calculated by the following formula:

[0055] For the latitude coordinate, the normalized latitude value my is calculated by the following formula:

[0056]

[0057] In practical applications, other ways of normalizing the first coordinate can also be used, and the embodiments of the present application are not limited in this regard.

[0058] By combining the normalized result of the geographic longitude and latitude coordinates (the fourth coordinate) obtained in the above step 1022 with the proportional mapping relationship of the three-dimensional space data frame obtained in step 1021, a final second coordinate CoordWorld of a geographic longitude and latitude coordinate (the first coordinate) in the ordinary three-dimensional space can be calculated, and the main calculation formula is as follows:

[0059]

[0060]

[0061]

[0062] wherein, represents the origin offset of the three-dimensional scene, and is set to (0, 0, 0) by default. In practical applications, it can be set according to the scene range in actual application.

[0063] In the above coordinate conversion process, special attention should be paid to the process of height conversion. The height of each polygon element can be mapped to the three-dimensional space by using Digital Elevation Model (DEM) data or other height information to form a preliminary three-dimensional scene coordinate.

[0064] It should be noted that in practical applications, the values of the height conversion factors SCoof_y and SZone_y can be determined according to the size of the scene, the range of the height value, and the sharpening degree of the conversion result, so as to ensure the optimization of the height data result in the three-dimensional scene. Secondly, in the mapping relationship of the height coordinate in the geographic space and the ordinary three-dimensional space, the Z coordinate in the geographic longitude and latitude represents the height, and in the conversion to the ordinary three-dimensional scene, the Y coordinate represents the height.

[0065] In practical applications, the spatial polygon data source input by the user can be in different formats, and therefore, the point set data describing the polygon can be preprocessed. In practical applications, the read-in original polygon point set in different construction modes can be arranged in a counterclockwise order, and then, according to a preset tolerance, collinear adjacent points smaller than the preset tolerance can be removed, and / or according to a Levels of Detail (LOD) setting level parameter, non-feature points of the polygon curve can be removed, to obtain the original point set .

[0066] In practical applications, the preset tolerance can be determined in combination with the actual meaning of the geographic spatial latitude and longitude data and the CIM data grading standard, for example, the preset tolerance can be set as 0.0001 m. Through the above steps, the point set in different construction modes is processed, the point set of the polygon is obtained, the unimportant points can be removed, and therefore, the complexity of the data can be significantly reduced, the complexity of data processing is reduced, the calculation time and storage requirement are reduced, the quality of the data is improved, and the accuracy and reliability of the final result are ensured.

[0067] In an optional implementation, the at least one first polygon point set includes at least one second polygon point set and at least one bridging branch. The splitting of the polygon to obtain the at least one first polygon point set corresponding to the polygon can include the following steps: Step 1031, connecting the outer ring and the inner ring of the polygon to obtain a first main chain corresponding to the polygon and at least one bridging branch, wherein the first main chain is a point set corresponding to a concave polygon, and the bridging branch is a point set corresponding to a convex polygon. Step 1032, segmenting the first main chain to obtain at least one second polygon point set, wherein the second polygon point set is a point set corresponding to a convex polygon.

[0068] In the embodiments of the present application, in the case where the polygon is nested, the inner and outer rings of the polygon can be analyzed to process the complex polygon nesting. In practical applications, the inner and outer rings of the polygon can be connected to obtain a first main chain corresponding to the polygon and at least one bridging branch corresponding to a convex polygon, and then the first main chain can be further segmented into at least one second polygon point set, so that the originally complex polygon is segmented into multiple convex polygons, which not only facilitates further segmentation into triangles to improve the calculation efficiency, but also reduces the calculation complexity.

[0069] In an alternative implementation, the connecting the outer ring and the inner ring of the polygon to obtain the first main chain corresponding to the polygon and the at least one bridge branch can include the following steps: Step 1, for the first chain corresponding to the polygon, constructing the bridge branch of the first chain and a second main chain in the polygon, wherein the second main chain is a polygon point set for describing an outer ring of the polygon, and the first chain is a polygon point set for describing an inner ring of the polygon; Step 2, connecting the second main chain and the first chain through the vertices of the bridge branch in a counterclockwise direction to generate a third main chain, wherein the third main chain is a polygon point set for describing a new outer ring of the polygon; Step 3, repeating the above operation for a second chain other than the first chain in the polygon to obtain the first main chain and the at least one bridge branch.

[0070] In the embodiments of the present application, first, an outermost polygon point set of a polygon is recorded as an outer ring, and a first polygon point set of the polygon is extracted from the original polygon point set to describe the outer ring. Meanwhile, all inner polygon point sets are recorded as inner rings, and L temporary chains of the inner rings are extracted from the original polygon point set to describe the inner rings.

[0071] Next, for a first chain of an inner ring of the polygon, a bridge branch of the first chain and a second main chain is constructed. The bridge branch is composed of four points, i.e., two adjacent points on the second main chain and two adjacent points on the first chain, and a quadrilateral formed by the four points does not intersect any remaining boundary line segment. Each branch quadrilateral is necessarily a convex point set which can be regarded as a part of a final triangular mesh, and the point set is composed of a quadrilateral formed by two triangles. The convex point set is temporarily stored, and a second main chain and the first chain are connected in a counterclockwise direction to form a new main chain (third main chain) , which is used as a main chain for subsequent main chain merging. The new main chain at this time constitutes a new outer ring polygon formed by connecting the outer ring polygon and the inner ring polygon through the bridge branch. The new outer ring polygon surrounds all the remaining inner ring polygons, removes the inner ring region, and is adjacent to the polygon of the bridge branch and does not cover it.

[0072] For the remaining L-1 chains (second chains other than the first chain) of the polygon, the above merging operation is repeated, and finally a first main chain to be divided ​and L sets of bridge branch points .

[0073] By the above manner, the first main chain and the at least one convex polygon constituting the bridge branch to be segmented are obtained, the part of the polygon originally existing in nesting can be split, the calculation complexity can be reduced, and the efficiency can be improved and the time for obtaining the triangular mesh can be saved by gradually segmenting into convex polygons.

[0074] In an optional implementation, segmenting the first main chain to obtain the at least one second polygon point set can include the following steps: Step 1, determining whether a target angle formed by a first vertex, a second vertex and a third vertex in the first main chain is a concave angle, wherein the first vertex is adjacent to the second vertex, and the second vertex is adjacent to the third vertex; Step 2, in the case that the target angle is a concave angle, obtaining a candidate cut point pair set corresponding to the target angle by performing cross multiplication on the first vertex and a vertex adjacent to the first vertex; Step 3, determining a fourth vertex as a point in the candidate cut point pair set closest to the first vertex in a forward direction, Step 4, determining a fifth vertex from among vertices adjacent to the fourth vertex and the first vertex, wherein the fifth vertex is a minimum in-circle point corresponding to the first main chain; Step 5, segmenting the first main chain into three sub-point sets using the first vertex, the fourth vertex and the fifth vertex; Step 6, repeating the above operations on the sub-point sets, and in the case that there is no concave angle in the sub-point sets, determining the sub-point sets as the second polygon point set.

[0075] In the embodiments of the present application, the first main chain can be segmented to obtain at least one second polygon point set. In actual application, the first main chain may be regarded as a concave polygon fusing an inner ring and an outer ring. The first main chain point set describing the concave polygon may be calculated point by point, and it is determined whether a target angle formed by a first vertex , a second vertex , and a third vertex (i n) is a concave angle, and in the case that the target angle is not a concave angle, the loop continues; otherwise, if the angle in which the point is located is a concave angle, cross multiplication is performed on a sub-point pair adjacent to the point to find a candidate cut point pair set for the target angle; a fourth vertex is obtained by finding a point in the candidate cut point pair set closest to the first vertex in a forward direction ; and a fifth vertex is determined from among vertices adjacent to the fourth vertex and the first vertex, wherein the fifth vertex is a minimum in-circle point corresponding to the first main chain . Beginning, until Find the minimum internal point. ;Utilizing points , , The original first main chain point set It is divided into three subsets, namely: , , .

[0076] To each , , The above operation is repeated for the three subsets of points until all subsets of points have no concave corners. At this point, a third polygon set of points can be obtained, for example, u spatially adjacent and non-overlapping convex polygons, corresponding to u point sets. . In practical applications, the above u point sets And the point set of the L bridging branches that have already been obtained. (It also satisfies the condition of spatially adjacent and non-overlapping convex polygons), and can form at least one first polygon point set, i.e., w convex point sets. .

[0077] In an optional implementation, constructing the triangular mesh corresponding to the polygon based on the at least one second polygon point set may include the following steps: Step 1041: Assign vertex indices to the at least one first polygon point set; Step 1042: Select the starting point of the first polygon point set as the sixth vertex, and obtain the triangle corresponding to the first polygon point set based on the sixth vertex, the seventh vertex, and the eighth vertex, wherein the seventh vertex and the eighth vertex are vertices in the second polygon point set other than the sixth vertex, and the seventh vertex and the eighth vertex are adjacent. Step 1043: Input at least one triangle into the polygon builder to obtain the constructed triangular mesh output by the polygon builder.

[0078] In practical applications, w sets of convex points can be used. The vertex index assignment is performed in sequence. The vertex index is an integer array, which can be used to indicate the vertices used by each primitive (such as a triangle or a line segment). Through the vertex index, vertex data can be reused, reducing memory occupation and improving rendering efficiency. Since each first polygon point set represents a convex polygon at this time, it can be divided into at least one triangle. For example, the number of vertices of the convex polygon is k, so P0 can be taken as the common vertex (the sixth vertex), and the vertex indices from P1 to P k-1 are recorded in sequence to construct (P0, P1, P2), (P0, P2, P3), …, (P0, P k-2 , P k-1 ) k-2 triangles. Through this method, the final polygon subdivision point set TrianglesDirectory<indices, coordinate> is obtained, which is passed to the polygon builder to complete the final construction of the triangular mesh Mesh. The triangular mesh constructed by this method is the simplest triangular mesh that describes the original polygon data, and the construction method has greatly improved the efficiency compared to the related art method.

[0079] Using the method in the embodiments of the present application to construct a triangular mesh not only significantly reduces the computational complexity, but also has stronger applicability in the batch generation of three-dimensional scene Mesh baseboards from geographic information data polygons, and the triangular subdivision algorithm in the embodiments of the present application has tens of times improvement in efficiency compared to the traditional triangular mesh construction method, and the generated result has better space occupation, which helps to save space resources.

[0080] In actual application, for the constructed triangular mesh Mesh, uv (texture coordinates) can be further calculated, texture information and detail features can be added to improve the realism and visual effect of the three-dimensional scene.

[0081] Figure 2 A flowchart of another triangular mesh construction method provided by an example embodiment of the present application is shown. As shown in Figure 2 , the method mainly includes the following steps: Step 201: Latitude and longitude polygon input.

[0082] Step 202: Geographic data preprocessing.

[0083] Step 203: Conversion of geographic coordinates to general three-dimensional scene coordinates.

[0084] Step 204: Efficient triangular mesh Mesh construction based on concave polygon subdivision.

[0085] Step 205: Texture mapping and detail enhancement.

[0086] Step 206: End and output.

[0087] The triangle mesh construction method provided in the embodiments of the present application can be executed by a triangle mesh construction device. The triangle mesh construction device provided in the embodiments of the present application is described by taking the triangle mesh construction device executing the triangle mesh construction method as an example.

[0088] Figure 3 A structure diagram of a triangle mesh construction device provided in an example embodiment of the present application is shown. The triangle mesh construction device can implement all or part of the embodiments shown in the drawings. Figure 1 The triangle mesh construction device includes a first obtaining module 301, a conversion module 302, a second obtaining module 303, and a construction module 304.

[0089] In the embodiments of the present application, the first obtaining module 301 is configured to obtain a first coordinate, wherein the first coordinate is used to indicate geographic information. The conversion module 302 is configured to convert the first coordinate into a second coordinate in a three-dimensional space according to a mapping relationship between a geographic space where the first coordinate is located and the three-dimensional space. The second obtaining module 303 is configured to, in a case where a polygon corresponding to the second coordinate exists in nesting, subdivide the polygon to obtain at least one first polygon point set corresponding to the polygon, wherein one first polygon point set is used to represent one convex polygon. The construction module 304 is configured to construct a triangle mesh corresponding to the polygon according to the at least one first polygon point set.

[0090] In an optional implementation, the first obtaining module 301 is configured to obtain the first coordinate, including: obtaining third coordinates of different sources; converting the third coordinates into the first coordinates under a preset space reference.

[0091] In an optional implementation, the conversion module 302 is configured to convert the first coordinate into the second coordinate in the three-dimensional space according to the mapping relationship between the geographic space where the first coordinate is located and the three-dimensional space, including: determining the mapping relationship between the geographic space where the first coordinate is located and the three-dimensional space according to a space boundary range of the geographic space and a scaling ratio between the geographic space and the three-dimensional space; performing normalization processing on the first coordinate to obtain a fourth coordinate corresponding to the first coordinate; obtaining the second coordinate corresponding to the first coordinate in the three-dimensional space according to the mapping relationship and the fourth coordinate.

[0092] In an optional implementation, the at least one first polygon point set includes at least one second polygon point set and at least one bridging branch. The second obtaining module 303 is configured to perform the splitting on the polygon to obtain at least one first polygon point set corresponding to the polygon, including: connecting the outer ring and the inner ring of the polygon to obtain a first main chain corresponding to the polygon and at least one bridge branch, wherein the first main chain is a point set corresponding to a concave polygon, and the bridge branch is a point set corresponding to a convex polygon; segmenting the first main chain to obtain at least one second polygon point set, wherein the second polygon point set is a point set corresponding to a convex polygon.

[0093] In an optional implementation, the second obtaining module 303 is configured to perform the connecting on the outer ring and the inner ring of the polygon to obtain the first main chain corresponding to the polygon and the at least one bridge branch, including: constructing, for a first branch corresponding to the polygon, the first branch and a bridge branch of a second main chain in the polygon, wherein the second main chain is a polygon point set used to describe the outer ring of the polygon, and the first branch is a polygon point set used to describe the inner ring of the polygon; connecting the second main chain and the first branch through the vertex of the bridge branch in a counterclockwise direction to generate a third main chain, wherein the third main chain is a polygon point set used to describe a new outer ring of the polygon; repeating the above operation on a second branch in the polygon except the first branch to obtain the first main chain and the at least one bridge branch.

[0094] In an optional implementation, the second obtaining module 303 is configured to perform the segmenting on the first main chain to obtain the at least one second polygon point set, including: determining whether a target angle formed by a first vertex, a second vertex and a third vertex in the first main chain is a concave angle, wherein the first vertex is adjacent to the second vertex, and the second vertex is adjacent to the third vertex; in a case where the target angle is a concave angle, obtaining a candidate cut point pair set corresponding to the target angle by performing a cross multiplication operation on the first vertex and a vertex adjacent to the first vertex; determining a fourth vertex as a point in the candidate cut point pair set closest to the first vertex in a forward direction, determining a fifth vertex from a vertex adjacent to the fourth vertex to the first vertex, wherein the fifth vertex is a minimum inscribed point corresponding to the first main chain; segmenting the first main chain into three sub-point sets by using the first vertex, the fourth vertex and the fifth vertex; The above operation is repeated on the sub-point set, and in a case where there is no concave angle in the sub-point set, the sub-point set is determined as the second polygon point set.

[0095] In an optional implementation, the construction module 304 is configured to construct the triangular mesh corresponding to the polygon according to the at least one second polygon point set, including: The second coordinates are used for vertex index assignment of the at least one second polygon point set; A starting point in the second polygon point set is selected as a sixth vertex, and a triangular shape corresponding to the second polygon point set is obtained according to the sixth vertex, a seventh vertex and an eighth vertex, where the seventh vertex and the eighth vertex are vertices in the second polygon point set except the sixth vertex, and the seventh vertex and the eighth vertex are adjacent to each other; The at least one triangular shape is input into a polygon constructor, and a constructed triangular mesh output by the polygon constructor is obtained.

[0096] The triangular mesh construction apparatus in the embodiments of the present application can be an electronic device or a component in an electronic device, for example, an integrated circuit or a chip. The electronic device can be a terminal or other devices other than a terminal. For example, the electronic device can be a mobile phone, a tablet computer, a notebook computer, a palm computer, a vehicle-mounted electronic device, a Mobile Internet Device (MID), an augmented reality (AR) / virtual reality (VR) device, a robot, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA), and the like, and can also be a server, a Network Attached Storage (NAS), a personal computer (PC), a television (TV), a teller machine, or a self-service machine, and the like, and the embodiments of the present application are not limited in this regard.

[0097] The triangular mesh construction apparatus in the embodiments of the present application can be an apparatus having an operating system. The operating system can be an Android operating system, an ios operating system, or other possible operating systems, and the embodiments of the present application are not limited in this regard.

[0098] The triangular mesh construction apparatus provided in the embodiments of the present application can achieve the following advantages. Figure 1The various processes implemented by the method embodiments of the first aspect are not repeated here to avoid repetition.

[0099] Optionally, as shown in Figure 4 The electronic device 400 is provided in the embodiments of the present application, and includes a processor 401 and a memory 402. The memory 402 has a program or instructions stored thereon, which can be run on the processor 401. When the program or instructions are executed by the processor 401, the above-mentioned Figure 1 The various steps of the triangular mesh construction method shown in FIG. 6 are not repeated here to avoid repetition, and the same technical effects can be achieved.

[0100] It should be noted that the electronic device in the embodiments of the present application includes the mobile electronic device and the non-mobile electronic device described above.

[0101] Figure 5 A structure block diagram of another electronic device 500 is shown, which is shown in an exemplary embodiment of the present application. The electronic device 500 can be implemented as a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart watch, a television, etc. The electronic device 500 can also be referred to as a user equipment, a portable terminal, a laptop terminal, a desktop terminal, etc.

[0102] Generally, the electronic device 500 includes a processor 501 and a memory 502.

[0103] The processor 501 can include one or more processing cores, such as an 8-core processor, a 10-core processor, etc. The processor 501 can be implemented in at least one of a hardware form of a DSP (Digital Signal Processing), an FPGA (Field-Programmable Gate Array), and a PLA (Programmable Logic Array). The processor 501 can also include a main processor and a coprocessor. The main processor is a processor for processing data in an awake state, also known as a CPU (Central Processing Unit). The coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 501 can be integrated with a GPU (Graphics Processing Unit) for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 501 can also include an AI (Artificial Intelligence) processor for processing machine learning-related computing operations.

[0104] Memory 502 may include one or more computer-readable storage media, which may be non-transitory. Memory 502 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In some embodiments, the non-transitory computer-readable storage media in memory 502 is used to store at least one instruction, which is executed by processor 501 to implement all or part of the steps in the triangular mesh construction method shown in the method embodiments of this application.

[0105] In some embodiments, the electronic device 500 may also optionally include a peripheral device interface 503 and at least one peripheral device. The processor 501, memory 502, and peripheral device interface 503 can be connected via a bus or signal line. Each peripheral device can be connected to the peripheral device interface 503 via a bus, signal line, or circuit board. Specifically, the peripheral device includes at least one of the following: a radio frequency circuit 504, a display screen 505, a camera assembly 506, an audio circuit 507, and a power supply 508.

[0106] In some embodiments, the electronic device 500 further includes one or more sensors 509. The one or more sensors 509 include, but are not limited to, an accelerometer 510, a gyroscope 511, a pressure sensor 512, an optical sensor 513, and a proximity sensor 514.

[0107] Those skilled in the art will understand that Figure 5 The structure shown does not constitute a limitation on the electronic device 500, and may include more or fewer components than shown, or combine certain components, or use different component arrangements.

[0108] This application also provides a computer-readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the various processes of the above-described triangular mesh construction method and achieve the same technical effect. To avoid repetition, they will not be described again here.

[0109] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.

[0110] This application embodiment also provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement the various processes of the above-described triangular mesh construction method and achieve the same technical effect. To avoid repetition, it will not be described again here.

[0111] It should be understood that the chip mentioned in the embodiments of the present application can also be referred to as a system-level chip, a system chip, a chip system, or a system-on-chip chip, etc.

[0112] The embodiments of the present application also provide a computer program product, which comprises a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions which, when executed by a computer, implement the steps of the above-mentioned triangular mesh construction method and achieve the same technical effects. To avoid repetition, details are not described here.

[0113] Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the application disclosed herein. The specification and examples given are exemplary only and the true scope and spirit of the application are indicated by the claims. The true scope and spirit of the application are indicated by the claims.

[0114] It should be understood that the present application is not limited to the precise construction that has been described above and shown in the accompanying drawings, and that various modifications and changes can be made by those skilled in the art without departing from the scope of the application. The scope of the application is indicated only by the appended claims.

Claims

1. A method for constructing triangular meshes, characterized in that, include: Obtain the first coordinates, wherein the first coordinates are used to indicate geographic information; Based on the mapping relationship between the geographic space and the three-dimensional space where the first coordinate is located, the first coordinate is converted into a second coordinate in the three-dimensional space; In the case where the polygons corresponding to the second coordinates are nested, the polygons are subdivided to obtain at least one first polygon point set corresponding to the polygons, wherein a first polygon point set is used to represent a convex polygon. Based on the at least one set of first polygon points, construct the triangular mesh corresponding to the polygon.

2. The method according to claim 1, characterized in that, Obtaining the first coordinate includes: Obtain third coordinates from different sources; The third coordinate is converted into the first coordinate under a preset spatial reference.

3. The method according to claim 1, characterized in that, The step of converting the first coordinates into second coordinates in the three-dimensional space based on the mapping relationship between the geographic space and the three-dimensional space includes: The mapping relationship between the geographic space and the three-dimensional space is determined based on the spatial boundary range of the geographic space where the first coordinate is located and the scaling ratio between the geographic space and the three-dimensional space. The first coordinate is normalized to obtain the fourth coordinate corresponding to the first coordinate. Based on the mapping relationship and the fourth coordinate, the second coordinate corresponding to the first coordinate in the three-dimensional space is obtained.

4. The method according to claim 1, characterized in that, The at least one first polygon point set includes: at least one second polygon point set and at least one bridging branch; The step of subdividing the polygon to obtain at least one first polygon point set corresponding to the polygon includes: Connect the outer and inner rings of the polygon to obtain the first main chain corresponding to the polygon and at least one bridging branch, wherein the first main chain is the point set corresponding to the concave polygon and the bridging branch is the point set corresponding to the convex polygon. The first main chain is segmented to obtain at least one second polygon point set, wherein the second polygon point set is the point set corresponding to the convex polygon.

5. The method according to claim 4, characterized in that, The step of connecting the outer and inner rings of the polygon to obtain the first main chain corresponding to the polygon and at least one bridging branch includes: For the first branch corresponding to the polygon, a bridging branch is constructed between the first branch and the second main chain in the polygon, wherein the second main chain is a polygon point set used to describe the outer ring of the polygon, and the first branch is a polygon point set used to describe the inner ring of the polygon. The second main chain and the first branch chain are connected in a counterclockwise direction through the vertices of the bridging branch to generate a third main chain, wherein the third main chain is a polygon point set used to describe a new outer ring of the polygon. Repeat the above operation on the second branch chain in the polygon other than the first branch chain to obtain the first main chain and at least one of the bridging branches.

6. The method according to claim 4, characterized in that, The step of segmenting the first main chain to obtain at least one set of second polygonal points includes: Determine whether the target angle formed by the first vertex, the second vertex, and the third vertex in the first main chain is a concave angle, wherein the first vertex is adjacent to the second vertex, and the second vertex is adjacent to the third vertex; When the target angle is a concave angle, a set of candidate cutting point pairs corresponding to the target angle is obtained by performing a cross product operation on the first vertex and the vertices that are not adjacent to the first vertex; The fourth vertex is determined as the point in the candidate cutting point pair set that is closest to the first vertex in the positive direction. From the adjacent vertices of the fourth vertex to the first vertex, determine the fifth vertex, wherein the fifth vertex is the minimum inscribed point corresponding to the first main chain; The first main chain is divided into three subsets using the first vertex, the fourth vertex, and the fifth vertex; Repeat the above operation on the sub-point set, and if the sub-point set does not have concave corners, determine the sub-point set as the second polygon point set.

7. The method according to any one of claims 1 to 6, characterized in that, The step of constructing the triangular mesh corresponding to the polygon based on the at least one set of first polygon points includes: Assign vertex indices to the at least one set of first polygon points; The starting point of the first polygon point set is selected as the sixth vertex. Based on the sixth vertex, the seventh vertex, and the eighth vertex, the triangle corresponding to the first polygon point set is obtained. The seventh vertex and the eighth vertex are vertices in the first polygon point set other than the sixth vertex, and the seventh vertex and the eighth vertex are adjacent. Input at least one of the triangles into the polygon builder to obtain the constructed triangular mesh output by the polygon builder.

8. A triangular mesh construction device, characterized in that, include: The first acquisition module is used to acquire first coordinates, wherein the first coordinates are used to indicate geographic information; The conversion module is used to convert the first coordinates into a second coordinate in the three-dimensional space according to the mapping relationship between the geographic space where the first coordinates are located and the three-dimensional space. The second acquisition module is used to subdivide the polygon when the polygon corresponding to the second coordinate is nested, and obtain at least one first polygon point set corresponding to the polygon, wherein a first polygon point set is used to represent a convex polygon. A construction module is used to construct a triangular mesh corresponding to the polygon based on the at least one first polygon point set.

9. An electronic device, characterized in that, The electronic device includes a processor and a memory, the memory storing programs or instructions that can run on the processor, the programs or instructions being executed by the processor to implement the steps of the method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a program or instructions that, when executed by a processor, implement the steps of the method as claimed in any one of claims 1 to 7.

11. A computer program product, characterized in that, The computer program product includes a computer program stored on a non-transitory computer-readable storage medium, the computer program including program instructions that, when executed by a computer, cause the computer to perform the steps of the method as described in any one of claims 1 to 7.