A method for polyhedral cutting of a three-dimensional grid
By using K-D trees and octree of adaptive voxels in urban-level three-dimensional grids for rapid positioning and screening, combined with multi-faceted cutting algorithm to decompose and merge face sheets, the problem of low multi-faceted cutting efficiency in the existing technology is solved, and efficient and accurate cutting effect is achieved.
Patent Information
- Application Number
- CN202510248913.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-04
- Publication Date
- 2025-06-17
- Estimated Expiration
- 2045-03-04
AI Technical Summary
The prior art is difficult to efficiently and accurately cut three-dimensional data at urban scales, resulting in poor performance and storage efficiency.
By retrieving the set of cut surfaces of the three-dimensional mesh, compute the crop surface enclosure box, and use the K-D tree to query the large mesh for small mesh and adaptive voxels, decompose the mesh to be cut into polygonal patches, update the set of effective points according to the crop surface relationship, build a three-dimensional patch and merge it into the three-dimensional grid.
It realizes efficient and accurate multi-faceted cutting of urban-level three-dimensional grids, reduces algorithm complexity and calculation consumption, and improves performance and storage efficiency.
Smart Images

Figure CN119762684B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and particularly to a method, apparatus, electronic device, and storage medium for multi-faceted cutting of a three-dimensional grid. Background Art
[0002] With the gradual development of information technology, in fields such as GIS (Geographic Information System), in addition to the display requirements of traditional two-dimensional raster (and vector) images, people are paying more and more attention to the display of three-dimensional data. However, the display of three-dimensional data is a complex technical issue. The smooth display of three-dimensional data requires computational resources and its optimization difficulty are more than an order of magnitude higher than those of two-dimensional data. The three-dimensional graphics rendering on mobile devices and browsers is more accessible to people compared to that on large games or professional software. However, on platforms such as mobile devices and browsers, the three-dimensional graphics rendering technology requires both the generality like that of professional software and the real-time performance like that of game rendering. Even for today's graphics hardware, it is still a significant challenge to meet these two requirements simultaneously on platforms with limited performance such as mobile devices and browsers. When facing actual performance problems, image engineers will perform targeted optimizations based on aspects such as the platform, hardware performance, image complexity, and algorithms. However, due to the performance limitations of the terminal and the complexity of the three-dimensional model, directly displaying the three-dimensional model on the terminal often fails to achieve the desired effect. Cutting the three-dimensional grid can achieve the purpose of locally displaying the three-dimensional grid, reducing the rendering pressure of a large number of grids, and has relatively wide applications in model cutting and geographic information systems. For example, in a geographic information system, slicing the model enables the platform to load on demand, reducing the rendering pressure on the platform, and plays an important role in urban planning, smart city construction, etc.
[0003] However, although displaying a 3D grid after cutting can reduce the pressure of network rendering, it is not easy. The distribution of traditional 2D raster file data is uniform. Regardless of the size of the raster file, the position of each pixel can be quickly calculated through the pixels and the range represented by the pixels, so cutting on the grid is quite efficient. However, it is very difficult to cut a 3D grid, especially to cut massive 3D data at the city level. Since there may be a single large grid (model) representing a very large area (such as terrain, roads, rivers, etc.) in a 3D grid at the city level, there are also a large number of medium or small grids representing single objects (such as buildings, bridges, trees, etc.), so when cutting a 3D grid at the city level, the spatial distribution must be considered to avoid models that do not perform cutting operations. Slicing itself is a multi-faceted cutting problem. In 2D data, a slice is actually a rectangle, and each slice requires at least four cutting faces. By analogy to 3D data, a slice can be a cube (such as a cuboid), which generally requires four or six cutting faces. Single-face cutting in 3D data is complex in itself. Multi-face cutting can indeed be decomposed into multiple single-face cutting, but from the perspective of computational efficiency and storage space utilization, it is very inefficient and will greatly reduce performance. However, when cutting multiple faces at the same time, it will be difficult to generate facets at the cuts of multiple faces. Therefore, how to efficiently and accurately cut city-scale 3D data is a technical problem that needs to be solved urgently. Summary of the invention
[0004] Embodiments of the present application provide a three-dimensional grid multi-faceted cutting method, device, electronic device and storage medium to solve one or more of the above-mentioned technical problems.
[0005] In a first aspect, an embodiment of the present application provides a multi-faceted cutting method for a three-dimensional grid, which is applied to a city-level three-dimensional grid, comprising: retrieving a cutting face set of the three-dimensional grid, and calculating a cutting face bounding box in the cutting face set; querying a small grid intersecting with the cutting face bounding box through a KD tree to obtain a small grid to be cut, and / or querying a voxel in a large grid intersecting with the cutting face bounding box through an adaptive voxel octree, and obtaining a large grid to be cut in the voxel; decomposing the small grid to be cut and the large grid to be cut into at least one polygonal patch, constructing the vertices of the polygonal patch in a clockwise order as a valid point set to be processed, retaining, eliminating and / or adding valid points according to the relative position relationship between two adjacent valid points in the valid point set to be processed and the cutting face in the cutting face set to obtain an updated valid point set, and constructing a three-dimensional patch based on the updated valid point set; merging the three-dimensional patch into the three-dimensional grid to form a new three-dimensional grid.
[0006] Second aspect, an embodiment of the present application provides a multi-faceted cutting device for three-dimensional grids, which is applied to urban-level three-dimensional grids and includes: a cutting bread bounding box acquisition module for retrieving a set of cutting planes of the three-dimensional grid and calculating the cutting bread bounding box in the set of cutting planes; a small grid to be cut acquisition module for querying small grids intersecting with the cutting bread bounding box through a K-D tree to obtain the small grids to be cut, and / or querying voxels in a large grid intersecting with the cutting bread bounding box through an octree of adaptive voxels and obtaining the large grids to be cut in the voxels; a three-dimensional patch construction module for decomposing the small grids to be cut and the large grids to be cut into at least one polygon patch, constructing the vertices of the polygon patch into a set of valid points to be processed in clockwise order, retaining, eliminating, and / or adding valid points according to the relative position relationship between two adjacent valid points in the set of valid points to be processed and the cutting planes in the set of cutting planes, obtaining an updated set of valid points, and constructing three-dimensional patches based on the updated set of valid points; a three-dimensional grid formation module for merging the three-dimensional patches into the three-dimensional grid to form a new three-dimensional grid.
[0007] Third aspect, an embodiment of the present application provides an electronic device, including a memory, a processor, and a computer program stored on the memory, and the processor implements the method described in any one of the above when executing the computer program.
[0008] Fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored, and the computer program implements the method described in any one of the above when executed by a processor.
[0009] According to the embodiments of the present application, the multi-plane cutting method for three-dimensional meshes proposed by the embodiments of the present application can be applied to city-level three-dimensional meshes. First, the set of cutting planes of the three-dimensional mesh can be retrieved, and the bounding box of the cutting planes in the set of cutting planes can be calculated; then, small meshes intersecting with the bounding box of the cutting planes can be queried through a K-D tree to obtain the small meshes to be cut, and / or voxels in large meshes intersecting with the bounding box of the cutting planes can be queried through an octree of adaptive voxels, and the large meshes to be cut in the voxels can be obtained; then, the small meshes to be cut and the large meshes to be cut can be decomposed into at least one polygon patch, the vertices of the polygon patch can be constructed into a set of valid points to be processed in clockwise order, and according to the relative position relationship between two adjacent valid points in the set of valid points to be processed and the cutting planes in the set of cutting planes, valid points can be retained, eliminated, and / or added to obtain an updated set of valid points, and a three-dimensional patch can be constructed based on the updated set of valid points; finally, the three-dimensional patch can be merged into the three-dimensional mesh to form a new three-dimensional mesh. By adopting the above solution, targeted search methods can be used for large meshes and small meshes in city-level three-dimensional meshes respectively. By using a K-D tree to index small meshes and an octree based on voxels to index large meshes, a size of the number of patches acceptable from a computational perspective can be quickly located and screened, neither calculating a large number of patches that are not cut nor indexing each patch to make the search space overly inflated, achieving a balance between performance and storage efficiency; after the search, based on the search results, the cutting results can be calculated successively according to the cutting planes, new points and edges can be regenerated in the form of ordered points, and finally all the results can be copied once. By adopting this method of "successively calculating and copying once" to cut patches, the computational efficiency is improved and the algorithm complexity is reduced, achieving the effect of efficiently and accurately performing multi-plane cutting on three-dimensional meshes at the city-level scale.
[0010] The present application organizes all three-dimensional meshes and patches by constructing a spatial structure. During the cutting process, the meshes and patches cut by the cutting planes are quickly screened through the calculation of the set of cutting planes and the spatial structure. For the parts that may be cut by the cutting planes, new points and edges are regenerated in the form of ordered points to generate a new three-dimensional mesh, and the complexity of the mesh topology structure is deliberately ignored to further improve the efficiency and reduce the algorithm complexity. Thus, the present application can quickly screen a large amount of data to reduce its computational amount, and at the same time, only one triangular mesh will be generated for multiple cutting planes, and there will only be a single copy of data copying, and the data replication efficiency has a good performance, and the performance improvement is very obvious. In addition, the generality of the algorithm is extended based on the idea of the polygon clipping algorithm in the present application, so that it can perform cutting on three-dimensional and concave polygons; and the retention of the original mesh manifold characteristics in some traditional cutting algorithms is abandoned, allowing its topological structure to be broken to achieve the purpose of efficiency improvement and complexity reduction.
[0011] The above description is only an overview of the technical solution of this application. In order to understand the technical means of this application more clearly, it can be implemented according to the content of the specification. And in order to make the above and other purposes, features, and advantages of this application more obvious and understandable, the following specifically illustrates the specific implementation manners of this application. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] In the drawings, unless otherwise specified, the same reference numerals throughout the several views represent the same or similar components or elements. These drawings are not necessarily drawn to scale. It should be understood that these drawings only depict some embodiments according to this application and should not be regarded as limiting the scope of this application.
[0013] Figure 1 shows a flowchart of a multi-plane cutting method for a three-dimensional grid provided in an embodiment of this application;
[0014] Figure 2 shows a schematic diagram of calculating the bounding box of the cutting planes in the set of cutting planes in a multi-plane cutting solution for a three-dimensional grid provided in an embodiment of this application;
[0015] Figure 3 shows a schematic diagram of constructing a search space for a three-dimensional grid using a K-D tree of an external bounding box in a multi-plane cutting solution for a three-dimensional grid provided in an embodiment of this application;
[0016] Figure 4 shows a schematic diagram of constructing a search space for a three-dimensional grid using a quadtree of adaptive voxels when the length of the z-axis in a three-dimensional coordinate system is much smaller than the lengths of the x-axis and the y-axis in a multi-plane cutting solution for a three-dimensional grid provided in an embodiment of this application;
[0017] Figure 5 shows a schematic diagram of a set of valid points in a multi-plane cutting solution for a three-dimensional grid provided in an embodiment of this application;
[0018] Figure 6 shows a schematic diagram of decomposing a grid into at least one polygon patch in a multi-plane cutting solution for a three-dimensional grid provided in an embodiment of this application;
[0019] Figure 7 shows a schematic diagram of retaining, eliminating, and / or adding valid points according to the relative position relationship between two adjacent valid points in the set of valid points to be processed and the cutting planes in the set of cutting planes to obtain an updated set of valid points in a multi-plane cutting solution for a three-dimensional grid provided in an embodiment of this application;
[0020] Figure 8Fig. 0 shows one of the exemplary schematic diagrams of constructing a 3D patch based on the updated valid point set in a multi-faceted cutting scheme for a 3D mesh provided in an embodiment of the present application;
[0021] Figure 9 Fig. 4 shows another exemplary schematic diagram of constructing a 3D patch based on the updated valid point set in a multi-faceted cutting scheme for a 3D mesh provided in an embodiment of the present application;
[0022] Figure 10 Fig. 8 shows a third exemplary schematic diagram of constructing a 3D patch based on the updated valid point set in a multi-faceted cutting scheme for a 3D mesh provided in an embodiment of the present application;
[0023] Figure 11 Fig. 12 shows a structural block diagram of a 3D mesh multi-faceted cutting device provided in an embodiment of the present application; and
[0024] Figure 12 Fig. 16 shows a block diagram of an electronic device for implementing the embodiments of the present application. Detailed Embodiments
[0025] In the following, only some exemplary embodiments are briefly described. As those skilled in the art can recognize, the described embodiments can be modified in various different ways without departing from the concept or scope of the present application. Therefore, the drawings and the description are considered to be exemplary in nature and not restrictive.
[0026] To facilitate the understanding of the technical solutions of the embodiments of the present application, the related technologies of the embodiments of the present application are described below. The following related technologies can be arbitrarily combined with the technical solutions of the embodiments of the present application as optional solutions, and all of them fall within the protection scope of the embodiments of the present application.
[0027] In some cases, methods such as plane clipping algorithm, Sutherland-Hodgman clipping algorithm (edge-by-edge clipping algorithm), BSP tree clipping method (Binary Space Partitioning), and Boolean clipping are generally used to clip 3D meshes. Among them, the plane clipping algorithm is a very common technique in the fields of computer graphics, geometric modeling, engineering calculation, etc., and is used to clip 3D meshes or geometric objects according to a given plane. The Sutherland-Hodgman clipping algorithm is a classic clipping algorithm, mainly used for clipping polygons, especially in 2D space. Its basic idea is to gradually clip by traversing each edge and judging the relationship between the edge and the clipping plane. This algorithm is simple to implement and suitable for plane clipping, but it is mainly used for simple 2D cases. When applied to 3D, more extensions are needed. Moreover, for simultaneous cutting by multiple planes, only multiple single-plane cuts can be decomposed into multiple single-plane cuts, and there will be a large number of repeated copies in the actual process. The BSP tree clipping method (Binary Space Partitioning) is a data structure that recursively divides 3D space into two half-spaces and can be used to accelerate geometric clipping. The BSP tree can efficiently perform mesh clipping and can quickly handle complex 3D clipping, especially in the case of multiple clipping planes. However, the process of constructing the BSP tree is very complex, and for large-scale meshes, constructing the BSP tree itself will be the largest overhead. Boolean clipping belongs to the intersection operation of Boolean operations. Its purpose is to calculate the intersecting part of two geometric bodies and return the result. The Boolean clipping result is accurate and robust, suitable for applications with strict geometric consistency requirements, and can handle any complex geometric bodies, including non-convex shapes, polygons, polyhedra, etc. However, Boolean clipping involves a large amount of geometric calculations (such as intersection detection, topology reconstruction), has high performance requirements for complex models, and due to the need to ensure its topological properties, additional steps are required to repair the result to ensure manifoldness.
[0028] These algorithms can effectively clip models within their respective application scopes. However, for fast multi-clipping plane cutting, without requiring the topological structure (such as manifold meshes) of the cut graphics, and only for display requirements, they are rather difficult or have serious performance problems, especially for some medium-sized or large-scale 3D meshes. And this application can perform fast and accurate cutting on large-scale 3D meshes such as city-level ones without considering the mesh topological structure and only for display, and can balance performance and efficiency, improve the calculation efficiency and reduce the algorithm complexity.
[0029] First, the terms involved are explained.
[0030] 3D meshes and patches: All meshes are composed of points, lines connecting the points, and faces segmented by the lines. Among them, each face is a patch, and the faces supported by different 3D model formats are different.
[0031] Adaptive voxels: A voxel is a cubic unit in 3D space, similar to a pixel in a 2D image, representing a specific position and its attributes in space. Adaptive voxels mean that the voxel size is not fixed.
[0032] Bounding Box (BBox): It refers to the smallest rectangle or cube that can completely enclose a geometric object (such as a point cloud, mesh, polygon, etc.).
[0033] Search space: A data structure for fast search constructed from 3D meshes in a certain way, which can be 3D or 2D.
[0034] Large meshes and small meshes: For 3D models generally oriented towards urban production, the density of patches is consistent. In other words, the number of patches is positively correlated with the mesh volume. Therefore, the larger the mesh volume, the more patches there are. Considering that small meshes are the vast majority, we use a statistical method to estimate a reasonable judgment range. Set the set of volumes of the bounding boxes of the meshes and sort them from small to large , and then calculate the 75% quartile , is the total number of meshes: ; Set the threshold for judging large meshes: ; Judge the mesh type: If , it is a large mesh; if , it is a small mesh.
[0035] Spatial dimensionality reduction: In 3D meshes at the urban scale, usually, the aspect ratio and axes are very different. In this case, if the axis is divided, the spatial division efficiency will become very low. To improve the spatial division efficiency, when the maximum length of the axis is less than and 1 / 5 of the minimum length of the axis, the division of the axis can be ignored, and the search space is constructed only in the axis and axis directions. Specifically, when the following conditions are met: , the axis is not considered, the spatial search structure is optimized, and the calculation efficiency is improved. At this time, the search space degenerates into 2D.
[0036] Cutting plane (cp): It refers to the plane that cuts a three-dimensional mesh, expressed by the plane equation where the positive and negative of the plane normal represent the inside and outside of the plane, and the data in the negative direction of the plane normal (the outside of the plane) is discarded by cutting.
[0037] Bounding box of cutting planes: Each cutting plane defines a spatial constraint condition, and the intersection of the inside of all cutting planes and the search space range constitutes the bounding box of the entire set of cutting planes. Its spatial range is as follows:
[0038] Truncated polyhedron is:
[0039] ;
[0040] Spatial range is: ;
[0041] represents the number of cutting planes, represents the boundary of the search space. Here, the intersection operation means only considering the area that satisfies all cutting plane conditions and is within the search space range. When ignoring axis, the formula in two dimensions is:
[0042] Truncated polyhedron is:
[0043] ;
[0044] Spatial range is: .
[0045] Cutting detection rule: Let the set of cutting planes be , the mesh or voxel be
[0046] , be the point of the mesh or voxel, and the function represents the substitution value of the point on the cutting plane .
[0047] To be retained: All vertices of the mesh or voxel are in the positive half-space and on the cutting plane of the cutting plane;
[0048] To be cut: There are two vertices in the mesh or voxel that are in the positive half-space and negative half-space of the cutting plane respectively;
[0049] Failed: All vertices of the mesh or voxel are not in the positive half-space of the cutting plane.
[0050] In consideration of high performance, generality, and the complexity of the algorithm itself, the embodiments of this application design and implement several core steps, including the construction of the search space, the positioning and screening of grids and patches, the multi-plane cutting and the generation of cutting edges, and the merging of grids, according to the order of magnitude of the three-dimensional grids at the urban scale and the spatial characteristics of the three-dimensional grids. Moreover, the three-dimensional grid model after cutting by the solution proposed in this application is for better application in display, and the topological attributes of the grids are deliberately avoided in the algorithm design to reduce the complexity of the algorithm and improve performance. Among them, the construction of the search space indexes the three-dimensional grids at the urban scale by size using a K-D tree or an octree of adaptive voxels for quick query of the grids that intersect with the cutting plane and are retained after cutting; the positioning and screening of grids and patches utilize the efficient query feature of the search space to locate the patches to be cut through grid query and patch search algorithms; the multi-plane cutting and the generation of cutting edges use the multi-plane cutting algorithm for the patches directly intersecting with the cutting plane, generate new vertices by calculating multiple cutting planes at once, support the generation of patches with different features on demand, and optimize the utilization of storage space; the merging of grids means merging the three-dimensional grids and patches retained in the search with the new patches achieved after cutting. Since the solution proposed in the embodiments of this application is for display, some topological attributes of the original grids will not be considered during the merging process. Generally speaking, the multi-plane cutting solution for three-dimensional grids proposed in the embodiments of this application is a high-performance, urban-scale data-oriented, display-priority multi-plane cutting algorithm.
[0051] The execution entity of the embodiments of the present application may be an application program, service, instance, functional module in software form, virtual machine (VM), container, cloud server, etc., or a hardware device with data processing functions (such as a server or terminal device) or a hardware chip (such as a CPU, GPU, FPGA, NPU, AI acceleration card, or DPU), etc. The device for realizing the multi-faceted cutting of a three-dimensional grid can be deployed on the computing device of the application party providing the corresponding service or on a cloud computing platform providing computing power, storage, and network resources. The service mode provided by the cloud computing platform to the outside world can be IaaS (Infrastructure as a Service), PaaS (Platform as a Service), SaaS (Software as a Service), or DaaS (Data as a Service). Taking the platform providing SaaS (Software as a Service) as an example, the cloud computing platform can utilize its own computing resources to provide the training of the multi-faceted cutting model of the three-dimensional grid or the execution of the function of the multi-faceted cutting module of the three-dimensional grid. The specific application architecture can be built according to service requirements. For example, the platform can provide a construction service based on the above model to the application party or individual using the platform resources, and further call the above model and implement the function of online or offline multi-faceted cutting of the three-dimensional grid based on the multi-faceted cutting request of the three-dimensional grid submitted by relevant client devices or servers, etc.
[0052] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or fully authorized by all parties. And the collection, use, and processing of relevant data need to comply with the relevant laws, regulations, and standards of relevant countries and regions, and corresponding operation entrances are provided for users to choose to authorize or refuse.
[0053] The technical solution of the present application and how the technical solution of the present application solves the foregoing technical problems will be described in detail below with specific embodiments. The several specific embodiments listed may be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described in detail below with reference to the accompanying drawings.
[0054] The embodiments of the present application provide a method for multi-faceted cutting of a three-dimensional grid, which is applied to a city-level three-dimensional grid, such as Figure 1 The flowchart of the multi-faceted cutting method 100 of the three-dimensional grid according to an embodiment of the present application is shown as follows. The method 100 may include:
[0055] In step S101, retrieve the set of cutting planes of the three-dimensional grid and calculate the bounding box of the cut cells in the set of cutting planes.
[0056] In the embodiment of the present application, before performing multi-plane cutting on a three-dimensional grid, a search space can be constructed first. After the search space is constructed, quickly locating and screening the grids and patches that meet the conditions is a key step. Especially in multi-plane cutting, correctly screening the grids and patches according to the cutting planes can greatly improve the efficiency and accuracy of the algorithm.
[0057] For the case of multi-plane cutting involved in the embodiment of the present application, the set of cutting planes can be regarded as a combined spatial constraint. Each cutting plane will generate certain constraint conditions for the grids and patches, and these constraint conditions will vary with different cutting planes. For a patch, if it is surrounded by multiple cutting planes (i.e., all its vertices are located in the positive direction of the cutting plane normal), it can be called a patch surrounded by the cut cells; if it intersects with a certain cutting plane, it can be called a patch intersecting with the cutting plane; similarly, for a grid, if it is surrounded by multiple cutting planes (i.e., all its vertices are located in the positive direction of the cutting plane normal), it can be called a grid surrounded by the cut cells; if it intersects with a certain cutting plane, it can be called a grid intersecting with the cutting plane. In order to quickly find these two types of grids and patches (the grids and patches intersecting with the cutting plane and the grids and patches surrounded by the cut cells) at one time, the set of cutting planes of the three-dimensional grid can be retrieved first, and the bounding box of the cut cells in the set of cutting planes can be calculated.
[0058] Figure 2 FIG. shows a schematic diagram of calculating the bounding box of the cut cells in the set of cutting planes in a multi-plane cutting scheme of a three-dimensional grid provided in the embodiment of the present application. As Figure 2 shown, the set of cutting planes is relatively a loose data set and cannot be directly used to query on a K-D tree or an octree. Therefore, the bounding box of the cut cells can be calculated first using the set of cutting planes, and then the corresponding K-D tree and octree can be queried using the bounding box of the cut cells. However, the query using the bounding box of the cut cells is only a rough range. For example, Figure 2 the intersection part of the set of cutting planes in Figure 2 the top view of the two-dimensional graphic in the upper half is the three-dimensional graphic in the lower half), the two-dimensional bounding box of the cut cells queried may include not only the grids or voxels intersecting with the cutting plane, but also the grids or voxels located outside the entire cutting plane.
[0059] In a possible implementation, before retrieving the set of cutting planes of the three-dimensional grid and calculating the bounding box of the cutting planes in the set of cutting planes, the above solution may further include: based on the classification of the three-dimensional grid, constructing the search space of the three-dimensional grid using a K-D tree of the circumscribed bounding box, and / or constructing the search space of the three-dimensional grid using an octree of adaptive voxels.
[0060] In a three-dimensional grid at the city scale, in addition to the large number of original models, due to different divisions of labor, some complete three-dimensional grids are divided into multiple ones. The number of three-dimensional grids in some large cities reaches more than one million. To quickly find the grids to be cut from a large number of three-dimensional grids, it is necessary to establish a fast search mechanism for the entire three-dimensional grid space, and this process can be called the construction of the search space. In a three-dimensional grid model, the complexity of the grid is mainly determined by the number of patches. The more the number of patches, the longer the operation time. Therefore, the embodiments of the present application propose a solution to design a search space that can index all patches for fast search, weighing the performance of the construction process and the search process as well as the utilization rate of the storage space. Considering that most of the massive models are small grids with a small footprint and a small number are large grids representing terrain, rivers, etc. with a large footprint, the search space can be divided into two parts, namely, a small grid search space based on a K-D tree and a large grid search space based on an octree of adaptive voxels. These two parts can be executed sequentially or in parallel, and the present application does not impose any restrictions on this.
[0061] In some embodiments, the method of constructing the search space of the three-dimensional grid using a K-D tree of the circumscribed bounding box may first obtain the circumscribed bounding boxes of all small grids in the three-dimensional grid, and use the minimum cube range after merging the circumscribed bounding boxes as the root node of the K-D tree, and obtain the coordinate set of the circumscribed bounding boxes in the three-dimensional coordinate system to form a circumscribed bounding box data set; then calculate the center points of the circumscribed bounding boxes of all small grids in the three-dimensional grid, and use the center points as the original nodes of the K-D tree, where the original nodes are used for storage and indexing; then select a dimension in the three-dimensional coordinate system, starting from the root node of the K-D tree, use the midpoint of the root node and the original node in the dimension in the circumscribed bounding box data set as the child node of the K-D tree, and then use the midpoint between the two child nodes, between the child node and the root node, or between the child node and the original node in the dimension in the circumscribed bounding box data set as a new child node of the K-D tree until the leaf node of the K-D tree is obtained or the volume of the child node is not greater than a preset threshold.
[0062] Since small meshes in the urban-level 3D grid are almost everywhere distributed throughout the area, although they may not be very uniform, it is reasonable in terms of efficiency and complexity to construct a large number of small meshes using a K-D tree. Moreover, the K-D tree is also relatively effective for range queries, which is more beneficial for subsequent cutting queries. Additionally, to improve the algorithm efficiency, the circumscribed bounding box of the 3D grid is used to represent each 3D grid. Although the search cannot be accurate to the patches, since the patch scale of the small meshes is relatively small itself, it is very worthwhile to exchange the additional computing power in subsequent cutting calculations for the overall construction efficiency and storage efficiency of the search space.
[0063] Figure 3 Fig. shows a schematic diagram of constructing the search space of 3D meshes using a K-D tree with circumscribed bounding boxes in a multi-faceted cutting scheme of 3D meshes provided in an embodiment of the present application. Figure 3 What is shown is a schematic diagram of constructing the search space of small meshes based on a K-D tree. As Figure 3 shown, the range of the entire K-D tree can be expressed by the following formula:
[0064] Wherein, can represent the circumscribed bounding box of the th small mesh, and is the number of small meshes.
[0065] Figure 3 In , corresponding to the circumscribed bounding box of the first small mesh, the circumscribed bounding box of the first small mesh is obtained from the two parts divided by the first type of dividing line (thick black solid line) in the figure. At this time, ; in , corresponding to the circumscribed bounding box of the second small mesh, the circumscribed bounding box of the second small mesh is obtained by further dividing the four parts obtained from the two parts divided by the first type of dividing line (thick black solid line) by the second type of dividing line (dashed line) in the figure. At this time, ; in , corresponding to the circumscribed bounding box of the third small mesh, the circumscribed bounding box of the third small mesh is obtained by further dividing the eight parts obtained from the four parts divided by the first two types of dividing lines (thick black solid line and dashed line) by the third type of dividing line (thin solid line) in the figure. At this time, ; and so on.
[0066] Next, the circumscribed bounding boxes of all small meshes can be added to the K-D tree. For each circumscribed bounding box, calculate its center point and store and index it as a node of the K-D tree.
[0067] Finally, the K-D tree can be recursively partitioned based on the coordinates of the bounding boxes of all small grids. Starting from the root node, a dimension (x, y, or z) is selected in turn, and the data set is divided into two parts at the median point (the median of the positions) in that dimension until the leaf nodes of the tree are reached, or the volume of the node is less than or equal to (To avoid the situation of model coincidence). Each leaf node stores at least one grid. Figure 3 The left figure shown in Figure 3 is a three-dimensional construction schematic diagram, and the right figure is a construction schematic diagram in two dimensions after spatial dimensionality reduction.
[0068] In some embodiments, the above method of constructing the search space of the three-dimensional grid using an octree with adaptive voxels can be to first obtain the bounding boxes of all grids in the three-dimensional grid, and use the smallest cube after merging the bounding boxes as the root node of the octree; then divide the root node of the octree into multiple child nodes in the three-dimensional coordinate system, and the spatial range of each child node is the volume block range of a cube in the three-dimensional coordinate system; finally, continue to divide the child nodes of the octree into multiple smaller volume blocks in the three-dimensional coordinate system until the volume block is not larger than the smallest voxel or the number of three-dimensional grid patches contained in the volume block is not larger than a preset threshold, and the smallest voxel is determined based on the larger quartile of the volumes of the bounding boxes of all grids in the three-dimensional grid.
[0069] For large grids, using a K-D tree constructed with bounding boxes as their search space may result in a large number of node overlaps, and the bounding boxes of large grids may be very large, almost covering the entire query range or the entire range of the K-D tree, which has a very large impact on the query efficiency and construction of the K-D tree. Even if a large grid is forcibly inserted into the K-D tree, the entire large grid will be retrieved subsequently, which has no positive significance for performance. For the above reasons, adaptive voxels can be used to represent the patch distribution state inside large grids, and an octree is used to index the voxels of all large grids to facilitate fast range queries.
[0070] In one example, the steps of constructing an octree large grid search space based on adaptive voxels can be:
[0071] First, the adaptive voxelization size can be set. During the adaptive voxelization process, the scale of the voxels is dynamically adjusted according to the patch distribution of the grid and the geometric shape of the grid itself. From experience, when the number of patches of a three-dimensional grid is within a certain threshold number of patches (for example patches), the computational efficiency during its cutting process is relatively high. Therefore, during the voxelization process, if the number of patches in a certain node is less than or equal to If the number of patches of a node is less than or equal to a certain value, the node can no longer be subdivided. In a more refined area, if the voxel size is too small, it may lead to an excessive computational burden. Therefore, a minimum voxel scale can be set. Among them, the minimum voxel can be determined based on the larger quartile of the volumes of the bounding boxes of all meshes. It is determined as follows. Specifically, when the volume of the current node is less than or equal to , the volume of this node will no longer be further subdivided, that is, this node becomes the smallest indivisible voxel to ensure the controllability and stability of the calculation. Expressed by a formula, let be the current voxel node. If: , then it can be judged that is the minimum voxel and will no longer be subdivided.
[0072] Next, an octree index can be constructed. After determining the termination condition of voxel subdivision, an octree can be constructed to index these voxels. Each octree leaf node can correspond to a voxel and contain all the intersecting patches within the voxel range. The levels and branches of the octree can be dynamically adjusted according to the distribution of the model, and it can efficiently divide the three-dimensional space into multiple smaller regions, thereby accelerating subsequent query and cutting operations. The steps to construct the octree index can be:
[0073] A. By merging the bounding boxes of all meshes, a minimum rectangular range containing all meshes can be obtained, and this range is used as the range of the octree root node. Specifically, the bounding box of the root node can be expressed as:
[0074] where can represent the bounding box of the th large mesh , and can be the number of meshes.
[0075] B. During the construction of the octree, the root node can be divided into multiple child nodes, and the spatial range of each child node can be a subset of the root node range. By recursively subdividing each child node into smaller volume blocks until the node meets the aforementioned voxel subdivision termination condition, it can be expressed as:
[0076] Exemplarily, when the length of the axis in the three-dimensional coordinate system is much smaller than the lengths of the axis and the axis, a quadtree with adaptive voxels is used to construct the search space of the three-dimensional mesh.
[0077] Figure 4 shows a multi-faceted cutting scheme for a three-dimensional mesh provided in an embodiment of the present application when in the three-dimensional coordinate system The length of the axis is much smaller than the length of the axis and When the length of the axis is such that, for the schematic diagram of constructing the search space of the three-dimensional grid using a quadtree with adaptive voxels. Continuing with the above example, for large city-level grids, generally the length of the axis will be much smaller than and , at this time, due to the lack of one dimension, the octree can degenerate into a quadtree; correspondingly, the volume formula of the voxel can be expressed as:
[0078] Figure 4 shows the construction effect under the quadtree. Similar to the construction of Figure 3 , only the axis is not considered, and it will not be elaborated here.
[0079] The above steps can first define the boundary rules for large and small grids through statistics, and then use the K-D tree and the octree with adaptive voxels to index the small and large grids respectively. In this structure, all patches are included in a certain voxel. From the perspective of storage efficiency, for small grids, indexing through the K-D tree can arrange its circumscribed bounding box in a suitable spatial region in an efficient manner, avoiding redundant spatial allocation. For larger grids, an octree structure with adaptive voxelization is used to divide the space, and the scale of the voxels is dynamically adjusted according to the distribution of the grids, reducing ineffective subdivision and ensuring that only necessary voxels participate in the calculation, thus avoiding storage waste caused by over-subdivision; from the perspective of query efficiency, the hybrid structure of the K-D tree and the octree with adaptive voxels can significantly improve the query efficiency. The K-D tree provides fast spatial query capabilities for small grids, while the octree optimizes the query performance of large grids through efficient voxel division. The combination of the two can not only avoid redundant calculations, but also adaptively adjust the query accuracy according to the size and complexity of the query area, ensuring a high query response speed. In addition, to improve the efficiency of search space division, dimensionality reduction division can also be performed in some cases to further accelerate the construction efficiency and query efficiency. At the same time, as the data scale increases, this structure can dynamically adjust and optimize the query efficiency to meet the query requirements of three-dimensional data at the city scale.
[0080] In step S102, query the small grids that intersect with the cutting bread bounding box through the K-D tree to obtain the small grids to be cut, and / or query the voxels in the large grids that intersect with the cutting bread bounding box through the octree with adaptive voxels, and obtain the large grids to be cut in the voxels.
[0081] In a possible implementation manner, the method of querying, through a K-D tree, the small grids that intersect with the cutting bread bounding box to obtain the small grids to be cut may be to query, through a K-D tree, the small grids that intersect with the cutting bread bounding box; and delete the small grids outside the cutting bread bounding box to obtain the small grids to be cut.
[0082] For small grids, directly use the cutting bread bounding box to query all grids that intersect with the cutting bread bounding box through a K-D tree, and perform cutting detection on the grids, without the need to further subdivide the patches inside the grids. The specific operation may be to first query the small grids, use the cutting bread bounding box to perform range query through a K-D tree, and directly extract the relevant small grids according to the cutting bread bounding box. Since these grids are usually relatively small, the entire grid can be directly obtained without further dividing into patches; then mark the grids to be retained and to be cut, discard the grids outside the cutting plane, and perform cutting detection on each candidate grid (the grids obtained from the K-D tree query). That is, grids or voxels with all vertices in the positive half-space and on the cutting plane of the cutting plane can be marked as to be retained; grids or voxels with two vertices in the positive half-space and negative half-space of the cutting plane respectively can be marked as to be cut; grids or voxels with all vertices not in the positive half-space of the cutting plane can be marked as not passed. In this way, the cutting detection result of each candidate grid can be marked as to be retained or to be cut, and the grids that do not pass the cutting detection are directly discarded. The goal of this step is to quickly screen out the grids that intersect with the set of cutting planes.
[0083] In a possible implementation manner, the large grid to be cut may include grids and patches to be cut; the method of querying, through an octree with adaptive voxels, the voxels in the large grid that intersect with the cutting bread bounding box and obtaining the set of large grids to be cut in the voxels may be to query, through an octree with adaptive voxels, the voxels in the large grid that intersect with the cutting bread bounding box; delete the voxels outside the cutting bread bounding box to obtain the voxels to be cut; extract all grids and patches in the voxels to be cut to obtain the large grids to be cut in the voxels.
[0084] Exemplarily, since the advantage of the octree in spatial partitioning lies in its ability to quickly locate the voxels that may be involved in the cutting plane set, voxels in the large grid that intersect with the bounding box of the cutting plane can be queried through the octree of adaptive voxels. The bounding box of the cutting plane is used to query all voxels through the octree to find the voxels that intersect with the bounding box of the cutting plane. Then, the patches in the voxels are marked. After finding the voxels related to the cutting plane set, cutting detection is performed on each voxel. That is, grids or voxels with all vertices in the positive half-space and on the cutting plane of the cutting plane can be marked as to be retained; grids or voxels with two vertices in the positive half-space and negative half-space of the cutting plane respectively in the grid or voxel can be marked as to be cut; grids or voxels with no vertices in the positive half-space of the cutting plane can be marked as not passed. In this way, the cutting detection result of each candidate grid can be marked as to be retained or to be cut, and grids that do not pass the cutting detection are directly discarded. This step is actually to mark the voxels, but there is no concept of voxels in the subsequent cutting, and the concept of voxels only stays in the search space. Therefore, in order to remove the concept of voxels here, the patches or grids in the voxels are directly marked, which is convenient for subsequent calculations.
[0085] In step S103, the small grids to be cut and the large grids to be cut are decomposed into at least one polygon patch, the vertices of the polygon patch are constructed into a set of valid points to be processed in clockwise order, and according to the relative position relationship between two adjacent valid points in the set of valid points to be processed and the cutting planes in the cutting plane set, valid points are retained, eliminated, and / or added to obtain an updated set of valid points, and a three-dimensional patch is constructed based on the updated set of valid points.
[0086] In the embodiment of the present application, after screening out the two groups of grids and patches to be retained and to be cut, the grids and patches to be cut can be cut by the cutting planes using a multi-plane cutting algorithm to retain all valid structures inside the cutting plane set. In order to achieve a balance between performance and complexity, a multi-plane cutting algorithm for three-dimensional space can be designed based on the Sutherland-Hodgman polygon clipping algorithm. The Sutherland-Hodgman algorithm is widely used in two-dimensional space, and the basic idea is to traverse the cutting plane and update the vertex set of the polygon in turn. However, the traditional Sutherland-Hodgman algorithm is only applicable to two-dimensional space and only suitable for processing convex polygons, which does not meet the requirements of the present application. Therefore, the embodiment of the present application has modified the Sutherland-Hodgman algorithm, extended its idea to three-dimensional space, and proposed a multi-plane cutting algorithm based on vertex operations, which can handle more complex three-dimensional grids and the cutting problems of concave polygons.
[0087] Exemplarily, the multi-plane cutting steps are as follows:
[0088] First, variables can be defined, that is, the set of valid points is obtained. Figure 5 A schematic diagram of a set of valid points in a multi - surface cutting scheme of a three - dimensional grid provided in an embodiment of the present application is shown. As Figure 5 shown, decomposing the small grid to be cut and the large grid to be cut into at least one polygon patch, and constructing the vertices of the polygon patch in clockwise order to form a set of valid points to be processed may include valid points (effective point, ep): ( Figure 5 In , the valid point is ); the set of valid points , where the order of the points in the set of valid points can be clockwise, and there is one and only one edge between any two adjacent points.
[0089] Correspondingly, other variables can also be defined according to the valid points in the set of valid points. The present application does not impose any restrictions on the variables thus defined. For example:
[0090] Cutting plane ;
[0091] Set of cutting planes ;
[0092] Points on the patch, in clockwise direction: ;
[0093] Set of original patches ;
[0094] Set of patches after cutting .
[0095] Secondly, the grid can be decomposed into patches (grid - decomposed patches). Figure 6 A schematic diagram of decomposing a grid into at least one polygon patch in a multi - surface cutting scheme of a three - dimensional grid provided in an embodiment of the present application is shown. As Figure 6 shown, the grid - decomposed patches of a three - dimensional grid are to decompose a complex three - dimensional grid model into a series of simple patches (usually triangles or quadrilaterals, and can also be polygons in the embodiments of the present application, and the present application does not impose any restrictions on this). For a grid composed of independent patches itself, each independent patch of the grid can be taken out separately, and its vertices are saved separately; for a grid with non - independent patches, when reading the patches, the vertices of each patch can be regenerated to implement the decomposition of the grid into patches, and finally all the patches are put into the set of original patches ( ).
[0096] In a possible implementation, the polygonal patch is composed of at least three sides; the method of retaining, eliminating, and / or adding valid points according to the relative positional relationship between two adjacent valid points in the set of valid points to be processed and the cutting plane in the set of cutting planes to obtain an updated set of valid points can be as follows: first, when both of the two adjacent valid points are located in the positive direction of the normal line of the cutting plane, retain the two adjacent valid points; then, when both of the two adjacent valid points are located in the negative direction of the normal line of the cutting plane, mark and delete the two adjacent valid points; then, when one of the two adjacent valid points is located in the positive direction of the normal line of the cutting plane and the other is located in the negative direction of the normal line of the cutting plane, take the intersection point of the line segment formed by the two adjacent valid points and the cutting plane as an added valid point, retain the valid point located in the positive direction of the normal line of the cutting plane, and mark and delete the valid point located in the negative direction of the normal line of the cutting plane; finally, delete all the marked and deleted valid points, and add all the added valid points to the set of valid points in order after marking to obtain an updated set of valid points.
[0097] Continuing with the above example, after decomposing the mesh into patches, multi-plane cutting and edge generation can be performed. During the multi-plane cutting process, in order to reduce the copying overhead of the vertices and their related data after cutting by different cutting planes, the "sequential cutting and single copy" strategy is adopted in the embodiments of the present application. Each cutting plane is calculated sequentially, and finally a single copy is performed at once, and no real copy is performed during the intermediate process.
[0098] Figure 7 The figure shows a schematic diagram of retaining, eliminating, and / or adding valid points according to the relative positional relationship between two adjacent valid points in the set of valid points to be processed and the cutting plane in the set of cutting planes in a multi-plane cutting scheme of a three-dimensional mesh provided in the embodiments of the present application to obtain an updated set of valid points. As Figure 7 shown, the overall process of multi-plane cutting and edge generation can be as follows:
[0099] Traverse the original patches: ;
[0100] (1) Construct a set of valid points for the vertices of the patch in a clockwise direction, which can be expressed as: ;
[0101] (2) Traverse the set of cutting planes If , it means that stable patches can no longer be generated for the current valid points, break out of the loop, and take the next patch f, that is, perform cutting on the next patch;
[0102] Otherwise, sequentially take two adjacent valid points from in order (For example or ),in
[0103] Then you can bring the effective point into the plane formula of the cutting surface to determine the effective point Relative to the cutting plane The specific judgment formula can be expressed as:
[0104] The process of adding and marking effective points can be expressed as:
[0105] if , then keep these two valid points without any modification;
[0106] if , then these two points are marked as eliminated;
[0107] if , then the line segment between these two points and the cutting surface intersect.
[0108] The situation of adding effective points is that In the case of , and the intersection Insert into the valid point set In and Between, keep Note the clockwise nature of the new intersection point. Will not be cut in this cutting surface The effective points are selected in the cutting process. Figure 7 The intersection of and .
[0109] The case of deleting valid points is that it can be ( ), it is determined that both valid points are outside the cutting surface, and ( ) Mark out.
[0110] The situation of retaining valid points is that When , it is determined that both valid points are within the cutting surface, the two valid points can be retained without any modification.
[0111] For example, Figure 7 In the example, we assume that there are 4 valid points. , and a total of 4 cutting surfaces , we can first calculate the effective point relative to the cutting surface Position. For example, the effective point relative to the cutting plane position, , then the line segment between these two points intersects the cutting plane and generates an intersection point , because , then delete , retain , add the new intersection point as ; the effective point relative to the cutting plane position, , then the line segment between these two points intersects the cutting plane and generates an intersection point , because , then delete , retain , add the new intersection point as . Similarly, when calculating the position relative to the cutting plane , the effective point relative to the cutting plane position, , then the line segment between these two points intersects the cutting plane and generates a new intersection point , because , then delete , retain , add the new intersection point as ; the effective point relative to the cutting plane position, , then the line segment between these two points intersects the cutting plane and generates an intersection point , because , then delete , retain , add the new intersection point as . Next, when calculating the position relative to the cutting plane , the effective points and relative to the cutting plane position, , the effective points and relative to the cutting plane position, , then retain these effective points without any modification ( Figure 7 it can be seen that the effective point is located on the cutting plane Above, the valid points The intersection points with the cutting plane coincide). Finally, when calculating the position relative to the cutting plane the valid points and relative to the cutting plane the position of if, then the line segment between these two points intersects the cutting plane the valid points and relative to the cutting plane the position of if, then the line segment between these two points intersects the cutting plane The method of adding, retaining, and deleting valid points is the same as the above steps and will not be elaborated here.
[0112] Then the set of valid points can be updated. That is, the current contains the original valid points and the newly inserted intersection points, where the original valid points have been marked for elimination and are therefore deleted together After deleting all the points marked for elimination in Figure 7 the updated set of valid points can be obtained. For example .
[0113] The updated set of valid points (eps) can be used as the set of valid points for the cutting operation with the next round of cutting planes .
[0114] After the above steps, the updated contains the valid points remaining after the cutting operation by the set of cutting planes If
[0115] it means that the current valid points can no longer generate stable patches, and the current result can be discarded to calculate the next patch . Otherwise, new patches can be generated according to the original . Since the updated are generated based on the original patches, they must be coplanar, and through orderly management throughout the cutting process, the connection relationship of the patches is ensured not to be damaged, and the valid points are always in order.
[0116] In some embodiments, valid points can also be retained, eliminated, and / or added according to the relative position relationship between two adjacent valid points in the updated set of valid points and other cutting planes in the set of cutting planes. After traversing all the cutting planes in the set of cutting planes, a set of valid points after the cutting operation is obtained; correspondingly, the above method of constructing a three-dimensional patch based on the updated set of valid points can be to construct a three-dimensional patch based on the set of valid points after the cutting operation.
[0117] Continuing with the above example, after repeating the above steps multiple times, that is, after traversing all the cutting planes in the set of cutting planes, an effective point set after the cutting operation can be obtained. Correspondingly, the above method of constructing a three-dimensional patch based on the updated effective point set can be to construct a three-dimensional patch based on the effective point set after the cutting operation.
[0118] In a possible implementation manner, all the effective points in the updated effective point set are marked with a clockwise order; correspondingly, the above method of constructing a three-dimensional patch based on the updated effective point set can, according to the clockwise order of the effective points in the updated effective point set, construct the effective points in the updated effective point set into a three-dimensional patch according to the geometric constraint conditions for constructing a three-dimensional patch.
[0119] Among them, there can be various geometric constraint conditions for constructing a three-dimensional patch, such as polygon, star triangulation, triangulation, etc., and the present application does not impose any restrictions on this.
[0120] Figure 8 FIG. shows one of the schematic diagrams of an example of constructing a three-dimensional patch based on an updated effective point set in a multi-plane cutting scheme of a three-dimensional mesh provided in an embodiment of the present application. As Figure 8 shown, on the premise that all points are coplanar and ordered, if there are no geometric constraint conditions for constructing a three-dimensional patch, all the effective points can be directly connected in the order of to generate a polygon patch. Continuing with the above example, the 6 effective points in the updated effective point set in can be connected in order to connect all the effective points , and a polygon patch is generated. Figure 7 in the updated effective point set to connect all the effective points , and a polygon patch is generated.
[0121] Figure 9 FIG. shows another schematic diagram of an example of constructing a three-dimensional patch based on an updated effective point set in a multi-plane cutting scheme of a three-dimensional mesh provided in an embodiment of the present application. As Figure 9 shown, on the premise that all points are coplanar and ordered, if the geometric constraint condition for constructing a three-dimensional patch is: it is required that the patch be a triangle and have good performance. Under this requirement, since the points are relatively few and ordered, star triangulation can be used to generate a new triangle for the first point and each adjacent effective point, and finally a triangular mesh is generated. However, this method is not suitable for concave polygons. Continuing with the above example, the 6 effective points in the updated effective point set in can be used, in the form of star triangulation, to connect the first effective point Figure 7 in the updated effective point set with each adjacent effective point Generate a new triangle and finally generate a triangular mesh.
[0122] Figure 10 FIG. 3 shows an example schematic diagram of constructing a three-dimensional patch based on the updated set of valid points in a multi-plane cutting scheme of a three-dimensional mesh provided in an embodiment of the present application. As Figure 10 shown, on the premise that all points are coplanar and ordered, if the geometric constraint conditions for constructing a three-dimensional patch are: the patch is required to be a triangle and there are geometric constraint conditions for the triangle (all triangles do not cross, and the triangle itself avoids being too flat, etc.), at this time, Delaunay triangulation can be used. Continuing with the above example, according to the 6 valid points in the updated set of valid points in Figure 7 , in the form of Delaunay triangulation, connect 3 adjacent valid points that can form a triangle to form a new triangle and finally generate a triangular mesh, for example . .
[0123] Next, the patch generated in the previous step can be added to the set of cut patches . When all patches have been traversed, is the final result of the three-dimensional mesh cutting. At this time, all vertex attributes in can be copied to construct a real three-dimensional patch. That is, the valid points in the updated set of valid points are constructed into three-dimensional patches according to the geometric constraint conditions for constructing three-dimensional patches.
[0124] In step S104, the three-dimensional patch is merged into the three-dimensional mesh to form a new three-dimensional mesh.
[0125] In the embodiment of the present application, the purpose of this step is to merge the patches and meshes to be retained with the new patches generated at the cutting edge in the previous step to generate a new complete three-dimensional mesh and form the final cutting result. The process of merging meshes can merge meshes according to requirements.
[0126] In a possible implementation manner, before the three-dimensional patch is merged into the three-dimensional mesh to form a new three-dimensional mesh, the above solution may further include: querying small meshes located inside the cutting breading box through a K-D tree to obtain the small meshes to be retained, and / or querying voxels in the large meshes located inside the cutting breading box through an octree of adaptive voxels to obtain the large meshes to be retained in the voxels.
[0127] The process of retaining small meshes and retaining large meshes has been reflected in the previous steps and will not be elaborated here.
[0128] In some embodiments, the method of merging the three-dimensional patches into the three-dimensional mesh to form a new three-dimensional mesh may include searching for the meshes and patches that appear in more than two voxels in the large mesh to be retained, and performing a deduplication process on the meshes and patches to obtain a large mesh after the deduplication process; merging the small mesh to be retained, the large mesh after the deduplication process, and the three-dimensional patches to form a new three-dimensional mesh.
[0129] In the search space of the large mesh, since the large mesh is voxelized, some of its patches may appear in multiple voxels. During merging, deduplication can be performed according to the meshes and indices; the scale of the city-level three-dimensional mesh is relatively large, and the overhead of copying is also relatively large. During the copying process, it can be copied at one time. Since this application does not focus on restoring the topological characteristics of the mesh during the merging process, but is mainly oriented towards display optimization and performance improvement, the merged mesh is very likely to be non-manifold, which is suitable for the efficient processing and display of large-scale data sets.
[0130] The multi-plane cutting method of the three-dimensional mesh proposed in the embodiments of this application, compared with the traditional processing method (traversing all meshes + multiple single-plane cuts), greatly reduces the processing time in the case of multi-plane cutting of the city-scale three-dimensional mesh. After testing, since the embodiments of this application propose a method of constructing a search space, the number of patches during cutting is greatly reduced in the multi-plane cutting based on fast positioning and screening in the search space, thereby greatly reducing the time consumed by multi-plane cutting; in addition, benefiting from "successive calculation and single copy", the time consumed by data copying is also greatly reduced. The total consumption time is about 1 / 13 of the traditional scheme.
[0131] Corresponding to the above examples and method embodiments provided in the embodiments of this application, the embodiments of this application also provide a multi-plane cutting device for a three-dimensional mesh, which is applied to a city-level three-dimensional mesh. As Figure 11 shown in the structural block diagram of the multi-plane cutting device 1100 of a three-dimensional mesh according to an embodiment of this application, the device 1100 may include:
[0132] The bread cutting frame acquisition module 1101 is configured to retrieve the cutting plane set of the three-dimensional grid and calculate the bread cutting frame in the cutting plane set; the small grid to be cut acquisition module 1102 is configured to query the small grids intersecting with the bread cutting frame through a K-D tree to obtain the small grids to be cut, and / or query the voxels in the large grid intersecting with the bread cutting frame through an octree of adaptive voxels and obtain the large grids to be cut in the voxels; the three-dimensional patch construction module 1103 is configured to decompose the small grids to be cut and the large grids to be cut into at least one polygon patch, construct the vertices of the polygon patch in a clockwise order into a set of valid points to be processed, and retain, eliminate, and / or add valid points according to the relative position relationship between two adjacent valid points in the set of valid points to be processed and the cutting planes in the cutting plane set to obtain an updated set of valid points, and construct a three-dimensional patch based on the updated set of valid points; the three-dimensional grid formation module 1104 is configured to merge the three-dimensional patch into the three-dimensional grid to form a new three-dimensional grid.
[0133] In a possible implementation manner, before merging the three-dimensional patch into the three-dimensional grid to form a new three-dimensional grid, the apparatus may further include: a small grid to be retained acquisition module, configured to query the small grids located inside the bread cutting frame through a K-D tree to obtain the small grids to be retained, and / or query the voxels in the large grid located inside the bread cutting frame through an octree of adaptive voxels to obtain the large grids to be retained in the voxels.
[0134] In some embodiments, the above three-dimensional grid formation module 1104 may include: a duplicate removal sub-module, configured to search for the grids and patches that appear in more than two voxels in the large grids to be retained and perform duplicate removal processing on the grids and patches to obtain the large grids after duplicate removal processing; a merging sub-module, configured to merge the small grids to be retained, the large grids after duplicate removal processing, and the three-dimensional patch to form a new three-dimensional grid.
[0135] In a possible implementation manner, before retrieving the cutting plane set of the three-dimensional grid and calculating the bread cutting frame in the cutting plane set, the above apparatus may further include: a search space construction module, configured to construct the search space of the three-dimensional grid by using a K-D tree of an external bounding box based on the classification of the three-dimensional grid, and / or construct the search space of the three-dimensional grid by using an octree of adaptive voxels.
[0136] In some embodiments, the above-mentioned search space construction module may include: an external bounding box dataset composition sub-module, configured to obtain the external bounding boxes of all small grids in the three-dimensional grid, and use the smallest cube range after merging the external bounding boxes as the root node of the K-D tree, and obtain the coordinates of the external bounding boxes in the three-dimensional coordinate system to form an external bounding box dataset; an original node generation sub-module, configured to calculate the center points of the external bounding boxes of all small grids in the three-dimensional grid, and use the center points as the original nodes of the K-D tree, where the original nodes are used for storage and indexing; a child node generation sub-module, configured to select a dimension in the three-dimensional coordinate system, start from the root node of the K-D tree, use the midpoint of the root node and the original node in the dimension in the external bounding box dataset as the child nodes of the K-D tree, and then use the midpoint between the two child nodes, between the child node and the root node, or between the child node and the original node in the dimension in the external bounding box dataset as the new child nodes of the K-D tree until the leaf nodes of the K-D tree are obtained or the volume of the child nodes is not greater than a preset threshold.
[0137] In some embodiments, the above-mentioned search space construction module may include: a root node generation sub-module, configured to obtain the external bounding boxes of all grids in the three-dimensional grid, and use the smallest cube after merging the external bounding boxes as the root node of the octree; a child node generation sub-module, configured to divide the root node of the octree into multiple child nodes in the three-dimensional coordinate system, and the spatial range of each child node is the volume block range of a cube in the three-dimensional coordinate system; a volume block division sub-module, configured to continue to divide the child nodes of the octree into multiple smaller volume blocks in the three-dimensional coordinate system until the volume block is not greater than the smallest voxel or the number of three-dimensional grid patches included in the volume block is not greater than a preset threshold, and the smallest voxel is determined based on the larger quartile of the volumes of the external bounding boxes of all grids in the three-dimensional grid.
[0138] Exemplarily, the above-mentioned device may further include: a three-dimensional grid search space dimensionality reduction construction module, configured to use a quadtree with adaptive voxels to construct the search space of the three-dimensional grid when the length of the z-axis in the three-dimensional coordinate system is much smaller than the lengths of the x-axis and the y-axis.
[0139] In a possible implementation manner, the above-mentioned to-be-cut grid acquisition module 1102 may include: a small grid query sub-module, configured to query the small grids intersecting with the cutting bread bounding box through a K-D tree; a to-be-cut small grid acquisition sub-module, configured to delete the small grids outside the cutting bread bounding box to obtain the to-be-cut small grids.
[0140] In a possible implementation, the large grid to be cut includes grids and patches to be cut; correspondingly, the above-mentioned large grid acquisition module 1102 for the grid to be cut may include: a voxel query sub-module, configured to query the voxels in the large grid that intersect with the bounding box of the cutting plane through an octree of adaptive voxels; a voxel to be cut acquisition sub-module, configured to delete the voxels outside the bounding box of the cutting plane to obtain the voxels to be cut; a large grid to be cut acquisition sub-module, configured to extract all the grids and patches in the voxels to be cut to obtain the large grid to be cut in the voxels.
[0141] In a possible implementation, the polygon patch is composed of at least three sides; correspondingly, the above-mentioned three-dimensional patch construction module 1103 may include: a marker retention sub-module, configured to retain the two adjacent valid points when both of the two adjacent valid points are located in the positive direction of the normal of the cutting plane; a marker deletion sub-module, configured to mark and delete the two adjacent valid points when both of the two adjacent valid points are located in the negative direction of the normal of the cutting plane; a retention, elimination, and addition sub-module, configured to, when one of the two adjacent valid points is located in the positive direction of the normal of the cutting plane and the other is located in the negative direction of the normal of the cutting plane, use the intersection point of the line segment formed by the two adjacent valid points and the cutting plane as a newly added valid point, retain the valid point located in the positive direction of the normal of the cutting plane, and mark and delete the valid point located in the negative direction of the normal of the cutting plane; a deletion sub-module, configured to delete all the marked and deleted valid points, and add the newly added valid points to the valid point set in the marked order to obtain an updated valid point set.
[0142] In some embodiments, the above-mentioned device may further include: a valid point set acquisition module after cutting operation, configured to retain, eliminate, and / or add valid points according to the relative position relationship between two adjacent valid points in the updated valid point set and other cutting planes in the cutting plane set, and obtain a valid point set after cutting operation after traversing all the cutting planes in the cutting plane set; correspondingly, the above-mentioned three-dimensional patch construction module 1103 may include: a first three-dimensional patch construction sub-module, configured to construct a three-dimensional patch based on the valid point set after cutting operation.
[0143] In a possible implementation, all the valid points in the updated valid point set are marked with a clockwise order; correspondingly, the above-mentioned three-dimensional patch construction module 1103 may include: a second three-dimensional patch construction sub-module, configured to construct the valid points in the updated valid point set into a three-dimensional patch according to the clockwise order of the valid points in the updated valid point set and the geometric constraint conditions for constructing a three-dimensional patch.
[0144] For the functions of the modules in the devices of the embodiments of the present application, reference may be made to the corresponding descriptions in the above methods, and they have corresponding beneficial effects, which will not be elaborated here.
[0145] Figure 12 It is a block diagram of an electronic device for implementing the embodiments of the present application. As Figure 12 shown, the electronic device includes: a memory 1201 and a processor 1202. The memory 1201 stores a computer program that can run on the processor 1202. When the processor 1202 executes the computer program, the method in the above embodiments is implemented. The number of the memory 1201 and the processor 1202 can be one or more.
[0146] The electronic device further includes:
[0147] a communication interface 1203, configured to communicate with external devices and perform data interaction and transmission.
[0148] If the memory 1201, the processor 1202, and the communication interface 1203 are implemented independently, the memory 1201, the processor 1202, and the communication interface 1203 can be interconnected through a bus and communicate with each other. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of representation, Figure 12 only a thick line is shown in
[0149] but it does not mean that there is only one bus or one type of bus. Optionally, in specific implementation, if the memory 1201, the processor 1202, and the communication interface 1203 are integrated on a chip, the memory 1201, the processor 1202, and the communication interface 1203 can communicate with each other through an internal interface.
[0150] The embodiments of the present application provide a computer-readable storage medium, which stores a computer program. When the program is executed by a processor, the method provided in the embodiments of the present application is implemented.
[0151] The embodiments of the present application further provide a computer program product, which includes a computer program. When the computer program is executed by a processor, the method provided in any one of the embodiments of the present application is implemented.
[0152] An embodiment of this application also provides a chip, which includes a processor for calling and running instructions stored in a memory, so that a communication device installed with the chip executes the method provided by the embodiment of this application.
[0153] An embodiment of this application also provides a chip, including: an input interface, an output interface, a processor, and a memory. The input interface, the output interface, the processor, and the memory are connected through an internal connection path. The processor is used to execute the code in the memory. When the code is executed, the processor is used to execute the method provided by the embodiment of this application.
[0154] It should be understood that the above-mentioned processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc. It is worth noting that the processor may be a processor that supports the advanced reduced instruction set machine (ARM) architecture.
[0155] Further, optionally, the above-mentioned memory may include a read-only memory and a random access memory. The memory may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may include a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may include a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available. For example, static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct rambus random access memory (DR RAM).
[0156] In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions according to the present application are generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium.
[0157] In the description of this specification, the descriptions with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples", etc. mean that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of this application. Moreover, the specific features, structures, materials, or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, without contradiction, those skilled in the art can combine and combine the different embodiments or examples described in this specification and the features of different embodiments or examples.
[0158] In addition, the terms "first" and "second" are used for descriptive purposes only and cannot be construed as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, the features defined with "first" and "second" may explicitly or implicitly include at least one of these features. In the description of this application, "a plurality of" means two or more unless otherwise specifically defined.
[0159] Any process or method described in the flowchart or otherwise described herein can be understood to represent a module, segment, or portion of code including one or more executable instructions for implementing a specific logical function or process. And the scope of the preferred embodiments of this application includes additional implementations, where the functions may be executed in a substantially simultaneous manner or in the reverse order according to the functions involved, rather than in the order shown or discussed.
[0160] The logic and / or steps described in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing a logical function, and can be specifically implemented in any computer-readable medium for use by an instruction execution system, apparatus, or device (such as a computer-based system, a system including a processor, or other systems that can fetch and execute instructions from the instruction execution system, apparatus, or device), or in connection with these instruction execution systems, apparatus, or devices.
[0161] It should be understood that each part of this application can be implemented by hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. All or part of the steps of the method in the above embodiments can be completed by a program instructing the relevant hardware, and this program can be stored in a computer-readable storage medium. When this program is executed, it includes one or a combination of the steps of the method embodiment.
[0162] In addition, each functional unit in various embodiments of the present application may be integrated into one processing module, or each unit may exist physically alone, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. When the above-mentioned integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium. The storage medium may be a read-only memory, a magnetic disk, an optical disc, or the like.
[0163] As described above, it is only an exemplary embodiment of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art within the technical scope recorded in the present application can easily think of various changes or substitutions thereof, and these should all be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A multi-faceted cutting method for a three-dimensional grid, applied to a city-level three-dimensional grid, comprising: Retrieving a clipping surface set of the three-dimensional grid, and calculating a clipping surface bounding box in the clipping surface set; Querying the small grid intersecting with the cropping surface bounding box through the KD tree to obtain the small grid to be cut, and / or, querying the voxels in the large grid intersecting with the cropping surface bounding box through the octree of the adaptive voxel, and obtaining the large grid to be cut in the voxel; Decompose the small grid to be cut and the large grid to be cut into at least one polygonal patch, construct the vertices of the polygonal patch into a valid point set to be processed in a clockwise order, retain, eliminate and / or add valid points according to the relative position relationship between two adjacent valid points in the valid point set to be processed and the cutting surface in the cutting surface set, obtain an updated valid point set, and construct a three-dimensional patch based on the updated valid point set; wherein the relative position relationship between two adjacent valid points in the valid point set to be processed and the cutting surface in the cutting surface set includes: the two adjacent valid points are located in the positive direction or the negative direction of the normal of the cutting surface; The three-dimensional facets are merged into the three-dimensional mesh to form a new three-dimensional mesh.
2. The method according to claim 1, wherein: Before merging the three-dimensional facets into the three-dimensional mesh to form a new three-dimensional mesh, the method further includes: The small grid located inside the cropping surface bounding box is queried through the KD tree to obtain the small grid to be retained, and / or the voxels in the large grid located inside the cropping surface bounding box are queried through the octree of the adaptive voxels to obtain the large grid to be retained in the voxels.
3. The method according to claim 2, wherein: The step of merging the three-dimensional facets into the three-dimensional mesh to form a new three-dimensional mesh comprises: Searching for meshes and patches that appear in more than two voxels in the large mesh to be retained, and performing deduplication processing on the meshes and patches to obtain a large mesh after deduplication processing; The small grid to be retained, the large grid after deduplication processing and the three-dimensional facet are merged to form a new three-dimensional grid.
4. The method according to claim 1, wherein: Before calling the clipping surface set of the three-dimensional grid and calculating the clipping surface bounding box in the clipping surface set, the method further includes: Based on the classification of the three-dimensional grid, a KD tree of an external bounding box is used to construct a search space of the three-dimensional grid, and / or an octree of adaptive voxels is used to construct the search space of the three-dimensional grid.
5. The method according to claim 4, wherein: The method of constructing the search space of the three-dimensional grid using the KD tree of the external bounding box includes: Obtaining the outer bounding boxes of all small grids in the three-dimensional grid, and taking the smallest cubic range after the outer bounding boxes are merged as the root node of the KD tree, and obtaining the coordinates of the outer bounding boxes in the three-dimensional coordinate system to form an outer bounding box data set; Calculate the center point of the circumscribed bounding box of all small grids in the three-dimensional grid, and use the center point as the original node of the KD tree, wherein the original node is used for storage and indexing; A dimension in the three-dimensional coordinate system is selected, starting from the root node of the KD tree, and the midpoint between the root node and the original node in the dimension in the circumscribed bounding box data set is used as a child node of the KD tree, and then the midpoint between two child nodes in the dimension, between a child node and the root node, or between a child node and the original node in the circumscribed bounding box data set is used as a new child node in the KD tree, until a leaf node of the KD tree is obtained or the volume of the child node is not greater than a preset threshold.
6. The method according to claim 4, wherein: The search space of constructing the three-dimensional grid using the octree of adaptive voxels includes: Obtaining the external bounding boxes of all grids in the three-dimensional grid, and taking the smallest cube formed by merging the external bounding boxes as the root node of the octree; Dividing the root node of the octree into a plurality of child nodes in a three-dimensional coordinate system, wherein the spatial range of each child node is a volume block range of a cube in the three-dimensional coordinate system; The child nodes of the octree are further divided into a plurality of smaller volume blocks in a three-dimensional coordinate system until the volume block is no larger than a minimum voxel or the number of three-dimensional mesh facets contained in the volume block is no larger than a preset threshold, and the minimum voxel is determined based on a larger quartile of the volume of the circumscribed bounding boxes of all meshes in the three-dimensional mesh.
7. The method according to claim 6, wherein: The method further comprises: When the z-axis length in the three-dimensional coordinate system is much smaller than the x-axis length and the y-axis length, a quadtree of adaptive voxels is used to construct the search space of the three-dimensional grid.
8. The method according to claim 1, wherein: The small meshes to be cut are obtained by querying the small meshes intersecting with the cropping surface bounding box through the KD tree, and the small meshes to be cut include: Query the small grids intersecting with the clipping surface bounding box through the KD tree; The small mesh outside the cutting surface bounding box is deleted to obtain the small mesh to be cut.
9. The method according to claim 1, wherein: The large grid to be cut includes grids and facets to be cut; The querying of the voxels in the large grid intersecting with the clipping plane bounding box through the octree of the adaptive voxels and obtaining the set of large grids to be cut in the voxels includes: Querying voxels in the large grid that intersect the clipping plane bounding box through an adaptive voxel octree; Deleting the voxels outside the bounding box of the cutting surface to obtain the voxels to be cut; All meshes and patches in the voxel to be cut are extracted to obtain a large mesh to be cut in the voxel.
10. The method according to claim 1, wherein: The polygonal patch consists of at least three edges; The retaining, eliminating and / or adding effective points according to the relative position relationship between two adjacent effective points in the effective point set to be processed and the cutting plane in the cutting plane set to obtain an updated effective point set includes: When the two adjacent valid points are both located in the positive direction of the normal line of the cutting surface, retaining the two adjacent valid points; In the case where the two adjacent valid points are both located in the negative direction of the normal line of the cutting surface, marking the two adjacent valid points for deletion; In the case where one of the two adjacent valid points is located in the positive direction of the normal line of the cutting surface and the other valid point is located in the negative direction of the normal line of the cutting surface, the intersection of the line segment formed by the two adjacent valid points and the cutting surface is used as a newly added valid point, the valid point located in the positive direction of the normal line of the cutting surface is retained, and the valid point located in the negative direction of the normal line of the cutting surface is marked for deletion; Delete all the marked deleted valid points, and mark all the newly added valid points in order and add them to the valid point set to obtain the updated valid point set.
11. The method according to claim 10, wherein: The method further comprises: According to the relative position relationship between two adjacent valid points in the updated valid point set and other cutting surfaces in the cutting surface set, retain, eliminate and / or add valid points, and after traversing all cutting surfaces in the cutting surface set, obtain a valid point set after cutting operation; The constructing of a three-dimensional surface based on the updated valid point set comprises: Construct a three-dimensional patch based on the valid point set after the cutting operation.
12. The method according to claim 1, wherein: All valid points in the updated valid point set are marked in clockwise order; The constructing of a three-dimensional surface based on the updated valid point set comprises: According to the clockwise order of the valid points in the updated valid point set, the valid points in the updated valid point set are constructed into a three-dimensional facet according to the geometric constraints for constructing a three-dimensional facet.
13. A multi-faceted cutting device for a three-dimensional grid, applied to a city-level three-dimensional grid, comprising: A cutting surface bounding box acquisition module is used to retrieve a cutting surface set of a three-dimensional grid and calculate a cutting surface bounding box in the cutting surface set; A to-be-cut mesh acquisition module is used to query the small mesh intersecting with the cutting surface bounding box through a KD tree to obtain the small mesh to be cut, and / or query the voxels in the large mesh intersecting with the cutting surface bounding box through an octree of adaptive voxels to obtain the large mesh to be cut in the voxels; A three-dimensional face patch construction module, used for decomposing the small grid to be cut and the large grid to be cut into at least one polygonal face patch, constructing the vertices of the polygonal face patch into a valid point set to be processed in a clockwise order, retaining, eliminating and / or adding valid points according to the relative position relationship between two adjacent valid points in the valid point set to be processed and the cutting surface in the cutting surface set, obtaining an updated valid point set, and constructing a three-dimensional face patch based on the updated valid point set; wherein the relative position relationship between two adjacent valid points in the valid point set to be processed and the cutting surface in the cutting surface set includes: the two adjacent valid points are located in the positive direction or negative direction of the normal of the cutting surface; The three-dimensional mesh forming module is used to merge the three-dimensional facets into the three-dimensional mesh to form a new three-dimensional mesh.
14. An electronic device comprising a memory, a processor and a computer program stored in the memory, wherein the processor implements the method according to any one of claims 1 to 12 when executing the computer program.
15. A computer-readable storage medium, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the method according to any one of claims 1 to 12 is implemented.
Citation Information
Patent Citations
Rapid retrieval method based on space division and model voxelization
CN115661374A