A BIM model simplification method and a simplification device

By using triangle attribute information to fold the folded edges in the BIM model simplification process, the geometric structure simplification error caused by the edge folding method in the prior art is solved, and the accuracy and authenticity of model simplification are improved.

CN112562085BActive Publication Date: 2025-05-30GLODON CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011530256.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-22
Publication Date
2025-05-30
Estimated Expiration
2040-12-22

AI Technical Summary

Technical Problem

The existing BIM model simplification method based on edge folding is likely to cause geometric structure simplification errors. For example, rectangles or spatial tetrahedrons composed of blinds and blades are difficult to retain real structural information during the simplification process.

Method used

By obtaining the original BIM model and vertex coordinates, the position coordinates and error measurement of the folding point corresponding to each edge of the triangle are calculated, and the edges to be folded are determined based on the sorting results of the error measurement from small to large, and the attribute information of the triangle that coincides with the edge to be folded is obtained in the original BIM model, so as to fold the edges to be folded according to the attribute information.

Benefits of technology

By using triangle attribute information to fold the folded edges, geometric structure errors are avoided during the simplification process, ensuring that the simplified BIM model retains the real structural information of the original model, and improving the accuracy of model simplification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112562085B_ABST
    Figure CN112562085B_ABST
Patent Text Reader

Abstract

The present invention provides a BIM model simplification method and a simplification device. Among them, the method includes: obtaining an original BIM model and the coordinates of vertices in the original BIM model, where the original BIM model is a triangular mesh model; calculating the position coordinates of folding points corresponding to each edge of the triangles in the original BIM model and the error measure according to the coordinates of the vertices, and determining the edges to be folded according to the sorting result of the error measure from small to large; obtaining the attribute information of the triangles in the original BIM model that have at least one vertex coincident with the edges to be folded; folding the edges to be folded according to the attribute information to obtain a simplified BIM model. By using the attribute information of the triangles that have at least one vertex coincident with the edges to be folded to perform folding protection on the edges to be folded, it is avoided that the folding produces a result that is significantly different from the original BIM model, so that the simplified BIM model retains the true structural information of the original BIM model and improves the accuracy of model simplification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of engineering construction, and particularly relates to a BIM model simplification method and a simplification device. Background Art

[0002] In the construction field, a Building Information Modeling (referred to as BIM model) contains a lot of building information, such as geometric information between building components, spatial relationships, budget costs, etc. Since the BIM model itself contains a large amount of data, although the current computer hardware level has made rapid development, with the continuous improvement of data acquisition accuracy and modeling technology, the accuracy of the BIM model is getting higher and higher, and the amount of data is also increasing rapidly, which brings great pressure to computer rendering, transmission, browsing, etc. Therefore, it is often necessary to simplify the BIM model to make it a model with a smaller amount of data.

[0003] In the prior art, model simplification methods can be divided into: vertex deletion method, edge collapse method, triangle collapse method, etc. according to different grid elements deleted. Among them, the edge collapse method is the most widely used simplification method at present because it can effectively maintain the original topological relationship of the grid. However, in the existing BIM model simplification method based on edge collapse, when performing the edge collapse operation, geometric structure simplification errors often occur. For example, for rectangles or spatial tetrahedrons composed of doors, windows, and shutter blades, etc., it is expected to be retained during the simplification process. However, if the tetrahedron is very long and narrow, such as the blades of a shutter, based on the idea of edge collapse, the short sides of the blades will be judged as the edges to be simplified first due to their short length, resulting in the simplification result becoming two overlapping triangles, and it is difficult to retain the true structural information of the shutter; or the simplification result shows long and narrow triangles that do not conform to the original BIM structure. Summary of the Invention

[0004] In view of this, embodiments of the present invention provide a BIM model simplification method and a simplification device to solve the problem that the existing BIM model simplification method based on edge collapse is prone to geometric structure simplification errors.

[0005] According to a first aspect, an embodiment of the present invention provides a BIM model simplification method, including:

[0006] Obtain an original BIM model and the coordinates of vertices in the original BIM model, where the original BIM model is a triangular mesh model;

[0007] According to the coordinates of the vertices, calculate the position coordinates of the folding points corresponding to each side of the triangles in the original BIM model and the error measure, and determine the edges to be folded according to the sorting result of the error measure from small to large;

[0008] Obtain the attribute information of the triangle in the original BIM model that has at least one vertex coincident with the edge to be folded;

[0009] Fold the edge to be folded according to the attribute information to obtain a simplified BIM model.

[0010] Optionally, the folding the edge to be folded according to the attribute information to simplify the original BIM model includes:

[0011] Judge whether the edge to be folded meets the preset protection condition according to the edge attribute or vertex coordinates in the attribute information;

[0012] When the edge to be folded meets the preset protection condition, remove the error measure corresponding to the edge to be folded from the sorting result;

[0013] Re-determine the edge to be folded according to the sorting result of the error measure from small to large.

[0014] Optionally, the judging whether the edge to be folded meets the preset protection condition according to the attribute information further includes:

[0015] When the edge to be folded does not meet the preset protection condition, fold the edge to be folded to obtain a simplified BIM model.

[0016] Optionally, the judging whether the edge to be folded meets the preset protection condition according to the attribute information includes:

[0017] Obtain the edge attributes of the other two edges in the current triangle where the edge to be folded is located, and the edge attributes include: common edge and non-common edge;

[0018] When the edge attributes of the other two edges are both non-common edges, determine that the edge to be folded meets the preset protection condition.

[0019] Optionally, the judging whether the edge to be folded meets the preset protection condition according to the attribute information includes:

[0020] Obtain the vertex coordinates of the first adjacent triangle and the second adjacent triangle of the edge to be folded, and the first adjacent triangle and the second adjacent triangle are triangles that have only one common vertex with the edge to be folded;

[0021] Based on the vertex coordinates of the first adjacent triangle and the second adjacent triangle, judge whether there is a common edge between the first adjacent triangle and the second adjacent triangle;

[0022] When there is a common edge between the first adjacent triangle and the second adjacent triangle, determine that the edge to be folded meets the preset protection condition.

[0023] Optionally, determining whether the edge to be folded satisfies a preset protection condition according to the attribute information includes:

[0024] Obtain the first normal direction of the third adjacent face triangle of the edge to be folded, where the third adjacent face triangle is a triangle that has only one common vertex with the edge to be folded;

[0025] Obtain the second normal direction after folding the third adjacent face triangle along the edge to be folded;

[0026] Calculate the angle difference between the first normal direction and the second normal direction, and determine whether the angle difference exceeds a preset angle difference threshold;

[0027] When the angle difference exceeds the preset angle difference threshold, determine that the edge to be folded satisfies the preset protection condition.

[0028] Optionally, determining whether the edge to be folded satisfies a preset protection condition according to the attribute information includes:

[0029] Obtain the vertex coordinates of the fourth adjacent face triangle of the edge to be folded, where the fourth adjacent face triangle is a triangle that has only one common vertex with the edge to be folded;

[0030] According to the vertex coordinates of the fourth adjacent face triangle and the folding point position coordinates, determine the corresponding new vertex coordinates after folding the fourth adjacent face triangle along the edge to be folded;

[0031] Determine the lengths of the respective sides of the folded fourth adjacent face triangle according to the new vertex coordinates;

[0032] Determine whether the edge to be folded satisfies the preset protection condition according to the lengths of the respective sides.

[0033] Optionally, determining whether the edge to be folded satisfies a preset protection condition according to the lengths of the respective sides includes:

[0034] Judge whether the lengths of the respective sides satisfy a preset side length relationship;

[0035] When the lengths of the respective sides satisfy the preset side length relationship, determine that the edge to be folded satisfies the preset protection condition.

[0036] Optionally, calculating the folding point position coordinates and error measure corresponding to each side of the triangle in the original BIM model according to the coordinates of the vertices includes:

[0037] According to the coordinates of the vertices, calculate the weighted values corresponding to the preset weighting coefficients of the first vertex and the second vertex in the current side of each triangle;

[0038] Calculate a quadratic error matrix corresponding to the first vertex and the second vertex and including a preset weighting value based on the weighting value and the coordinates of the vertex.

[0039] Calculate the position coordinates and error measure of the folding point corresponding to the current edge based on the quadratic error matrix including a preset weighting coefficient.

[0040] Optionally, the calculating the position coordinates and error measure of the folding point corresponding to the current edge based on the quadratic error matrix including a preset weighting coefficient includes:

[0041] Obtain the coordinates of the first vertex and the second vertex of the current edge, and calculate the length of the current edge according to the coordinates of the first vertex and the second vertex.

[0042] Calculate the quadratic error matrix of the folding point corresponding to the current edge based on the length of the current edge and the quadratic error matrix corresponding to the first vertex and the second vertex and including a preset weighting coefficient.

[0043] Calculate the position coordinates and error measure of the folding point corresponding to the current edge according to the quadratic error matrix of the folding point corresponding to the current edge.

[0044] According to a second aspect, an embodiment of the present invention provides a BIM model simplification device, including:

[0045] An acquisition module, configured to acquire an original BIM model and the coordinates of vertices in the original BIM model, where the original BIM model is a triangular mesh model;

[0046] A first processing module, configured to calculate the position coordinates and error measure of the folding point corresponding to each edge of a triangle in the original BIM model according to the coordinates of the vertices, and determine an edge to be folded according to the sorting result of the error measures from small to large;

[0047] A second processing module, configured to acquire the attribute information of a triangle in the original BIM model that has at least one vertex coincident with the edge to be folded;

[0048] A third processing module, configured to fold the edge to be folded according to the attribute information to obtain a simplified BIM model.

[0049] According to a third aspect, an embodiment of the present invention provides a non-transitory computer-readable storage medium, where the non-transitory computer-readable storage medium stores computer instructions, and when the computer instructions are executed by a processor, the method described in the first aspect of the present invention and any one of its optional manners is implemented.

[0050] According to a fourth aspect, an embodiment of the present invention provides an electronic device, including: a memory and a processor, which are communicatively connected to each other. The memory stores computer instructions, and the processor executes the computer instructions to execute the method according to the first aspect of the present invention and any of its optional embodiments.

[0051] The technical solution of the present invention has the following advantages:

[0052] An embodiment of the present invention provides a BIM model simplification method and device. By obtaining an original BIM model and the coordinates of vertices in the original BIM model, the original BIM model being a triangular mesh model; calculating the position coordinates of folding points and error measures corresponding to each side of a triangle in the original BIM model according to the coordinates of the vertices, and determining the edges to be folded according to the sorting result of the error measures from small to large; obtaining the attribute information of triangles in the original BIM model that have at least one vertex coincident with the edges to be folded; and folding the edges to be folded according to the attribute information to obtain a simplified BIM model. Thus, by using the attribute information of triangles that have at least one vertex coincident with the edges to be folded to perform folding protection on the edges to be folded, it is possible to avoid results that may significantly differ from the original BIM model during folding, so that the simplified BIM model retains the true structural information of the original BIM model and improves the accuracy of model simplification. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following will briefly introduce the drawings required for use in the description of the specific embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0054] Figure 1 It is a flowchart of the BIM model simplification method in an embodiment of the present invention;

[0055] Figure 2 It is a schematic diagram of the situation where the simplified model degenerates after edge folding in an embodiment of the present invention;

[0056] Figure 3 It is a schematic diagram of the situation where the prismatic structure is missing in the simplified model after edge folding in an embodiment of the present invention;

[0057] Figure 4 It is a schematic diagram of the situation where reverse folding occurs in the simplified model after edge folding in an embodiment of the present invention;

[0058] Figure 5 It is a schematic diagram of the BIM model data simplification process in an embodiment of the present invention;

[0059] Figure 6 Schematic diagram of vertex fusion of BIM model in the embodiment of the present invention;

[0060] Figure 7 Schematic diagram of adding a virtual plane to an edge in the embodiment of the present invention;

[0061] Figure 8 Schematic diagram of the edge folding process of the BIM model in the embodiment of the present invention;

[0062] Figure 9 Schematic diagram of the structure of the BIM model simplification device in the embodiment of the present invention;

[0063] Figure 10 Schematic diagram of the structure of the electronic device in the embodiment of the present invention. Detailed implementation manners

[0064] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0065] In addition, the technical features involved in different embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.

[0066] In the prior art, in the existing edge - folding - based BIM model simplification method, when performing the edge folding operation, geometric structure simplification errors often occur. For example, for rectangles or spatial tetrahedrons composed of doors, windows, and shutter blades, etc., they are expected to be retained during the simplification process. However, if the tetrahedron is very long and narrow, such as the blades of a shutter, then based on the idea of edge folding, the short sides of the blades will be judged as the edges to be preferentially simplified due to their short lengths, resulting in a simplified result of two overlapping triangles, making it difficult to retain the true structural information of the shutter; or the simplified result shows long and narrow triangles that do not conform to the original BIM structure.

[0067] Based on the above problems, the embodiments of the present invention provide a BIM model simplification method, which can be used in electronic devices, such as computers, mobile phones, tablet computers, etc. As Figure 1 shown, the BIM model simplification method specifically includes the following steps:

[0068] Step S101: Obtain the original BIM model and the coordinates of the vertices in the original BIM model, and the original BIM model is a triangular mesh model.

[0069] Among them, the original BIM model is a triangular mesh model, which is composed of a number of triangular patches spliced together. The original BIM model can be a model generated by using architectural design software or a BIM model directly imported from the outside.

[0070] Step S102: According to the coordinates of the vertices, calculate the position coordinates of the folding points corresponding to each side of the triangles in the original BIM model and the error measure, and determine the edge to be folded according to the sorting result of the error measure from small to large.

[0071] Among them, the coordinates of each vertex can be directly extracted from the original BIM model. Each triangle represents a triangular patch. Based on the edge-collapse model simplification idea, according to the coordinates of the vertices in the current edge and its associated triangular patches, the position coordinates of the folding points and the error measure after folding and simplifying the current edge can be calculated. Based on the edge-collapse idea, this error measure represents the folding cost of folding the current edge. The larger the error measure value, the greater the folding cost of folding it. On the contrary, the folding cost is smaller. By sorting the error measure from small to large, the edge with the smallest folding cost is used as the edge to be folded. This step will be described in detail below.

[0072] Step S103: Obtain the attribute information of the triangles in the original BIM model that have at least one vertex coincident with the edge to be folded.

[0073] Among them, the edge to be folded is composed of two vertices. Extract all the triangles in the original BIM model that contain at least one of these two vertices, and obtain the corresponding attribute information of these triangles. The attribute information includes the edge attributes of the triangles and the vertex attributes of each vertex of the triangles. Specifically, the edge attributes include whether the current edge is a common edge or a non-common edge, and the vertex attributes include vertex coordinates, etc.

[0074] Step S104: Fold the edge to be folded according to the attribute information to obtain a simplified BIM model.

[0075] Specifically, before folding the edge to be folded, judge whether the edge to be folded is an edge that needs to be protected from folding according to the attribute information of this folding edge. If it is determined according to the above attribute information that folding this edge will cause obvious changes in the model structure compared with the original model, then perform folding protection on it to avoid folding. If it is determined according to the attribute information that the edge to be folded will not cause obvious changes to the original model after folding, then fold this edge to be folded to obtain a simplified BIM model.

[0076] By performing the above steps, the BIM model simplification method provided by the embodiments of the present invention performs folding protection on the edge to be folded by using the attribute information of the triangle having at least one vertex coincident with the edge to be folded, thereby avoiding the result that the folding may produce an obvious difference from the original BIM model, so that the simplified BIM model retains the true structural information of the original BIM model and improves the accuracy of model simplification.

[0077] Specifically, in one embodiment, the above step S104 includes the following steps:

[0078] Step S401: Determine whether the edge to be folded meets a preset protection condition according to the edge attribute or vertex coordinates in the attribute information.

[0079] Wherein, the preset protection condition is set according to the model simplification requirements set by the user. For example, when the user expects to retain the edge structure of the BIM model, the preset protection condition is the protection condition set according to the edge attribute, and when the user expects to retain special tetrahedral structures such as shutters in the BIM model, the preset protection condition is the condition set to retain the special tetrahedral structure. In addition, the number of preset protection conditions can be set according to the user's simplification requirements. For example, 1 protection condition can be set, or multiple protection conditions can be set. The present invention is not limited thereto.

[0080] Step S402: When the edge to be folded meets the preset protection condition, remove the error measure corresponding to the edge to be folded from the sorting result.

[0081] Specifically, if the current edge to be folded meets any of the above preset protection conditions, it means that the edge should be retained and not folded, and then folding protection is performed by removing its corresponding error measure from the sorting result.

[0082] Step S403: Re-determine the edge to be folded according to the sorting result of the error measures from small to large.

[0083] Specifically, if the current edge to be folded is subjected to folding protection, determine the next edge to be folded from the sorting result and continue to repeat the above process to judge whether the new edge to be folded is subjected to folding protection.

[0084] Step S403: When the edge to be folded does not meet the preset protection condition, fold the edge to be folded to obtain a simplified BIM model.

[0085] Specifically, if the edge to be folded does not meet the preset protection condition, it indicates that simplifying this folded edge will not have an obvious impact on the model structure. At this time, this folded edge can be removed by folding to simplify the BIM model, and then the above step S102 is executed again to continue simplifying the BIM model until the simplified model meets the preset model simplification requirements. In practical applications, the preset model simplification requirements are that the number of triangular facets in the simplified model is less than the preset number of triangular facets, or the minimum value of the edge error measure in the simplified model is greater than the preset error measure threshold; or all edges in the simplified model are non-common edges, etc. The present invention is not limited thereto.

[0086] By executing the above steps, the BIM model simplification method provided by the embodiment of the present invention folds and protects the structure expected to be retained by the user using the preset protection condition before folding the edge to be folded, avoiding structural simplification errors caused by the folded edge and improving the accuracy of model simplification.

[0087] Specifically, in one embodiment, the above step S401 includes the following steps:

[0088] Step S41: Obtain the edge attributes of the other two edges in the current triangle where the edge to be folded is located. The edge attributes include: common edge and non-common edge.

[0089] Among them, in the BIM model, if an edge is located at the edge of the triangular mesh, that is, there is only one triangular facet in the entire BIM model that contains this edge, then the attribute of this edge is a non-common edge. If two or more triangular facets share this edge, then the attribute of this edge is a common edge.

[0090] Step S42: When the edge attributes of the other two edges are both non-common edges, determine that the edge to be folded meets the preset protection condition.

[0091] Specifically, when the edge to be folded is located in the edge triangular facet of the entire triangular mesh, the edge triangular facet means that two of the three edges of the triangular facet are located at the edge of the triangular mesh. As Figure 2 shown, the shaded triangle represents the edge triangular facet, and the dashed line edge e is the edge to be folded. When folding the dashed line edge e, it will cause the edge triangular facet to degenerate into a reciprocating line segment. This situation is called a degenerate situation. In the process of BIM model simplification, this situation needs to be avoided from folding, otherwise the edge information of the entire BIM model will be overly lost. In practical applications, the method for determining whether an edge will degenerate after folding is: traverse all n triangles tri i related to this edge e in the BIM model, where i = 0, 1, 2,..., n - 1), when any triangle tri iWhen the other two edges except e are both non - common edges, it is considered that the folding of e will cause a degenerate situation, so it is not folded and protection is set for it.

[0092] By performing the above steps, the BIM model simplification method provided by the embodiments of the present invention determines whether a folding edge needs folding protection through the edge attributes of the other two edges of the triangle to which the folding edge belongs, thereby avoiding the situation of model degradation after simplifying the BIM model, so that the simplified BIM model can effectively retain the edge structure information of the original BIM model.

[0093] Specifically, in another alternative embodiment, step S401 described above includes the following steps:

[0094] Step S51: Obtain the vertex coordinates of the first adjacent - face triangle and the second adjacent - face triangle of the folding edge to be folded.

[0095] Among them, the first adjacent - face triangle and the second adjacent - face triangle are triangles that have only one common vertex with the folding edge to be folded. In a BIM model, building structures such as doors, windows, and shutter blades are usually represented as a spatial tetrahedron. As Figure 3 shown, Figure 3 the dashed line in it is the folding edge to be folded, and the two shaded triangles are the two adjacent - face triangles of the folding edge.

[0096] Step S52: Based on the vertex coordinates of the first adjacent - face triangle and the second adjacent - face triangle, determine whether there is a common edge between the first adjacent - face triangle and the second adjacent - face triangle. Specifically, as Figure 3 shown, there is a common edge m between the two adjacent - face triangles.

[0097] Step S53: When there is a common edge between the first adjacent - face triangle and the second adjacent - face triangle, determine that the folding edge to be folded meets the preset protection condition.

[0098] Specifically, for a spatial tetrahedron formed by building structures such as doors, windows, and shutter blades, if edge folding is performed on it, no matter which edge is folded, it will cause a large visual difference. As Figure 3 shown, a spatial tetrahedron becomes two completely overlapping triangular patches after folding, resulting in the loss of the edge - like structure. Therefore, specific judgment is required to avoid this situation. In practical applications, the method for judging whether there will be a loss of the edge - like structure after folding an edge is as follows: An edge e has vertices v 0 , v 1 , for the two adjacent - face triangles of e, which are respectively represented as tri 0 , tri 1 , and tri 0 , tri 1 have a common non - v 0 , v1 vertex v of 2 , v 3 , that is, tri 0 , tri 1 have a common edge. Then it is considered that edge e cannot be folded.

[0099] By performing the above steps, the BIM model simplification method provided by the embodiments of the present invention determines whether the folding edge needs to be protected from folding by judging whether there is a common edge between two adjacent face triangles of the edge to be folded, thereby avoiding the loss of the edge-like structure after simplifying the BIM model, so that the simplified BIM model can effectively retain the edge-like structure information of the original BIM model.

[0100] Specifically, in another alternative embodiment, step S401 described above includes the following steps:

[0101] Step S61: Obtain the first normal direction of the third adjacent face triangle of the edge to be folded.

[0102] Among them, the third adjacent face triangle is a triangle that has only one common vertex with the edge to be folded. Specifically, this normal direction can be determined by obtaining the coordinates of the three vertices of the third adjacent face triangle in the BIM model. The specific calculation process of the normal direction is a prior art and will not be elaborated here.

[0103] Step S62: Obtain the second normal direction of the third adjacent face triangle after folding along the edge to be folded.

[0104] Among them, the process of folding the edge to be folded is the process of merging the two vertices of this edge into one vertex. The specific folding process is as Figure 4 shown, where the edge formed by the two bold vertices is the edge to be folded. The method for obtaining the normal direction of the third adjacent face triangle after folding is the same as that before folding and will not be elaborated here.

[0105] Step S63: Calculate the angle difference between the first normal direction and the second normal direction, and judge whether the angle difference exceeds a preset angle difference threshold.

[0106] Specifically, this angle difference is the minimum value of the angle differences of the two normal directions in any direction in the three-dimensional space, that is, the minimum value of the angle differences in the X-axis direction, Y-axis direction, and Z-axis direction.

[0107] Step S64: When the angle difference exceeds the preset angle difference threshold, determine that the edge to be folded meets the preset protection condition.

[0108] Among them, the preset angular difference threshold can be set according to the actual simplification accuracy requirements and the actual structure of the BIM model, such as 30°, 60°, 75°, etc., and the present invention is not limited thereto.

