A method and system for generating a multi-sided mesh based on a sphere

CN122821036APending Publication Date: 2026-09-25NANJING HANHAI FUXI DEFENSE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610881744.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-17
Publication Date
2026-09-25

AI Technical Summary

Technical Problem

[0003]当前主流的球面区域网格生成方案存在两大共性技术瓶颈:其一,多数方法基于平面几何假设,通过投影变换将球面区域映射至二维平面后进行网格剖分与单元归属判定,但球面至平面的投影过程必然产生不可消除的几何畸变,在大跨度地理范围或高纬度区域场景中,距离、面积、角度的计算误差会显著放大,难以满足导航、遥感测绘、空域管控等对空间计算精度要求较高的业务需求;其二,少量直接在球面坐标系下开展网格化的现有技术,缺乏针对性的区域边界约束机制,网格生成阶段无有效范围筛选策略,需全域遍历海量无关网格单元并逐个进行包含关系校验,导致冗余计算量大、运算效率低下,算法工程化落地难度高,无法支撑在线实时网格化处理等实际应用场景

Benefits of technology

本发明全程依托球面空间完成计算处理,无需将球面区域投影至二维平面,从根源避免投影变换带来的距离、角度、面积等几何畸变,大幅降低大范围区域、高纬度区域场景下的计算误差,有效满足高精度空间建模、测绘分析、空域管控等业务使用要求。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122821036A_ABST
    Figure CN122821036A_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on spherical polyhedral mesh generation method and system, belong to the technical field of spatial information processing and geographic modeling.Import to be meshed spherical surface, extract spherical closed region and corresponding vertex, convert latitude and longitude system coordinate into radian system coordinate, and obtain three-dimensional unit spherical coordinate by mapping;Determine spatial range constraint according to the grid type of closed region;With the preset grid level and spatial range constraint, the latitude and longitude grid index interval is obtained by conversion;Generate candidate grid index set based on latitude and longitude grid index interval;Obtain candidate spherical grid cell set by traversing candidate grid index set;Based on candidate spherical grid cell set, respectively construct corresponding normal vector according to grid type, complete grid validity discrimination in combination with spherical center vector, and filter to obtain effective grid cell.The application avoids the distance, angle, area and other geometric distortion caused by projection transformation from the root, and greatly reduces the calculation error under the scene of large range area and high latitude area.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the technical field of spatial information processing and geographic modeling, specifically relating to a method and system for generating polygonal grids based on spheres. Background Technology

[0002] With the continuous evolution of Geographic Information Systems (GIS), spatial information sensing, and regional modeling technologies, spherical spatial representation and gridding have become core technologies supporting the structured organization and quantitative analysis of spatial data. In practical applications, the boundaries of target geographic regions are typically defined by latitude and longitude vertices, forming two typical spherical region representations: one is irregular spherical polygons, such as air traffic control zones, environmental monitoring areas, and geographic areas of interest; the other is regions based on spherical triangles as constituent units, commonly seen in global spherical triangulation results, locally refined modeling blocks, and the smallest units of hierarchical spherical grids. Therefore, how to achieve high-precision and high-efficiency gridding and structured representation of these two types of regions within a spherical geometric system has become a fundamental and critical problem that urgently needs to be solved in the fields of spatial information processing and spherical modeling.

[0003] Current mainstream spherical region mesh generation schemes suffer from two common technical bottlenecks: First, most methods are based on planar geometry assumptions, mapping the spherical region to a two-dimensional plane through projection transformation before meshing and cell assignment determination. However, the projection process from the sphere to the plane inevitably produces unavoidable geometric distortions. In scenarios with large geographical spans or high latitudes, the calculation errors for distance, area, and angle will be significantly amplified, making it difficult to meet the high spatial computing accuracy requirements of applications such as navigation, remote sensing mapping, and airspace management. Second, the few existing technologies that directly perform meshing in the spherical coordinate system lack targeted regional boundary constraint mechanisms. There is no effective range filtering strategy in the mesh generation stage, requiring the traversal of massive amounts of unrelated mesh cells across the entire region and the verification of inclusion relationships for each cell. This results in large amounts of redundant computation, low computational efficiency, and high difficulty in the engineering implementation of the algorithm, making it unable to support practical application scenarios such as online real-time meshing processing.

[0004] In summary, existing technologies struggle to balance computational accuracy and mesh generation efficiency in spherical geometry. There is an urgent need to develop a mesh generation method that natively adapts to spherical geometric space and can cover two typical region types: spherical polygons and spherical triangles. This method should not only avoid projection distortion to ensure computational accuracy but also reduce invalid calculations and improve generation efficiency through region constraints. This would fill the gaps in existing technologies and meet the practical needs of spherical region modeling and spatial meshing in various fields. Summary of the Invention

[0005] To address the technical problems existing in the background art described above, the present invention provides a method for generating polygonal meshes based on spheres.

[0006] This invention is achieved through the following technical solution: a method for generating polygonal meshes based on a sphere, comprising the following steps: Step 1: Import the sphere to be meshed, extract the closed regions of the sphere and their corresponding vertices. (The number of vertices in the closed region is likely an error and should be left as is.) If, then it is a triangular mesh; if , then it is a polygonal grid; Step 2: Convert the latitude and longitude coordinates of each vertex to radian coordinates, and map them to obtain the corresponding three-dimensional unit spherical coordinates; Step 3: Determine the corresponding spatial range constraint based on the grid type of the closed region; combine the preset grid level with the spatial range constraint to calculate the latitude and longitude grid index interval; Step 4: Based on the latitude and longitude grid index intervals, generate a candidate grid index set. Traverse the candidate mesh index set to obtain the candidate spherical mesh cell set; Step 5: Based on the candidate spherical mesh unit set, construct corresponding normal vectors according to the mesh type, and combine them with the spherical center vector to complete the mesh validity judgment and filter out the valid mesh units; Step 6: Perform binary interleaving on the latitude and longitude indices corresponding to the effective grid cells to generate Morton codes, and output the code set.

[0007] In a further embodiment, the mapping process for the three-dimensional unit spherical coordinates is as follows: The latitude and longitude coordinate system is ,in, The vertex index is... , and Vertices Longitude and latitude are measured in angular units; The angle is converted to longitude. and latitude and angle Convert longitude to radians Latitude in radians ; Based on the radian system of longitude Latitude in radians The corresponding three-dimensional unit spherical coordinates are obtained by mapping using the following formula. : .

[0008] In a further embodiment, the process for determining the spatial range constraint is as follows: Extract the longitude and latitude in angular form corresponding to all vertices of the closed region, and solve for the corresponding maximum longitude. Minimum longitude Maximum latitude and latitude minimum value ; From the maximum longitude Minimum longitude Maximum latitude and latitude minimum value A rectangle circumscribed in latitude and longitude is formed to serve as a constraint on the spatial range.

[0009] In a further embodiment, the conversion process for the latitude and longitude grid index interval is as follows: Let the spherical empty grid level be The number of grid cells in the longitude direction is determined as follows: The number of grids in the latitudinal direction is ; Based on the latitude-longitude grid index mapping relationship, the extreme values ​​of latitude and longitude in angular system corresponding to the spatial range constraint are mapped to grid indices to obtain the latitude-longitude grid index interval; The latitude and longitude-grid index mapping relationship is expressed in the following form: , ; in, For longitude direction grid index, For latitudinal grid indexing, Indicates longitude in angle system. Representing latitude and longitude in angular form. This is the floor function operator.

[0010] In a further embodiment, the generation process of the candidate spherical mesh element set is as follows: A candidate grid index set is defined based on the latitude and longitude grid index interval. The expression is: ,in, and These are the minimum and maximum values ​​of the longitude index interval. and These are the minimum and maximum values ​​within the latitude index range; Traverse the candidate grid index set All index combinations Calculate the longitude of the center point of each grid cell. and angle system dimension ; Longitude based on angle and angle system dimension The center vector of the sphere is calculated. : ; The candidate spherical mesh unit set is formed by summing the spherical center vectors corresponding to all mesh units.

[0011] In a further embodiment, the selection process for the effective grid cells is as follows: Construct a normal vector for the great circle plane for each edge of the closed region: ,in, and Vertices and vertex Three-dimensional unit spherical coordinates; Traverse all grid cells within the candidate spherical grid cell set and extract the spherical center vector corresponding to each grid cell. ; Based on the grid cell type, an inclusion determination is performed to filter out grid cells located inside the closed region as valid grid cells; All effective grid cells constitute the effective grid cell set. The expression is: , For candidate grid index set A single element in The inclusion determination result is the center point of the grid cell.

[0012] In a further embodiment, when the closed region is a polygonal mesh, the specific process for determining inclusion is as follows: Introducing a three-dimensional reference vector The normal vector of the great circle plane on each side After correction, the inner normal vector of the polygonal mesh is obtained. : ;in, The sign function is used to calculate the spherical center vector corresponding to the candidate spherical mesh element. The dot product expressions for all dot products are: (The expression is incomplete and requires further context.) ; If all dot products If the signs match, the center point is determined to be inside the polygon, and the corresponding grid cell is a valid cell.

[0013] In a further embodiment, when the closed region is a triangular mesh, the specific process for determining inclusion is as follows: Introducing the three-dimensional unit spherical coordinates corresponding to the third vertex , and Based on three-dimensional unit spherical coordinates Normal vectors of the great circle plane corresponding to each side Perform orientation correction to obtain the inner normal vector pointing into the triangular mesh. The correction formula is: ,in, It is a symbolic function; Calculate the spherical center vector corresponding to the candidate spherical mesh element. The dot product expressions for all dot products are: (The expression is incomplete and requires further context.) ; If all dot products If all values ​​are greater than 0, then the center point of the candidate grid cell is determined to be inside the triangular grid, and the corresponding grid cell is a valid cell.

[0014] In a further embodiment, the output process of the encoded set is as follows: For the set of valid mesh cells determined by the inclusion property of spherical polygons Each grid cell in Obtain its corresponding longitude index. Latitude Index ; Calling the binary interleaving function For the longitude index Latitude Index Interweaving is performed to generate the spatial grid code for the grid cell. The spatial grid is encoded using Morton codes; The spatial grid codes of all valid grid cells are aggregated to form a code set. : .

[0015] A spherical-based polygon mesh generation system, used to implement the polygon mesh generation method described above, includes: The first module is set to import the sphere to be meshed, extract the closed regions of the sphere and their corresponding vertices, and if the number of vertices in the closed region is... If, then it is a triangular mesh; if , then it is a polygonal grid; The second module is configured to convert the latitude and longitude coordinates of each vertex into radian coordinates and map them to the corresponding three-dimensional unit spherical coordinates. The third module is configured to determine the corresponding spatial range constraint based on the grid type of the closed region; and to calculate the latitude and longitude grid index interval by combining the preset grid level with the spatial range constraint. The fourth module is configured to generate a candidate grid index set based on the latitude and longitude grid index interval. Traverse the candidate mesh index set to obtain the candidate spherical mesh cell set; The fifth module is configured to construct corresponding normal vectors based on the candidate spherical mesh unit set, according to the mesh type, and combine them with the spherical center vector to complete the mesh validity judgment and filter out the valid mesh units; The sixth module is configured to perform binary interleaving of the latitude and longitude indices corresponding to the effective grid cells to generate Morton codes and output a set of codes.

[0016] The beneficial effects of this invention are: This invention relies entirely on spherical space for calculations, eliminating the need to project the spherical region onto a two-dimensional plane. This avoids geometric distortions such as distance, angle, and area caused by projection transformations, significantly reducing calculation errors in large-scale and high-latitude scenarios. It effectively meets the requirements of high-precision spatial modeling, surveying and analysis, and airspace management.

[0017] This method constructs an outer rectangle by extracting the extreme values ​​of latitude and longitude of the region vertices, delineates the effective spatial range and converts it into a grid index interval, and only performs traversal and verification on candidate grids within the interval. It abandons the global search mode, greatly reduces the amount of invalid calculation, improves the overall efficiency of grid generation, and is suitable for engineering application scenarios such as online real-time gridding and dynamic region modeling.

[0018] For spherical triangles and spherical polygons, corresponding inclusion determination rules are designed respectively. For polygons, the normal vector of the great circle plane is directly used for judgment. For triangles, vertices are introduced to complete the normal vector direction correction to ensure that the normal vector points to the inside of the region. The spherical geometry is rigorous, the mesh cell selection results are accurate and stable, and the occurrence of misjudgment and omission is reduced.

