CN119416317B - Method for generating underlying surface body pasting grid for high-precision simulation and electronic equipment - Google Patents
Method for generating underlying surface body pasting grid for high-precision simulation and electronic equipment Download PDFInfo
- Publication number
- CN119416317B CN119416317B CN202411461657.8A CN202411461657A CN119416317B CN 119416317 B CN119416317 B CN 119416317B CN 202411461657 A CN202411461657 A CN 202411461657A CN 119416317 B CN119416317 B CN 119416317B
- Authority
- CN
- China
- Prior art keywords
- building
- top surface
- vertex
- indication data
- data
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F30/00—Computer-aided design [CAD]
- G06F30/10—Geometric CAD
- G06F30/13—Architectural design, e.g. computer-aided architectural design [CAAD] related to design of buildings, bridges, landscapes, production plants or roads
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F30/00—Computer-aided design [CAD]
- G06F30/20—Design optimisation, verification or simulation
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T17/00—Three dimensional [3D] modelling, e.g. data description of 3D objects
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2111/00—Details relating to CAD techniques
- G06F2111/10—Numerical modelling
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02A—TECHNOLOGIES FOR ADAPTATION TO CLIMATE CHANGE
- Y02A90/00—Technologies having an indirect contribution to adaptation to climate change
- Y02A90/10—Information and communication technologies [ICT] supporting adaptation to climate change, e.g. for weather forecasting or climate simulation
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Geometry (AREA)
- Theoretical Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computer Hardware Design (AREA)
- Evolutionary Computation (AREA)
- General Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Computer Graphics (AREA)
- Architecture (AREA)
- Civil Engineering (AREA)
- Structural Engineering (AREA)
- Computational Mathematics (AREA)
- Mathematical Analysis (AREA)
- Mathematical Optimization (AREA)
- Pure & Applied Mathematics (AREA)
- Processing Or Creating Images (AREA)
Abstract
The invention provides an underlying surface body pasting grid generation method and electronic equipment for high-precision simulation, wherein the method comprises the steps of determining building vertex indication data of each building based on building indication data of each building respectively; the method comprises the steps of generating initial top surface indication data and side surface indication data of each building based on building vertex indication data of each building respectively, determining target top surface indication data of each building based on the initial top surface indication data of each building respectively, generating an underlying surface three-dimensional model of a target area based on the target top surface indication data and the side surface indication data of each building, and generating an underlying surface paste grid of the target area based on the underlying surface three-dimensional model, wherein the underlying surface paste grid is used for carrying out diffusion simulation on the target area. The embodiment of the invention can conveniently generate the lower pad surface paste grid and improve the generation efficiency of the lower pad surface paste grid.
Description
Technical Field
The invention relates to the technical field of diffusion simulation, in particular to an underlying surface paste grid generation method for high-precision simulation and electronic equipment.
Background
The numerical simulation technology is widely applied to researches such as atmospheric boundary layer research and atmospheric aerosol conveying diffusion as an effective means, and obtains a good effect, wherein the research on the actual law of the material (such as aerosol and the like) under the underlying surface body pasting grid has important significance in the aspects of reasonably distributing environmental resources in the areas, designing a risk avoidance scheme for harmful material leakage events and the like, and the underlying surface body pasting grid of one area is generated through an underlying surface three-dimensional model of the corresponding area. Based on this, diffusion simulation of any substance in the target area can be realized based on a small-scale model (i.e., CFD model) of computational fluid dynamics (ComputationalFluidDynamics, CFD), but CFD models generally only support Three-dimensional model data in a fixed format (e.g., obj (a 3D (Three-dimensional) model file format), stl (a file format for representing a triangle mesh), etc.), but related art generally utilizes modeling software such as 3D Max (a Three-dimensional animation rendering and manufacturing software) to manufacture an underlying Three-dimensional model by using a manual modeling manner, that is, manufacture of an underlying Three-dimensional model generally by a manual manner, resulting in cumbersome and inefficient operation of generating an underlying Three-dimensional model, and thus in cumbersome and inefficient operation of generating an underlying body-attached mesh. Based on this, how to generate the underlying surface-mounted grid of the target area conveniently, so as to improve the generation efficiency of the underlying surface-mounted grid, no better solution exists at present.
Disclosure of Invention
In view of the above, the embodiment of the invention provides a method and electronic equipment for generating an underlying surface-mounted grid for high-precision simulation, so as to solve the problems of complicated operation, low efficiency and the like in generating the underlying surface-mounted grid caused by related technologies, that is, the embodiment of the invention can conveniently generate an underlying surface three-dimensional model of a target area through target top surface indication data and side surface indication data of each building in the target area, thereby conveniently generating the underlying surface-mounted grid of the target area, and effectively improving the generation efficiency of the underlying surface-mounted grid.
According to an aspect of the embodiment of the present invention, there is provided an underlying surface patch grid generation method for high-precision simulation, the method including:
Acquiring target building data of a target area, wherein the target building data comprises building indication data of each building in the target area;
determining building vertex indication data of each building based on the building indication data of each building respectively, wherein the building vertex indication data of one building comprises vertex data of each building vertex in the corresponding building, and the vertex data comprises vertex coordinates of the corresponding building vertex;
generating initial top surface indication data and side surface indication data of each building based on building vertex indication data of each building respectively, and determining target top surface indication data of each building based on the initial top surface indication data of each building respectively;
Generating a three-dimensional model of the underlying surface of the target area based on the target top surface indication data and the side surface indication data of each building;
And generating an underlying surface paste grid of the target area based on the underlying surface three-dimensional model, wherein the underlying surface paste grid is supported to be used for performing diffusion simulation on the target area.
According to another aspect of the embodiments of the present invention, there is provided an underlying patch grid generating apparatus for high-precision simulation, the apparatus including:
An acquisition unit configured to acquire target building data of a target area, the target building data including building instruction data of each building in the target area;
A processing unit, configured to determine building vertex indication data of each building based on the building indication data of each building, where the building vertex indication data of one building includes vertex data of each building vertex in the corresponding building, and the vertex data includes vertex coordinates of the corresponding building vertex;
the processing unit is further used for generating initial top surface indication data and side surface indication data of each building based on building vertex indication data of each building respectively, and determining target top surface indication data of each building based on the initial top surface indication data of each building respectively;
The processing unit is further used for generating a three-dimensional model of the underlying surface of the target area based on the target top surface indication data and the side surface indication data of each building;
The processing unit is further configured to generate an underlying surface-to-object grid of the target area based on the underlying surface three-dimensional model, where the underlying surface-to-object grid is supported to perform diffusion simulation on the target area.
According to another aspect of embodiments of the present invention, there is provided an electronic device comprising a processor, and a memory storing a program, wherein the program comprises instructions which, when executed by the processor, cause the processor to perform the above mentioned method.
According to another aspect of embodiments of the present invention, there is provided a non-transitory computer-readable storage medium storing computer instructions for causing a computer to perform the above-mentioned method.
The method and the device can acquire the target building data of the target area, wherein the target building data comprises building indication data of each building in the target area, and the building vertex indication data of each building is determined based on the building indication data of each building respectively, wherein the building vertex indication data of one building comprises vertex data of each building vertex in the corresponding building, and the vertex data comprises vertex coordinates of the corresponding building vertex. Based on this, it is possible to generate initial ceiling surface indication data and side surface indication data of each building based on the building vertex indication data of each building, respectively, and determine target ceiling surface indication data of each building based on the initial ceiling surface indication data of each building, respectively. Further, an underlying three-dimensional model of the target area may be generated based on the target top indication data and the side indication data for each building, and an underlying body mesh of the target area may be generated based on the underlying three-dimensional model, the underlying body mesh supporting diffusion simulation for the target area. Therefore, the embodiment of the invention can conveniently generate the three-dimensional model of the underlying surface of the target area through the target top surface indication data and the side surface indication data of each building in the target area, so that the underlying surface body pasting grid of the target area can be conveniently generated, and the generation efficiency of the underlying surface body pasting grid can be effectively improved; in addition, the target top surface indication data and the side surface indication data of one building can be used for representing a three-dimensional building model of the corresponding building, namely, the embodiment of the invention can generate the three-dimensional building model of any building through the target top surface indication data and the side surface indication data of any building, that is, the embodiment of the invention can only generate the side surface and the top surface when generating the three-dimensional building model, and does not need to generate the bottom surface of the building, which is needed to be removed when generating the underlying surface body pasting grid, and can effectively save calculation resources; in addition, the embodiment of the invention can accurately represent the top surface of the building through the target top surface indication data of each building, so that the accuracy of the target top surface indication data can be effectively improved, the quality of the underlying surface three-dimensional model is further improved, and high-precision simulation (namely diffusion simulation) can be conveniently realized through the underlying surface three-dimensional model with higher quality.
Drawings
Further details, features and advantages of the invention are disclosed in the following description of exemplary embodiments with reference to the following drawings, in which:
Fig. 1 shows a flow diagram of an underlying patch grid generation method for high-precision simulation according to an exemplary embodiment of the present invention;
FIG. 2 illustrates a flow diagram of another method for generating an underlying patch grid for high-precision simulation in accordance with an exemplary embodiment of the present invention;
FIG. 3 illustrates a flow diagram of yet another method for generating an underlying patch grid for high-precision simulation in accordance with an exemplary embodiment of the present invention;
FIG. 4 illustrates a flow diagram of yet another method for generating an underlying patch grid for high-precision simulation in accordance with an exemplary embodiment of the present invention;
FIG. 5 illustrates a schematic diagram of an underlying three-dimensional model according to an exemplary embodiment of the present invention;
FIG. 6 illustrates a schematic view of an underlying patch grid in accordance with an exemplary embodiment of the present invention;
FIG. 7 illustrates a schematic view of another underlying patch grid in accordance with an exemplary embodiment of the present invention;
FIG. 8 shows a schematic block diagram of an underlying patch grid generating device for high-precision simulation in accordance with an exemplary embodiment of the present invention;
fig. 9 shows a block diagram of an exemplary electronic device that can be used to implement an embodiment of the invention.
Detailed Description
Embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. While the invention is susceptible of embodiment in the drawings, it is to be understood that the invention may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but rather are provided to provide a more thorough and complete understanding of the invention. It should be understood that the drawings and embodiments of the invention are for illustration purposes only and are not intended to limit the scope of the present invention.
It should be understood that the various steps recited in the method embodiments of the present invention may be performed in a different order and/or performed in parallel. Furthermore, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the invention is not limited in this respect.
The term "including" and variations thereof as used herein are intended to be open-ended, i.e., including, but not limited to. The term "based on" is based at least in part on. The term "one embodiment" means "at least one embodiment," another embodiment "means" at least one additional embodiment, "and" some embodiments "means" at least some embodiments. Related definitions of other terms will be given in the description below. It should be noted that the terms "first," "second," and the like herein are merely used for distinguishing between different devices, modules, or units and not for limiting the order or interdependence of the functions performed by such devices, modules, or units.
It should be noted that references to "one", "a plurality" and "a plurality" in this disclosure are intended to be illustrative rather than limiting, and those skilled in the art will appreciate that "one or more" is intended to be construed as "one or more" unless the context clearly indicates otherwise.
The names of messages or information interacted between the devices in the embodiments of the present invention are for illustrative purposes only and are not intended to limit the scope of such messages or information.
It should be noted that, the execution body of the method for generating the underlying surface paste grid for high-precision simulation provided by the embodiment of the invention may be one or more electronic devices, which is not limited in the invention, wherein the electronic devices may be terminals (i.e. clients) or servers, and when the execution body includes a plurality of electronic devices, and the plurality of electronic devices include at least one terminal and at least one server, the method for generating the underlying surface paste grid for high-precision simulation provided by the embodiment of the invention may be executed jointly by the terminals and the servers. Accordingly, the terminals mentioned herein may include, but are not limited to, smartphones, tablet computers, notebook computers, desktop computers, etc., and the servers mentioned herein may be independent physical servers, may be server clusters or distributed systems formed by a plurality of physical servers, and may also be cloud servers providing cloud services, cloud databases, cloud computing (cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDNs (Content Delivery Network, content distribution networks), and basic cloud computing services such as big data and artificial intelligent platforms, etc.
Based on the above description, the embodiment of the present invention proposes an underlying patch grid generation method for high-precision simulation, which may be performed by the above-mentioned electronic device (terminal or server), or which may be performed jointly by the terminal and server. For convenience of explanation, the following description will take an example in which the electronic device executes the method for generating an underlying surface-mounted mesh for high-precision simulation, and as shown in fig. 1, the method for generating an underlying surface-mounted mesh for high-precision simulation may include the following steps S101 to S105:
S101, acquiring target building data of a target area, wherein the target building data comprises building indication data of each building in the target area.
Alternatively, the target area may be any area, which is not limited in the embodiment of the present invention. Alternatively, one building may include a plurality of building contour points, and alternatively, building indication data of one building may include, but is not limited to, contour point coordinates of each building contour point in the corresponding building, building height indication information of the corresponding building, and the like, which is not limited in the embodiment of the present invention.
In the embodiment of the present invention, the target building data may be obtained by, but not limited to, the following methods:
the first way of obtaining is that the electronic device may store target building data of the target area in its own storage space, in which case the electronic device may obtain the target building data from its own storage space.
The second acquisition mode is that the electronic device can acquire a building data download link of the target area and takes the building data downloaded based on the building data download link as target building data.
The third way of obtaining the data of the initial building is that the electronic device can obtain the data of the initial building, the data of the initial building can be an original SHP (ESRI shapefile) data (namely, SHP file, a space data open format), the SHP data stores a layer of geometric figures such as lines, points or polygons, and is related with a geographic coordinate system, and the data is a compound data set, and can be at least composed of three files, namely, SHP, shx (an index file for storing membership between map elements) and dbf (a database format file), the SHP file is widely used for various maps and map features, and a common SHP file containing building information can comprise building ids (Identity document, identification numbers), coordinates of all boundary points of the bottom surface of a building (2D, two-dimensional, namely, coordinates of initial contour points of building contour points), building floor numbers and the like. Based on the above, the electronic device may clip the initial building data according to the target area range of the target area to obtain clipped building data, the clipped building data may include initial building indication data of each building in the target area, the initial building indication data of one building may include initial contour point coordinates of each building contour point and the number of building layers in the corresponding building, one initial contour point coordinate may be a two-dimensional longitude and latitude coordinate, and the clipped building data may be used to determine the target building data. Alternatively, the building contour point of one building may be used to indicate a plurality of floor vertices in the floor of the corresponding building and a plurality of ceiling vertices in the ceiling of the corresponding building, and the initial building data may include initial building indication data for each of the at least one initial building.
Optionally, when clipping the initial building data according to the target area range of the target area to obtain clipped building data, each initial building in at least one initial building can be traversed, the current traversed initial building is taken as the current initial building, the geometric information of the current initial building (namely, the initial contour point coordinate of each building contour point in the current initial building) is determined from the initial building indication data of the current initial building, whether the initial contour point coordinate of each building contour point in the current initial building is located in the latitude and longitude range of the target area or not (namely, the latitude and longitude range of the target area or not) can be judged according to the target area range (namely, the latitude and longitude range of the target area) of the target area, if the initial contour point coordinate of each building contour point in the current initial building is located in the latitude and longitude range of the target area, the initial building indication data of the current initial building is added into the clipped building data (namely, the current initial building is taken as one building in the target area) to obtain new data (SHP) after each initial building in the at least one initial building is traversed. Optionally, the electronic device may create an empty index linked list to store the indexes of the buildings in the target area, and if the initial contour point coordinates of each building contour point in the current initial building are all located in the latitude and longitude range of the target area, the index (e.g. id) of the current initial building is added to the index linked list, and after the traversing is completed, the initial building indication information of the initial building corresponding to each index in the index linked list is output and added to the cut building data.
Optionally, when the target building data is determined by using the trimmed building data, for any building in the target area, initial building indication data of any building can be determined from the trimmed building data, and the initial contour point coordinates of each building contour point in any building are transformed to obtain contour point coordinates of each building contour point in any building, one contour point coordinate can be a coordinate of the corresponding building contour point in a cartesian coordinate system (such as a unit can be meters, etc.), and one contour point coordinate can be a two-dimensional coordinate in the cartesian coordinate system with the target point as an origin, optionally, the target point can be a center point of the target area, also can be an upper left corner point of the target area, etc., according to the embodiment of the invention, the coordinate of each building contour point in any building can be transformed from the initial contour point coordinates (namely, longitude and latitude coordinates) to contour point coordinates (namely, cartesian coordinates with the origin), that is, any contour point can be calculated by adding the coordinate of each building contour point to the initial contour point in any coordinate system (namely, any building point in any coordinate system, x-coordinate) and any building contour point in any coordinate system (namely, any building point in any coordinate system) can be calculated. Alternatively, the electronic device may also add the number of building floors of any building to the building indication data of any building to use the number of building floors of any building as the building height indication information of any building, or may calculate the height of any building (i.e., the building height) using the number of building floors and the floor height of any building (i.e., the height of a single floor) and add the height of any building to the building indication data of any building to use the height of any building as the building height indication information of any building to achieve the acquisition of the target building data, and so on. Alternatively, the electronic device may further allocate an index to each building in the target area and add the index of any building to the building indication data of any building, so that the building indication data of any building may further include the index of any building (e.g., building id, etc.), or may add the index of each building to the target building data, so that the target building data may further include the index of each building. Alternatively, the floor height may be empirically set, or may be set according to actual requirements, which is not limited in this embodiment of the present invention, and may be 3m (meters) as an example.
S102, building vertex indication data of each building are determined based on the building indication data of each building respectively, the building vertex indication data of one building comprises vertex data of each building vertex in the corresponding building, and one vertex data comprises vertex coordinates of the corresponding building vertex.
Wherein one building may include a plurality of building vertices and the plurality of building vertices in one building may include a plurality of floor vertices of the corresponding building (i.e., a plurality of floor vertices of the floor of the corresponding building) and a plurality of roof vertices (i.e., a plurality of roof vertices of the roof of the corresponding building), then each building vertex in one building may be each building vertex in the plurality of building vertices included in the corresponding building, respectively. In embodiments of the present invention, points in a building (e.g., building vertices or floor vertices, etc.) may also be referred to as corresponding building points, corresponding points in a plane may also be referred to as corresponding plane points, etc.
Alternatively, one vertex data may further include an index of a corresponding building vertex, i.e., the vertex data of one building vertex may include, but is not limited to, vertex coordinates and indexes of a corresponding building vertex, etc., where one vertex coordinate may be a three-dimensional coordinate (including x-coordinate, y-coordinate, and z-coordinate (i.e., vertical coordinate of one building vertex may be a height of a corresponding building vertex)), and, illustratively, a z-coordinate of one bottom surface vertex of any building may be 0 (i.e., a height of any bottom surface vertex may be 0), and a z-coordinate of one top surface vertex of any building may be determined based on a height of any building (i.e., a height of one top surface vertex of any building may be determined based on a height of any building). Alternatively, one building contour point may correspond to one bottom surface vertex and one top surface vertex, that is, the contour point coordinates of one building contour point may include x coordinates and y coordinates, and then the x coordinates of the bottom surface vertex and the top surface vertex corresponding to one building contour point may be the x coordinates of the corresponding building contour point, and the y coordinates of the bottom surface vertex and the top surface vertex corresponding to one building contour point may be the y coordinates of the corresponding building contour point. For example, one vertex coordinate may be represented as v x coordinates y coordinates z coordinates, i.e., may be represented as "v { x } { y } { z }, and v may represent a point.
S103, generating initial top surface indication data and side surface indication data of each building based on the building vertex indication data of each building respectively, and determining target top surface indication data of each building based on the initial top surface indication data of each building respectively.
Wherein the target top indicating data and side indicating data of one building may be used to represent a three-dimensional building model of the corresponding building. Accordingly, the target top surface indication data and the side surface indication data of all the buildings in the target area can be used for representing the three-dimensional building group model, i.e. the target top surface indication data and the side surface indication data of each building in the target area can be used for representing the three-dimensional building group model of the target area.
In embodiments of the present invention, it may be assumed that all buildings are substantially identical in shape from top to bottom. Optionally, for any building in the target area, the electronic device may generate side indication data of any building according to the target side linking order based on building vertex indication data of any building, where the side indication data of any building includes surface indication information of each of k sides of any building, one surface indication information includes an index of each point in one surface (i.e. the index of each point in one surface may represent the corresponding surface), k is a number of building contour points in any building, and k is an integer greater than 1, and optionally, the target side linking order may be clockwise (i.e. clockwise order), counterclockwise (i.e. counterclockwise order), and so on.
Optionally, the indexes of the bottom surface vertexes in any building can be p+1, p+2, and p+k, and the indexes of the top surface vertexes in any building can be p+k+1, p+k+2, and p+k+k, wherein p is the initial vertex index of any building, and the number of the bottom surface vertexes and the number of the top surface vertexes in any building are k. Based on this, since the sides are all rectangular (convex polygon), k sides of any building can be directly generated in the target side linking order, and by way of example, assuming that the target side linking order is counterclockwise, each side can be linked counterclockwise, then the plane representation information of the i-th side (i e [1, k-1 ]) of any building can be f p + i p +i+p+i+1+kp+i+k, the plane representation information of the k-th side can be f p + k p +1p+k+1p+k+k+k, where f can represent the plane, p+m can represent the index of the m-th bottom vertex of the plurality of bottom vertices of any building (e.g., p+i or p+1, etc.) as described above), and when m is greater than k, p+m can represent the index of the m-k-th top vertex of the plurality of top vertices of any building (e.g., p+i+k, etc.), where f can represent a positive integer.
Correspondingly, the electronic equipment can determine the vertex data of each top surface vertex in the top surface of any building from the building vertex indication data of any building, triangulate the top surface of any building based on the vertex data of each top surface vertex to obtain initial top surface indication data of any building, wherein the initial top surface indication data of any building comprises the surface representation information of each initial top surface triangulated surface in a plurality of initial top surface triangulated surfaces of the top surface of any building.
Alternatively, the electronic device may perform delaunay triangulation (a triangulation algorithm) on the top surface of any building to obtain surface representation information (one surface representation information is represented by an index of each point in the corresponding surface, and the surface representation information of one surface may also be referred to as a point index of the corresponding surface) of each initial top surface triangulation surface (also referred to as a triangular surface) that can cover the top surface of any building, which do not overlap with each other. Optionally, the electronic device may invoke a module for implementing delaunay triangulation in a scipy library (a high-level script language combining interpretability, compilations, interactivity, and object-oriented software packages used in mathematics, science, and engineering fields) in Python (delaunay triangulation is performed on the top surface of any building based on vertex data of each top surface vertex), wherein, the point index outputted by the delaunay triangulation module in Python is from 0, and an index correction is required, for example, index information of an initial top surface triangulation surface of the top surface of any building to be outputted is 0 1+k+1 (i.e., the surface representation information of the initial top surface triangulation surface may be f p +k+1p+k+2p+k+3, i.e., index 0 may correspond to index "p+k+1" in the index of each top surface of any building vertex, index 1 may correspond to index "p+k+1" in the top surface of any building), and the index of the surface representation information actually written into the initial top surface triangulation surface should be added by p+k+1 (i.e., the surface representation information of the initial top surface triangulation surface may be used in the mathematical, the normal software package).
It should be noted that, since an excessive triangle may be generated when the non-convex polygon is triangulated, an excessive initial top surface triangulated surface may be generated. Accordingly, when determining the target top surface indication data of each building based on the initial top surface indication data of each building, the electronic device can traverse each of a plurality of initial top surface triangulation surfaces of the top surface of any building for any building in the target area, and take the currently traversed initial top surface triangulation surface as the current initial top surface triangulation surface, then, the center of gravity of the current initial top surface triangulation surface can be determined based on the surface indication information of the current initial top surface triangulation surface, the vertex coordinates of each top surface vertex in the current initial top surface triangulation surface can be determined based on the surface indication information of the current initial top surface triangulation surface, so that the vertex coordinates of each top surface vertex in the current initial top surface triangulation surface can be averaged to take the average value between the vertex coordinates of each top surface vertex in the current initial top surface triangulation surface as the center of gravity of the current initial top surface triangulation surface, if the currently traversed initial top surface triangulation surface is positioned in the top surface of any building (the current initial top surface can be determined to be positioned in the top surface of any building at this moment), the center of gravity of the current initial top surface triangulation surface can be added to any building in any of the current initial top surface as the current top surface of any building, if the current top surface triangulation surface is not determined, the method comprises the steps of obtaining the face representation information of the current initial top surface triangulation face of any building, not adding the face representation information of the current initial top surface triangulation face to the target top surface indication data of any building, and obtaining the target top surface indication data of any building after traversing each of a plurality of initial top surface triangulation faces of the top surface of any building, wherein the target top surface indication data of any building comprises the face representation information of each of a plurality of target top surface triangulation faces of the top surface of any building. Alternatively, each target top surface triangulation surface of the top surface of any building may be located within the top surface of any building. Based on the method, the initial top surface triangulation surface with the center of gravity in the top surface of any building can be used as the target top surface triangulation surface of the top surface of any building, so that the triangulation accuracy can be effectively improved, the accuracy of target top surface indication data can be effectively improved, and the quality of a follow-up underlying surface three-dimensional model can be further improved. Optionally, after the triangulation is completed, the index of each initial top surface triangulation surface is written in the form of "f { index1} { index2} { index3}" until all initial top surface triangulation surfaces are output, where index may be represented as an index, that is, the surface representation information of one top surface triangulation surface may include the index of each top surface vertex of the three top surface vertices. therefore, the embodiment of the invention provides a method for judging whether the triangle generated by triangulation is outside the top surface by using the triangle gravity center method, so that the effect of triangulating the concave polygon can be improved when the top surface is the concave polygon.
Optionally, the electronic device may further determine whether the number of building contour points in any building is greater than a preset contour point threshold; if the number of contour points of the building in any building is greater than a preset contour point threshold, triggering and executing the vertex data based on each vertex of the top surface, triangulating the top surface of any building to obtain initial top surface indication data of any building, and further triggering and executing each initial top surface triangulating surface of a plurality of initial top surface triangulating surfaces traversing the top surface of any building to determine target top surface indication data of any building, if the number of contour points of the building in any building is less than or equal to the preset contour point threshold, adopting vertex data of each vertex of the top surface of any building to generate top surface indication information of any building (at this time, the top surface indication information of any building can comprise an index of each vertex of the top surface of any building, for example, the top surface indication information can be expressed as f p +k+1p+k+k+2.) to add the indication information of any building to the initial top surface indication data of any building, if the number of contour points of any building in any building is less than or equal to the preset contour point threshold, and determining the top surface indication information of any building can be based on the initial top surface indication data of any vertex data. Alternatively, the preset number of contour points threshold may be empirically set or may be set according to actual needs, which is not limited in this embodiment of the present invention, and exemplary, the preset number of contour points threshold may be 4, it should be understood that when the number of contour points of a building in any building is not more than 4 (i.e. less than or equal to 4), the top surface of any building is typically a simple polygon, so that the index of each top surface vertex in any building may be directly output according to the target top surface order, alternatively, the target top surface order may be clockwise, counterclockwise, etc., which is not limited in this embodiment of the present invention. Based on this, the embodiment of the invention can firstly judge whether the outline of the building is a complex polygon (namely, judge whether the number of the outline points of the building is larger than the threshold value of the preset outline points, the complex polygon can be the top surface of the outline points of the building, the number of the outline points of the building is larger than the threshold value of the preset outline points), thereby carrying out triangulation only on the complex polygon and effectively improving the operation efficiency.
S104, generating a three-dimensional model of the underlying surface of the target area based on the target top surface indication data and the side surface indication data of each building.
The three-dimensional building group model may be an obj file (i.e., the obj file storing the three-dimensional building group model may be referred to as a three-dimensional building group model obj file, i.e., the three-dimensional building group model may be referred to as a three-dimensional building group model obj file), that is, after the target top surface indicating data and the side surface indicating data of any building are obtained, the target top surface indicating data and the side surface indicating data of any building may be added to the three-dimensional building group model obj file to generate a three-dimensional building group model in obj format, i.e., a three-dimensional building group model obj file including the target top surface indicating data and the side surface indicating data of each building may be generated. Wherein an obj-format file may include, but is not limited to, at least one of vertex data, free-form surface/surface attributes, a rendering index sequence, free-form surface/surface content declarations, associated free-form surfaces, groups, and rendering attribute information. Most common rendering indexes represent geometric vertices, texture coordinates, vertex normals, and faces of polygons, whereas obj formats support high resolution data compared to stl files and similar file formats, and obj files can represent complex or irregularly shaped objects by dividing their surfaces into small triangle chunks, such subdivision and assembly processes make handling and rendering designs easier.
In one embodiment, the electronic device may generate a three-dimensional building group model of the target area using the target top surface indication data and the side surface indication data of each building, and use the three-dimensional building group model as an underlying three-dimensional model of the target area, where the underlying three-dimensional model may include only the three-dimensional building group model. Alternatively, the underlying three-dimensional model may be an obj file (i.e., the obj file of the underlying three-dimensional model may be stored in the form of an obj file, and may be referred to as an underlying three-dimensional model obj file), where in this case, the three-dimensional building group model may be used as an underlying three-dimensional model, i.e., the three-dimensional building group model obj file may be used as an underlying three-dimensional model obj file. Based on the above, the embodiment of the invention can generate the underlying three-dimensional model in obj format. Based on this, the bottom surface indicated by the underlying three-dimensional model of the target area may be a plane where z is equal to 0.
In another embodiment, the electronic device may also generate a three-dimensional terrain model of the target area to employ the target top surface indicating data and the side surface indicating data for each building, and the three-dimensional terrain model, generate an underlying three-dimensional model of the target area, and so on. The specific implementation manner of generating the three-dimensional terrain model of the target area, and using the target top surface indication data and the side surface indication data of each building and the three-dimensional terrain model to generate the underlying surface three-dimensional model of the target area can be shown below, and the embodiments of the present invention are not described herein.
S105, generating an underlying surface paste grid of the target area based on the underlying surface three-dimensional model, wherein the underlying surface paste grid is used for carrying out diffusion simulation on the target area.
In the embodiment of the invention, the electronic device may use the underlying surface-mounted grid to perform diffusion simulation on any substance (such as any contaminant) in the target area, that is, the underlying surface-mounted grid may support the diffusion simulation on any substance in the target area. Alternatively, any substance may be any aerosol or any contaminant, and the embodiment of the present invention is not limited thereto.
The method and the device can acquire the target building data of the target area, wherein the target building data comprises building indication data of each building in the target area, and the building vertex indication data of each building is determined based on the building indication data of each building respectively, wherein the building vertex indication data of one building comprises vertex data of each building vertex in the corresponding building, and the vertex data comprises vertex coordinates of the corresponding building vertex. Based on this, it is possible to generate initial ceiling surface indication data and side surface indication data of each building based on the building vertex indication data of each building, respectively, and determine target ceiling surface indication data of each building based on the initial ceiling surface indication data of each building, respectively. Further, an underlying three-dimensional model of the target area may be generated based on the target top indication data and the side indication data for each building, and an underlying body mesh of the target area may be generated based on the underlying three-dimensional model, the underlying body mesh supporting diffusion simulation for the target area. Therefore, the embodiment of the invention can conveniently generate the three-dimensional model of the underlying surface of the target area through the target top surface indication data and the side surface indication data of each building in the target area, so that the underlying surface body pasting grid of the target area can be conveniently generated, and the generation efficiency of the underlying surface body pasting grid can be effectively improved; in addition, the target top surface indication data and the side surface indication data of one building can be used for representing a three-dimensional building model of the corresponding building, namely, the embodiment of the invention can generate the three-dimensional building model of any building through the target top surface indication data and the side surface indication data of any building, that is, the embodiment of the invention can only generate the side surface and the top surface when generating the three-dimensional building model, and does not need to generate the bottom surface of the building, which is needed to be removed when generating the underlying surface body pasting grid, and can effectively save calculation resources; in addition, the embodiment of the invention can accurately represent the top surface of the building through the target top surface indication data of each building, so that the accuracy of the target top surface indication data can be effectively improved, the quality of the underlying surface three-dimensional model is further improved, and high-precision simulation (namely diffusion simulation) can be conveniently realized through the underlying surface three-dimensional model with higher quality.
Based on the above description, the embodiment of the invention also provides a more specific generation method of the underlying surface paste grid for high-precision simulation. Accordingly, the method for generating the under-pad patch grid for high-precision simulation may be performed by the above-mentioned electronic device (terminal or server), or the method for generating the under-pad patch grid for high-precision simulation may be performed by both the terminal and the server. For convenience of explanation, the following description will take the electronic device to execute the method for generating the underlying surface-mounted grid for high-precision simulation as an example, referring to fig. 2, the method for generating the underlying surface-mounted grid for high-precision simulation may include the following steps S201-S207:
S201, acquiring initial terrain data of the target area, wherein the initial terrain data includes initial terrain heights of each grid point in the target area.
Alternatively, the target area may include a plurality of mesh areas, and each mesh area in the target area may be each mesh area in the plurality of mesh areas. Optionally, the multiple grid areas in the target area may be divided according to a target resolution, where the target resolution may be used to indicate a size of one grid area in the target area, and optionally, the target resolution may be set empirically or according to actual requirements, which is not limited in the embodiment of the present invention. Wherein one grid point in the target area may be the center point of one grid area in the target area, i.e. each grid point in the target area may be the center point of each grid area in the target area. Alternatively, the initial terrain height of one grid point may be the altitude of the corresponding grid point.
Alternatively, the initial terrain data may include initial grid point coordinates for each grid point in the target area, and the initial grid point coordinates for one grid point may include, but are not limited to, the x-coordinate, the y-coordinate, and the initial terrain height (i.e., here, the z-coordinate of the corresponding grid point) for the corresponding grid point, that is, the initial terrain data may also include the x-coordinate and the y-coordinate for each grid point in the target area. Alternatively, one initial grid point coordinate and one grid point coordinate described below may be three-dimensional coordinates in a cartesian coordinate system with the target point as the origin. Alternatively, the initial terrain data of the target area may be a point cloud data, that is, the point cloud data of the target area may be obtained in the embodiment of the present invention, and the initial grid coordinates of each grid point may be included.
In an embodiment of the present invention, the initial terrain data may be obtained by, but not limited to, the following modes:
The first acquisition mode is that the electronic equipment can store initial topographic data of the target area in the self storage space of the electronic equipment, and in this case, the electronic equipment can acquire the initial topographic data of the target area from the self storage space.
The second acquisition mode is that the electronic equipment can acquire the target area topographic data download link and takes the topographic data downloaded based on the target area topographic data download link as the initial topographic data of the target area.
The third acquisition mode includes that the electronic device can acquire original terrain data, cut the original terrain data according to a target area range of a target area to obtain cut terrain data, the cut terrain data can comprise original grid point data of each original grid point in the target area, the original grid point data of one original grid point can comprise longitude and latitude coordinates and original terrain height of the corresponding original grid point, the original terrain height can be altitude of the corresponding original grid point, based on the original terrain data, initial terrain data can be determined based on the cut terrain data, initial terrain data of the target area can be acquired, and the like. Alternatively, the raw terrain data may be a DEM (Digital elevation model, digital terrain model, also referred to as digital elevation model) data (raw terrain data, also referred to as raw DEM data or raw DEM file), typically in tif format (an image file format), and the digital elevation model may be a representation of the topological surface of the earth's bare surface (bare ground), excluding trees, buildings and any other surface objects.
Optionally, when the original topographic data is cut according to the target area range of the target area to obtain cut topographic data, the original grid point data of all original grid points with longitude and latitude coordinates within the target area range can be added to the cut topographic data to obtain the original grid point data of each original grid point in the target area, so that the cut topographic data is obtained.
Optionally, when determining the initial terrain data based on the cropped terrain data, the target area may be classified according to a target resolution (where the target resolution may be used to indicate an area size of a grid area in a longitude and latitude coordinate system) and a target area range, to obtain a plurality of grid areas in the target area (i.e., longitude and latitude coordinates of each grid point in the target area may be obtained, and one grid point may be a center point of one grid area), so that raw grid point data of each original grid point in the target area may be used, respectively calculating an initial terrain height of each grid point, and performing coordinate conversion on the longitude and latitude coordinates of each grid point to obtain xy coordinates of each grid point (i.e., to obtain xy coordinates of each grid point in a cartesian coordinate system with the target point as an origin), so as to obtain initial terrain data, and optionally, for any grid point in the target area, first P original grid points closest to the longitude and latitude coordinates of any grid point may be determined from the target area, so as to weight (e.g., average operation, etc.) the original terrain heights of each original grid point in the first P original grid points may be weighted so as to obtain the initial terrain height of any grid point. Or the electronic device may perform coordinate conversion on the target area range and the longitude and latitude coordinates of each original grid point to obtain a target conversion range of the target area in the cartesian coordinate system and a conversion coordinate of each original grid point (that is, xy coordinates with the target point as a coordinate origin), and may perform grid division on the target area according to the target resolution (the target resolution may be used to indicate an area size of one grid area in the cartesian coordinate system) and the target conversion range, to obtain a plurality of grid areas in the target area (that is, xy coordinates of each grid point in the target area may be obtained), based on this, for any grid point in the target area, the first P original grid points closest to the xy coordinates of any grid point may be determined from the target area based on the xy coordinates of any grid point and the conversion coordinates of each original grid point in the target area, so as to perform weighted summation on the original terrain heights of each original grid point in the first P original grid points to obtain the original terrain heights of any grid point, so as to obtain the original grid point coordinates of any grid point, and so on. Wherein P may be a positive integer.
S202, determining the relative terrain height of each grid point based on the initial terrain height of each grid point, and generating a three-dimensional terrain model of the target area based on the relative terrain height of each grid point.
Alternatively, in determining the relative terrain height of each grid point based on the initial terrain height of each grid point, the electronic device may determine a minimum initial terrain height from the initial terrain heights of each grid point, and use the difference between the initial terrain height and the minimum initial terrain height of each grid point as the relative terrain height of the corresponding grid point, i.e., the relative terrain height of any grid point may be the difference between the initial terrain height and the minimum initial terrain height of any grid point, that is, the altitude of the lowest point may be subtracted to achieve the determination of the relative terrain height of each grid point. It should be appreciated that the three-dimensional terrain model need not reflect the true altitude of the terrain, but only the terrain relief of the target area, and that embodiments of the present invention may convert the altitude to a relative terrain height relative to the lowest point of the target area (which may be 0 relative to the terrain height) in view of unnecessary storage and computing resources consumed in the subsequent background grid generation, grid refinement steps when the altitude is too high.
Optionally, when generating the three-dimensional terrain model of the target area based on the relative terrain height of each grid point, the electronic device may triangulate the target area based on the relative terrain height of each grid point to obtain a terrain triangulation result of the target area, where the terrain triangulation result includes grid point coordinates of each grid point and surface representation information of each of the plurality of terrain triangulation surfaces, the grid point coordinates of one grid point may include x-coordinates, y-coordinates, and relative terrain heights of the corresponding grid point (i.e., the z-coordinates of the one grid point may be the relative terrain heights of the corresponding grid point), and add the terrain triangulation result to the three-dimensional terrain model file to implement generating the three-dimensional terrain model of the target area. In other words, the target area may be triangulated based on the grid point coordinates of each grid point to obtain a terrain triangulation result of the target area, alternatively, the grid point coordinates of each grid point may also be referred to as relative terrain data of the target area, i.e. the relative terrain data may include the grid point coordinates of each grid point, at which time the target area may be triangulated based on the relative terrain data of the target area. Based on the above, when the initial terrain data is the point cloud data, the embodiment of the invention provides a method for generating the three-dimensional bottom surface based on the point cloud data and through triangulation, that is, the embodiment of the invention can triangulate the point cloud data with relative terrain height to generate the three-dimensional terrain model, and convert the initial terrain height (altitude) into the relative terrain height when processing the initial terrain height, thereby effectively avoiding the waste of calculation and storage resources caused by the subsequent generation of excessively high background grids. The three-dimensional terrain model file may be used to represent a three-dimensional terrain model of the target area, alternatively, the three-dimensional terrain model file may be an obj file, that is, the format of the three-dimensional terrain model may be an obj format, that is, the three-dimensional terrain model file may be generated according to the embodiment of the present invention, alternatively, the three-dimensional terrain model file may be referred to as a three-dimensional terrain model obj file, so that a terrain triangulation result is added to the three-dimensional terrain model obj file, that is, grid point coordinates of each grid point and surface representation information of each terrain triangulation surface may be written into the three-dimensional terrain model obj file, as shown in fig. 3. It should be appreciated that the three-dimensional terrain model is a continuous three-dimensional floor and may be composed of a plurality of non-coincident triangular surfaces that are stitched together.
Optionally, the electronic device may make delaunay triangulation of the target area. Optionally, the electronic device may call a module (may be simply referred to as delaunay triangulation module) for implementing delaunay triangulation in scipy library in Python to perform delaunay triangulation on the target area, based on this, when outputting the three-dimensional terrain model obj file, the grid point coordinates of all grid points in the target area may be written out according to the form of "v { x } { y } { z }" (the value of z in one grid point coordinate is the relative terrain height of the corresponding grid point), and then according to the triangulation, the surface representation information of all terrain triangulation surfaces is output according to the form of "f { index1} { index2} { index3 }". It should be noted that, the point index (i.e., the plane representation information) outputted by the delaunay triangulation module in Python is started from 0, and an index correction is required, for example, the outputted plane information of the 1 st terrain triangulation plane is 012, and the index actually written into the three-dimensional terrain model file should be added with +1 (i.e., the plane representation information of the 1 st terrain triangulation plane may be f 12 3). The electronic device may record the number of all written grid points, which may be denoted as N, i.e. the number of grid points in the target area may be N, where N is a positive integer.
S203, acquiring target building data of a target area, wherein the target building data comprises building indication data of each building in the target area.
S204, building vertex indication data of each building are determined based on the building indication data of each building respectively, the building vertex indication data of one building comprises vertex data of each building vertex in the corresponding building, and one vertex data comprises vertex coordinates of the corresponding building vertex.
Wherein the building indication data of one building includes contour point coordinates of each building contour point in the corresponding building and building height indication information of the corresponding building, and the vertex data may further include an index of the vertex of the corresponding building.
Based on this, the electronic device may traverse each building in the target area and take the currently traversed building as the current building, alternatively, the target building data may further include a building identification of each building in the target area, then each building identification in the target building data may be traversed and take the building indicated by the currently traversed building identification as the currently traversed building to implement traversing each building in the target area, one building identification may be used to indicate one building, one building identification may be the number (i.e., id) of the corresponding building, if the building identification of the 1 st building in the target area may be 1, then the value of s may be 1 when s represents the currently traversed building identification and the currently traversed building is the 1 st building. In other words, the current building may refer to the s-th building.
Further, the electronic device may determine an initial vertex index of the current building and determine an index of each building vertex in the current building based on the initial vertex index of the current building, where the initial vertex index of the current building may be p=n when the current building is the 1 st building (i.e., s=1), and p=p (where p is the initial vertex index of the previous building of the current building) +2×k (where k is the number of building contour points of the previous building of the current building) when the current building is not the 1 st building, i.e., the initial vertex index of the current building may be the initial vertex index of the previous building of the current building+2×the number of building contour points of the previous building of the current building. Accordingly, when determining the index of each building vertex in the current building based on the initial vertex index of the current building, p+1, p+2, p+k may be sequentially used as the index of each of the plurality of bottom surface vertices of the current building, i.e., the index of each bottom surface vertex of the current building may be sequentially used as the initial vertex index +1, the initial vertex index +2, and the initial vertex index +k (where k may be the number of building contour points of the current building), and p+k+1, p+k+2, p+k+k may be sequentially used as the index of each of the plurality of top surface vertices of the current building, i.e., the index of each top surface of the current building may be sequentially used as the initial vertex index +k+1, the initial vertex index +k+2, and the initial vertex index +k+k may be sequentially used as the index of each of the plurality of top surface vertices of the current building, i.e., the top surface of the corresponding plurality of top surface vertices of the current building may be sequentially determined.
Further, the electronic device may determine a building center point coordinate of the current building based on a contour point coordinate of each building contour point in the current building, that is, may perform a mean operation on the contour point coordinate of each building contour point in the current building to obtain a building center point coordinate of the current building (which is a two-dimensional coordinate, that is, an x coordinate in the building center point coordinate may be a mean value between x coordinates of each building contour point, and a y coordinate in the building center point coordinate may be a mean value between y coordinates of each building contour point), and may determine a ground relative height of the current building based on a relative terrain height of each grid point in M grid points corresponding to the building center point coordinate, that is, may perform a weighted sum (such as a mean operation) on the relative terrain heights of each grid point in the M grid points to obtain the ground relative height of the current building. Alternatively, the electronic device may determine M grid points from the target area based on the building center point coordinates and the xy coordinates of each grid point in the target area, and the M grid points may be the first M grid points having the closest distance between the xy coordinates in the target area and the building center point coordinates.
The electronic device may determine the vertex coordinates of each building vertex in the current building based on the contour point coordinates of each building contour point in the current building, the ground relative height, and the building height indication information of the current building, and may add the vertex coordinates and index of each building vertex in the current building to the building vertex indication data of the current building such that the vertex data of one building vertex in the current building includes the vertex coordinates and index of the corresponding building vertex, thereby implementing the determination of the building vertex indication data of the current building, as shown in fig. 4. Alternatively, the x-coordinate in the vertex coordinates of one building vertex may be the x-coordinate of the building contour point corresponding to the corresponding building vertex, the y-coordinate in the vertex coordinates of one building vertex may be the y-coordinate of the building contour point corresponding to the corresponding building vertex, and the z-coordinate in the vertex coordinates of one building vertex may be determined based on the building height indication information and the ground relative height of the corresponding building or may be zero, and one vertex coordinate may be a three-dimensional coordinate. Optionally, when the building height indication information of one of the top surface vertexes in the current building is the number of building floors of the corresponding building, the z coordinate in the vertex coordinate of one top surface vertex in the current building (i.e. the z coordinate of one top surface vertex) can be the building height indication information of the current building x the floor height+the ground relative height, so that the building height indication information of the current building and the floor height can be multiplied to obtain the height of the current building, and the sum of the height of the current building and the ground relative height is taken as the height of each top surface vertex in the current building (i.e. the z coordinate of the top surface vertex), and when the building height indication information of one of the current building is the height of the corresponding building (i.e. the building height), the z coordinate in the vertex coordinate of one top surface vertex in the current building can be the building height indication information of the current building x the floor height, the height of the current building vertex can be taken as the height of the corresponding top surface coordinate of the current vertex in the current building, and the ground relative height of each top surface vertex can be indicated as the height of the current vertex in the current building. The x-coordinate, y-coordinate, and z-coordinate of the vertex coordinates of one building vertex may also be simply referred to as the x-coordinate, y-coordinate, and z-coordinate of the corresponding building vertex. Therefore, the embodiment of the invention can stretch the height of the building when the building is generated so as to stretch the height of the building into the actual height of the building plus the relative height of the ground where the building is positioned, so that the part below the ground can be removed when the subsequent butt joint CFD model generates the lower cushion surface body pasting grid, the bottom surface of the building can be ignored when the building part is processed, and only the side surface and the top surface of the building are generated, thereby effectively saving the computing resources.
Based on this, after traversing each building in the target area, building vertex indication data for each building can be obtained. Then, correspondingly, assuming that the number of buildings in the target area is S, when the building identifier S of the current building is less than S, the traversing of the buildings in the target area may be continued until each building is traversed.
S205, generating initial top surface indication data and side surface indication data of each building based on building vertex indication data of each building, respectively, and determining target top surface indication data of each building based on initial top surface indication data of each building, respectively.
S206, generating an underlying three-dimensional model of the target area by using the target top surface indication data and the side surface indication data of each building and the three-dimensional terrain model.
In the embodiment of the invention, the electronic device can superimpose the three-dimensional building group model on the three-dimensional terrain model to generate the underlying three-dimensional model, as shown in fig. 5, that is, can superimpose (i.e., merge) the three-dimensional building group model obj file containing the target top surface indication data and the side surface indication data of each building with the three-dimensional terrain model obj file containing the three-dimensional terrain model to obtain the underlying three-dimensional model obj file, thereby realizing the generation of the underlying three-dimensional model of the target area.
In other words, the electronic device may employ a three-dimensional building group model (including target top surface indicating data and side surface indicating data for each building) and a three-dimensional terrain model to generate an underlying three-dimensional model of the target area.
S207, generating an under-pad surface-mounted grid of the target area based on the under-pad surface three-dimensional model, wherein the under-pad surface-mounted grid is used for carrying out diffusion simulation on the target area.
In the embodiment of the invention, the electronic equipment can import the object file of the three-dimensional model obj of the underlying surface into the CFD model to call the CFD model to generate the background grid of the target area, namely, the background grid generating tool of the CFD model can be called to generate the background grid which has the same origin as the three-dimensional model of the underlying surface and the range of which is not more than the three-dimensional model of the underlying surface (namely, not more than the target area). Based on the above, the three-dimensional model of the underlying surface and the background grid of the target area can be adopted to generate the underlying surface body-attaching grid of the target area, as shown in fig. 6, that is, a grid thinning tool of the CFD model can be called to refine the background grid and remove grids below the underlying surface and inside the building, so that the underlying surface body-attaching grid attached to the real underlying surface can be generated for subsequent simulation. Alternatively, the under-pad patch grid may include all grids of the background grid of the target area except the grid occupied by the under-pad three-dimensional model, i.e., all grids of the background grid of the target area except the grid below the under-pad (i.e., below the ground) and the grid inside the building.
In other embodiments, when the underlying three-dimensional model includes only a three-dimensional building group model, the building interior grid may be removed from the background grid to generate an underlying body-contacting grid, where the underlying body-contacting grid may be as shown in FIG. 7, alternatively, where features on the underlying three-dimensional model surface may also be extracted to remove the building interior grid from the background grid based on the features on the underlying three-dimensional model surface to generate an underlying body-contacting grid, and so on, as the invention is not limited in this respect.
The method and the device can acquire the initial terrain data of the target area, wherein the initial terrain data comprises the initial terrain height of each grid point in the target area, so that the relative terrain height of each grid point is determined based on the initial terrain height of each grid point, and a three-dimensional terrain model of the target area is generated based on the relative terrain height of each grid point. Accordingly, target building data of a target area may be acquired, the target building data including building indication data of each building in the target area, and building vertex indication data of each building is determined based on the building indication data of each building, respectively, the building vertex indication data of one building including vertex data of each building vertex in the corresponding building, and the vertex data including vertex coordinates of the corresponding building vertex. Then, initial top surface indication data and side surface indication data of each building may be generated based on the building vertex indication data of each building, respectively, and target top surface indication data of each building may be determined based on the initial top surface indication data of each building, respectively. Based on the above, the target top surface indication data and the side surface indication data of each building and the three-dimensional terrain model can be adopted to generate an underlying three-dimensional model of the target area, and based on the underlying three-dimensional model, an underlying surface patch grid of the target area is generated, wherein the underlying surface patch grid is supported for carrying out diffusion simulation on the target area. Therefore, the embodiment of the invention provides a method for generating the three-dimensional building group model based on the DEM data to superimpose the three-dimensional building group model generated based on the SHP file, and further provides a method for generating the patch grid required by supporting the CFD simulation based on the SHP data and the DEM data, so that the degree of automation is high, the operation is simple and efficient, the generation efficiency of the patch grid of the lower pad surface can be effectively improved, and the accuracy of the patch grid of the lower pad surface can be effectively improved.
Based on the description of the related embodiments of the above-mentioned method for generating an under-pad patch grid for high-precision simulation, the embodiment of the present invention further proposes an under-pad patch grid generating device for high-precision simulation, which may be a computer program (including program code) running in an electronic device, as shown in fig. 8, and may include an acquisition unit 801 and a processing unit 802. The under-mat patch grid generation device for high-precision simulation may perform the under-mat patch grid generation method for high-precision simulation shown in fig. 1 or 2, that is, the under-mat patch grid generation device for high-precision simulation may operate the above units:
An acquisition unit 801 for acquiring target building data of a target area, the target building data including building instruction data of each building in the target area;
A processing unit 802, configured to determine building vertex indication data of each building based on the building indication data of each building, where the building vertex indication data of one building includes vertex data of each building vertex in the corresponding building, and one vertex data includes vertex coordinates of the corresponding building vertex;
The processing unit 802 is further configured to generate initial top surface indication data and side surface indication data of each building based on building vertex indication data of each building, and determine target top surface indication data of each building based on the initial top surface indication data of each building;
the processing unit 802 is further configured to generate an underlying three-dimensional model of the target area based on the target top surface indication data and the side surface indication data of each building;
The processing unit 802 is further configured to generate an underlying surface-to-object grid of the target area based on the underlying surface three-dimensional model, where the underlying surface-to-object grid is supported to perform diffusion simulation on the target area.
In one embodiment, the obtaining unit 801 may be further configured to:
Acquiring initial terrain data of the target area, wherein the initial terrain data comprises initial terrain heights of each grid point in the target area;
The processing unit 802 may also be configured to:
Determining a relative terrain elevation for each grid point based on the initial terrain elevation for each grid point, and generating a three-dimensional terrain model for the target area based on the relative terrain elevation for each grid point;
The processing unit 802 may be specifically configured to, when generating the three-dimensional model of the underlying surface of the target area based on the target top surface indication data and the side surface indication data of each building:
And generating a three-dimensional model of the underlying surface of the target area by adopting the target top surface indication data and the side surface indication data of each building and the three-dimensional terrain model.
In another embodiment, the processing unit 802 may be specifically configured to, when generating the three-dimensional terrain model of the target area based on the relative terrain heights of each grid point:
triangulating the target area based on the relative terrain height of each grid point to obtain a terrain triangulating result of the target area, wherein the terrain triangulating result comprises grid point coordinates of each grid point and surface representation information of each of a plurality of terrain triangulating surfaces;
and adding the terrain triangulation result to a three-dimensional terrain model file to realize the generation of the three-dimensional terrain model of the target area.
In another embodiment, the building indication data of one building includes contour point coordinates of each building contour point in the corresponding building and building height indication information of the corresponding building, and the vertex data further includes an index of the corresponding building vertex, and the processing unit 802 is specifically configured to, when determining the building vertex indication data of each building based on the building indication data of each building respectively:
Traversing each building in the target area, and taking the currently traversed building as a current building;
determining an initial vertex index of the current building, and determining an index of each building vertex in the current building based on the initial vertex index of the current building;
determining the relative ground height of the current building based on the relative terrain height of each grid point in M grid points corresponding to the building center point coordinates, wherein M grid points are determined from grid points included in the target area, and M is a positive integer;
Determining the vertex coordinates of each building vertex in the current building based on the contour point coordinates of each building contour point in the current building, the ground relative height and the building height indication information of the current building, and adding the vertex coordinates and indexes of each building vertex in the current building to the building vertex indication data of the current building so that the vertex data of one building vertex in the current building comprises the vertex coordinates and indexes of the corresponding building vertex;
after traversing each building in the target area, building vertex indication data of each building is obtained.
In another embodiment, the processing unit 802 may be specifically configured to, when generating the initial top surface indication data and the side surface indication data of each building based on the building vertex indication data of each building respectively:
Generating side indication data of any building according to a target side link sequence based on building vertex indication data of any building in the target area, wherein the side indication data of any building comprises surface representation information of each side in k sides of the any building, one surface representation information comprises indexes of points in one surface, and k is the number of building contour points in the any building;
And triangulating the top surface of any building based on the vertex data of each top surface vertex to obtain initial top surface indication data of any building, wherein the initial top surface indication data of any building comprises surface representation information of each initial top surface triangulating surface in a plurality of initial top surface triangulating surfaces of the top surface of any building.
In another embodiment, the processing unit 802 may be specifically configured to, when determining the target top surface indication data of each building based on the initial top surface indication data of each building, respectively:
Traversing each initial top surface triangulation surface of a plurality of initial top surface triangulation surfaces of the top surface of any building, and taking the current traversed initial top surface triangulation surface as a current initial top surface triangulation surface;
Determining a center of gravity of the current initial top surface triangulation surface based on the surface representation information of the current initial top surface triangulation surface;
if the center of gravity of the current initial top surface triangulation surface is located in the top surface of any building, adding the surface representation information of the current initial top surface triangulation surface to target top surface indication data of any building so that the current initial top surface triangulation surface is used as one target top surface triangulation surface of the top surface of any building;
If the gravity center of the current initial top surface triangulation surface is not located in the top surface of any building, not adding the surface representation information of the current initial top surface triangulation surface into target top surface indication data of any building;
And after traversing each initial top surface triangulation surface in the plurality of initial top surface triangulation surfaces of the top surface of any building, obtaining target top surface indication data of any building, wherein the target top surface indication data of any building comprises surface representation information of each target top surface triangulation surface in the plurality of target top surface triangulation surfaces of the top surface of any building.
In another embodiment, the processing unit 802 may be further configured to:
judging whether the number of the contour points of the building in any building is larger than a preset contour point number threshold value or not;
If the number of the contour points of the building in any building is larger than the preset contour point number threshold value, triggering and executing the vertex data based on the vertices of each top surface, and triangulating the top surface of any building to obtain initial top surface indication data of any building;
If the number of the outline points of the building in any building is smaller than or equal to the preset outline point number threshold value, vertex data of each top surface vertex in the top surface of any building is adopted to generate top surface representation information of any building so as to add the top surface representation information of any building into initial top surface indication data of any building, the top surface representation information of any building comprises an index of each top surface vertex in the top surface of any building, and the determining of target top surface indication data of each building is respectively based on the initial top surface indication data of each building and comprises the steps of taking the initial top surface indication data of any building as target top surface indication data of any building.
According to an embodiment of the present invention, each unit in the underlying surface-mounted mesh generating device for high-precision simulation shown in fig. 8 may be combined into one or several additional units, respectively or all of them, or some unit(s) thereof may be further split into a plurality of units having smaller functions, which may achieve the same operation without affecting the achievement of the technical effects of the embodiment of the present invention. The above units are divided based on logic functions, and in practical applications, the functions of one unit may be implemented by a plurality of units, or the functions of a plurality of units may be implemented by one unit. In other embodiments of the present invention, any of the underlying surface-to-body mesh generating devices for high-precision simulation may also include other units, and in practical applications, these functions may be implemented with assistance from other units, and may be implemented by cooperation of a plurality of units.
According to another embodiment of the present invention, the underlying patch grid generating apparatus for high-precision simulation shown in fig. 8 may be constructed by running a computer program (including program code) capable of executing the steps involved in the respective methods shown in fig. 1 or fig. 2 on a general-purpose electronic device such as a computer including a processing element such as a Central Processing Unit (CPU), a random access storage medium (RAM), a read-only storage medium (ROM), and the like, and the storage element, and the underlying patch grid generating method for high-precision simulation of the embodiment of the present invention may be implemented. The computer program may be recorded on, for example, a computer storage medium, and loaded into and run in the above-described electronic device through the computer storage medium.
Based on the description of the method embodiments and the apparatus embodiments above, exemplary embodiments of the present invention also provide an electronic device including at least one processor, and a memory communicatively coupled to the at least one processor. The memory stores a computer program executable by the at least one processor for causing the electronic device to perform a method according to an embodiment of the invention when executed by the at least one processor.
The exemplary embodiments of the present invention also provide a non-transitory computer readable storage medium storing a computer program, wherein the computer program, when executed by a processor of a computer, is for causing the computer to perform a method according to an embodiment of the present invention.
The exemplary embodiments of the invention also provide a computer program product comprising a computer program, wherein the computer program, when being executed by a processor of a computer, is for causing the computer to perform a method according to an embodiment of the invention.
With reference to fig. 9, a block diagram of an electronic device 900 that may be a server or a client of the present invention will now be described, which is an example of a hardware device that may be applied to aspects of the present invention. Electronic devices are intended to represent various forms of digital electronic computer devices, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 9, the electronic device 900 includes a computing unit 901 that can perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM) 902 or a computer program loaded from a storage unit 908 into a Random Access Memory (RAM) 903. In the RAM 903, various programs and data required for the operation of the electronic device 900 can also be stored. The computing unit 901, the ROM 902, and the RAM 903 are connected to each other by a bus 904. An input/output (I/O) interface 905 is also connected to the bus 904.
A plurality of components in the electronic device 900 are connected to the I/O interface 905, including an input unit 906, an output unit 907, a storage unit 908, and a communication unit 909. The input unit 906 may be any type of device capable of inputting information to the electronic device 900, and the input unit 906 may receive input numeric or character information and generate key signal inputs related to user settings and/or function controls of the electronic device. The output unit 907 may be any type of device capable of presenting information and may include, but is not limited to, a display, speakers, video/audio output terminals, vibrators, and/or printers. Storage unit 908 may include, but is not limited to, magnetic disks, optical disks. The communication unit 909 allows the electronic device 900 to exchange information/data with other devices through a computer network such as the internet and/or various telecommunications networks, and may include, but is not limited to, modems, network cards, infrared communication devices, wireless communication transceivers and/or chipsets, such as bluetooth (TM) devices, wiFi devices, wiMax devices, cellular communication devices, and/or the like.
The computing unit 901 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of computing unit 901 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 901 performs the respective methods and processes described above. For example, in some embodiments, the underlying patch grid generation method for high-precision simulation may be implemented as a computer software program tangibly embodied on a machine-readable medium, such as the storage unit 908. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 900 via the ROM 902 and/or the communication unit 909. In some embodiments, the computing unit 901 may be configured to perform the underlying patch grid generation method for high-precision simulation by any other suitable means (e.g., by means of firmware).
Program code for carrying out methods of the present invention may be written in any combination of one or more programming languages. These program code may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus such that the program code, when executed by the processor or controller, causes the functions/operations specified in the flowchart and/or block diagram to be implemented. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of the present invention, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus, and/or device (e.g., magnetic discs, optical disks, memory, programmable Logic Devices (PLDs)) used to provide machine instructions and/or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal used to provide machine instructions and/or data to a programmable processor.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user, for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback), and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
It is also to be understood that the foregoing is merely illustrative of the present invention and is not to be construed as limiting the scope of the invention, which is defined by the appended claims.
Claims (9)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202411461657.8A CN119416317B (en) | 2024-10-18 | 2024-10-18 | Method for generating underlying surface body pasting grid for high-precision simulation and electronic equipment |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202411461657.8A CN119416317B (en) | 2024-10-18 | 2024-10-18 | Method for generating underlying surface body pasting grid for high-precision simulation and electronic equipment |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN119416317A CN119416317A (en) | 2025-02-11 |
| CN119416317B true CN119416317B (en) | 2025-04-18 |
Family
ID=94464767
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202411461657.8A Active CN119416317B (en) | 2024-10-18 | 2024-10-18 | Method for generating underlying surface body pasting grid for high-precision simulation and electronic equipment |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN119416317B (en) |
Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2021238359A1 (en) * | 2020-05-28 | 2021-12-02 | 华为技术有限公司 | Method for constructing multi-level of detail model of object, and computer device |
| CN116611999A (en) * | 2023-05-09 | 2023-08-18 | 南通大学 | LST data spatial resolution improvement method considering underlying surface properties |
-
2024
- 2024-10-18 CN CN202411461657.8A patent/CN119416317B/en active Active
Patent Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2021238359A1 (en) * | 2020-05-28 | 2021-12-02 | 华为技术有限公司 | Method for constructing multi-level of detail model of object, and computer device |
| CN116611999A (en) * | 2023-05-09 | 2023-08-18 | 南通大学 | LST data spatial resolution improvement method considering underlying surface properties |
Also Published As
| Publication number | Publication date |
|---|---|
| CN119416317A (en) | 2025-02-11 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN107193911B (en) | BIM model-based three-dimensional visualization engine and WEB application program calling method | |
| CN112381931B (en) | Method for generating 3D scene based on JSON data | |
| CN106960470B (en) | Three-dimensional point cloud curved surface reconstruction method and device | |
| US8269762B2 (en) | Almost rectangular triangulations | |
| CN114092645A (en) | Visual building method and device of three-dimensional scene, electronic equipment and storage medium | |
| CN114937126B (en) | Flattening editing method, device, equipment and storage medium for quantifying grid topography | |
| CN102750734A (en) | Method and system for display virtual three-dimensional earth system | |
| CN119416317B (en) | Method for generating underlying surface body pasting grid for high-precision simulation and electronic equipment | |
| CN116993955B (en) | Three-dimensional model retopology method, device, equipment and storage medium | |
| CN119416318B (en) | Three-dimensional earth surface model generation method and device for atmospheric simulation and electronic equipment | |
| CN112597260A (en) | Visualization method and device for air quality mode forecast data | |
| CN113112594A (en) | Power transmission and transformation project three-dimensional model lightweight method and device based on electric power GIM | |
| CN118015194A (en) | Model processing method, device and computer readable storage medium | |
| CN107784674B (en) | Method and system for simplifying three-dimensional model | |
| CN111898276A (en) | Overhead line model processing method and device, computer equipment and medium | |
| WO2023221683A1 (en) | Image rendering method and apparatus, device, and medium | |
| CN116402985A (en) | Tactile processing method, device, storage medium and electronic equipment | |
| CN115511701A (en) | Method and device for converting geographic information | |
| CN115019021A (en) | Image processing method, device, device and storage medium | |
| CN114782652A (en) | Model leveling method, device, equipment and storage medium | |
| CN113870426A (en) | Three-dimensional space coordinate conversion method, storage medium and computing device | |
| CN119248161B (en) | Interactive numerical simulation area setting method and device and electronic equipment | |
| CN120182455B (en) | A method, system and computer-readable storage medium for rendering land parcel lines on the ground | |
| CN119963747B (en) | Calculation method, calculation device and storage medium for three-dimensional space geometric elements | |
| CN114647709B (en) | Map data processing method, map data processing device, electronic equipment and computer storage medium |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |