A method for constructing a digital twin building model of a campus based on Godot
By building a digital twin building model of a smart park based on the Godot engine, the problems of long development cycle, high cost and insufficient model granularity in existing technologies are solved, and efficient and low-cost construction of refined virtual building models is achieved.
Patent Information
- Application Number
- CN202210693509.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-17
- Publication Date
- 2025-09-09
- Estimated Expiration
- 2042-06-17
AI Technical Summary
When constructing digital twin building models of smart parks, existing technologies have problems such as long development cycles, high costs, and insufficient model granularity, which makes it difficult to meet the refined needs of smart parks.
Using a method based on the Godot engine, by constructing building information storage nodes, external and internal structure generation nodes, and texture generation nodes, combined with the park building generation algorithm, the SceneTree structure is dynamically adjusted to construct a park model with building granularity that can be used for digital twin applications of smart parks.
While ensuring the accuracy of the digital twin of the smart park, the development cycle is shortened, the development cost is reduced, the efficient construction of refined virtual building models is achieved, and the access of other IoT projects in the smart park is supported.
Smart Images

Figure CN115221580B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of digital twin data processing, and in particular to a method for constructing a digital twin building model of a park based on Godot. Background Art
[0002] Digital twin refers to the full use of physical models, sensor updates, operation history and other data, integrating multi-disciplinary, multi-physical quantity, multi-scale, and multi-probability simulation processes, completing mapping in virtual space, and thus reflecting the entire life cycle of the corresponding physical equipment.
[0003] Specifically, the digital twin of a park refers to a visualization model built on a three-dimensional engine that can reflect the status of the park in real time in the application scenario of park management in order to more intuitively and clearly display the spatial layout structure of the physical buildings in the park, the current security, fire protection and other IoT system status of the park.
[0004] Therefore, during the construction of a digital twin of a smart campus, a 3D model of the entire campus' buildings serves as the foundation for the digital twin. Similar to a real-world map, it can more vividly and accurately depict the locational relationships of various IoT systems. Currently, common modeling methods include those based on BIM data, those combining satellite imagery with GIS systems, those using drone-based oblique photography, and manual modeling.
[0005] Among them, the digital twin park built based on BIM data modeling has a better degree of realism and low secondary development costs, but the BIM system itself is relatively expensive and its popularity needs to be improved. The modeling method based on satellite imagery and GIS systems has slow data updates, and the constructed models still require manual processing before they can be used to build the park's digital twin. The secondary development cost is high, and the model granularity is at the building level, which cannot support the refined models required by smart parks. Modeling based on oblique photography is similar to that of satellite imagery combined with GIS systems, but it can be updated more quickly. However, each update also requires a lot of manual processing. Manual modeling can construct building models with high realism and granularity that meet the needs of the park's digital twin, but manual modeling is not only time-consuming and costly, but also has low replicability. Summary of the Invention
[0006] The purpose of the present invention is to overcome the defects of the above-mentioned prior art and provide a method for constructing a campus digital twin building model based on Godot.
[0007] The purpose of the present invention can be achieved by the following technical solutions:
[0008] A method for constructing a digital twin building model of a campus based on Godot, the method comprising the following steps:
[0009] Step 1: Construct a building information storage node InfoNode to store relevant information of the corresponding building and the corresponding floor;
[0010] Step 2: Construct the building's external structure generation node FacadeGenerator and internal structure generation node InnerGenerator;
[0011] Step 3: Build a texture generation node and build a reusable architectural texture library based on the texture generation node;
[0012] Step 4: Obtain the location and shape information of each building in the park building plan image;
[0013] Step 5: Obtain the basic information of each building and add a building information storage node for each building to store the basic information of each building in the park;
[0014] Step 6: Construct a campus model with building granularity that can be used for secondary development of digital twin applications for smart parks.
[0015] In the step 1, a building information storage node InfoNode is constructed based on the Node node of the Godot engine.
[0016] In the step 2, the Spatial, ArrayMesh and SpatialMaterial nodes of the Godot engine are combined with the campus building generation algorithm to respectively construct the building's external structure generation node FacadeGenerator and the internal structure generation node InnerGenerator.
[0017] In step 3, the process of constructing a texture generation node and constructing a reusable building texture library based on the texture generation node is specifically as follows:
[0018] Based on the Godot engine's SpatialMaterial and Texture nodes, we construct an architectural texture mat that meets project requirements by configuring adjustable parameters. This allows for lossless horizontal stretching of the texture, thereby obtaining a reusable architectural texture library. The adjustable parameters include texture mapping, Albedo, Diffus, Reflection, and Shader.
[0019] The texture generation node includes a facade texture generation node and a building interior texture generation node, and the reusable building texture library includes a reusable building facade texture library and a reusable building interior texture library. The reusable building texture library is constructed based on the facade texture generation node, and the reusable building interior texture library is constructed based on the building interior texture generation node.
[0020] In step 4, the process of obtaining the position information and shape information of each building in the park building plan image is specifically as follows:
[0021] Draw a plan image of the campus buildings, use rectangles to describe the building location information, or use CAD drawings / BIM models instead, or obtain the building edges on paper drawings based on machine recognition. After optimization, obtain the location information pos(x, y) and shape information rect[n] of each building, where x is the x-coordinate of the building, y is the y-coordinate of the building, and n represents n vertices, which refers to the n vertex information in the array to describe the shape.
[0022] In step 5, the basic information of each building includes building ID bid, number of floors floor, floor height h, number of companies and company name.
[0023] In step 6, the process of constructing a park model with building granularity that can be used for secondary development of smart park digital twin applications is specifically as follows:
[0024] Based on the shape information and basic information of the building, the external structure generation node is used to generate a three-dimensional floor model, and the building texture mat in the building texture library is selected to perform texture mapping on the three-dimensional floor model to obtain the target floor virtual model. It is mounted under the Node node of the Godot engine and constructs a 3D floor model of each building by reading the building ID bid and floor number floor in the building information storage node InfoNode Where m is the mth layer, Pos(a, b, c) is a three-dimensional vector of Vector3, a=0 is the x-coordinate, b=0 is the y-coordinate, and c=h*m is the height. The park building generation algorithm is used to dynamically adjust the SceneTree structure of the Godot engine to construct a park model with a building granularity that can be used for secondary development of smart park digital twin applications. Where p is the number of building IDs.
[0025] When constructing a digital twin building model at the floor level, the method further includes the following steps:
[0026] Step 7: Obtain a plane image of the interior walls of the floor, and determine the position information wallpos[q] of all walls in the plane image of the interior walls of the floor, where q represents an array with q vertices.
[0027] Step 8: Generate the internal wall model of each floor based on the building internal structure generation node InnerGenerator and the position information wallpos[q] of the building internal wall And construct the two-dimensional coordinate plane xO (bid,floor) y;
[0028] Step 9: Mesh detail the interior wall models of each floor (bid,floor) Meshunit with target floor virtual model (bid,floor) By connecting the building ID bid with the floor, we can obtain the interactive models of all the buildings in the park and the three-dimensional coordinate system corresponding to the interactive models.
[0029] In step 9, the three-dimensional coordinate system The sensors used to realize the building are through the three-dimensional coordinate system Quickly build in smart campus digital twin applications.
[0030] Compared with the prior art, the present invention has the following beneficial effects:
[0031] 1. Based on the open-source Godot engine, this invention strikes a balance among various modeling methods. While ensuring the required accuracy of the digital twin of a smart park, it appropriately compromises the authenticity of the building, shortens the development cycle, reduces development costs, and promotes the digitalization of the smart park. It solves the problems of long development cycles and high development costs encountered in the informatization of basic building models in the current construction of the digital twin of a smart park.
[0032] 2. When generating virtual buildings, the present invention uses artificially produced reusable material maps to improve the expressiveness of virtual buildings. By utilizing a unified data structure and relying on the Godot engine to build a digital twin application for a smart park, it is not only possible to quickly construct a park-level virtual building, but also to ensure the granularity of the constructed virtual building to ensure the possibility of access to other IoT projects in the smart park. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 Flow chart of the method of the present invention. DETAILED DESCRIPTION
[0034] The present invention is described in detail below with reference to the accompanying drawings and specific embodiments. This embodiment is implemented based on the technical solution of the present invention, and provides a detailed implementation method and specific operation process, but the protection scope of the present invention is not limited to the following embodiments.
[0035] like Figure 1 As shown, the present invention provides a method for constructing a digital twin building model of a campus based on Godot to improve the generation efficiency of virtual buildings in a smart campus. The method includes the following steps:
[0036] Step 1: Based on the Node node of the Godot engine, build a building information storage node InfoNode to store the relevant information of the corresponding building and the corresponding floor;
[0037] Step 2: Based on the Spatial, ArrayMesh, and SpatialMaterial nodes of the Godot engine and the model generation algorithm, construct the building's external structure generation node FacadeGenerator and internal structure generation node InnerGenerator respectively;
[0038] Step 3: Based on the SpatialMaterial and Texture nodes of the Godot engine, construct a building texture mat that meets the project requirements by configuring adjustable parameters (including texture mapping, Albedo, Diffus, Reflection, and Shader). Keep the texture lossless in the horizontal direction and reuse the texture as much as possible to support more building structures and facilitate reuse when the project is expanded.
[0039] Step 4: Manually draw a top view of the campus buildings, using rectangles to describe the building location information, or use CAD drawings / BIM models instead. You can also use machine recognition to obtain the building edges on paper drawings, and after optimization, obtain the location information pos(x, y) and shape information rect[n] of each building;
[0040] Step 5: Add a building information storage node InfoNode for each building to store basic information of each building in the park to facilitate subsequent development. Basic information includes building IDbid, floor floor, floor height h, number of companies, and company name;
[0041] Step 6: Generate a 3D floor model using the external structure generation node based on the building's shape information and basic information. Select the building texture mat in the building texture library to perform texture mapping on the 3D floor model to obtain the target floor virtual model. It is mounted under the Node node of the Godot engine and constructs a 3D floor model of each building by reading the building ID bid and floor number floor in the building information storage node InfoNode Among them, m is the mth layer. The scene tree structure of Godot engine is dynamically adjusted by using the park building generation algorithm to construct a park model with building granularity that can be used for secondary development of smart park digital twin applications. Where p is the number of building IDs;
[0042] Step 7: If a more accurate digital twin building model at the floor level is required, obtain the plane image of the internal walls of the floor and determine the position information wallpos[q] of all walls in the plane image;
[0043] Step 8: Use the building internal structure generation node InnerGenerator and the location information of the building's internal walls to construct the internal wall model of each floor Construct a two-dimensional coordinate plane xO (bid,floor) y, and meshdetail (bid,floor) with MeshUnit (bid,floor) Connect, by matching the building IDbid with the floor, that is, build a 3D campus building model based on the location information of each campus building, providing a model foundation for the digital twin application of the smart campus;
[0044] Step 9: Complete the interactive floor-level models of all buildings in the park and the corresponding 3D coordinate system After the construction of the system, subsequent sensors such as fire protection, electricity and civil air defense will be used through the three-dimensional coordinate system. Quickly build in smart campus digital twin applications.
[0045] The present invention can be applied to different parks by changing the inputs of steps 3 and 4, so as to quickly build a digital twin application development virtual building model available for each park.
[0046] While ensuring the provision of three-dimensional interactive buildings for other Internet of Things systems in the smart park, the present invention can also shorten the development cycle and reduce development costs.
[0047] The above describes in detail the preferred embodiments of the present invention. It should be understood that those skilled in the art can make numerous modifications and variations based on the concepts of the present invention without inventive effort. Therefore, any technical solutions that can be derived by those skilled in the art through logical analysis, reasoning, or limited experimentation based on the concepts of the present invention and the prior art should be within the scope of protection defined by the claims.
Claims
1. A method for constructing a digital twin building model of a campus based on Godot, characterized in that: The method comprises the following steps: Step 1: Construct a building information storage node InfoNode to store relevant information of the corresponding building and the corresponding floor; Step 2: Construct the building's external structure generation node FacadeGenerator and internal structure generation node InnerGenerator; Step 3: Build a texture generation node and build a reusable architectural texture library based on the texture generation node; Step 4: Obtain the location and shape information of each building in the park building plan image; Step 5: Obtain the basic information of each building and add a building information storage node for each building to store the basic information of each building in the park; Step 6: Construct a campus model with building granularity that can be used for secondary development of smart campus digital twin applications; In step 3, the process of constructing a texture generation node and constructing a reusable building texture library based on the texture generation node is specifically as follows: Based on the Godot engine's SpatialMaterial and Texture nodes, we construct a building texture mat that meets project requirements by configuring adjustable parameters. This allows for lossless horizontal stretching of the texture, thereby obtaining a reusable building texture library. The adjustable parameters include texture mapping, Albedo, Diffus, Reflection, and Shader. The texture generation nodes include facade texture generation nodes and building interior texture generation nodes, the reusable building texture library includes a reusable building facade texture library and a reusable building interior texture library, and the reusable building texture library is constructed based on the facade texture generation nodes, and the reusable building interior texture library is constructed based on the building interior texture generation nodes; In step 4, the process of obtaining the position information and shape information of each building in the park building plan image is specifically as follows: Draw a planar image of the campus buildings, using rectangles to describe the building location information, or using CAD drawings / BIM models instead, or obtaining the building edges on paper drawings based on machine recognition. After optimization, obtain the location information pos(x, y) and shape information rect[n] of each building, where x is the x-coordinate of the building, y is the y-coordinate of the building, and n represents n vertices, which refers to the n vertex information in the array used to describe the shape; In step 5, the basic information of each building includes the building ID bid, the number of floors floor, the floor height h, the number of companies and the company name; In step 6, the process of constructing a park model with building granularity that can be used for secondary development of smart park digital twin applications is specifically as follows: Based on the shape information and basic information of the building, the external structure generation node is used to generate a three-dimensional floor model, and the building texture mat in the building texture library is selected to perform texture mapping on the three-dimensional floor model to obtain the target floor virtual model. It is mounted under the Node node of the Godot engine and constructs a 3D floor model of each building by reading the building ID bid and floor number floor in the building information storage node InfoNode Where m is the mth layer, Pos(a, b, c) is a three-dimensional vector of Vector3, a=0 is the x-coordinate, b=0 is the y-coordinate, and c=h*m is the height. The park building generation algorithm is used to dynamically adjust the SceneTree structure of the Godot engine to construct a park model with a building granularity that can be used for secondary development of smart park digital twin applications. Where p is the number of building IDs.
2. The method for constructing a digital twin building model of a campus based on Godot according to claim 1, characterized in that: In the step 1, a building information storage node InfoNode is constructed based on the Node node of the Godot engine.
3. The method for constructing a digital twin building model of a campus based on Godot according to claim 1, characterized in that: In the step 2, the Spatial, ArrayMesh and SpatialMaterial nodes of the Godot engine are combined with the campus building generation algorithm to respectively construct the building's external structure generation node FacadeGenerator and the internal structure generation node InnerGenerator.
4. The method for constructing a digital twin building model of a campus based on Godot according to claim 1, characterized in that: When constructing a digital twin building model at the floor level, the method further includes the following steps: Step 7: Obtain a plane image of the interior walls of the floor, and determine the position information wallpos[q] of all walls in the plane image of the interior walls of the floor, where q represents an array with q vertices. Step 8: Generate the internal wall model of each floor based on the building internal structure generation node InnerGenerator and the position information wallpos[q] of the building internal wall And construct the two-dimensional coordinate plane xO (bid,floor) y; Step 9: Mesh detail the interior wall models of each floor (bid,floor) Meshunit with target floor virtual model (bid,floor) By connecting the building ID bid with the floor, we can obtain the interactive models of all the buildings in the park and the three-dimensional coordinate system corresponding to the interactive models.
5. The method for constructing a digital twin building model of a campus based on Godot according to claim 4, characterized in that: In step 9, the three-dimensional coordinate system The sensors used to realize the building are through the three-dimensional coordinate system Quickly build in smart campus digital twin applications.
Citation Information
Patent Citations
Historical building restoration method and system based on digital twinning technology
CN114418932A
Visual editing method for digital twin system in smart park
CN114528613A