[0019] This invention is compatible with triangular meshes with four or more vertices and can be applied to various scenarios such as spherical triangulation regions, geographic regions of interest, environmental monitoring areas, and aviation operation areas. It has strong versatility and a wide range of applications. Attached Figure Description

[0020] Figure 1 This is a flowchart of a method for generating polygonal meshes based on spheres. Detailed Implementation

[0021] The present invention will now be further described with reference to the accompanying drawings and embodiments.

[0022] Example 1 like Figure 1As shown, this embodiment discloses a method for generating polygonal meshes based on a sphere, which enables rapid generation of meshes within a spherical polygonal region. While maintaining the accuracy of spherical spatial calculations, it improves mesh generation efficiency and enhances practicality in modeling complex spherical regions. The method includes the following steps: Step 1: Import the sphere to be meshed, extract the closed regions of the sphere and their corresponding vertices. (The number of vertices in the closed region is likely an error and should be left as is.) If, then it is a triangular mesh; if , then it is a polygonal grid; Step 2: Convert the latitude and longitude coordinates of each vertex to radian coordinates, and map them to obtain the corresponding three-dimensional unit spherical coordinates; Step 3: Determine the corresponding spatial range constraint based on the grid type of the closed region; combine the preset grid level with the spatial range constraint to calculate the latitude and longitude grid index interval; Step 4: Based on the latitude and longitude grid index intervals, generate a candidate grid index set. Traverse the candidate mesh index set to obtain the candidate spherical mesh cell set; Step 5: Based on the candidate spherical mesh unit set, construct corresponding normal vectors according to the mesh type, and combine them with the spherical center vector to complete the mesh validity judgment and filter out the valid mesh units; Step 6: Perform binary interleaving on the latitude and longitude indices corresponding to the effective grid cells to generate Morton codes, and output the code set.

[0023] In one specific embodiment of the present invention, the spherical polygon mesh generation method first needs to map the latitude and longitude coordinates of the vertices of the closed region of the sphere to three-dimensional unit spherical coordinates to eliminate projection distortion and provide a unified mathematical basis for subsequent geometric operations. The mapping process for these three-dimensional unit spherical coordinates is as follows: Suppose the closed region contains There are vertices, and the latitude and longitude coordinates of each vertex are... ,in, The vertex index is... Furthermore, to ensure boundary continuity, it is agreed that... In the formula, and Vertices Longitude and latitude are measured in terms of angles.

[0024] To facilitate subsequent trigonometric function calculations, the angle is converted to longitude. and latitude and angle Convert longitude to radians Latitude in radians ; , .

[0025] Based on the radian system of longitude Latitude in radians The corresponding three-dimensional unit spherical coordinates are obtained by mapping using the following formula. : .

[0026] Through the above steps, all vertices of the closed spherical region are uniformly converted into unit vectors on a three-dimensional unit sphere. This conversion is the foundation for all subsequent geometric operations in this invention, such as the construction of the great circle plane normal vector and inclusion determination. By transforming the spherical geometry problem into a vector operation problem in three-dimensional space, it ensures that all subsequent calculations are performed in the distortion-free native spherical space, fundamentally avoiding the distance, angle, and area distortion problems caused by traditional planar projection methods, and significantly improving the accuracy of subsequent mesh generation and determination.

[0027] In one specific embodiment of the present invention, to avoid indiscriminate traversal of the entire spherical mesh and significantly improve mesh generation efficiency, it is necessary to first determine the spatial range constraint corresponding to the closed region of the spherical surface, and then perform subsequent inclusion determination only on candidate mesh cells within the constraint range. The specific process for determining this spatial range constraint is as follows: Extract all vertices of the closed region The corresponding longitude and latitude in angular form are used to solve for the maximum longitude value. Minimum longitude Maximum latitude and latitude minimum value ; From the maximum longitude Minimum longitude Maximum latitude and latitude minimum value A rectangle circumscribed in latitude and longitude is formed to serve as a constraint on the spatial range.

[0028] In a further embodiment, the closed region described in this embodiment includes triangular meshes and polygonal meshes. If the closed region is a triangular mesh, all vertices are... , and ,in, , and The longitude is measured in angles from the three vertices. , and The latitude is represented by the angles of the three vertices.

[0029] Solving for the corresponding maximum longitude yields the solution. Minimum longitude Maximum latitude and latitude minimum value : , ; , .

[0030] Taking a polygonal mesh as an example, the vertices of the polygonal mesh are... The corresponding maximum longitude values ​​can be obtained by solving the following formulas respectively. Minimum longitude Maximum latitude and latitude minimum value : , , , .

[0031] In practical applications, the bounding rectangle of latitude and longitude can be further converted into latitude and longitude index intervals under the corresponding grid level. Only candidate grid cells within the interval are traversed and their validity is determined, thus abandoning the traditional approach of traversing a massive number of irrelevant grids across the entire region and significantly reducing unnecessary computation. This step, while ensuring coverage of all grid cells that may fall within the target area, effectively limits the computational scope, significantly improving the overall operational efficiency of subsequent grid generation and determination, and better adapting to engineering application scenarios such as online real-time meshing and dynamic region modeling.

[0032] In a specific embodiment of the present invention, in order to achieve efficient inclusion determination of spherical polygon mesh, after determining the spatial range constraint, it is also necessary to construct a central reference point and a three-dimensional reference vector for the polygon mesh, so as to provide a key benchmark for subsequent normal vector direction unification and inclusion determination.

[0033] The purpose of this step is to determine the center reference point of the region by averaging the vertices, and then map it to a reference vector on the three-dimensional unit sphere. This provides a unified directional reference for the normal vector of the great circle plane of the polygonal mesh, avoids complex direction correction logic, and greatly simplifies the subsequent judgment process.

[0034] In one specific embodiment of the present invention, in order to convert the latitude and longitude bounding rectangle of the spherical closed region into discrete grid index intervals and achieve rapid location and traversal of candidate grids, a latitude and longitude grid index interval conversion process needs to be executed. This process is a key step in connecting continuous geographic coordinates and discrete grid cells, and is also the foundation for subsequent efficient grid generation.

[0035] The conversion process for the latitude and longitude grid index intervals is as follows: Let the spherical empty grid level be The number of grid cells in the longitude direction is determined as follows: The number of grids in the latitudinal direction is Furthermore, , .

[0036] Based on the latitude-longitude grid index mapping relationship, the extreme values ​​of latitude and longitude in angular system corresponding to the spatial range constraint are mapped to grid indices to obtain the latitude-longitude grid index interval; The latitude and longitude-grid index mapping relationship is expressed in the following form: , ; in, For longitude direction grid index, For latitudinal grid indexing, Indicates longitude in angle system. Representing latitude and longitude in angular form. This is the floor function operator, ensuring that the result is a non-negative integer index.

[0037] Furthermore, using the maximum longitude value in the aforementioned technology... Minimum longitude Maximum latitude and latitude minimum value For example, then: The minimum longitude value Maximum longitude Substituting these values ​​into the longitude direction mapping formula, we obtain the minimum longitude index value. and the maximum value of longitude index ; Minimum latitude Maximum latitude Substituting each value into the latitude direction mapping formula, we obtain the minimum value of the latitude index. and latitude index maximum value ; Indexed by longitude Latitude index range Together they constitute the latitude and longitude grid index interval.

[0038] After completing the grid index interval conversion of the latitude and longitude circumscribed rectangle, a candidate spherical grid cell set can be generated based on this interval, providing all grid cells to be verified for subsequent inclusion determination. The generation process of the candidate spherical grid cell set is as follows: A candidate grid index set is defined based on the latitude and longitude grid index interval. The expression is: ,in, and These are the minimum and maximum values ​​of the longitude index interval. and These are the minimum and maximum values ​​of the latitude index range; this set contains the indices of all grid cells that may fall within the closed region of the target sphere, and serves as the boundary for subsequent traversals.

[0039] Traverse the candidate grid index set All index combinations Calculate the longitude of the center point of each grid cell. and angle system dimension : , ; To accommodate subsequent inclusion determination calculations in 3D space, the latitude and longitude coordinates of the grid cell center points are converted into spherical center vectors. : ; The candidate spherical mesh unit set is formed by summing the spherical center vectors corresponding to all mesh units.

[0040] Through a three-step process of defining the index set, calculating the latitude and longitude of the center point, and mapping the three-dimensional vector, discrete grid indices are efficiently converted into a set of candidate grid cells in a unified format, providing complete and standardized input data for subsequent determination of the inclusion of spherical polygons.