[0109] Specifically, Figure 4 The process of folding the vertex on the right side of the folding edge to the left is shown. After folding, there is a situation where the normal vector direction of a triangular patch is completely reversed. This reversal will cause a significant decrease in the simplification quality, and this reverse folding situation should be avoided during the simplification process. In practical applications, the method for determining whether reverse folding will occur after folding an edge is as follows: record the normal vector directions of each triangular patch related to the folding edge before and after folding. If the amplitude of the normal vector change exceeds the preset angular difference threshold, it is considered that the edge cannot be folded.

[0110] By performing the above steps, the BIM model simplification method provided by the embodiment of the present invention determines whether the folding edge needs folding protection by judging the change in the normal direction of all adjacent face triangles of the edge to be folded before and after folding, thereby avoiding reverse folding after simplifying the BIM model and causing a change in the spatial structure, so that the simplified BIM model can effectively retain the spatial structure information of the original BIM model.

[0111] Specifically, in another alternative embodiment, the above step S401 includes the following steps:

[0112] Step S71: Obtain the vertex coordinates of the fourth adjacent face triangle of the edge to be folded.

[0113] Among them, the fourth adjacent face triangle is a triangle that has only one common vertex with the edge to be folded.

[0114] Step S72: Determine the new vertex coordinates corresponding to the fourth adjacent face triangle after folding along the edge to be folded according to the vertex coordinates of the fourth adjacent face triangle and the folding point position coordinates.

[0115] Among them, the calculation method of each new vertex coordinate corresponding to the fourth adjacent face triangle after folding along the edge to be folded is a prior art. For specific reference, see the relevant representations of the prior art and will not be elaborated here.

[0116] Step S73: Determine the lengths of the sides of the folded fourth adjacent face triangle according to the new vertex coordinates.

[0117] Specifically, the calculation of the side length is shown in formula (1):

[0118]

[0119] Among them, κ represents the length of the current side, v 1 ,v 2Respectively represent the vertex coordinates of the two vertices of the current edge.

[0120] Step S74: Determine whether the edge to be folded meets the preset protection condition according to the lengths of the respective edges.

[0121] Specifically, during the process of calculating the position of the folding point of the edge to be folded, if the matrix for obtaining the optimal folding point shows approximate linear correlation, in this case, the obtained folding point will be very far from the entire BIM model, resulting in very long and narrow triangular patches after folding, affecting the quality of the triangular patches and not conforming to the actual structure of the model. To avoid the appearance of long and narrow triangles, it is possible to determine whether the lengths of the respective edges meet the preset side length relationship; when the lengths of the respective edges meet the preset side length relationship, it is determined that the edge to be folded meets the preset protection condition. In practical applications, the judgment criterion for this preset side length relationship is to calculate the following formula (2):

[0122]

[0123] where S represents the area of the triangular patch, l 1 , l 2 , l 3 are the lengths of the three sides of the triangular patch. When γ is 1, it means that this triangle is an equilateral triangle with the best quality. When γ approaches 0, it represents that the triangle is very long and narrow. When the γ value of the triangular patch is less than the set threshold, this edge should not be folded. The set threshold can be set according to the actual structural characteristics and simplification requirements of the BIM model, for example: 0.2, 0.3, etc. The present invention is not limited thereto. In practical applications, the above preset side length relationship can also be the angular relationship of the respective angles of the triangle. By determining the angles of the respective angles of the triangle based on the side lengths of the triangle, the longer and narrower the triangle, the smaller the angular value of a certain angle of the triangle. Thus, it is possible to determine the triangle angles using the side lengths and then determine whether the triangle is long and narrow. The present invention is not limited thereto.

[0124] By performing the above steps, the BIM model simplification method provided by the embodiments of the present invention determines whether the folding edge needs to be folded and protected by judging the side length relationship of the respective sides of all adjacent surface triangles of the edge to be folded, thereby avoiding the problem of long and narrow triangles appearing after simplifying the BIM model and affecting the quality of the triangular patches, and improving the quality of the triangular patches of the simplified BIM model.

[0125] It should be noted that during the actual simplification process of the BIM model, several alternative implementation manners of the above step S104 can be set simultaneously according to the model simplification requirements, or some can be selected for setting. For example: only the protection condition for the prismatic structure can be set, or the above four folding edge protection conditions can be set simultaneously. The present invention is not limited thereto.

[0126] Specifically, in one embodiment, step S102 described above specifically includes the following steps:

[0127] Step S21: Calculate the weighted values corresponding to the preset weighting coefficients of the first vertex and the second vertex in the current edge of each triangle according to the coordinates of the vertices.

[0128] Specifically, in the BIM model, the larger the area of a triangular patch, the richer the texture information it usually contains. During the actual simplification process, it is expected that the triangular patches with larger areas are preferentially retained to preserve more texture information of the original BIM model. Therefore, the preset weighting coefficient can be the area of each triangle corresponding to the current vertex as the weighted value, that is, the larger the area of the triangle corresponding to the folding edge, the larger the weighted value of the corresponding preset weighting coefficient, and the larger the error measure value calculated subsequently, and the later the folding order of this edge. On the contrary, the smaller the area of the triangle corresponding to the folding edge, the earlier it is folded. In practical applications, the preset weighting coefficient can also be the angle of the current vertex in its corresponding triangular patch. Similarly, the larger the angle, the later the folding edge to which the vertex belongs is folded. Thus, the simplification order is optimized, facilitating the retention of more model information of the original BIM model.

[0129] Step S22: Calculate the quadratic error matrix corresponding to the first vertex and the second vertex, which includes the preset weighted value, based on the weighted value and the coordinates of the vertices.

[0130] Specifically, the detailed calculation process of the quadratic error matrix is described in detail below.

[0131] Step S23: Calculate the position coordinates and error measure of the folding point corresponding to the current edge based on the quadratic error matrix including the preset weighting coefficient.

