Vertex data processing method, device and equipment based on BIM building model
By constructing voxel models in building a voxel model in the architectural model for classification and clustering of vertex data, the problem of failing to effectively process topological information in the existing technology is solved, and the effect of retaining topological information in the process of model simplification is achieved.
Patent Information
- Application Number
- CN202311491020.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-09
- Publication Date
- 2025-05-09
AI Technical Summary
The existing model preprocessing aggregated vertex algorithm only considers geometric information and does not process the topological information, resulting in some topological information disappearing and does not meet complex business needs.
By constructing voxel models, a vertex data of the building model is classified at a distance, a vertex index set is generated, and a quadratic and clustered according to the attribute information of the vertex coordinates is updated, and the vertex data of the triangle face is updated to preserve the topological information and attribute information of the model.
It realizes the model's geometric information and topological information are retained during the vertex aggregation process, meets complex business needs and improves computing efficiency.
Smart Images

Figure CN119963765A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of engineering construction, and in particular to a vertex data processing method, device and equipment based on a BIM building model. Background Art
[0002] City Information Modeling (CIM) is based on Building Information Modeling (BIM, hereinafter referred to as "building model"), integrated with Geographic Information System (GIS) and Internet of Things (IOT), and is the ultimate manifestation of smart cities and digital cities.
[0003] In the CIM platform, all building information is digitized, including all ground information such as buildings on the ground: indoor buildings, roads, rivers, bridges, trees, and transportation; underground buildings include: gas pipelines, water supply pipelines, heating pipelines, subway routes and other information; and aerial buildings include: cloud layer, weather and other information. The establishment of the CIM platform can provide digital data support for urban management and urban planners, such as disaster simulation, heavy snow and rain, and calculation of the drainage volume of urban drainage pipes; after an earthquake, contingency plans for personnel evacuation and road repair and rescue are made. CIM is to model the real world on the virtual end to enhance urban management capabilities, optimize people's living safety and living environment, and realize the digital twin and metaverse of the city.
[0004] Common building models contain a lot of information. For example, the building information model can be regarded as a parametric 3D geometric model. In addition to the building component information, this model also contains spatial relationships, regional information, the number and characteristics of building components, budget costs, material inventory and project schedules to show the entire life cycle of the building.
[0005] At present, neither open source nor commercial simplification software has the function of fast vertex aggregation processing to reconstruct the topology for building models without topological information. Compared with ordinary models, building models generally have straight geometric structures, such as doors, windows, exterior walls, beams and columns. Such geometric structures are the most common geometric structures in building models and the ones that best reflect the characteristics of buildings. Subjective visual judgment usually only wants to keep these parts and delete the rest, which requires model simplification. However, the model simplification algorithm needs to input the model with topological information. If the input model is just a bunch of discrete triangles, there is no way to process it. This requires us to perform preprocessing operations to aggregate vertices and reconstruct the topological information of the model. The general model preprocessing vertex aggregation algorithm only considers geometric information and does not process topological information, resulting in the disappearance of some topological information, which does not meet complex business needs. Summary of the invention
[0006] Therefore, in order to solve the technical problem that the general model preprocessing vertex aggregation algorithm only considers geometric information and does not process topological information, resulting in the disappearance of part of the topological information and thus failing to meet complex business requirements, the embodiments of the present invention provide a vertex data processing method, device and apparatus based on the BIM building model. Specifically, the following technical solutions are disclosed:
[0007] In a first aspect, an example of the present invention discloses a vertex data processing method based on a BIM building model, which is applied to the field of building information digitization. The method comprises:
[0008] Acquire architectural model data input by a user, wherein the architectural model data includes: vertex data of a series of triangular facets of a target architectural model and attribute information of each vertex data;
[0009] A voxel model is constructed according to the vertex data, and the voxel model is used to perform distance classification on all vertex data of the target building model;
[0010] All vertex data are classified by distance through a voxel model to generate N vertex index sets, each vertex index set includes: one or more vertex coordinate sets and attribute information of vertex coordinates, each vertex coordinate set includes at least one vertex coordinate, N ≥ 2 and is a positive integer;
[0011] Classify the vertex coordinate sets according to the attribute information to obtain M vertex coordinate sets, M≤N;
[0012] The M vertex coordinate sets are clustered to generate target vertex data of the triangular patch, the vertex data of the triangular patch is updated, and the target vertex data is transmitted to the model processing device.
[0013] The method provided in this aspect is based on the vertex data of the building model. The vertices on all triangular patches in the target building model are first classified according to distance through a voxel model and divided into multiple vertex index sets. Then, based on the attribute information of the coordinates of each vertex in each vertex index set, secondary classification is performed according to different attributes. The point sets in the threshold range are aggregated in blocks according to the different attribute information to obtain the aggregated target vertex data. Finally, the target vertex data of each triangular patch after classification is updated with the original triangular patch vertex data and transmitted to the model processing device. Since the method performs secondary classification processing on the vertex coordinates on the triangular patch, the topological information and attribute information of the model are retained after processing, thereby meeting complex business needs.
[0014] In combination with the first aspect, in a possible implementation, a voxel model is obtained based on vertex data, including: constructing a spatial hash table, the content of which is empty; obtaining a target bounding box that matches the building model data, and recording the vertex coordinates of the lower left corner of the target bounding box; dividing the target bounding box into voxels of the same size; obtaining the vertices of each voxel and the vertex coordinates of each vertex within the voxel; calculating the hash value of each vertex in the spatial hash table; obtaining the vertex index of the vertex set of each vertex in the voxel grid where it is located; constructing a key-value pair of each hash value and vertex index through the hash value and vertex index; inserting the key-value pair into the spatial hash table to generate a voxel model; establishing a correspondence between the hash value of each vertex and each vertex index to generate a target hash table.
[0015] In this implementation, based on the original target building model data structure, a target bounding box is constructed, and the target bounding box is divided into voxels of uniform size to generate a voxel model. The vertex coordinates are classified by the voxel model to achieve the effect of classifying all vertex coordinates according to distance.
[0016] In combination with the first aspect, in a possible implementation, obtaining a target bounding box that matches the building model data includes: generating, based on the building model data, a first bounding box that contains a set of all vertex data of triangular facets of the building model data, the size of the first bounding box being a first volume; expanding the first bounding box to generate a second bounding box, and marking the second bounding box as a target bounding box, the size of the second bounding box being a second volume, the first volume being smaller than the second volume, and the second bounding box containing all vertex coordinate data of the triangular facets.
[0017] In this implementation, an enlarged second bounding box is generated based on the first bounding box, which prevents the vertices of the triangle patches in the original bounding box from falling on the edge of the bounding box, thereby achieving boundary processing of the model.
[0018] In combination with the first aspect, in another possible implementation, calculating the hash value of each vertex in the spatial hash table includes: obtaining the vertex coordinates of the lower left corner of the target bounding box space; obtaining the volume of the voxel, the target vertex coordinates, and the vertex index; calculating the hash value of the target vertex by a hash value calculation formula, and the hash value calculation formula is:
[0019]
[0020] p represents the target vertex coordinates, b represents the vertex coordinates of the lower left corner of the target bounding box space, v represents the volume of the voxel, and key represents the hash value of the target vertex.
[0021] In this implementation, a hash value of the target vertex is generated through the volume of the voxel, the target vertex coordinates and the vertex coordinates of the lower left corner of the bounding box space, providing data for subsequent key-value pair matching.
[0022] In combination with the first aspect, in another possible implementation, all vertex data are distance classified through a voxel model to generate N vertex index sets, including: establishing a cube with a side length of 2*d, with the coordinates of the vertex as the center and a preset distance threshold as the radius d; calculating the hash value of the cube in the spatial hash table; obtaining all vertex index sets in the cube through the key value correspondence between the hash value and the vertex index; after calculating all vertex data through the voxel model, N vertex index sets inside all voxels are obtained.
[0023] In this implementation, distance classification of vertices within a preset distance is completed by constructing a cube, which facilitates subsequent vertex aggregation operations.
[0024] In combination with the first aspect, in another possible implementation, the vertex coordinate sets are classified according to attribute information to obtain M vertex coordinate sets, which includes: obtaining the attribute information carried by each vertex index in the vertex coordinate set, the attribute information including: texture, color and material; classifying the vertex indexes in the vertex coordinate set according to preset attribute information texture, color and material to generate M vertex coordinate sets.
[0025] In this implementation, by classifying vertex coordinate sets according to attribute information, subsequent vertex aggregation operations are facilitated.
[0026] In combination with the first aspect, in another possible implementation, M vertex coordinate sets are obtained, and vertices with the same attributes in the M vertex coordinate sets are aggregated; the three vertex indexes of the triangle are updated to new vertex indexes according to the key-value correspondence, and the target vertex data of the triangle is generated and updated.
[0027] In this implementation, the method updates the three vertex indexes of the triangular facet and retains the topological information and attribute information of the model after the update, thereby meeting complex business needs.
[0028] In a second aspect, an embodiment of the present invention discloses a vertex data processing device based on a BIM building model, the device comprising:
[0029] An acquisition unit is used to acquire the building model data input by the user, wherein the building model data includes: vertex data of a series of triangular facets of the target building model and attribute information of each vertex data;
[0030] A construction unit, used for constructing a voxel model according to the vertex data, wherein the voxel model is used for performing distance classification on all vertex data of the target building model;
[0031] A first classification unit is used to perform distance classification on all vertex data through a voxel model to generate N vertex index sets, each vertex index set includes: one or more vertex coordinate sets and attribute information of the vertex coordinates, each vertex coordinate set includes at least one vertex coordinate, and N is ≥ 2 and is a positive integer;
[0032] The second classification unit is used to classify the vertex coordinate sets according to the attribute information to obtain M vertex coordinate sets, M≤N;
[0033] An aggregation unit, used for clustering the M vertex coordinate sets, generating target vertex data of the triangular patch, and updating the vertex data of the triangular patch;
[0034] The transmission unit is used to transmit the target vertex data to the model processing device.
[0035] In a third aspect, an embodiment of the present invention further discloses an electronic device, comprising a processor and a memory, wherein the memory is coupled to the processor; computer-readable program instructions are stored on the memory, and when the instructions are executed by the processor, the vertex data processing method based on the BIM building model described in the first aspect or any implementation method of the first aspect is implemented.
[0036] In addition, an embodiment of the present invention further discloses a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the vertex data processing method based on the BIM building model as described in the first aspect or any embodiment of the first aspect is implemented. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0038] Figure 1 A schematic diagram of a vertex data processing method based on a BIM building model provided by an embodiment of the present invention;
[0039] Figure 2 A flowchart of a vertex data processing method based on a BIM building model provided by an embodiment of the present invention;
[0040] Figure 3 A flowchart of constructing a hash table based on vertex data processing provided by an embodiment of the present invention;
[0041] Figure 4 A schematic diagram of a triangle patch vertex index provided by an embodiment of the present invention;
[0042] Figure 5 A flow chart of constructing a bounding box based on vertex data processing of a building model provided by an embodiment of the present invention;
[0043] Figure 6 A flow chart of distance classification based on vertex data processing of a building model provided by an embodiment of the present invention;
[0044] Figure 7 A flowchart of a process determination of vertex data processing based on a building model provided by an embodiment of the present invention;
[0045] Figure 8 A flow chart of attribute information classification based on vertex data processing of a building model provided by an embodiment of the present invention;
[0046] Fig. 9 A vertex aggregation flow chart of vertex data processing based on a building model provided by an embodiment of the present invention;
[0047] Fig.10 A structural block diagram of a vertex data processing device for a building model provided by an embodiment of the present invention;
[0048] Fig.11 A schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0049] The technical solution of the present invention will be described clearly and completely below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0050] First, the technical terms involved in the technical solution of this application are explained.
[0051] (1) Building Information Model
[0052] Building Information Modeling (BIM) technology was first proposed by Autodesk in 2002 and has been widely recognized by the industry worldwide. It can help realize the integration of building information. From the design, construction, operation to the end of the building's life cycle, various information is always integrated in a three-dimensional model information database. Design teams, construction units, facility operation departments, owners and other parties can work together based on BIM to effectively improve work efficiency, save resources, reduce costs, and achieve sustainable development.
[0053] The core of building information model is to establish a virtual three-dimensional model of the building project and use digital technology to provide a complete and actual building project information library for this model. This information library not only contains geometric information, professional attributes and status information describing building components, but also contains status information of non-component objects such as space and motion behavior. With the help of this three-dimensional model containing building project information, the degree of information integration of the building project is greatly improved, thus providing a platform for engineering information exchange and sharing for stakeholders of the building project.
[0054] Building information modeling has the following characteristics: it can be used not only in design, but also in the entire life cycle of construction projects; designing with building models is digital design; the database of building models is dynamically changing and is constantly updated, enriched and enriched during the application process; it provides a platform for collaborative work for all parties involved in the project.
[0055] (2) Mesh
[0056] Mesh, literally translated as "grid", is composed of a series of triangular patches. A triangular patch contains the index of the three points of the triangle. Through the index, the position, normal, color, etc. of the corresponding point can be found in the vertex list. Figure 1As shown, a dog-shaped three-dimensional model is shown, which includes a series of triangular facets. Each triangular facet can be composed of three vertices to form a triangle, and the vertices are associated with information such as position, normal, and color.
[0057] (3) Attribute information
[0058] Attribute information, also known as topological information, is used to describe the texture of a three-dimensional object, such as color, texture, roughness, metalness, reflectivity, refractive index, luminosity, etc. Topological information can be a data set that provides attributes and lighting algorithms for a renderer.
[0059] In the real world, every object reacts differently to light. For example, a metal object will usually appear shinier than a clay vase, and a wooden box will reflect light differently than a metal box. Some objects will not scatter as much when reflecting light, resulting in a smaller highlight, while other objects will scatter a lot, resulting in a highlight with a larger radius. If you want to simulate multiple types of objects in a 3D rendering, define different material property information for each surface.
[0060] The embodiment of the present invention proposes a technical solution for vertex data processing based on a BIM building model, which is used to solve the technical problem that a general model preprocessing vertex aggregation algorithm only considers geometric information but does not process topological information, resulting in the disappearance of part of the topological information and thus failing to meet complex business needs.
[0061] According to an embodiment of the present invention, it should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0062] In this embodiment, a method for processing vertex data of a building model is provided, which can be used in the above-mentioned mobile terminals, such as PCs, tablet computers, etc. Figure 2 is a flow chart of a vertex data processing method based on a BIM building model according to an embodiment of the present invention, such as Figure 2 As shown, the process includes the following steps:
[0063] Step 201: Acquire building model data input by a user, wherein the building model data includes vertex data of a series of triangular facets of a target building model and attribute information of each vertex data.
[0064] The architectural model format input by the user needs to be composed of triangular facets. Triangular facets refer to two-dimensional geometric figures composed of three vertices and three edges. Each edge connects two vertices, eventually forming a closed triangle. Triangular facets are usually used to describe the surface of three-dimensional objects. Complex shapes can be constructed by combining a large number of adjacent triangular facets.
[0065] Vertex data refers to the data of each vertex of a triangle patch. This vertex data can be specified for each vertex or used as a constant for all vertices.
[0066] For example, if you want to draw a fixed-color triangle patch, you can specify a constant value for all three vertices of the triangle patch. However, the positions of the three vertices that make up the triangle patch are different, so you must specify a vertex array to store the three position values.
[0067] Step 202: Acquire a voxel model according to the vertex data, wherein the voxel model is used to perform distance classification on all vertex data of the target building model.
[0068] Voxel refers to a data structure that uses a fixed-size cube as the smallest unit to represent a three-dimensional object. The first step of voxelization is to calculate the bounding box of the model, then determine the number of grids to be divided, and divide the grids in three directions.
[0069] Step 203: All the vertex data are distance-classified through the voxel model to generate N vertex index sets, each of which includes: one or more vertex coordinate sets and attribute information of vertex coordinates, each of which includes at least one vertex coordinate, N≥2 and is a positive integer.
[0070] The vertex index usually consists of two parts: vertex coordinate data and index data. Vertex data refers to vertex coordinates, textures, colors and other information, while index data is used to describe the relationship between these vertices. Through these index values, the computer can quickly find each vertex position, texture position, color position and other information to construct the shape of the geometric body.
[0071] In addition, distance classification refers to classifying vertices according to distance. For example, the preset distance is 2mm, and a vertex in the input building model is used as the center to form a cube with a side length of 4mm centered on the vertex. All vertices contained in the cube are classified into one category, thereby generating a point cluster, which includes multiple vertex coordinates and multiple attribute information of the vertex.
[0072] Step 204: Classify the vertex coordinate sets according to the attribute information to obtain M vertex coordinate sets, where M≤N.
[0073] Classification according to attribute information refers to classification according to the attribute topology information in its vertex index, such as color, texture, material and other information.
[0074] Step 205 , clustering the M vertex coordinate sets, generating target vertex data of the triangular face, updating the vertex data of the triangular face, and transmitting the target vertex data to a model processing device.
[0075] Specifically, the M vertex coordinate sets are clustered to generate target vertex data of the triangular patch, and updating the vertex data of the triangular patch includes: obtaining the minimum value of the vertex index in the M vertex coordinate sets as the first vertex index; establishing a correspondence between other vertices in the vertex coordinate set and the first vertex index; obtaining three vertex indexes of the target triangular patch; updating the three vertex indexes of the triangular patch to the first vertex index according to the correspondence, and generating and updating the target vertex data of the triangular patch.
[0076] The method provided in this embodiment processes the architectural model data input by the user through a spatial hash table. First, a spatial hash table is established, and the architectural model data input by the user is input into the spatial hash table. Then, the vertex indexes in the model data are classified by distance to obtain N vertex index sets, each of which includes a vertex coordinate set and attribute information of the vertex coordinates. Finally, the vertex coordinate sets are classified according to the attributes to obtain M vertex coordinate sets, and the M vertex coordinate sets are clustered to obtain aggregated vertices, where the vertices are close in distance and have the same attributes, and the corresponding vertices of the triangles are updated, where the vertices are close in distance and have the same attributes, thereby realizing the preprocessing process of the architectural model, which not only takes into account the geometric information, but also preserves the topological information, thereby meeting complex business needs.
[0077] Optionally, in another embodiment, see Figure 3 The above step 202 specifically includes:
[0078] Step 3021, construct a spatial hash table, the content of which is empty.
[0079] The spatial hash table refers to a mapping structure from spatial voxels to mesh triangle patch vertices. The initialization definition of the spatial hash table in the code standard library is as follows:
[0080] typedef std::unordered_multimap<CVector3i,int,HashFunctor> HashType
[0081] Step 3022, obtain a target bounding box that matches the building model data, and record the vertex coordinates of the lower left corner of the target bounding box.
[0082] Step 3023, dividing the target bounding box into voxels of uniform size.
[0083] Specifically, when the target bounding box space has n vertices and the bounding box size is x, y, z, the entire space bounding box is divided into u*v*w voxels, and the division method is:
[0084]
[0085]
[0086]
[0087] Among them, each voxel has an independent hash value for quick indexing, which makes it easy to calculate the voxel to which each point belongs.
[0088] Step 3024, obtaining the vertex of each of the voxels and the vertex coordinates of each of the vertex within the voxel.
[0089] Step 3025, calculate the hash value of each vertex in the spatial hash table.
[0090] Specifically, first obtain the vertex coordinates (b1, b2, b3) of the lower left corner of the target bounding box space;
[0091] Then get the volume of the voxel (voxel1, voxel2, voxel3), the target vertex coordinates p1, p2, p3, the vertex index (Id p );
[0092] Then, the hash value of the target vertex is calculated using the hash value calculation formula, which is:
[0093]
[0094] Among them, p represents the target vertex coordinates, b represents the vertex coordinates of the lower left corner of the target bounding box space, v represents the volume of the voxel, key represents the hash value of the target vertex, and the subscripts 1, 2, and 3 represent three dimensions respectively.
[0095] Step 3026, obtaining the vertex index of each vertex in the vertex set in the voxel grid where the vertex is located.
[0096] like Figure 4As shown in the figure, in a triangle, the three vertices are A1, A2 and A3, among which A1's vertex index is 0, and the vertex coordinate data is (1,0,0); A2's vertex index is 2, and the vertex coordinate data is (0,0,1); A3's vertex index is 1, and the vertex coordinate data is (0,1,0).
[0097] The vertex index of each vertex in the vertex set of the voxel grid in which it is located is Id p .
[0098] Step 3027, constructing a key-value pair of each hash value and vertex index through the hash value and the vertex index;
[0099] The key-value pair is the implementation of the mapping in the programming language to the mathematical concept. The key is used as the index of the element, and the value represents the data stored and read. The key-value pair in this embodiment is (key, Id p ).
[0100] Step 3028: insert the key-value pair into the spatial hash table to generate the voxel model.
[0101] Specifically, (key,Id p ) key-value pairs are inserted into the spatial hash table to generate a voxel model.
[0102] Step 3029: Establish a corresponding relationship between the hash value of each vertex and each vertex index, and generate a target hash table.
[0103] At this point, the hash table of the input mesh model has been established. No matter how large the mesh model is, it only takes constant time O(C) to establish the hash table, where C represents a constant. The bounding box space of the mesh model is divided into a number of voxels, and each vertex corresponds to a voxel. According to the structure of the hash table, all vertices in a voxel can be found in O(1) time.
[0104] Through the structure of the hash table, the mesh vertices can be traversed and the vertices can be classified in O(1) time, which improves the efficiency of the calculation.
[0105] Optionally, in another implementation of this embodiment, see Figure 5 The above step 3022 specifically includes:
[0106] Step 5021: Generate a first bounding box containing a set of all vertex data of triangular facets of the building model data according to the building model data, wherein the size of the first bounding box is a first volume.
[0107] The building model data includes vertex data of a plurality of triangular facets, the first bounding box is a bounding box generated by enclosing all the triangular facets of the model, and the first bounding box contains the building model.
[0108] Step 5022, expand the first bounding box to generate a second bounding box, and mark the second bounding box as the target bounding box, the size of the second bounding box is a second volume, the first volume is smaller than the second volume, and the second bounding box contains all vertex coordinate data of the triangle face.
[0109] For example, the diagonal line of the first bounding box is expanded by 1%, and the boundary of the first bounding box is processed to ensure that all critical points of the first bounding box are included, thereby generating a second bounding box.
[0110] In this implementation, an enlarged second bounding box is generated based on the first bounding box, which prevents the vertices of the triangle patches in the original bounding box from falling on the edge of the bounding box, thereby achieving boundary processing of the model.
[0111] Optionally, in another embodiment, see Figure 6 The above step 203 specifically includes:
[0112] Step 6031, establish a cube with a side length of 2*d, the cube takes the coordinates of the vertex as the center and a preset distance threshold as the radius d.
[0113] The method provided in this embodiment uses the vertex coordinates of the vertex as the center and the distance threshold as the radius d to establish a small cube, and uses the geometric information of the cube and the grid bounding box.
[0114] Step 6032, calculating the hash value of the cube in the spatial hash table.
[0115] Then calculate the minimum hash value key of the lower left corner and upper right corner of the cube in the spatial hash table respectively min =(i min ,j min ,k min ) and the maximum hash value key max =(i max ,j max ,k max ), that is, calculate the position of the cube in the spatial hash table.
[0116] Step 6033, obtaining a set of all vertex indexes in the cube through the key-value correspondence between the hash value and the vertex index.
[0117] Step 6034, after calculating all the vertex data through the voxel model, obtain N vertex index sets inside all the voxels.
[0118] Specifically, the corresponding relationship is searched through the index of the spatial hash table to find all the vertices within the cube. Then, the vertex set inside all voxels within the cube is calculated, and the points whose distance to the current vertex is less than the distance threshold are calculated and collected to obtain all the points in the grid whose distance to the previous vertex is less than the threshold, and generate N vertex index sets.
[0119] In this implementation, a hash value of the target vertex is generated through the volume of the voxel, the target vertex coordinates and the vertex coordinates of the lower left corner of the bounding box space, providing data for subsequent key-value pair matching.
[0120] Optionally, in another embodiment, see Figure 7 The above steps 202 and 203 specifically include:
[0121] Step 702: Determine whether the current point has been searched.
[0122] Specifically, after obtaining the vertex, it is determined whether the current vertex has been searched. If it has been searched, the process returns to step 701: obtaining the vertex of each voxel and the vertex coordinates of each vertex in the voxel, thereby obtaining a new vertex;
[0123] If it has not been searched, execute step 703: perform distance classification on all the vertex data through the voxel model to generate N vertex index sets, each of which includes: one or more vertex coordinate sets and attribute information of the vertex coordinates, each of which includes at least one vertex coordinate, N ≥ 2 and is a positive integer.
[0124] Step 704: Determine whether the traversal of the mesh vertices is complete.
[0125] Specifically, after the current vertex data is calculated, it is determined whether all vertices in the grid have been traversed. If not, the process returns to step 701: obtaining the vertex of each voxel and the vertex coordinates of each vertex in the voxel;
[0126] If all vertices in the mesh have been traversed, the process proceeds to step 705: classifying the vertex coordinate sets according to the attribute information to obtain M vertex coordinate sets, where M≤N.
[0127] Optionally, in another embodiment, see Figure 8 The above step 104 specifically includes:
[0128] In this embodiment, through logical judgment between different steps, the computer can traverse all triangular facets in the model data, thereby ensuring the accuracy of the data.
[0129] Step 8041, obtaining attribute information carried by each vertex index in the vertex coordinate set, the attribute information including: texture, color and material;
[0130] Step 8042, classifying the vertex indexes in the vertex coordinate set according to preset attribute information texture, color and material to generate M vertex coordinate sets;
[0131] Specifically, the distances between vertices in the same vertex coordinate set are less than the preset distance threshold, but they may contain different attributes. For example, in a building model mesh, glass, floor, tile, etc. are all different materials. Vertices belonging to different materials in the same set cannot be aggregated even if they are within the preset distance threshold. Otherwise, the subsequent algorithm model may perform some geometric processing, which may lead to loss and confusion of material information. For example, an area that should have been glass material is pasted with tile material, etc.
[0132] Therefore, according to the business requirements for the classification of different attributes, these vertices are divided into several categories. Not only does the distance of each category of vertices fall within the threshold range, but the attributes are also consistent.
[0133] Optionally, in another embodiment, see Fig. 9 The above step 105 specifically includes:
[0134] Step 9051, obtaining the M vertex coordinate sets, and aggregating vertices with the same attributes in the M vertex coordinate sets;
[0135] Step 9052: Update the three vertex indexes of the triangular face to new vertex indexes according to the key-value correspondence, and generate and update the target vertex data of the triangular face.
[0136] For example, the three vertex indexes of the current triangle patch are (i, j, k). According to the hash algorithm model map, the vertex index is changed to (map[i], map[j], map[k]), which realizes the aggregation operation, and then the new vertex index (map[i], map[j], map[k]) is handed over to the subsequent algorithm model for processing.
[0137] The method provided in this aspect is based on the vertex data of the BIM building model. The vertices on all triangular facets in the target building model are first classified according to distance through a voxel model and divided into multiple vertex index sets. Then, based on the attribute information of the coordinates of each vertex in each vertex index set, secondary classification is performed according to different attributes. The point sets with different geometries within the threshold range are aggregated in blocks according to the different attribute information to obtain the aggregated target vertex data. Finally, the target vertex data of each triangular facet after classification is updated with the original triangular facet vertex data and transmitted to the model processing device. Since the method performs secondary classification processing on the vertex coordinates on the triangular facets, the topological information and attribute information of the model are retained after processing, thereby meeting complex business needs.
[0138] This embodiment provides a vertex data processing method based on a BIM building model, which has the following beneficial effects on building model data:
[0139] 1. When the building model is vertex aggregated, both the geometric information of the triangle patches and the attribute information of the triangle patches are saved, meeting subsequent complex business needs.
[0140] 2. According to the characteristics of the hash table, all vertices in a certain voxel can be found in O(1) time, and the vertices can be classified in O(1) time, which improves the efficiency of vertex aggregation calculation.
[0141] In this embodiment, a device for processing vertex data based on a BIM building model is also provided, and the device is used to implement the vertex data processing method based on a BIM building model in the above-mentioned embodiment, which has been described and will not be repeated. As used below, the term "unit" or "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0142] This embodiment provides a device for processing vertex data based on a BIM building model. Fig.10 As shown, the device includes: an acquisition module 1001, a construction module 1002, a first classification module 1003, a second classification module 1004, an aggregation module 1005 and a transmission module 1006. In addition, the device also includes other more or fewer units / modules, such as a storage module, etc., which is not limited in this embodiment.
[0143] The acquisition module 1001 is used to acquire the building model data input by the user, wherein the building model data includes: vertex data of a series of triangular facets of the target building model and attribute information of each vertex data.
[0144] The construction module 1002 is used to obtain a voxel model according to the vertex data, and the voxel model is used to perform distance classification on all vertex data of the target building model.
[0145] The first classification module 1003 is used to perform distance classification on all the vertex data through the voxel model to generate N vertex index sets, each of which includes: one or more vertex coordinate sets and attribute information of the vertex coordinates, each of which includes at least one vertex coordinate, and N≥2 is a positive integer.
[0146] The second classification module 1004 is used to classify the vertex coordinate sets according to the attribute information to obtain M vertex coordinate sets, where M≤N.
[0147] The aggregation module 1005 is used to cluster the M vertex coordinate sets, generate target vertex data of the triangular face, update the vertex data of the triangular face, and transmit the target vertex data to the model processing device.
[0148] The transmission module 1006 is used to transmit the target vertex data to the model processing device.
[0149] In some optional implementations, construction module 1002 is specifically used to construct a spatial hash table, the content of which is empty; obtain a target bounding box that matches the building model data, and record the vertex coordinates of the lower left corner of the target bounding box; divide the target bounding box into voxels of uniform size; obtain the vertices of each voxel, and the vertex coordinates of each vertex within the voxel; calculate the hash value of each vertex in the spatial hash table; obtain the vertex index of the vertex set of each vertex in the voxel grid where it is located; construct a key-value pair of each hash value and vertex index through the hash value and vertex index; insert the key-value pair into the spatial hash table to generate a voxel model.
[0150] In some other optional embodiments, the construction module 1002 is further specifically used to generate a first bounding box containing a set of all vertex data of a triangular face of the building model data based on the building model data, wherein the size of the first bounding box is a first volume; the first bounding box is expanded to generate a second bounding box, and the second bounding box is marked as a target bounding box, wherein the size of the second bounding box is a second volume, the first volume is smaller than the second volume, and the second bounding box contains all vertex coordinate data of the triangular face.
[0151] In other optional embodiments, the first classification module 1003 is specifically used to obtain the vertex coordinates of the lower left corner of the target bounding box space, the volume of the voxel, the target vertex coordinates and the index of the vertex; calculate the hash value of the target vertex according to the vertex coordinates, the volume of the voxel, the target vertex coordinates and the index of the vertex, and the hash value calculation formula; establish a cube with a side length of 2*d, the cube is centered on the coordinates of the vertex and has a preset distance threshold as the radius d; calculate the hash value of the cube in the spatial hash table; obtain all vertex index sets in the cube through the key value correspondence between the hash value and the vertex index; after calculating all the vertex data through the voxel model, obtain N vertex index sets inside all the voxels.
[0152] In other optional embodiments, the second classification module 1004 is specifically used to classify the attribute information carried by each vertex index in the vertex coordinate set according to the preset attribute information texture, color and material, and generate M vertex coordinate sets.
[0153] In other optional implementations, the aggregation module 1005 is specifically used to obtain the M vertex coordinate sets, aggregate vertices with the same attributes in the M vertex coordinate sets; update the three vertex indexes of the triangular face to new vertex indexes according to the key-value correspondence, and generate and update the target vertex data of the triangular face.
[0154] The embodiment of the present invention also provides a computer device having the above Fig.10 A vertex data processing device based on a BIM building model is shown.
[0155] See also Fig.11 , Fig.11 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Fig.11 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including a high-speed interface and a low-speed interface. Each component utilizes different buses to communicate with each other, and can be installed on a common mainboard or installed in other ways as required. The processor can process the instructions executed in the computer device, including instructions stored in the memory or on the memory to display the graphical information of the GUI on an external input / output device. In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Equally, multiple computer devices can be connected, and each device provides part of the necessary operation. Fig.11 A processor 10 is taken as an example.
[0156] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0157] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.
[0158] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created by the use of a computer device based on the presentation of a small program landing page, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0159] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0160] The computer device also includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30 and the output device 40 may be connected via a bus or other means. Fig.11 The example of connecting through bus is taken in the following.
[0161] The input device 30 can receive input digital or character information, and generate key signal input related to the user settings and function control of the computer device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator bar, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 may include a display device, an auxiliary lighting device, a tactile feedback device, etc. The above-mentioned display device includes but is not limited to a liquid crystal display, a light emitting diode, a display and a plasma display. In some optional embodiments, the display device can be a touch screen.
[0162] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0163] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A vertex data processing method based on a BIM building model, characterized in that: The method comprises: Acquire architectural model data input by a user, wherein the architectural model data includes: vertex data of a series of triangular facets of a target architectural model and attribute information of each vertex data; Constructing a voxel model according to the vertex data, wherein the voxel model is used to perform distance classification on all vertex data of the target building model; Performing distance classification on all the vertex data through the voxel model to generate N vertex index sets, each of the vertex index sets including: one or more vertex coordinate sets and attribute information of vertex coordinates, each of the vertex coordinate sets including at least one vertex coordinate, N≥2 and is a positive integer; Classify the vertex coordinate sets according to the attribute information to obtain M vertex coordinate sets, M≤N; The M vertex coordinate sets are clustered to generate target vertex data of the triangular face patch, the vertex data of the triangular face patch is updated, and the target vertex data is transmitted to a model processing device.
2. The method according to claim 1, characterized in that: The step of obtaining a voxel model according to the vertex data comprises: Constructing a spatial hash table, wherein the content of the spatial hash table is empty; Get the target bounding box that matches the building model data, and record the vertex coordinates of the lower left corner of the target bounding box; Splitting the target bounding box into voxels of uniform size; Obtaining the vertex of each of the voxels and the vertex coordinates of each of the vertices within the voxel; Calculate the hash value of each vertex in the spatial hash table; Get the vertex index of each vertex in the vertex set of the voxel grid where the vertex is located; Constructing a key-value pair of each hash value and vertex index through the hash value and the vertex index; The key-value pair is inserted into the spatial hash table to generate the voxel model.
3. The method according to claim 2, characterized in that: The step of obtaining a target bounding box that matches the building model data includes: Generate, according to the building model data, a first bounding box containing a set of all vertex data of triangular facets of the building model data, wherein the size of the first bounding box is a first volume; The first bounding box is expanded to generate a second bounding box, and the second bounding box is marked as the target bounding box. The size of the second bounding box is a second volume, the first volume is smaller than the second volume, and the second bounding box contains all vertex coordinate data of the triangular face.
4. The method according to claim 2, characterized in that: The step of calculating the hash value of each vertex in the spatial hash table includes: Obtain the vertex coordinates of the lower left corner of the target bounding box space, the volume of the voxel, the target vertex coordinates and the vertex index; The hash value of the target vertex is calculated according to the vertex coordinates, the volume of the voxel, the target vertex coordinates and the index of the vertex, and a hash value calculation formula, wherein the hash value calculation formula is: Among them, p represents the target vertex coordinates, b represents the vertex coordinates of the lower left corner of the target bounding box space, voxel represents the volume of the voxel, and key represents the hash value of the target vertex.
5. The method according to claim 1, characterized in that: All the vertex data are distance-classified through the voxel model to generate N vertex index sets, including: Create a cube with a side length of 2*d, the cube takes the coordinates of the vertex as the center and a preset distance threshold as the radius d; Calculate the hash value of the cube in the spatial hash table; Obtaining a set of all vertex indexes in the cube through a key-value correspondence between hash values and vertex indexes; After all the vertex data are calculated through the voxel model, N vertex index sets inside all the voxels are obtained.
6. The method according to claim 1, characterized in that: The vertex coordinate sets are classified according to the attribute information to obtain M vertex coordinate sets, which include: Obtaining attribute information carried by each vertex index in the vertex coordinate set, the attribute information including: texture, color and material; The vertex indexes in the vertex coordinate set are classified according to preset attribute information texture, color and material to generate M vertex coordinate sets.
7. The method according to any one of claims 1 to 6, characterized in that: The clustering of the M vertex coordinate sets to generate target vertex data of the triangular face patch and updating the vertex data of the triangular face patch includes: Obtain the M vertex coordinate sets, and aggregate vertices with the same attributes in the M vertex coordinate sets; The three vertex indexes of the triangular face are updated to new vertex indexes according to the key-value correspondence, and the target vertex data of the triangular face is generated and updated.
8. A vertex data processing device based on a BIM building model, characterized in that: The device comprises: An acquisition module, used to acquire building model data input by a user, wherein the building model data includes: vertex data of a series of triangular facets of a target building model and attribute information of each vertex data; A construction module, used for constructing a voxel model according to the vertex data, wherein the voxel model is used for performing distance classification on all vertex data of the target building model; A first classification module, used for performing distance classification on all the vertex data through the voxel model to generate N vertex index sets, each of which includes: one or more vertex coordinate sets and attribute information of vertex coordinates, each of which includes at least one vertex coordinate, and N≥2 is a positive integer; A second classification module is used to classify the vertex coordinate sets according to the attribute information to obtain M vertex coordinate sets, M≤N; An aggregation module, used for clustering the M vertex coordinate sets, generating target vertex data of the triangular face patch, and updating the vertex data of the triangular face patch; The transmission module is used to transmit the target vertex data to the model processing device.
9. An electronic device, characterized in that: It includes a processor and a memory, wherein the memory is coupled to the processor; the memory stores computer-readable program instructions, and when the instructions are executed by the processor, the vertex data processing method based on the BIM building model as claimed in any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium, characterized in that: Computer instructions are stored on the computer-readable storage medium, and the computer instructions are used to enable a computer to execute the vertex data processing method based on the BIM building model according to any one of claims 1 to 7.
Citation Information
Cited By
Triangular patch data management method and device and XR equipment
CN120953544A
Three-dimensional geometric model topological information storage method based on sparse voxel data blocks
CN122223269A