[0041] In a further embodiment, the selection process for effective grid cells is as follows: Construct a normal vector for the great circle plane for each edge of the closed region: ,in, and Vertices and vertex The three-dimensional unit spherical coordinates; the normal vector is perpendicular to the edge. The large circular plane in which it is located provides a reference for subsequent determination of the relative position of the point and the edge.

[0042] Traverse all grid cells within the candidate spherical grid cell set and extract the spherical center vector corresponding to each grid cell. This represents the position of the mesh element on the three-dimensional sphere. Based on the grid cell type, an inclusion determination is performed to filter out grid cells located inside the closed region as valid grid cells; All effective grid cells constitute the effective grid cell set. The expression is: , For candidate grid index set A single element in The inclusion determination result is the center point of the grid cell.

[0043] Furthermore, for different types of closed regions (polygonal meshes or triangular meshes), the corresponding inclusion determination logic is executed respectively: When the closed region is a polygonal mesh, the specific process for determining inclusion is as follows: Introducing a three-dimensional reference vector The normal vector of the great circle plane on each side After correction, the inner normal vector of the polygonal mesh is obtained. : ;in, This is a sign function; it outputs 1 when the input value is positive and -1 when the input value is negative. It calculates the spherical center vector corresponding to the candidate spherical mesh element. The dot product expressions for all dot products are: (The expression is incomplete and requires further context.) ; If all dot products If the signs match, the center point is determined to be inside the polygon, and the corresponding grid cell is a valid cell.

[0044] Furthermore, three-dimensional reference vector The calculation process is as follows: Calculate the center reference point of the polygonal grid, where the latitude and longitude of the center reference point in angular form are: ,in, As vertex Longitude is determined by angle. As vertex Latitude is measured by angle; Longitude is determined by angles around a central reference point. The latitude and angular coordinates are based on the central reference point; this reference point is an approximate representation of the geometric center of the polygonal grid and can stably reflect the overall positional characteristics of the region.

[0045] To accommodate subsequent 3D vector calculations, the latitude and longitude coordinates of the central reference point are mapped to reference vectors on a 3D unit sphere, and the central reference point is mapped to a 3D reference vector. : .

[0046] Correspondingly, when the closed region is a triangular mesh, the specific process for determining inclusion is as follows: Introducing the three-dimensional unit spherical coordinates corresponding to the third vertex , and Based on three-dimensional unit spherical coordinates Normal vectors of the great circle plane corresponding to each side Perform orientation correction to obtain the inner normal vector pointing into the triangular mesh. The correction formula is: ,in, It is a symbolic function; Calculate the spherical center vector corresponding to the candidate spherical mesh element. The dot product expressions for all dot products are: (The expression is incomplete and requires further context.) ; If all dot products If all values ​​are greater than 0, then the center point of the candidate grid cell is determined to be inside the triangular grid, and the corresponding grid cell is a valid cell.

[0047] This filtering process is based on the strict logic of spherical geometry, eliminating the need to project the sphere onto a two-dimensional plane and avoiding judgment errors caused by projection distortion. At the same time, through pre-built index intervals and efficient vector operations, it significantly improves the efficiency and accuracy of grid filtering, providing a reliable data source for subsequent standardized coding output.

[0048] Finally, the output process of the encoded set is as follows: For the set of valid mesh cells determined by the inclusion property of spherical polygons Each grid cell in Obtain its corresponding longitude index. Latitude Index ; Calling the binary interleaving function For the longitude index Latitude Index Interweaving is performed to generate the spatial grid code for the grid cell. The spatial grid is encoded using Morton code; the Morton code is generated by alternating the binary bits of the longitude and latitude indices in sequence. For example, if the longitude index is... Latitude index is The Morton code after interleaving is .

[0049] This encoding method can map two-dimensional grid indices to one-dimensional integers while maintaining good spatial locality, meaning that adjacent grid cells also have high continuity in the one-dimensional encoding space, making it very suitable for the storage and retrieval of spatial data.

[0050] The spatial grid codes of all valid grid cells are aggregated to form a code set. : .