[0132] Specifically, step S23 above can be achieved by obtaining the coordinates of the first vertex and the second vertex of the current edge, and calculating the length of the current edge according to the coordinates of the first vertex and the second vertex; based on the length of the current edge and the quadratic error matrix including the preset weighting coefficient corresponding to the first vertex and the second vertex, calculate the quadratic error matrix of the folding point corresponding to the current edge; according to the quadratic error matrix of the folding point corresponding to the current edge, calculate the position coordinates and error measure of the folding point corresponding to the current edge. In practical applications, if the length of the current edge is longer, the more spatial structure information the related triangles contain. Therefore, it is desired that the longer the edge length, the later it is folded, in order to retain as much model information of the original BIM model as possible.

[0133] By performing the above steps, the BIM model simplification method provided by the embodiments of the present invention optimizes the model simplification order by setting the preset weighting coefficient and the edge length as weights to calculate the error measure, facilitating the retention of more model information of the original BIM model.

[0134] The following will combine specific application examples to provide a detailed description of the BIM model simplification method provided by the embodiments of the present invention.

[0135] Figure 5 It is a schematic diagram of the BIM model data simplification process, specifically including:

[0136] 101: The user inputs the original BIM model, and the required format is a triangular mesh model.

[0137] 102: Fuse the adjacent vertices between the triangles adjacent to the vertices.

[0138] As Figure 6 shown, fuse the adjacent vertices between the triangles adjacent to the vertices in the original BIM model. On the left are two triangles composed of six vertices. When the Euclidean space distance of the vertices is close enough, fuse all adjacent vertices into one vertex, and transform it into two triangles composed of four vertices on the right. The specific vertex fusion process is not the invention point of this application and will not be described in detail here.

[0139] 103: Initialize the Q matrix of all points.

[0140] The meaning of the Q matrix is to calculate the sum of the squared distances from a point to the planes of all triangular patches within the one-ring neighborhood around the point. The point p is represented as a homogeneous matrix with spatial coordinates (x, y, z) T :

[0141] p = (x, y, z, 1) T

[0142] The plane coefficients of the plane q defined by a triangular patch t are a, b, c, d

[0143] q = (a, b, c, d) T

[0144] Then the spatial squared distance from the point p to the plane q is:

[0145] dist(q, p) 2 = (q T p) 2 = p T (qq T )p =: p T Q q p

[0146] Among them, the Q matrix Q representing the distance to the plane q q is expressed as:

[0147]

[0148] Where a, b, c, d are the plane coefficients of plane q. The preset weighting coefficient σ can be the area of ​​the triangle patch t, ​​and the weighted matrix formula is:

[0149] σQ q

[0150] The sum of the weighted square distances from point p to each plane in the surrounding ring of neighboring triangles is:

[0151]

[0152] Q p The record is the Q matrix of point p, which is called the quadratic error matrix of point p. Then the quadratic error matrix of all points in the triangulated network is initialized one by one.

[0153] The above is the calculation method of the general vertex Q matrix. For the vertices on the edge of the model, that is, the vertices located on the edge of the model, additional penalties need to be added to them to minimize the folding of the edge and the excessive loss of features. The method is to add a virtual plane (indicated by the dotted line) to all edge edges. The plane is perpendicular to the only triangle facet related to the edge. When calculating the Q matrix of the edge vertex, an additional penalty is added to it, because the high correlation between the two perpendicular planes can achieve the purpose of maintaining the features as much as possible and delaying folding.

[0154] like Figure 7 As shown: The dotted line describes a virtual plane q virtual , which is perpendicular to the plane where the edge lies. virtual The plane coefficients are represented by a, b, c, d as in the general plane. The virtual plane q virtual The Q matrix Q q The calculation method is exactly the same as that of an ordinary plane. However, the weighting method of the two related vertices is different from that of the plane where the ordinary triangle is located. virtual The preset weighting coefficient σ uses the square of the side length instead of the area of ​​an ordinary triangle. The rest of the process is the same as the ordinary vertex calculation process and will not be repeated here.

[0155] 104: Initialize edge measure and calculate folding points on edges.

[0156] After the quadratic error matrix of all vertices is calculated, it is necessary to initialize the quadric error metrics of all edges in the triangular mesh, as well as the spatial position of the folding point when the edge is folded. For two vertices v of an edge e, 1 ,v 2 The Q matrices at initialization are as well as If this edge is folded, the second - order error matrix of the folding point v′ is

[0157]

[0158] where κ is the length calculation formula of the edge e, which is

[0159]

[0160] The second - order error measure of the folding point v′ is

[0161] v′ T Q v′ v′

[0162] Then we need to find the spatial position of the point v′ to make the whole formula v′ T Q v′ v′ reach the minimum, that is, to minimize the second - order error measure. The significance of this is that after folding the edge, the two vertices of the edge are folded into one point. Then the sum of the squared distances from this new folding point v′ to the planes of all the triangular patches in the one - ring neighborhood of the original vertex v 1 ,v 2 reaches the minimum. This means that the geometric features lost by folding this edge are the smallest. The method to find the spatial position of v′ is

[0163] Let the second - order error matrix of the point v′ be Q v′

[0164]

[0165] Minimizing the second - order error measure should make the partial derivatives of the measure equation with respect to x, y, and z all equal to 0, that is:

[0166]

[0167] We get the equation:

[0168]

[0169] Then the result of v′ is:

[0170]

[0171] After obtaining v′, substitute it into the error measure equation to obtain the error δ of folding this edge as

[0172] δ = v′ T Q v′ v′

[0173] It is necessary to calculate the position of the folding point and the error measure for each edge in the triangular mesh model in turn.

[0174] 105: Sort all edges according to the measure size.

[0175] After obtaining the error measure δ of each edge, it is necessary to sort all edges from small to large according to the error measure. The sorting method is to use the heap data structure heap. When an edge is inserted into the heap, the insertion position is determined according to the size of its error measure. Therefore, after traversing all edges, the obtained heap is already sorted and sorted from small to large according to the error measure.

[0176] 106: Fold the edge with the smallest folding measure.

