A method and apparatus for conforming a surface to a topography
By constructing a quadtree topology to determine the coordinates of the projection points of the components, the problem of unevenness between the components and the terrain surface caused by manual calculation of terrain elevation is solved, and the components are quickly and accurately aligned with the terrain surface, thus improving the accuracy of calculation and statistics.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HUADIAN HEAVY IND CO LTD
- Filing Date
- 2026-03-11
- Publication Date
- 2026-06-19
AI Technical Summary
During the process of fitting components to the terrain surface, manual calculation of terrain elevation leads to insufficient accuracy in component structural calculations and engineering quantity statistics, affecting the flatness of components with the terrain surface.
By constructing a quadtree topology based on the target terrain data, and using the nodes of the quadtree topology to store the coordinate indexes of the sub-terrain regions, the coordinates of the projection points of the component to be fitted are determined, and the bottom of the component is fitted to the terrain surface of the target building model.
It enables rapid and accurate bonding of components to the terrain surface, improving the accuracy of component structural calculations and engineering quantity statistics.
Smart Images

Figure CN122244353A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of terrain data processing technology, and more specifically to a method and apparatus for fitting components to a terrain surface. Background Technology
[0002] In engineering mechanics, a component refers to an independent moving unit or fixed structural unit of a mechanical structure, such as a crank, beam, or column. The coordination between terrain and components is a crucial aspect of outdoor engineering modeling for buildings in factories, industrial parks, and mountainous areas. For example, equipment foundation columns in factories, streetlights along roads in industrial parks, and independent columns in mountainous buildings all require their bottoms to be flush with the terrain surface to meet structural stability requirements and ensure accurate quantity surveying.
[0003] In related technologies, during the process of fitting components to the terrain surface, workers generally need to manually check the terrain elevation of each component and then adjust the bottom elevation and position of each component individually. This method is highly dependent on manual labor and inefficient. When manually calculating the terrain elevation, the undulation of the terrain surface often leads to estimation errors, affecting the accuracy of subsequent structural calculations and quantity surveys, which in turn results in components not fitting perfectly flush with the terrain surface. Summary of the Invention
[0004] This invention provides a method and apparatus for fitting components to a terrain surface, in order to solve the problem that in the process of fitting components to a terrain surface, manually calculating the terrain elevation affects the accuracy of subsequent component structure calculations and engineering quantity statistics, thus leading to the component not fitting the terrain surface evenly.
[0005] According to the first aspect, this embodiment provides a method for fitting a component to a terrain surface, the method comprising:
[0006] Based on the target terrain data, the target terrain region is determined; Based on the target terrain region, a quadtree topology is constructed. The nodes of the quadtree topology store the coordinate indices of the sub-terrain regions of the target terrain region. Based on the base point coordinates and quadtree topology of the component to be bonded, determine the projection point coordinates of the component to be bonded. Based on the projection point coordinates of the component to be bonded, the bottom of the component to be bonded is bonded to the terrain surface of the target building model.
[0007] In some optional implementations, the target terrain region and target building model are determined based on the target terrain data, including: Preprocess the target terrain data; Select the terrain data with the largest x-coordinate, smallest x-coordinate, largest y-coordinate, and smallest y-coordinate from the preprocessed target terrain data; The target terrain data is determined based on the maximum horizontal coordinate terrain data, the minimum horizontal coordinate terrain data, the maximum vertical coordinate terrain data, and the minimum vertical coordinate terrain data.
[0008] In some alternative implementations, a quadtree topology is constructed based on the target terrain region, including: Determine the root node of the quadtree topology; Obtain the triangular mesh data of the target terrain region and the triangular mesh data of the current node; Store the triangular mesh data of the target terrain region in the root node of a quadtree topology; The quadtree topology is obtained by recursively inserting the triangular mesh data of the current node starting from the root node until the preset conditions are met. The quadtree topology stores the coordinate index of the node based on the triangular mesh data of each node.
[0009] In some optional implementations, the triangular mesh data of the current node is inserted recursively, starting from the root node, until a preset condition is met, including: Starting from the root node, determine if the number of triangles in the current node exceeds a preset threshold; If so, based on the number of triangles in the current node, divide the current node into four sub-quadrants of the same size, and assign the triangles in the current node to the corresponding sub-quadrants; If not, add the triangular mesh data of the current node to the current node and end the recursive insertion operation.
[0010] In some optional implementations, the projection point coordinates of the component to be bonded are determined based on the base point coordinates and the quadtree topology, including: Obtain the coordinates of the base point of the component to be bonded; Based on the coordinate indexes of the sub-terrain regions of the target terrain region stored in the quadtree topology structure, retrieve the leaf node of the quadtree topology structure to obtain the coordinate index of the corresponding sub-terrain region stored in the leaf node. Use the coordinate indices of the corresponding sub-terrain regions stored in the leaf nodes as the candidate coordinate index set; Using the base point coordinates of the component to be bonded as a reference, a target ray is emitted towards the target building model, and the intersection coordinates of the target ray and the candidate coordinate index set are determined. The coordinates of the intersection point are used as the coordinates of the projection point of the component to be bonded.
[0011] In some alternative implementations, a target building model is constructed using 3D building tools based on the target terrain data.
[0012] According to a second aspect, the present invention provides a device for conforming a component to a terrain surface, the device comprising: The terrain region determination module is used to determine the target terrain region based on the target terrain data. The topology construction module is used to construct a quadtree topology based on the target terrain region. The nodes of the quadtree topology store the coordinate indices of the sub-terrain regions of the target terrain region. The projection coordinate determination module is used to determine the projection point coordinates of the component to be bonded based on the base point coordinates and the quadtree topology. The terrain surface bonding module is used to bond the bottom of the component to be bonded to the terrain surface of the target building model based on the coordinates of the projection point of the component to be bonded.
[0013] According to a third aspect, the present invention provides an electronic device comprising: The memory and processor are interconnected and communicate with each other. The memory stores computer instructions, and the processor executes the computer instructions to perform the method of fitting a component to a terrain surface in the first aspect or any embodiment of the first aspect.
[0014] According to a fourth aspect, the present invention provides a computer-readable storage medium storing computer instructions for causing a computer to perform a method of conforming a component to a terrain surface according to the first aspect or any embodiment of the first aspect.
[0015] According to a fifth aspect, the present invention provides a computer program product including computer instructions for causing a computer to perform a method of conforming a component to a terrain surface in accordance with the first aspect or any embodiment of the first aspect.
[0016] The technical solution of this invention has the following advantages: This invention discloses a method and apparatus for fitting a component to a terrain surface. The method includes: determining a target terrain region based on target terrain data; constructing a quadtree topology structure based on the target terrain region, wherein the nodes of the quadtree topology structure store the coordinate indices of sub-terrain regions of the target terrain region; determining the projection point coordinates of the component to be fitted based on the base point coordinates of the component and the quadtree topology structure; and fitting the bottom of the component to be fitted to the terrain surface of the target building model based on the projection point coordinates of the component. Because this invention constructs a quadtree topology structure based on the target terrain region and further determines the projection point coordinates of the component to be fitted based on the quadtree topology structure, it achieves rapid and accurate fitting of the component to be fitted to the terrain surface, resulting in a flush fit between the component and the terrain surface. Attached Figure Description
[0017] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0018] Figure 1 This is a flowchart illustrating a method for fitting a component to a terrain surface according to an embodiment of the present invention; Figure 2 This is a schematic diagram of a quadtree topology according to an embodiment of the present invention; Figure 3 This is a schematic diagram of node insertion in a quadtree topology according to an embodiment of the present invention; Figure 4 This is a structural block diagram of a device for conforming components to a terrain surface according to an embodiment of the present invention; Figure 5 This is a schematic diagram of the hardware structure of an electronic device according to an embodiment of the present invention. Detailed Implementation
[0019] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0020] It is understood that before using the technical solutions disclosed in the various embodiments of the present invention, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in the present invention and their authorization should be obtained in accordance with relevant laws and regulations through appropriate means.
[0021] The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.
[0022] According to an embodiment of the present invention, a method embodiment for fitting a component to a terrain surface is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0023] This embodiment provides a method for fitting a component to a terrain surface, which can be used in computer equipment, servers, and mobile terminals such as mobile phones and tablets. Figure 1 This is a flowchart of a method for fitting a component to a terrain surface according to an embodiment of the present invention, such as... Figure 1 As shown, the process includes the following steps: Step S101: Determine the target terrain area based on the target terrain data.
[0024] Specifically, the target terrain data includes the terrain boundaries, elevation points, and triangular grid information of the target terrain.
[0025] In some specific implementations, step S101 above, which determines the target terrain region and the target building model based on the target terrain data, includes: Step a1: Preprocess the target terrain data.
[0026] For example, by comparing and filtering the boundary range of the target terrain and deleting points that are outside the target terrain range.
[0027] For example, if there are local missing parts in the target terrain, resulting in holes in the terrain mesh, the holes are filled by interpolation of the triangular faces near the missing points. Based on the vertex elevations of at least three complete triangular meshes around the hole, the virtual vertex coordinates of the hole area are calculated to generate new triangular faces, ensuring that the terrain mesh is continuous without any breaks.
[0028] Step a2: Select the terrain data with the largest x-coordinate, smallest x-coordinate, largest y-coordinate, and smallest y-coordinate from the preprocessed target terrain data.
[0029] Step a3: Determine the target terrain data based on the maximum horizontal coordinate terrain data, the minimum horizontal coordinate terrain data, the maximum vertical coordinate terrain data, and the minimum vertical coordinate terrain data.
[0030] For example, the maximum horizontal coordinate terrain data is represented by maxX, the minimum horizontal coordinate terrain data by minX, the maximum vertical coordinate terrain data by maxY, and the minimum vertical coordinate terrain data by minY. Based on these maxX, minX, maxY, and minY, the target terrain data is further determined.
[0031] Step S102: Based on the target terrain region, construct a quadtree topology structure. The nodes of the quadtree topology structure store the coordinate indices of the sub-terrain regions of the target terrain region.
[0032] In some specific implementations, step S102 above, which involves constructing a quadtree topology based on the target terrain region, includes: Step b1: Determine the root node of the quadtree topology.
[0033] Step b2: Obtain the triangular mesh data of the target terrain area and the triangular mesh data of the current node.
[0034] Step b3: Store the triangular mesh data of the target terrain region in the root node of the quadtree topology.
[0035] Step b4: Recursively insert the triangular mesh data of the current node starting from the root node until the preset conditions are met, thus obtaining the quadtree topology. The quadtree topology stores the coordinate index of each node based on the triangular mesh data of each node.
[0036] like Figure 2 The diagram shows a schematic of constructing a quadtree topology. The root node stores the triangular mesh data of the target terrain region. Based on the root node, child nodes of the quadtree topology are continuously inserted recursively. These child nodes are A, B, C, D, E, F, G, H, I, J, K, and L.
[0037] In some more specific implementations, step b4 above, which recursively inserts the triangular mesh data of the current node starting from the root node until a preset condition is met, includes: Step b41A: Starting from the root node, determine if the number of triangle meshes in the current node is greater than a preset threshold.
[0038] The preset threshold is the maximum number of triangle grids that is pre-defined.
[0039] Step b42A: If yes, divide the current node into four sub-quadrants of the same size according to the number of triangles in the current node, and assign the triangles in the current node to the corresponding sub-quadrants.
[0040] like Figure 3 The diagram shown illustrates node insertion in a quadtree topology. Figure 3 correspond Figure 2The quadtree topology in the diagram divides the current node into four equally sized subquadrants, A, B, C, and D, based on the number of triangles in the current node's mesh. If node A is further divided, the subquadrants become E, F, G, and H; and if node H is further divided, the subquadrants become I, J, K, and L. Figure 3 In the diagram, the four sub-quadrants of the same size are the first quadrant (northeast), the second quadrant (northwest), the third quadrant (southwest), and the fourth quadrant (southeast). The terrain range of the first quadrant is [centerX, maxX] x [centerY, maxY], the terrain range of the second quadrant is [minX, centerX] x [centerY, maxY], the terrain range of the third quadrant is [minX, centerX] x [minY, centerY], and the terrain range of the fourth quadrant is [centerX, maxX] x [minY, centerY].
[0041] Step b43A: If not, add the triangle mesh data of the current node to the current node to end the recursive insertion operation.
[0042] In step b43A above, if the number of triangle meshes in the current node is less than a preset threshold, the recursive insertion operation ends after adding the triangle mesh data of the current node to the current node.
[0043] Steps b41A to b43A above involve recursively inserting the current node based on the number of triangles in the current node's mesh, thereby constructing a quadtree topology.
[0044] In some other specific implementations, step b4 above, which recursively inserts the triangular mesh data of the current node starting from the root node until a preset condition is met, includes: Step b41B: Starting from the root node, determine whether the current depth of the current node is greater than the preset depth.
[0045] Step b42B: If yes, divide the current node into four sub-quadrants of the same size according to the number of triangles in the current node, and assign the triangles in the current node to the corresponding sub-quadrants.
[0046] Step b43B: If not, add the triangle mesh data of the current node to the current node and end the recursive insertion operation.
[0047] Steps b41B to b43B above involve recursively inserting the current node based on its current depth, thereby constructing a quadtree topology.
[0048] Step S103: Determine the projected point coordinates of the component to be fitted based on the base point coordinates of the component to be fitted and the quadtree topological structure.
[0049] Specifically, the component to be fitted can represent each component to be fitted in a batch of components to be fitted, and the component to be fitted can be a structural column in a building. The base point coordinates of the component to be fitted represent the bottom center point of each component to be fitted.
[0050] In some specific embodiments, the above step S103, determining the projected point coordinates of the component to be fitted based on the base point coordinates of the component to be fitted and the quadtree topological structure, includes: Step c1: Obtain the base point coordinates of the component to be fitted.
[0051] Specifically, the base point coordinates of the component to be fitted are the center coordinates of the component to be fitted.
[0052] Step c2: Retrieve the leaf nodes of the quadtree topological structure according to the coordinate index of the sub-topographic area of the target topographic area stored in the quadtree topological structure, and obtain the coordinate index of the corresponding sub-topographic area stored in the leaf node.
[0053] Specifically, given a base point coordinate, traverse the quadtree topological structure starting from the root node of the quadtree topological structure. If the current node is a leaf node, query the coordinate index stored in the node. If the current node is not a leaf node, continue to determine which quadrant the base point coordinate of the component to be fitted is located in among the sub-nodes.
[0054] For example, the base point coordinates of the component to be fitted are (x, y).
[0055] If x >= centerX and y >= centerY, enter the first quadrant (northeast); If x < centerX and y >= centerY, enter the second quadrant (northwest); If x < centerX and y < centerY, enter the third third quadrant (southwest); If x >= centerX and y < centerY, enter the fourth quadrant (southeast).
[0056] Step c3: Use the coordinate index of the corresponding sub-topographic area stored in the leaf node as the candidate coordinate index set; Step c4: Taking the base point coordinates of the component to be fitted as a reference, emit a target ray to the target building model and judge the intersection coordinates of the target ray and the candidate coordinate index set.
[0057] Step c5: Use the intersection coordinates as the projected point coordinates of the component to be fitted.
[0058] In this embodiment, through steps c1-c5 above, the coordinate indexes of the sub-terrain regions of the target terrain region stored in the quadtree topology are retrieved from the leaf nodes of the quadtree topology to obtain the coordinate indexes of the corresponding sub-terrain regions stored in the leaf nodes; the coordinate indexes of the corresponding sub-terrain regions stored in the leaf nodes are used as the candidate coordinate index set; based on the base point coordinates of the component to be bonded, a target ray is emitted to the target building model and the intersection coordinates of the target ray and the candidate coordinate index set are determined; the intersection coordinates are used as the projection point coordinates of the component to be bonded. Finally, this embodiment can quickly determine the projection point coordinates of the component to be bonded.
[0059] Step S104: Based on the projection point coordinates of the component to be bonded, bond the bottom of the component to be bonded to the terrain surface of the target building model.
[0060] The projection point coordinates of the component to be bonded are the unique intersection point between the component to be bonded and the terrain surface of the target building model. Through this unique intersection point, the bottom of the component to be bonded can be quickly and tightly bonded to the terrain surface of the target building model.
[0061] Because this invention takes the base point coordinates of the component to be bonded as the starting point, emits a target ray to the target building model, determines the intersection coordinates of the target ray and the target terrain area, and then quickly locates the node coordinates that are consistent with the intersection coordinates through a quadtree topology structure, and uses the node coordinates as the projection point coordinates of the component to be bonded, thereby achieving fast and accurate bonding of the component to be bonded to the terrain surface, so as to achieve a flush bonding between the component to be bonded and the terrain surface.
[0062] In some specific implementations, a target building model is constructed using 3D building tools based on the target terrain data.
[0063] In this embodiment, the 3D building tool can be Autodesk Revit software. By combining this 3D building tool with the target terrain data, 3D building tools can be generated quickly.
[0064] This embodiment also provides a device for conforming a component to a terrain surface. This device is used to implement the above embodiments and preferred embodiments, and details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0065] This embodiment provides a device for fitting components to a terrain surface, such as... Figure 4 As shown, it includes: The terrain region determination module 401 is used to determine the target terrain region based on the target terrain data; The topology construction module 402 is used to construct a quadtree topology based on the target terrain region. The nodes of the quadtree topology store the coordinate indices of the sub-terrain regions of the target terrain region. The projection coordinate determination module 403 is used to determine the projection point coordinates of the component to be bonded based on the base point coordinates and the quadtree topology. The terrain surface bonding module 404 is used to bond the bottom of the component to be bonded to the terrain surface of the target building model according to the projection point coordinates of the component to be bonded.
[0066] In some alternative implementations, the terrain region determination module 401 includes: The data processing submodule is used to preprocess the target terrain data; The coordinate selection submodule is used to select the maximum x-coordinate terrain data, minimum x-coordinate terrain data, maximum y-coordinate terrain data, and minimum y-coordinate terrain data from the preprocessed target terrain data. The terrain determination submodule is used to determine the target terrain data based on the maximum horizontal coordinate terrain data, the minimum horizontal coordinate terrain data, the maximum vertical coordinate terrain data, and the minimum vertical coordinate terrain data.
[0067] In some alternative implementations, the topology component module 402 includes: The leaf root node determination submodule is used to determine the root node of the quadtree topology; The grid data acquisition submodule is used to acquire the triangular grid data of the target terrain area and the triangular grid data of the current node; The grid data storage submodule is used to store the triangular grid data of the target terrain region in the root node of the quadtree topology; The current node insertion submodule is used to recursively insert the triangular mesh data of the current node starting from the root node until the preset conditions are met, resulting in a quadtree topology. The quadtree topology stores the coordinate index of each node based on the triangular mesh data of that node.
[0068] In some alternative implementations, the current node inserts a submodule, including: The grid quantity judgment unit is used to determine whether the number of triangle grids in the current node is greater than a preset threshold, starting from the root node; The first data allocation unit is used to divide the current node into four sub-quadrants of the same size according to the number of triangles in the current node, and allocate the triangles in the current node to the corresponding sub-quadrants. The second data allocation unit is used to add the triangular mesh data of the current node to the current node and end the recursive insertion operation if no.
[0069] In some alternative implementations, the projection coordinate determination module 403 includes: The base point coordinate determination submodule is used to obtain the base point coordinates of the component to be bonded; The coordinate index retrieval submodule is used to retrieve the leaf node of the quadtree topology structure based on the coordinate index of the sub-terrain region of the target terrain region stored in the quadtree topology structure, and obtain the coordinate index of the corresponding sub-terrain region stored in the leaf node. The candidate coordinate determination submodule is used to use the coordinate indices of the corresponding sub-terrain regions stored in the leaf nodes as the candidate coordinate index set; The intersection point coordinate determination submodule is used to emit a target ray to the target building model based on the base point coordinates of the component to be bonded and to determine the intersection point coordinates of the target ray with the candidate coordinate index set. The projection coordinate determination submodule is used to use the intersection coordinates as the projection point coordinates of the component to be bonded.
[0070] In some optional implementations, the device for fitting components to the terrain surface in this embodiment further includes: a model building module for building a target building model using three-dimensional building tools based on the target terrain data.
[0071] The device for conforming a component to a terrain surface provided in this embodiment of the invention can execute the method for conforming a component to a terrain surface provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects for executing the method. Further functional descriptions of the various modules and units described above are the same as in the corresponding embodiments described above, and will not be repeated here.
[0072] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention.
[0073] The following is a detailed reference. Figure 5 , Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention.
[0074] The following is a detailed reference. Figure 5 The diagram illustrates a structural schematic suitable for implementing an electronic device according to embodiments of the present invention. The electronic device may include a processor (e.g., a central processing unit, graphics processor, etc.) 501, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 502 or a program loaded from memory 508 into random access memory (RAM) 503. The RAM 503 also stores various programs and data required for the operation of the electronic device. The processor 501, ROM 502, and RAM 503 are interconnected via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0075] Typically, the following devices can be connected to I / O interface 505: input devices 506 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 507 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; memory devices 508 including, for example, magnetic tapes, hard disks, etc.; and communication devices 509. Communication device 509 allows electronic devices to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 5 Electronic devices with various devices are shown, but it should be understood that it is not required to implement or have all of the devices shown, and more or fewer devices may be implemented or have instead.
[0076] In particular, according to embodiments of the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present invention include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 509, or installed from a memory 508, or installed from a ROM 502. When the computer program is executed by the processor 501, it performs the functions defined in the method of component conforming to a terrain surface according to embodiments of the present invention.
[0077] Figure 5 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments of the present invention.
[0078] This invention also provides a computer-readable storage medium. The methods described above according to embodiments of the invention can be implemented in hardware or firmware, or implemented as recordable on a storage medium, or implemented as computer code originally stored on a remote storage medium or a non-transitory machine-readable storage medium and subsequently stored on a local storage medium after being downloaded via a network. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium can also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code. When the software or computer code is accessed and executed by the computer, processor, or hardware, the method of component conforming to a terrain surface shown in the above embodiments is implemented.
[0079] A portion of this invention can be applied as a computer program product, such as computer program instructions, which, when executed by a computer, can invoke or provide the methods and / or technical solutions according to the invention through the operation of the computer. Those skilled in the art will understand that the forms in which computer program instructions exist in a computer-readable medium include, but are not limited to, source files, executable files, installation package files, etc. Correspondingly, the ways in which computer program instructions are executed by a computer include, but are not limited to: the computer directly executing the instructions, or the computer compiling the instructions and then executing the corresponding compiled program, or the computer reading and executing the instructions, or the computer reading and installing the instructions and then executing the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to a computer.
[0080] Although embodiments of the invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations all fall within the scope defined by the appended claims.
Claims
1. A method for fitting a component to a terrain surface, characterized in that, The method includes: Based on the target terrain data, the target terrain region is determined; Based on the target terrain region, a quadtree topology is constructed, and the nodes of the quadtree topology store the coordinate indices of the sub-terrain regions of the target terrain region; Based on the base point coordinates of the component to be bonded and the quadtree topology, determine the projection point coordinates of the component to be bonded. Based on the projection point coordinates of the component to be bonded, the bottom of the component to be bonded is bonded to the terrain surface of the target building model.
2. The method according to claim 1, characterized in that, Based on the target terrain data, determine the target terrain region and the target building model, including: The target terrain data is preprocessed; Select the terrain data with the largest x-coordinate, smallest x-coordinate, largest y-coordinate, and smallest y-coordinate from the preprocessed target terrain data; The target terrain data is determined based on the maximum horizontal coordinate terrain data, the minimum horizontal coordinate terrain data, the maximum vertical coordinate terrain data, and the minimum vertical coordinate terrain data.
3. The method according to claim 1, characterized in that, Based on the target terrain region, a quadtree topology is constructed, including: Determine the root node of the quadtree topology; Obtain the triangular mesh data of the target terrain region and the triangular mesh data of the current node; The triangular mesh data of the target terrain region is stored in the root node of a quadtree topology; The quadtree topology is obtained by recursively inserting the triangular mesh data of the current node starting from the root node until the preset conditions are met. The quadtree topology stores the coordinate index of each node according to the triangular mesh data of each node.
4. The method according to claim 3, characterized in that, The triangle mesh data of the current node is inserted recursively, starting from the root node, until a preset condition is met, including: Starting from the root node, determine if the number of triangles in the current node is greater than a preset threshold; If so, based on the number of triangles in the current node, divide the current node into four sub-quadrants of the same size, and allocate the triangles in the current node to the corresponding sub-quadrants; If not, add the triangle mesh data of the current node to the current node and end the recursive insertion operation.
5. The method according to claim 1, characterized in that, Based on the base point coordinates of the component to be bonded and the quadtree topology, the projection point coordinates of the component to be bonded are determined, including: Obtain the coordinates of the base point of the component to be bonded; Based on the coordinate indexes of the sub-terrain regions of the target terrain region stored in the quadtree topology, the leaf nodes of the quadtree topology are retrieved to obtain the coordinate indexes of the corresponding sub-terrain regions stored in the leaf nodes. The coordinate indices of the corresponding sub-terrain regions stored in the leaf nodes are used as the candidate coordinate index set; Using the base point coordinates of the component to be bonded as a reference, a target ray is emitted towards the target building model, and the intersection coordinates of the target ray and the candidate coordinate index set are determined; The coordinates of the intersection point are used as the coordinates of the projection point of the component to be bonded.
6. The method according to any one of claims 1 to 5, characterized in that, Based on the target terrain data, a target building model is constructed using 3D building tools.
7. A device for conforming a component to a terrain surface, characterized in that, The device includes: The terrain region determination module is used to determine the target terrain region based on the target terrain data. The topology construction module is used to construct a quadtree topology structure based on the target terrain region. The nodes of the quadtree topology structure store the coordinate indices of the sub-terrain regions of the target terrain region. The projection coordinate determination module is used to determine the projection point coordinates of the component to be bonded based on the base point coordinates of the component to be bonded and the quadtree topology. The terrain surface bonding module is used to bond the bottom of the component to be bonded to the terrain surface of the target building model according to the projection point coordinates of the component to be bonded.
8. An electronic device, characterized in that, include: A memory and a processor are communicatively connected, the memory storing computer instructions, and the processor executing the computer instructions to perform the method of conforming a component to a terrain surface as described in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing a computer to perform the method of conforming a component to a terrain surface as described in any one of claims 1 to 6.
10. A computer program product, characterized in that, Includes computer instructions for causing a computer to perform the method of conforming a component to a terrain surface as described in any one of claims 1 to 6.