[0051] For the selected valid grid cells, Morton codes are generated using binary interleaving and then uniformly summarized and output, assigning a unique identifier to each grid cell. This code possesses good spatial adjacency characteristics, facilitating subsequent grid data storage, retrieval, querying, and secondary analysis, and providing convenience for the structured management of spatial data.

[0052] Example 2 To implement the polygon mesh generation method described in Example 1, this example provides a spherical polygon mesh generation system, including: The first module is set to import the sphere to be meshed, extract the closed regions of the sphere and their corresponding vertices, and if the number of vertices in the closed region is... If, then it is a triangular mesh; if , then it is a polygonal grid; The second module is configured to convert the latitude and longitude coordinates of each vertex into radian coordinates and map them to the corresponding three-dimensional unit spherical coordinates. The third module is configured to determine the corresponding spatial range constraint based on the grid type of the closed region; and to calculate the latitude and longitude grid index interval by combining the preset grid level with the spatial range constraint. The fourth module is configured to generate a candidate grid index set based on the latitude and longitude grid index interval. Traverse the candidate mesh index set to obtain the candidate spherical mesh cell set; The fifth module is configured to construct corresponding normal vectors based on the candidate spherical mesh unit set, according to the mesh type, and combine them with the spherical center vector to complete the mesh validity judgment and filter out the valid mesh units; The sixth module is configured to perform binary interleaving of the latitude and longitude indices corresponding to the effective grid cells to generate Morton codes and output a set of codes.

Claims

1. A method for generating polygonal meshes based on spheres, characterized in that, Includes the following steps: Step 1: Import the sphere to be meshed, extract the closed regions of the sphere and their corresponding vertices. (The number of vertices in the closed region is likely a factor in the original text.) If, then it is a triangular mesh; if Then it is a polygonal grid; Step 2: Convert the latitude and longitude coordinates of each vertex to radian coordinates, and map them to obtain the corresponding three-dimensional unit spherical coordinates; Step 3: Determine the corresponding spatial range constraint based on the grid type of the closed region; combine the preset grid level with the spatial range constraint to calculate the latitude and longitude grid index interval; Step 4: Based on the latitude and longitude grid index intervals, generate a candidate grid index set. Traverse the candidate mesh index set to obtain the candidate spherical mesh cell set; Step 5: Based on the candidate spherical mesh unit set, construct corresponding normal vectors according to the mesh type, and combine them with the spherical center vector to complete the mesh validity judgment and filter out the valid mesh units; Step 6: Perform binary interleaving on the latitude and longitude indices corresponding to the effective grid cells to generate Morton codes, and output the code set.

2. The method for generating polygonal meshes based on a sphere according to claim 1, characterized in that, The mapping process for the three-dimensional unit spherical coordinates is as follows: The latitude and longitude coordinate system is ,in, The vertex index is... , and Vertices Longitude and latitude are measured in angles. The angle is converted to longitude. and latitude and angle Convert longitude to radians Latitude in radians ; Based on the radian system of longitude Latitude in radians The corresponding three-dimensional unit spherical coordinates are obtained by mapping using the following formula. : 。 3. The method for generating polygonal meshes based on a sphere according to claim 1, characterized in that, The process for determining the spatial range constraints is as follows: Extract the longitude and latitude in angular form corresponding to all vertices of the closed region, and solve for the corresponding maximum longitude. Minimum longitude Maximum latitude and latitude minimum value ; From the maximum longitude Minimum longitude Maximum latitude and latitude minimum value A rectangle circumscribed in latitude and longitude is formed to serve as a constraint on the spatial range.

4. The method for generating polygonal meshes based on a sphere according to claim 3, characterized in that, The conversion process for the latitude and longitude grid index intervals is as follows: Let the spherical empty grid level be The number of grid cells in the longitude direction is determined as follows: The number of grids in the latitudinal direction is ; Based on the latitude-longitude grid index mapping relationship, the extreme values ​​of latitude and longitude in angular system corresponding to the spatial range constraint are mapped to grid indices to obtain the latitude-longitude grid index interval; The latitude and longitude-grid index mapping relationship is expressed in the following form: , ; in, For longitude direction grid index, For latitudinal grid indexing, Indicates longitude in angle system. Representing latitude and longitude in angular form. This is the floor function operator.