[0177] According to the existing sorting result, start folding from the edge with the smallest error measure, folding one edge at a time. This process is to gather the two points of an edge into one point. The folding position is the point that minimized the error measure calculated before for this edge. The folding process is as Figure 8 shown. The left figure is a schematic diagram before folding, and the two vertices of the edge to be folded are v 1 , v 2 . The right figure is a schematic diagram after folding, and the folding point is v'. The folding process is divided into two steps: First, delete all the triangular patches within the one-ring neighborhood of v 1 , v 2 , which will generate a hole; then reconstruct triangular patches for all the points on the edge of the hole and the newly generated folding point v'. Specifically, before performing the edge folding operation, it is necessary to determine whether the folding edge needs to avoid folding to avoid multiple simplified results that are significantly different from the original mesh model. For specific content, refer to the relevant description in step S104 of the above embodiment, and it will not be repeated here.

[0178] It should be noted that Figure 8 only the manifold case is described for intuitive display, that is, each edge is shared by less than or equal to two relevant triangular patches. However, the folding method is not limited to the manifold case. For the non-manifold case where an edge is shared by more than two triangular patches, the folding operation can also refer to the above process. The present invention is not limited thereto.

[0179] 107: Update the error measure of the edge.

[0180] When an edge is folded, due to the change in the position of the new vertex, the planes of all the triangular patches around this point change. Therefore, it is necessary to recalculate the quadratic error matrix Q for the vertices involved in these triangular patches, and the calculation method still uses the method described in 103. After these vertices update the Q matrix, it is necessary to update the edge measure for the edges involved in these vertices and calculate the new folding point, and then re-insert them into the heap. The method used still uses the method described in 104.

[0181] 108: Determine whether to exit.

[0182] At the completion of each folding, it is necessary to determine whether the simplification standard is met. If the simplification goal is achieved, the loop is exited and the simplified model is output. If the simplification goal is not achieved, the process returns to 106 to continue folding the edge with the minimum measure until the simplification goal is reached. The simplification goal is considered to be achieved if any of the following criteria is met. The relationships between each criterion are "or" relationships: there are no triangular patches left in the triangular mesh; the number of triangular patches in the triangular mesh is less than the standard input by the user; the minimum measure among all the measures of the edges in the triangular mesh is greater than the threshold input by the user; the minimum measure among all the measures of the edges in the triangular mesh is infinite.

[0183] An embodiment of the present invention also provides a BIM model simplification device, as Figure 9 shown. The BIM model simplification device includes:

[0184] A first acquisition module 101, configured to acquire the original BIM model and the coordinates of the vertices in the original BIM model. The original BIM model is a triangular mesh model. For detailed content, refer to the relevant description of step S101 in the above method embodiment. Details will not be elaborated here.

[0185] A first processing module 102, configured to calculate the position coordinates of the folding points corresponding to each edge of the triangle in the original BIM model and the error measure according to the coordinates of the vertices, and determine the edge to be folded according to the sorting result of the error measure from small to large. For detailed content, refer to the relevant description of step S102 in the above method embodiment. Details will not be elaborated here.

[0186] A second processing module 103, configured to acquire the attribute information of the triangle that has at least one vertex coincident with the edge to be folded in the original BIM model. For detailed content, refer to the relevant description of step S103 in the above method embodiment. Details will not be elaborated here.

[0187] A third processing module 104, configured to fold the edge to be folded according to the attribute information to obtain a simplified BIM model. For detailed content, refer to the relevant description of step S104 in the above method embodiment. Details will not be elaborated here.

[0188] The further function descriptions of the above-mentioned respective modules are the same as those in the corresponding method embodiments above, and will not be elaborated here.

[0189] Through the collaborative cooperation of the above-mentioned respective components, the BIM model simplification device provided by the embodiment of the present invention folds and protects the edge to be folded by using the attribute information of the triangle that has at least one vertex coincident with the edge to be folded, thereby avoiding the result that may produce an obvious difference from the original BIM model during folding, enabling the simplified BIM model to retain the true structural information of the original BIM model, and improving the accuracy of model simplification.

[0190] An embodiment of the present invention further provides an electronic device, such as Figure 10 shown, the electronic device may include a processor 901 and a memory 902, where the processor 901 and the memory 902 may be connected through a bus or other means, Figure 10 and taking the connection through the bus as an example.

[0191] The processor 901 may be a central processing unit (CPU). The processor 901 may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. chips, or combinations of the above types of chips.

[0192] The memory 902, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs, non-transitory computer-executable programs, and modules, such as the program instructions / modules corresponding to the methods in the embodiments of the present invention. The processor 901 executes various functional applications and data processing of the processor by running the non-transitory software programs, instructions, and modules stored in the memory 902, that is, implements the above method.

[0193] The memory 902 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system and application programs required for at least one function; the data storage area may store data created by the processor 901, etc. In addition, the memory 902 may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, a flash memory device, or other non-transitory solid-state storage devices. In some embodiments, the memory 902 may optionally include a memory remotely provided with respect to the processor 901, and these remote memories may be connected to the processor 901 through a network. Examples of the above networks include, but are not limited to, the Internet, an enterprise intranet, a local area network, a mobile communication network, and combinations thereof.

[0194] One or more modules are stored in the memory 902 and, when executed by the processor 901, execute the above method.

[0195] The specific details of the above electronic device can be understood by referring to the corresponding relevant descriptions and effects in the above method embodiments, and will not be elaborated here.

[0196] Those skilled in the art can understand that to implement all or part of the processes in the above method embodiments, it can be completed by instructing relevant hardware through a computer program. The program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the above method embodiments. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only memory (ROM), a random access memory (RAM), a flash memory, a hard disk drive (HDD), or a solid-state drive (SSD), etc.; the storage medium can also include a combination of the above types of memories.

[0197] The above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit them. Although the present invention has been described in detail with reference to the above embodiments, those of ordinary skill in the art should understand that: it is still possible to modify the specific implementation manners of the present invention or make equivalent replacements. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention shall be covered by the scope of the claims of the present invention.

Claims

1. A BIM model simplification method, characterized in that, it includes: Obtain the original BIM model and the coordinates of the vertices in the original BIM model, where the original BIM model is a triangular mesh model; According to the coordinates of the vertices, calculate the position coordinates of the folding points corresponding to each side of the triangles in the original BIM model and the error measure, and determine the edges to be folded according to the sorting result of the error measure from small to large; Obtain the attribute information of the triangles in the original BIM model that have at least one vertex coincident with the edge to be folded; Fold the edge to be folded according to the attribute information to obtain a simplified BIM model, where folding the edge to be folded according to the attribute information to obtain a simplified BIM model includes: judging whether the edge to be folded meets a preset protection condition according to the edge attribute or vertex coordinates in the attribute information; when the edge to be folded meets the preset protection condition, remove the error measure corresponding to the edge to be folded from the sorting result; re-determine the edge to be folded according to the sorting result of the error measure from small to large.

2. The method according to claim 1, characterized in that, judging whether the edge to be folded meets the preset protection condition according to the attribute information further includes: When the edge to be folded does not meet the preset protection condition, fold the edge to be folded to obtain a simplified BIM model.

3. The method according to claim 1, characterized in that, judging whether the edge to be folded meets the preset protection condition according to the attribute information includes: Obtain the edge attributes of the other two sides in the current triangle where the edge to be folded is located, and the edge attributes include: common edges and non-common edges; When the edge attributes of the other two sides are both non-common edges, determine that the edge to be folded meets the preset protection condition.

4. The method according to claim 1, characterized in that, judging whether the edge to be folded meets the preset protection condition according to the attribute information includes: Obtain the vertex coordinates of the first adjacent triangle and the second adjacent triangle of the edge to be folded, where the first adjacent triangle and the second adjacent triangle are triangles that have only one common vertex with the edge to be folded; Based on the vertex coordinates of the first adjacent triangle and the second adjacent triangle, judge whether there is a common edge between the first adjacent triangle and the second adjacent triangle; When there is a common edge between the first adjacent triangle and the second adjacent triangle, determine that the edge to be folded meets the preset protection condition.

5. The method according to claim 1, characterized in that, judging whether the edge to be folded meets the preset protection condition according to the attribute information includes: Obtain the first normal direction of the third adjacent triangle of the edge to be folded, where the third adjacent triangle is a triangle that has only one common vertex with the edge to be folded; Obtain the second normal direction after folding the third adjacent triangle along the edge to be folded; Calculate the angle difference between the first normal direction and the second normal direction, and judge whether the angle difference exceeds a preset angle difference threshold; When the angle difference exceeds the preset angle difference threshold, it is determined that the edge to be folded meets the preset protection condition.

6. The method according to claim 1, wherein, the determining whether the edge to be folded meets the preset protection condition according to the attribute information includes: obtaining the vertex coordinates of the fourth adjacent face triangle of the edge to be folded, where the fourth adjacent face triangle is a triangle having only one common vertex with the edge to be folded; determining the new vertex coordinates corresponding to the fourth adjacent face triangle after folding along the edge to be folded according to the vertex coordinates of the fourth adjacent face triangle and the folding point position coordinates; determining the lengths of the respective sides of the folded fourth adjacent face triangle according to the new vertex coordinates; determining whether the edge to be folded meets the preset protection condition according to the lengths of the respective sides.

7. The method according to claim 6, wherein, the determining whether the edge to be folded meets the preset protection condition according to the lengths of the respective sides includes: judging whether the lengths of the respective sides meet the preset side length relationship; when the lengths of the respective sides meet the preset side length relationship, determining that the edge to be folded meets the preset protection condition.

8. The method according to claim 1, wherein, the calculating the folding point position coordinates and the error measure corresponding to each side of the triangle in the original BIM model according to the coordinates of the vertices includes: calculating the weighted values corresponding to the preset weighting coefficients of the first vertex and the second vertex in the current side of each triangle according to the coordinates of the vertices; calculating the quadratic error matrix including the preset weighting value corresponding to the first vertex and the second vertex based on the weighted values and the coordinates of the vertices; calculating the folding point position coordinates and the error measure corresponding to the current side based on the quadratic error matrix including the preset weighting coefficient.

9. The method according to claim 8, wherein, the calculating the folding point position coordinates and the error measure corresponding to the current side based on the quadratic error matrix including the preset weighting coefficient includes: obtaining the coordinates of the first vertex and the second vertex of the current side, and calculating the length of the current side according to the coordinates of the first vertex and the second vertex; calculating the quadratic error matrix of the folding point corresponding to the current side based on the length of the current side and the quadratic error matrix including the preset weighting coefficient corresponding to the first vertex and the second vertex; calculating the folding point position coordinates and the error measure corresponding to the current side according to the quadratic error matrix of the folding point corresponding to the current side.

10. A BIM model simplification device, wherein, it includes: an obtaining module, configured to obtain the original BIM model and the coordinates of the vertices in the original BIM model, where the original BIM model is a triangular mesh model; a first processing module, configured to calculate the folding point position coordinates and the error measure corresponding to each side of the triangle in the original BIM model according to the coordinates of the vertices, and determine the edge to be folded according to the sorting result of the error measures from small to large; a second processing module, configured to obtain the attribute information of the triangle having at least one vertex coincidence with the edge to be folded in the original BIM model; A third processing module, configured to fold the edge to be folded according to the attribute information to obtain a simplified BIM model, wherein the third processing module is further configured to: determine whether the edge to be folded meets a preset protection condition according to the edge attribute or vertex coordinates in the attribute information; when the edge to be folded meets the preset protection condition, remove the error measure corresponding to the edge to be folded from the sorting result; and re-determine the edge to be folded according to the sorting result of the error measures from small to large.

11. A non-transitory computer-readable storage medium, characterized in that the non-transitory computer-readable storage medium stores computer instructions, and when the computer instructions are executed by a processor, the method described in any one of claims 1-9 is implemented.

12. An electronic device, characterized in that it includes: a memory and a processor, the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the computer instructions to execute the method described in any one of claims 1-9.

Citation Information

Patent Citations

  • Model simplification method based on significant color attribute character preservation

    CN105761314A

  • BIM-based lightweight deep processing work method

    CN108595858A