5. The method for generating polygonal meshes based on a sphere according to claim 1, characterized in that, The process for generating the candidate spherical mesh element set is as follows: A candidate grid index set is defined based on the latitude and longitude grid index interval. The expression is: ,in, and These are the minimum and maximum values ​​of the longitude index interval. and These are the minimum and maximum values ​​within the latitude index range; Traverse the candidate grid index set All index combinations Calculate the longitude of the center point of each grid cell. and angle system dimension ; Longitude based on angle and angle system dimension The center vector of the sphere is calculated. : ; The candidate spherical mesh unit set is formed by summing the spherical center vectors corresponding to all mesh units.

6. The method for generating polygonal meshes based on a sphere according to claim 1, characterized in that, The selection process for the effective grid cells is as follows: Construct a normal vector for the great circle plane for each edge of the closed region: ,in, and Vertices and vertex Three-dimensional unit spherical coordinates; Traverse all grid cells within the candidate spherical grid cell set and extract the spherical center vector corresponding to each grid cell. ; Based on the grid cell type, an inclusion determination is performed to filter out grid cells located inside the closed region as valid grid cells; All effective grid cells constitute the effective grid cell set. The expression is: , For candidate grid index set A single element in The inclusion determination result is the center point of the grid cell.

7. The method for generating polygonal meshes based on a sphere according to claim 6, characterized in that, When the closed region is a polygonal mesh, the specific process for determining inclusion is as follows: Introducing a three-dimensional reference vector The normal vector of the great circle plane on each side After correction, the inner normal vector of the polygonal mesh is obtained. : ;in, The sign function is used to calculate the spherical center vector corresponding to the candidate spherical mesh element. The dot product expressions for all dot products are: (The expression is incomplete and requires further context.) ; If all dot products If the signs match, the center point is determined to be inside the polygon, and the corresponding grid cell is a valid cell.

8. The method for generating polygonal meshes based on a sphere according to claim 6, characterized in that, When the closed region is a triangular mesh, the specific process for determining inclusion is as follows: Introducing the three-dimensional unit spherical coordinates corresponding to the third vertex , and Based on three-dimensional unit spherical coordinates Normal vectors of the great circle plane corresponding to each side Perform orientation correction to obtain the inner normal vector pointing into the triangular mesh. The correction formula is: ,in, It is a symbolic function; Calculate the spherical center vector corresponding to the candidate spherical mesh element. The dot product expressions for all dot products are: (The expression is incomplete and requires further context.) ; If all dot products If all values ​​are greater than 0, then the center point of the candidate grid cell is determined to be inside the triangular grid, and the corresponding grid cell is a valid cell.

9. The method for generating polygonal meshes based on a sphere according to claim 1, characterized in that, The output process of the encoded set is as follows: For the set of valid mesh cells determined by the inclusion property of spherical polygons Each grid cell in Obtain its corresponding longitude index. Latitude Index ; Calling the binary interleaving function For the longitude index Latitude Index Interweaving is performed to generate the spatial grid code for the grid cell. The spatial grid is encoded using Morton codes; The spatial grid codes of all valid grid cells are aggregated to form a code set. : 。 10. A spherical-based polygon mesh generation system for implementing the polygon mesh generation method as described in any one of claims 1 to 9, characterized in that, include: The first module is set to import the sphere to be meshed, extract the closed regions of the sphere and their corresponding vertices, and if the number of vertices in the closed region is... If, then it is a triangular mesh; if Then it is a polygonal grid; The second module is configured to convert the latitude and longitude coordinates of each vertex into radian coordinates and map them to the corresponding three-dimensional unit spherical coordinates. The third module is configured to determine the corresponding spatial range constraint based on the grid type of the closed region; and to calculate the latitude and longitude grid index interval by combining the preset grid level with the spatial range constraint. The fourth module is configured to generate a candidate grid index set based on the latitude and longitude grid index interval. Traverse the candidate mesh index set to obtain the candidate spherical mesh cell set; The fifth module is configured to construct corresponding normal vectors based on the candidate spherical mesh unit set, according to the mesh type, and combine them with the spherical center vector to complete the mesh validity judgment and filter out the valid mesh units; The sixth module is configured to perform binary interleaving of the latitude and longitude indices corresponding to the effective grid cells to generate Morton codes and output a set of codes.