A multi-type collision detection method and system for a BIM lightweight model

By using a two-layer index structure and bounding box intersection judgment method, the shortcomings of soft collision detection in BIM lightweight models are solved, enabling rapid and accurate detection of both hard and soft collisions, thus improving the efficiency and accuracy of construction design.

CN116305386BActive Publication Date: 2026-07-21NORTHWEST ENGINEERING CORPORATION LIMITED

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
NORTHWEST ENGINEERING CORPORATION LIMITED
Filing Date
2022-09-08
Publication Date
2026-07-21

AI Technical Summary

Technical Problem

Existing BIM lightweight model detection technologies cannot effectively identify soft collisions, leading to problems being discovered during the construction phase, resulting in wasted time and resources. Furthermore, hard collision detection efficiency is low for large-scale models.

Method used

A two-layer index structure and bounding box intersection judgment method are adopted to quickly identify hard collisions and soft collisions. By establishing a first-layer professional index structure and a second-layer geometric index structure, combined with bounding box intersection and distance calculation, the collision relationship between models is judged, and spatial triangular patches are used to optimize the intersection judgment algorithm.

Benefits of technology

It enables rapid and accurate detection of lightweight BIM models, detects hard and soft collisions in advance, improves the efficiency and accuracy of construction design, reduces the amount of calculation, and enhances the automation and efficiency of large-scale model detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116305386B_ABST
    Figure CN116305386B_ABST
Patent Text Reader

Abstract

The application provides a multi-type collision detection method and system of a BIM lightweight model, relates to the field of multi-type collision detection, can quickly and accurately find hard collision and soft collision between models, finds unreasonable or wrong places between drawings in advance, and adjusts conflicts in a design model in time; a first layer index structure can quickly calculate a potential collision professional model combination; a second layer index structure determines professional models to which geometric bodies belong, uses a mathematical method, continuously excludes geometric bodies far away from each other, and reduces the calculation amount of model intersection; meanwhile, a space triangular facet intersection judgment algorithm is used, the calculation rate is improved, and the automatic and efficient detection capability of hard collision and soft collision of a large volume model is improved. The application is used for multi-type collision detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of multi-type collision detection, and in particular to a multi-type collision detection method and system for lightweight BIM models. Background Technology

[0002] With the advancement of digital technology, BIM (Building Information Modeling, a data-driven tool applied to engineering design, construction, and management; the core of BIM is to create a virtual 3D model of the building project and use digital technology to provide this model with a complete and accurate database of building information) lightweight technology has been widely used in the engineering and construction industry. During the BIM model design process, various disciplines need to periodically assemble their design deliverables. The assembled model may have geometric intersections, i.e., collisions. Therefore, comprehensive analysis is needed to identify potential problems caused by pipeline conflicts or collisions between disciplines, so that conflicts can be addressed promptly during the design phase.

[0003] Conventional collision detection determines hard collisions by testing the pairwise intersections of all global components. However, soft collisions also exist in construction projects; even if two components do not intersect, a soft collision is considered to have occurred if their distance is less than a specified threshold. Currently, there is no suitable soft collision detection method for lightweight BIM models, leading to soft collision problems often being discovered only during the construction phase, resulting in a significant waste of time and resources and severely impacting construction progress. Furthermore, existing collision detection technologies require constructing a global model octree and then extracting data from it for calculations. For large-scale models (tens or even hundreds of gigabytes), this method requires calculating an excessively large amount of data, making the testing process slow and inefficient. Summary of the Invention

[0004] This invention proposes a multi-type collision detection method and system for lightweight BIM models, which can quickly and accurately detect hard and soft collisions between models, identify inconsistencies or errors in drawings in advance, and adjust conflicts in the design model in a timely manner. The technical solution is as follows:

[0005] According to a first aspect of the present invention, a multi-type collision detection method for a lightweight BIM model is provided, the method comprising:

[0006] 101. Establish a first-level professional index structure, and establish a second-level index structure based on the first-level professional index structure; the second-level index structure is a geometry index, and the ID of the geometry represents a unique index in the project; wherein, the establishment of the first-level professional index structure is based on the node to be collided selected by the user interface as the professional model to be collided with; obtain the specified collision detection type according to the professional model to be collided with, and the collision type includes hard collision and soft collision.

[0007] 102. Arrange all professional models in the first-level professional index structure to obtain combinations of two professional models; extract the combinations to be detected in sequence, determine the collision relationship between the two professional models in each professional model combination, obtain the potential collision professional index array, determine whether the professional models will collide, and construct the potential collision professional model index set.

[0008] 103. Based on the potential collision professional index array, determine the collision relationship of the geometry in the potential collision combination; if two geometry collides, record the collision data and save it in the database.

[0009] Preferably, the first-layer index structure is established by using the node to be collided selected by the user interface as the professional model to be collided with.

[0010] Preferably, step 102, based on the first-layer professional index structure, combines professional models in pairs, determines whether collisions will occur between the professional models, and constructs a potential collision professional model index set. This means determining whether two professional models collide through collision detection of their bounding boxes, where the expression for the bounding box is:

[0011] (1)

[0012] in, These represent the minimum X-coordinate value, minimum Y-coordinate value, and minimum Z-coordinate value in the coordinates of each vertex of the professional model, respectively; These represent the maximum X-coordinate value, maximum Y-coordinate value, and maximum Z-coordinate value in the coordinates of each vertex of the professional model, respectively;

[0013] If a hard collision type is specified, the bounding box intersection method is used to determine whether the intersection of the bounding boxes of the two professional models is empty. If the bounding boxes of the two professional models have an intersection, the two professional models may have a hard collision.

[0014] If a soft collision type is specified, the distance between the two bounding boxes is obtained through the bounding box distance calculation method. If the distance between the bounding boxes of the two professional models is less than a given threshold, the two professional models may collide.

[0015] Preferably, if a hard collision type is specified, the intersection test is used to determine whether the intersection of the bounding boxes of the two professional models is empty. If the bounding boxes of the two professional models have an intersection, the two professional models may have a hard collision. The bounding box intersection judgment method is used to determine whether the bounding boxes of the two professional models intersect. The bounding box intersection judgment method is as follows.

[0016] The expression for bounding box 1:

[0017]

[0018] The expression for bounding box 2:

[0019]

[0020] a) If the vertex coordinates of the bounding boxes of two professional models do not coincide, and the following condition is met, then the bounding boxes of the two professional models do not intersect:

[0021] The minimum X-coordinate, or minimum Y-coordinate, or minimum Z-coordinate of each vertex in bounding box 1 is greater than the maximum X-coordinate, or maximum Y-coordinate, or maximum Z-coordinate of each vertex in bounding box 2; or,

[0022] The maximum X-coordinate, maximum Y-coordinate, or maximum Z-coordinate of each vertex of bounding box 1 is less than the minimum X-coordinate, minimum Y-coordinate, or minimum Z-coordinate of each vertex of bounding box 2.

[0023] That is, it satisfies the following specific formula:

[0024] ,or

[0025] or ,or (2)

[0026] or ,or

[0027] b) If condition a) is not met, then bounding box 1 intersects with bounding box 2;

[0028] If a soft collision type is specified, the distance between the two bounding boxes is calculated relative to a given threshold. If the distance between the bounding boxes of the two professional models is less than the given threshold, it is determined that a soft collision may occur between the two professional models. This determination is made by calculating the distance using the bounding box distance calculation method, as follows:

[0029] calculate , , Let x, y, and z be the minimum distances between the two bounding boxes in the x, y, and z directions, respectively.

[0030]

[0031] (3)

[0032]

[0033] a) If it does not exist If the distance d between the two bounding boxes is less than 0, then the distance d between the two bounding boxes is less than

[0034] b) If only one exists , The distance between the two bounding boxes ;

[0035] c) If multiple , Then the distance between the two bounding boxes

[0036] ;

[0037] Determine the distance between two bounding boxes The size of , Given a distance threshold.

[0038] if If the distance between the two bounding boxes is greater than a given threshold, then the distance between the two bounding boxes is greater than a given threshold.

[0039] if If the distance between the two bounding boxes is less than a given threshold, then the distance between the two bounding boxes is less than a given threshold.

[0040] Preferably, step 102, which involves sequentially extracting the combinations to be detected, determining the collision relationship between two professional models in each professional model combination, and obtaining a potential collision professional index array, refers to obtaining the collision relationship between two professional models for hard collisions based on the bounding box intersection judgment method.

[0041] For soft collisions, the collision relationship between two professional models is obtained based on the relationship between the distance between the two bounding boxes and a given threshold, and all professional models that may collide are combined and added to the potential collision professional model index array.

[0042] Preferably, based on the potential collision professional model index array, the collision relationship of the geometry in the potential collision professional model is determined. The determination of the geometry collision relationship here is divided into: calculation of the geometry collision between potential collision professional models and calculation of the geometry collision within the same professional model.

[0043] The calculation of geometric collisions between potential collision professional models is based on the index array of potential collision professional models, extracting each potential collision combination to obtain the professional model. Includes a second-level index structure and a professional model. The second-level index structure combines the geometries contained in the two index structures in pairs to obtain the geometries to be detected, and performs collision relationship determination; it then sequentially extracts the geometries to be detected and determines the collision relationship between the two geometries in each combination;

[0044] Among them, the collision calculation of geometric objects within the same professional model involves combining all geometric objects contained in the professional model in pairs to obtain the geometric object combination to be detected, and then determining the collision relationship; the geometric object combination to be detected is extracted in sequence, and the collision relationship between the two geometric objects in each combination is determined.

[0045] If two geometric objects collide, the collision result is recorded as collision relationship-collision type and stored in the database.

[0046] Preferably, the geometric combinations to be detected are extracted sequentially, and the collision relationship between the two geometric combinations in each combination is determined by the following steps;

[0047] 201. Obtain the bounding boxes of geometry A and geometry B in each combination. Determine the positional relationship between the two bounding boxes based on their positions and whether they collide. If the collision type is hard collision, determine if the two bounding boxes intersect; if so, the two geometry collide using the bounding box intersection determination method. If the collision type is soft collision, determine if the distance between the two bounding boxes is less than a given threshold; if so, the two geometry collide using the bounding box distance calculation method. The specific steps for determining a soft collision between two geometry are as follows:

[0048] 202. Obtain all triangular faces of geometry A and their bounding boxes. Through collision testing between two bounding boxes, determine the positional relationship between the bounding box of each triangular face of geometry A and the bounding box of geometry B. If a collision is determined, proceed to step 203. Wherein, if the collision type is hard collision, the bounding box intersection judgment method is used. If the two bounding boxes intersect, it is determined that a hard collision has occurred. If the collision type is soft collision, the bounding box distance calculation method is used. If the distance between the two bounding boxes is less than a given threshold, it is determined that a soft collision has occurred.

[0049] 203. Obtain the bounding boxes of all triangular faces of geometry B. Based on the collision test of the bounding boxes of two triangular faces, if a collision is determined, proceed to step 204.

[0050] If it is a hard collision, the bounding box of each triangular facet of geometry B intersects with the bounding box of the triangular facet of geometry A described in step 202. If the result is yes, step 204 is executed. If it is a soft collision, the distance between the bounding box of each triangular facet of geometry B and the bounding box of the triangular facet of geometry A described in step 202 is determined. If the distance is less than a given threshold, step 204 is executed.

[0051] 204. Obtain the triangular facets corresponding to the bounding boxes of the two triangular facets that collide. Based on the collision test of the two triangular facets, determine the positional relationship between the two geometric objects containing the triangular facets. For hard collisions, if the two triangular facets intersect, the two geometric objects will have a hard collision. For soft collisions, if the distance between the two triangular facets is less than a given threshold, the two geometric objects will have a soft collision.

[0052] Step 204 determines the positional relationship between the two triangular facets based on a collision test. For hard collisions, if the two triangular facets intersect, a hard collision occurs between the two geometric bodies. This refers to calculating whether the two triangular facets of the two geometric bodies intersect, using a spatial triangular facet intersection judgment algorithm. The steps of this algorithm are as follows:

[0053] Obtain triangular facets respectively vertex The plane containing the two triangular facets And calculate the normal values ​​of the two triangular faces respectively. ;

[0054] Among them, the case where two triangular facets are skew and do not intersect:

[0055] If the inner product of two vectors If the two triangles have the same sign and neither is zero, then the two triangles are skew and do not intersect.

[0056] dot product of two vectors t The expression is:

[0057] (4)

[0058] Among them, the two triangular facets are coplanar:

[0059] The first step is to determine if the two triangular faces are coplanar; calculate the coplanarity of each triangular face. cross product of normal vectors f : f Equation

[0060] (5)

[0061] like and A value of 0 indicates Coplanar.

[0062] The second step is to determine whether the three vertices of one triangular facet are inside the other triangular facet when they are coplanar. If at least one vertex is inside the other triangular facet, it means that the two triangular facets intersect; otherwise, continue to the third step of judgment.

[0063] The third step is to determine whether the two triangular facets intersect. Are the three vertices on the triangle? The opposite sides of each edge, and the triangular facets Are the three vertices in The opposite sides of each edge; if all conditions are met, a triangular facet... They must intersect; otherwise, they must not.

[0064] Among them, the case where two triangular facets intersect on opposite sides:

[0065] If in equation (5) If the calculation result is not zero, then the triangular facet Skew faces; Intersection judgment: judge the triangular facets separately. line segments Is it related to triangular facets? Intersecting triangular facets line segment Is it related to triangular facets? If any two triangular faces intersect, then the triangles are intersecting. intersect.

[0066] Preferably, step 204 determines the positional relationship of the two triangular facets based on the collision test. For soft collisions, if the distance between the two triangular facets is less than a given threshold, then the two geometric bodies have a soft collision. This refers to the soft collision between the two triangular facets. The minimum distance between the two triangular facets is calculated. The algorithm steps are as follows:

[0067] S301 obtains triangular facets respectively vertex Calculate the triangular facets respectively Each edge and triangular facet The distance to each edge;

[0068] The distances to nine pairs of sides were calculated in total. They are:

[0069] , , ,

[0070] , , ,

[0071] , , ;

[0072] S302 calculates the vertices respectively To triangular facet distance,

[0073] get and vertex To triangular facet The distance is obtained. ;

[0074] S303 obtains the minimum distance between the two triangular facets. ;

[0075] Preferably, the distance between the two sides of the two triangular facets in step S301 can also be calculated using the Lumelsky algorithm.

[0076] Preferably, the geometric collision calculation within the same professional model refers to verifying whether all geometric objects under that professional model will collide in pairs for each selected professional model; combining all geometric objects contained in the professional model in pairs to obtain the geometric object combination to be detected; extracting two geometric object combinations in sequence, and determining the positional relationship between the two geometric object combinations; if two geometric objects collide, the collision relationship is recorded as collision relationship-collision type and stored in the database.

[0077] This invention provides a multi-type collision detection method for lightweight BIM models, tailored to the specific characteristics of water conservancy and hydropower engineering. Combining intersection calculation, distance calculation, and indexing technologies, it can quickly and accurately detect hard and soft collisions between models, identify inconsistencies or errors in drawings in advance, and adjust conflicts in the design model in a timely manner. The first-layer indexing structure can quickly calculate potential collision combinations of professional models; the second-layer indexing structure determines the professional model to which the geometry belongs, and uses mathematical methods to continuously eliminate geometries that are far apart, reducing the computational workload of model intersection calculations; simultaneously, a spatial triangular facet intersection judgment algorithm is used to improve the calculation speed, enhancing the automated and efficient detection capabilities of hard and soft collisions for large-scale models.

[0078] According to a second aspect of the present invention, a multi-type collision detection system for a lightweight BIM model is provided, comprising an index module, a collision judgment module, and a collision relationship module.

[0079] The index module is used to establish a first-level professional index structure and a second-level index structure based on the professional index structure. The second-level index structure is a geometry index, where the ID of the geometry represents a unique index in the project. It obtains the specified collision detection type, which includes hard collision and soft collision. The establishment of the first-level professional index structure uses the node to be collided selected by the user interface as the professional model to be collided with.

[0080] The collision determination module is used to determine whether a collision will occur between the professional models by combining them in pairs according to the first-level index structure, and to construct a potential collision professional model index set.

[0081] Based on the potential collision model, further determine the collision relationships between and within the geometry of the models to obtain collision detection results.

[0082] The collision relationship module is used to store the collision detection results of judging the collision relationship between and within the professional model in the database. The collision detection result is that two geometric objects collide, the collision data is recorded, the collision data is recorded as collision relationship-collision type, and saved in the database.

[0083] Preferably, the collision determination module further includes a professional model collision determination unit and a geometry collision determination unit. The professional model collision determination unit is used to determine whether a collision occurs between the two professional model bounding boxes based on their positional relationship. The bounding box is expressed as: (1)

[0084] in, These represent the minimum x-coordinate, minimum y-coordinate, and minimum z-coordinate values ​​in the coordinates of each vertex of the professional model, respectively. These represent the maximum x-coordinate, maximum y-coordinate, and maximum z-coordinate values ​​in the coordinates of each vertex of the professional model, respectively.

[0085] If a hard collision type is specified, the intersection test is used to determine whether the intersection of the bounding boxes of the two professional models is empty. If the bounding boxes of the two professional models have an intersection, the two professional models may have a hard collision. The bounding box intersection judgment method is used to determine whether the bounding boxes of the two professional models intersect.

[0086] If a soft collision type is specified, the distance between two bounding boxes is obtained by the bounding box distance calculation method. If the distance between the two bounding boxes is less than a given threshold, the two models may collide.

[0087] The professional model collision judgment unit also includes a bounding box intersection judgment subunit and a bounding box distance judgment subunit. The bounding box intersection judgment subunit uses the following method:

[0088] The expression for bounding box 1:

[0089]

[0090] The expression for bounding box 2:

[0091]

[0092] a) If the vertex coordinates of the bounding boxes of two professional models do not coincide, and the following condition is met, then the bounding boxes of the two professional models do not intersect:

[0093] The minimum x-coordinate, minimum y-coordinate, or minimum z-coordinate of each vertex in bounding box 1 is greater than the maximum x-coordinate, maximum y-coordinate, or maximum z-coordinate of each vertex in bounding box 2; or,

[0094] The maximum x-coordinate, maximum y-coordinate, or maximum z-coordinate of each vertex of bounding box 1 is less than the minimum x-coordinate, minimum y-coordinate, or minimum z-coordinate of each vertex of bounding box 2.

[0095] That is, it satisfies the following specific formula:

[0096] ,or

[0097] or , or (2)

[0098] or , or

[0099] b) If condition a) is not met, the bounding box 1 and the bounding box 2 intersect;

[0100] The bounding box distance judgment subunit calculates the distance using the bounding box distance calculation method, and then determines whether two professional models will have a soft collision. The judgment method is as follows:

[0101] calculate , , Let x, y, and z be the minimum distances between the two bounding boxes in the x, y, and z directions, respectively.

[0102]

[0103] (3)

[0104] ;

[0105] a) If it does not exist If the distance d between the two bounding boxes is less than 0, then the distance d between the two bounding boxes is less than

[0106] b) If only one exists , The distance between the two bounding boxes is then considered to be... ;

[0107] c) If multiple , Then the distance between the two bounding boxes is considered to be ;

[0108] Determine the distance between two bounding boxes and Size ,

[0109] if If the distance between the two bounding boxes is greater than a given threshold, then the distance between the two bounding boxes is greater than a given threshold.

[0110] if If the distance between the two bounding boxes is less than a given threshold, then the distance between the two bounding boxes is less than a given threshold.

[0111] The geometry collision determination unit is used to calculate the geometry collision between potential collision professional models and the geometry collision within the same professional model.

[0112] The calculation of geometric collisions between potential collision models is based on the potential collision model index array, extracting each potential collision combination to obtain the professional model. Includes a second-level index structure and a professional model. The second-level index structure combines the geometries contained in the two index structures in pairs to obtain the geometries to be detected, and performs collision relationship determination; it then sequentially extracts the geometries to be detected and determines the collision relationship between the two geometries in each combination;

[0113] The geometry collision calculation within the same professional model involves combining all the geometries in the professional model pairwise to obtain the geometry combinations to be detected, and then determining the collision relationship. The geometry combinations to be detected are extracted sequentially, and the collision relationship between the two geometries in each combination is determined. Preferably, the geometry collision determination unit further includes a geometry bounding box determination subunit, a bounding box determination subunit for the triangular facets of geometry A and geometry B, a bounding box determination subunit for the triangular facets of geometry A and B, and a triangular facet determination subunit for geometry A and B.

[0114] The process of sequentially extracting the geometric combinations to be detected and determining the collision relationship between the two geometric objects in each combination is carried out through the following sub-unit tests;

[0115] The bounding box judgment subunit obtains the bounding boxes of two geometries, A and B. It determines the positional relationship between the two bounding boxes using the bounding box intersection judgment method and checks whether the two bounding boxes collide. If a collision is determined, the bounding box judgment subunit for the triangular facet of geometry A and the bounding box of geometry B is executed. If the collision type is hard collision, it determines that the two bounding boxes intersect, and the two geometries have a hard collision. If the collision type is soft collision, it determines that the distance between the two bounding boxes is less than a given threshold, and the two geometries have a soft collision.

[0116] The triangular facets of geometry A and the bounding boxes of geometry B are used to obtain all triangular facets of geometry A and their bounding boxes. Through collision testing between the bounding boxes of the geometry and the triangular facets, the positional relationship between the bounding box of each facet of geometry A and the bounding box of geometry B is determined. If a collision is determined, the triangular facet bounding box determination subunits of geometry A and B are executed. Specifically, if the collision type is a hard collision, the bounding box intersection method is used. If the two bounding boxes intersect, it is determined that a hard collision has occurred. If the collision type is a soft collision, the bounding box distance calculation method is used. If the distance between the two bounding boxes is less than a given threshold, it is determined that a soft collision has occurred.

[0117] The triangular facet bounding box determination subunit for geometry A and B is used to obtain all triangular facet bounding boxes of geometry B. Based on the collision test between the triangular facet bounding boxes of geometry B and geometry A, if a collision is determined, the process is transferred to the triangular facet determination subunit for geometry A and B.

[0118] Specifically, in the case of a hard collision, if the bounding box of each triangular facet of geometry B intersects with the bounding box of the triangular facet of geometry A and the bounding box of geometry B, then proceed to the triangular facet judgment subunit of geometry A and B for processing; if the case of a soft collision, if the distance between the bounding box of each triangular facet of geometry B and the bounding box of the triangular facet of geometry A and the bounding box of geometry B is less than a given threshold, then proceed to the triangular facet judgment subunit of geometry A and B for processing.

[0119] The triangular facet judgment subunits of geometries A and B are used to obtain the triangular facests corresponding to the bounding boxes of the two triangular facets that collide. Based on the collision test of the two triangular facets, the positional relationship between the geometries containing the two triangular facets is determined. For hard collisions, if the two triangular facets intersect, the two geometries will have a hard collision. For soft collisions, if the distance between the two triangular facets is less than a given threshold, the two geometries will have a soft collision.

[0120] For hard collisions, if two triangular facets intersect, then a hard collision occurs between the two geometric bodies. This refers to the hard collision between the two triangular facets of the two geometric bodies. The calculation of whether the two triangular facets of the two geometric bodies intersect is performed using a spatial triangular facet intersection judgment algorithm. The steps of this spatial triangular facet intersection judgment algorithm are as follows:

[0121] Obtaining triangular facets vertex ( The plane containing the two triangular facets And calculate the normal vectors of the two triangular faces. ;

[0122] Among them, the case where two triangular facets are skew and do not intersect:

[0123] like If the two triangles have the same sign and neither is zero, then the two triangles are skew and do not intersect.

[0124] dot product of two vectors t The expression is:

[0125] (4)

[0126] Among them, the two triangular facets are coplanar:

[0127] The first step is to determine if the two triangular faces are coplanar; calculate the values ​​of each triangular face separately. cross product of normal vectors f : f Equation

[0128] (5)

[0129] like and A value of 0 indicates Coplanar.

[0130] The second step is to determine whether the three vertices of one triangular facet are inside the other triangular facet when they are coplanar. If at least one vertex is inside the other triangular facet, it means that the two triangular facets intersect; otherwise, continue to the third step of judgment.

[0131] The third step is to determine whether the two triangular faces intersect. This only requires determining whether the triangular faces intersect. Are the three vertices on the triangle? The opposite sides of each edge, and the triangular facets Are the three vertices in The opposite sides of each edge; if all conditions are met, a triangular facet... They must intersect; otherwise, they must not.

[0132] Among them, the case where two triangular facets intersect on opposite sides:

[0133] If in equation (5) If the calculation result is not zero, then the triangular facet Skew faces; Intersection judgment: judge the triangular facets separately. line segments Is it related to triangular facets? intersect, line segments Is it related to triangular facets? If any two triangular faces intersect, then the triangles are intersecting. intersect;

[0134] For the soft collision of the two triangular facets, the minimum distance between the two triangular facets is calculated. The algorithm steps are as follows:

[0135] S301 obtains triangular facets respectively vertex Calculate the triangular facets respectively Each edge and triangular facet The distance to each edge;

[0136] Calculate the distances to nine pairs of sides in total. They are:

[0137] , , ,

[0138] , , ,

[0139] , , ;

[0140] S302 calculates the vertices respectively To triangular facet The distance is obtained. ; and vertex To triangular facet The distance is obtained. ;

[0141] S303 obtains the minimum distance between the two triangular facets. ;

[0142] Preferably, the distance between the two sides of the two triangular facets in step S301 can also be calculated using the Lumelsky algorithm.

[0143] This invention provides a multi-type collision detection system for lightweight BIM models, specifically designed for the professional characteristics of water conservancy and hydropower engineering. Combining technologies such as intersection calculation, distance calculation, and indexing, it can quickly and accurately detect hard and soft collisions between models, identify inconsistencies or errors in drawings in advance, and adjust conflicts in the design model in a timely manner. The first-layer index structure in the index module can quickly calculate potential collision-professional model combinations; the second-layer index structure determines the professional model to which the geometry belongs; the collision judgment module uses mathematical methods to continuously exclude geometries that are far apart, reducing the computational load of model intersection calculations; simultaneously, it employs a spatial triangular facet intersection judgment algorithm to improve calculation speed; and the collision relationship module enhances the automated and efficient detection capabilities of hard and soft collisions for large-scale models.

[0144] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit the invention. Attached Figure Description

[0145] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0146] Figure 1 This is a flowchart of a multi-type collision detection method for a lightweight BIM model provided in an embodiment of the present invention;

[0147] Figure 2 This is a two-layer index structure diagram of a multi-type collision detection method for lightweight BIM models provided in this embodiment of the invention;

[0148] Figure 3 This is a bounding box diagram of a professional model for a multi-type collision detection method for a lightweight BIM model provided in an embodiment of the present invention;

[0149] Figure 4 This is a flowchart of a multi-type collision detection method for lightweight BIM models provided in this embodiment of the invention;

[0150] Figure 5 This is a schematic diagram of the bounding box of the geometry of a multi-type collision detection method for a lightweight BIM model provided in an embodiment of the present invention;

[0151] Figure 6 This is a schematic diagram of a triangular bounding box for a multi-type collision detection method for a lightweight BIM model provided in an embodiment of the present invention;

[0152] Figure 7 This is a schematic diagram of the intersection of triangular facets in a multi-type collision detection method for a lightweight BIM model provided in an embodiment of the present invention.

[0153] Figure 8 This is a schematic diagram of the triangular facet distance of a multi-type collision detection method for a lightweight BIM model provided in an embodiment of the present invention;

[0154] Figure 9 This is a schematic structural diagram of a multi-type collision detection system for a lightweight BIM model provided in an embodiment of the present invention;

[0155] Figure 10 This is a geometric collision judgment unit structure diagram of a multi-type collision detection method for lightweight BIM models provided in this embodiment of the invention;

[0156] Figure 11 This is a structural diagram of the bounding box collision judgment unit of a multi-type collision detection method for lightweight BIM models provided in an embodiment of the present invention. Detailed Implementation

[0157] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Rather, they are merely examples of apparatuses and methods consistent with some aspects of the invention as detailed in the appended claims.

[0158] Example 1

[0159] This invention provides a multi-type collision detection method for lightweight BIM models, such as... Figure 1 As shown, the method includes the following steps:

[0160] 101. Establish a first-level professional index structure, and establish a second-level index structure based on the first-level professional index structure; the second-level index structure is a geometry index, and the ID of the geometry represents a unique index in the project; wherein, the establishment of the first-level professional index structure is based on the node to be collided selected by the user interface as the professional model to be collided with; obtain the specified collision detection type according to the professional model to be collided with, and the collision type includes hard collision and soft collision.

[0161] 102. Arrange all professional models in the first-level professional index structure to obtain combinations of two professional models; extract the combinations to be detected in sequence, determine the collision relationship between the two professional models in each professional model combination, and obtain the potential collision professional index array; determine whether the professional models will collide, and construct the potential collision professional model index set.

[0162] 103. Based on the potential collision professional index array, determine the collision relationship of the geometry in the potential collision combination; if two geometry collides, record the collision data and save it in the database.

[0163] In one embodiment, the first-layer index structure is established by using the node to be collided selected by the user interface as the professional model to be collided with.

[0164] In one embodiment, step 102, based on the first-layer professional index structure, combines professional models pairwise to determine whether collisions will occur between the professional models, and constructs a potential collision professional model index set. This means determining whether two professional models collide through collision detection of their bounding boxes, where the expression for the bounding box is:

[0165] (1)

[0166] in, These represent the minimum X-coordinate value, minimum Y-coordinate value, and minimum Z-coordinate value in the coordinates of each vertex of the professional model, respectively; These represent the maximum X-coordinate value, maximum Y-coordinate value, and maximum Z-coordinate value in the coordinates of each vertex of the professional model, such as... Figure 3 As shown;

[0167] If a hard collision type is specified, the bounding box intersection method is used to determine whether the intersection of the bounding boxes of the two professional models is empty. If the bounding boxes of the two professional models have an intersection, the two professional models may have a hard collision.

[0168] If a soft collision type is specified, the relationship between the distance between two bounding boxes and a given threshold is obtained through the bounding box distance calculation method. If the distance between the bounding boxes of the two professional models is less than the given threshold, the two professional models may collide.

[0169] In one embodiment, if a hard collision type is specified, the intersection test is used to determine whether the intersection of the bounding boxes of two professional models is empty. If the bounding boxes of two professional models have an intersection, the two professional models may have a hard collision. The bounding box intersection judgment method is used to determine whether the bounding boxes of two professional models intersect. The bounding box intersection judgment method is as follows.

[0170] The expression for bounding box 1:

[0171]

[0172] The expression for bounding box 2:

[0173]

[0174] a) If the vertex coordinates of the bounding boxes of two professional models do not coincide, and the following condition is met, then the bounding boxes of the two professional models do not intersect:

[0175] The minimum X-coordinate, or minimum Y-coordinate, or minimum Z-coordinate of each vertex in bounding box 1 is greater than the maximum X-coordinate, or maximum Y-coordinate, or maximum Z-coordinate of each vertex in bounding box 2; or,

[0176] The maximum X-coordinate, maximum Y-coordinate, or maximum Z-coordinate of each vertex of bounding box 1 is less than the minimum X-coordinate, minimum Y-coordinate, or minimum Z-coordinate of each vertex of bounding box 2.

[0177] That is, it satisfies the following specific formula:

[0178] ,or

[0179] or ,or (2)

[0180] or ,or

[0181] b) If condition a) is not met, bounding box 1 and bounding box 2 intersect;

[0182] If a soft collision type is specified, the distance between the two bounding boxes is calculated relative to a given threshold. If the distance between the bounding boxes of the two professional models is less than the given threshold, it is determined that a soft collision may occur between the two professional models. This determination is made by calculating the distance using the bounding box distance calculation method, as follows:

[0183] calculate , , Let x, y, and z be the minimum distances between the two bounding boxes in the x, y, and z directions, respectively.

[0184]

[0185] (3)

[0186]

[0187] (1) If it does not exist If the distance d between the two bounding boxes is less than 0, then the distance d between the two bounding boxes is less than

[0188] (2) If only one exists , The distance between the two bounding boxes ;

[0189] (3) If there are multiple , Then the distance between the two bounding boxes ;

[0190] Determine the distance between two bounding boxes and The size,

[0191] if The distance between the two bounding boxes is greater than a given threshold;

[0192] if The distance between the two bounding boxes is less than a given threshold.

[0193] In one embodiment, step 102, which involves sequentially extracting the combinations to be detected, determining the collision relationship between two professional models in each professional model combination, and obtaining a potential collision professional index array, refers to obtaining the collision relationship between two professional models for hard collisions based on the bounding box intersection judgment method of the two professional models.

[0194] For soft collisions, the collision relationship between two professional models is obtained based on the relationship between the distance between their bounding boxes and a given threshold, and all professional models that may collide are combined and added to the potential collision professional model index array.

[0195] In one embodiment, the collision relationship of the geometry in the potential collision professional model is determined based on the potential collision professional model index array. The method for determining the collision relationship of the geometry is: calculation of the collision between geometry in potential collision professional models and calculation of the collision between geometry within the same professional model.

[0196] The calculation of geometric collisions between potential collision professional models is based on the index array of potential collision professional models, extracting each potential collision combination to obtain the professional model. Includes a second-level index structure and a professional model. The second-level index structure combines the geometries contained in the two index structures in pairs to obtain the geometries to be detected, and performs collision relationship determination; it then sequentially extracts the geometries to be detected and determines the collision relationship between the two geometries in each combination;

[0197] Among them, the geometry collision calculation within the same professional model combines all the geometry contained in the professional model in pairs to obtain the geometry combination to be detected, and performs collision relationship determination; sequentially extracts the geometry combination to be detected and determines the collision relationship between the two geometry in each combination;

[0198] If two geometric objects collide, the collision relationship is recorded as collision relationship-collision type and stored in the database.

[0199] In one embodiment, the geometric combinations to be detected are extracted sequentially, and the collision relationship between the two geometric objects in each combination is determined by the following steps;

[0200] 201. Obtain the bounding boxes of geometry A and geometry B in each combination. Determine the positional relationship between the two bounding boxes based on the bounding boxes. Determine if the two bounding boxes collide. If a collision is determined, proceed to step 202. If the collision type is hard collision, determine if the two bounding boxes intersect using the bounding box intersection determination method. If the collision type is soft collision, determine if the distance between the two bounding boxes is less than a given threshold using the bounding box distance calculation method. If so, the two geometry collide.

[0201] 202. Obtain all the bounding boxes of the triangular faces of geometry A. Through collision testing between the bounding boxes of geometry A and the bounding boxes of triangular faces, determine the positional relationship between each bounding box of geometry A and the bounding box of geometry B. If a collision is determined, proceed to step 203. If the collision type is a hard collision, use the bounding box intersection method. If two bounding boxes intersect, it is determined that a hard collision has occurred. If the collision type is a soft collision, use the bounding box distance calculation method. If the distance between two bounding boxes is less than a given threshold, it is determined that a soft collision has occurred.

[0202] 203. Obtain all the bounding boxes of the triangular facets of geometry B. Based on the collision test between two bounding boxes of the triangular facets, if a collision is determined, proceed to step 204.

[0203] If it is a hard collision, the bounding box of each triangular facet of geometry B intersects with the bounding box of the triangular facet of geometry A described in step 202. If the result is yes, step 204 is executed. If it is a soft collision, the distance between the bounding box of each triangular facet of geometry B and the bounding box of the triangular facet of geometry A described in step 202 is determined. If the distance is less than a given threshold, step 204 is executed.

[0204] 204. Obtain the triangular facets corresponding to the bounding boxes of the two triangular facets that collide. Based on the collision test of the two triangular facets, determine the positional relationship between the two geometric objects containing the triangular facets. For hard collisions, if the two triangular facets intersect, the two geometric objects will have a hard collision. For soft collisions, if the distance between the two triangular facets is less than a given threshold, the two geometric objects will have a soft collision.

[0205] Step 204 determines the positional relationship between the two triangular facets based on the collision test. For hard collisions, if the two triangular facets intersect, a hard collision occurs between the two geometric bodies. This refers to calculating whether the two triangular facets of the two geometric bodies intersect, using a spatial triangular facet intersection judgment algorithm. The steps of this algorithm are as follows:

[0206] Obtain triangular facets respectively vertex ( The plane containing the two triangular facets And calculate the normal vectors of the two triangular faces respectively. ;

[0207] In one embodiment, the two triangular facets are non-intersecting:

[0208] If the dot product of two vectors If two triangles have the same sign and neither is zero, then they are skew and do not intersect; the inner product of two vectors. t The expression is:

[0209] (4)

[0210] In one embodiment, the two triangular facets are coplanar:

[0211] The first step is to determine if the two triangular faces are coplanar; calculate the coplanarity of each triangular face. cross product of normal vectors f : f Equation

[0212] (5)

[0213] like and A value of 0 indicates Coplanar.

[0214] Second, determine whether the three vertices of one triangular facet are inside another triangular facet when they are coplanar. If at least one vertex is inside the other triangular facet, it means that the two triangular facets intersect; otherwise, continue to the third step of judgment.

[0215] Third, to determine whether two triangular facets intersect, it is only necessary to determine the triangular facets themselves. Are the three vertices in The opposite sides of each edge, and the triangular facets Are the three vertices in The opposite sides of each edge; if all conditions are met, a triangular facet... They must intersect; otherwise, they must not.

[0216] In one embodiment, the two triangular facets intersect as follows:

[0217] If in equation (5) If the calculation result is not zero, then the triangular facet Skew faces; Intersection judgment: judge the triangular facets separately. line segments Is it related to triangular facets? Intersecting triangular facets line segments Is it related to triangular facets? If any two triangular faces intersect, then the triangles are intersecting. intersect.

[0218] In one embodiment, step 204 determines the positional relationship of the two triangular facets based on the collision test of the two triangular facets. For soft collision, if the distance between the two triangular facets is less than a given threshold, then the two geometric bodies have a soft collision. This refers to the soft collision between the two triangular facets. The minimum distance between the two triangular facets is calculated. The algorithm steps are as follows.

[0219] S301 Obtains Triangular Piece vertex Calculate the triangular facets respectively Each edge and triangular facet The distance to each edge;

[0220] The distances to nine pairs of sides were calculated in total. They are:

[0221] , , ,

[0222] , , ,

[0223] , , ;

[0224] S302 calculates the vertices respectively To triangular facet distance,

[0225] get and vertex To triangular facet The distance is obtained. ;

[0226] S303 obtains the minimum distance between the two triangular facets. ;

[0227] In one embodiment, the distance between the two sides of the two triangular facets in step S301 can also be calculated using the Lumelsky algorithm.

[0228] In one embodiment, geometric collision calculation within the same professional model refers to verifying whether all geometric objects under that professional model will collide with each other for each selected professional model; combining all geometric objects contained in the professional model in pairs to obtain the geometric object combination to be detected; extracting two geometric object combinations in sequence, and determining the positional relationship between the two geometric object combinations; if two geometric objects collide, the collision relationship is recorded as collision relationship-collision type and stored in the database.

[0229] This invention provides a multi-type collision detection method for lightweight BIM models, tailored to the specific characteristics of water conservancy and hydropower engineering. Combining intersection calculation, distance calculation, and indexing technologies, it can quickly and accurately detect hard and soft collisions between models, identify inconsistencies or errors in drawings in advance, and adjust conflicts in the design model in a timely manner. The first-layer indexing structure can quickly calculate potential collision combinations of professional models; the second-layer indexing structure determines the professional model to which the geometry belongs, and uses mathematical methods to continuously eliminate geometries that are far apart, reducing the computational workload of model intersection calculations; simultaneously, a spatial triangular facet intersection judgment algorithm is used to improve the calculation speed, enhancing the automated and efficient detection capabilities of hard and soft collisions for large-scale models.

[0230] Example 2

[0231] This invention provides a specific application of a multi-type collision detection method for lightweight BIM models.

[0232] This paper proposes a multi-type collision detection method for lightweight BIM models, taking into account the professional characteristics of water conservancy and hydropower engineering models (such as dam construction, powerhouse, spillway, geology, machinery, and transportation). The method utilizes techniques such as intersection calculation, distance calculation, and indexing. First, it constructs a two-layer index structure: a professional index and a model geometry index under each professional category. Second, by traversing the professional index structure, it identifies combinations of professional models with potential collisions. Then, it combines the geometries under these potentially colliding professional models using the geometry index structure. Through intersection or distance testing, a collision occurs when the geometries intersect (hard collision) or do not meet the distance requirements (soft collision). Finally, it acquires all colliding geometric models and displays the collision detection results.

[0233] The technical solution of this invention, which provides a multi-type collision detection method based on a lightweight BIM model, is as follows:

[0234] 1. Construct a two-level index structure for the model.

[0235] 1) Establish a professional index structure

[0236] Considering the characteristics of a comprehensive model for water conservancy and hydropower projects (design is done by discipline, so the overall model can be divided into sub-models for multiple disciplines, such as dam construction, powerhouse, spillway, geology, machinery, and transportation), a first-level index structure, namely the professional model index, is established using the node to be collided selected by the user interface as the professional model to be collided. The ID of each professional model represents a unique professional model index within the project. The establishment of the first-level index structure is as follows: Figure 2 The aforementioned Professional ID1, Professional ID2, ... Professional IDM

[0237] 2) Establish a geometric index structure

[0238] A second-level index structure, namely the geometry index, is established under the professional model index. The ID of the geometry represents a unique geometry index in the project.

[0239] The established second-level index structure is as follows Figure 2 As shown, the second-level index result corresponding to professional ID1 is geometry ID1_1, ID1_2, ... ID1_ The second-level index result corresponding to the professional ID M is the geometry ID, and the second-level index result corresponding to the geometry ID is geometry IDM_1, ..., IDM_2, ..., IDM_ .

[0240] 2. Obtain the collision type

[0241] This step involves obtaining the collision detection type and collision detection object specified by the designer.

[0242] There are two types of collisions: hard collisions and soft collisions.

[0243] Hard collision refers to the situation where the intersection of two geometric objects (the smallest geometric unit used for collision detection) is not empty.

[0244] Soft collision, also known as gap collision, requires setting a specific distance value (the distance is a non-negative number). A soft collision occurs when the distance between two geometric objects is less than the set threshold; otherwise, it does not. This method is often used for models with spacing requirements, such as pipes and wiring.

[0245] 3. Construct a potential collision professional model index array

[0246] Based on the first-level index structure, professional models are paired and their collisions are determined. This process excludes combinations of professional models that are far apart, thus constructing a potential collision index set. 1) Determining the collision relationships between professional models.

[0247] Calculate the bounding box for each professional model to obtain the world coordinates of the bounding box. The bounding box used in this embodiment is an AABB bounding box. The expression for the bounding box is:

[0248] (1)

[0249] in, These represent the minimum X-coordinate value, minimum Y-coordinate value, and minimum z-coordinate value among the coordinates of each vertex in the professional model, respectively; These represent the maximum X-coordinate, maximum Y-coordinate, and maximum Z-coordinate values ​​in the coordinates of each vertex of the professional model, respectively.

[0250] The positional relationship between two professional models is determined by using their bounding boxes. If the bounding boxes of the two professional models do not intersect, then a hard collision will definitely not occur (if the minimum distance between the bounding boxes of the two professional models is greater than a given threshold, then a soft collision will definitely not occur). Specifically, the determination uses methods for bounding box intersection and bounding box distance calculation.

[0251] Enclosure 1:

[0252] Enclosure 2:

[0253] Methods for determining bounding box intersections:

[0254] (1) If the vertex coordinates of bounding box 1 and bounding box 2 do not overlap, it means that the two bounding boxes do not intersect. Specifically, there are two scenarios: First, the minimum X-coordinate (or minimum Y-coordinate or minimum Z-coordinate) of each vertex of bounding box 1 is greater than the maximum X-coordinate (or maximum Y-coordinate or maximum Z-coordinate) of each vertex of bounding box 2; second, the maximum X-coordinate (or maximum Y-coordinate or maximum Z-coordinate) of each vertex of bounding box 1 is less than the minimum X-coordinate (or minimum Y-coordinate or minimum Z-coordinate) of each vertex of bounding box 2. If the above conditions are met, then bounding box 1 and bounding box 2 do not intersect. That is, the following specific formula is satisfied:

[0255] ,or

[0256] or ,or (2)

[0257] or ,or ;

[0258] (2) If condition (1) is not satisfied, bounding box 1 intersects with bounding box 2.

[0259] Bounding box distance calculation method:

[0260] Calculate separately:

[0261]

[0262] (3)

[0263]

[0264] (1) If it does not exist If the distance d between the two bounding boxes is less than 0, then the distance d between the two bounding boxes is less than

[0265] (2) If only one exists , The distance between the two bounding boxes ;

[0266] (3) If there are multiple , Then the distance between the two bounding boxes

[0267] if If the distance between the two bounding boxes is greater than a given threshold, then the distance between the two bounding boxes is greater than a given threshold.

[0268] if If the distance between the two bounding boxes is less than a given threshold, then the distance between the two bounding boxes is less than a given threshold.

[0269] 2) Obtain the index array of potential collision professional models

[0270] Arrange all professional models to obtain pairwise combinations of professional models (professional models) Professional models Assume the total number of selected professional models is... M So, the total amount obtained is A unique combination of pairs to be tested.

[0271] exist Extract the combinations to be detected sequentially, and judge each combination (professional model). Professional models The collision relationship between two specialized models is determined. All possible collision combinations are added to a potential collision specialized model index array. This step narrows the scope of geometric collision calculations, reduces computational load, and improves the efficiency of model intersection operations by calculating potential collision specialized models.

[0272] 4. Geometric Collision Detection

[0273] 1) Geometric collision calculation between potential collision professional models

[0274] Based on the index array of potential collision professional models, extract each potential collision combination (professional model). Professional models ), will professional model All included geometry and professional models All included geometric shapes are paired and their positional relationships are determined. Geometric shape A is defined in the professional model. The extracted geometry, geometry B, is from the professional model. The geometry extracted from within.

[0275] The specific geometric collision detection process is as follows: Figure 4 As shown.

[0276] Step 401: Collision test of two bounding boxes

[0277] Obtain the bounding boxes of geometry A and geometry B. The bounding box of a geometry is as follows: Figure 5 As shown.

[0278] Determine the positional relationship between the bounding boxes of two geometric objects: If the collision type is hard collision, the two bounding boxes intersect using the bounding box intersection method, and the two geometric objects have a hard collision; if the collision type is soft collision, the distance between the two bounding boxes is calculated, and if the distance between the two bounding boxes is less than a given threshold, the two geometric objects have a soft collision. If a collision occurs, proceed to step 402 for further determination.

[0279] Step 402: Collision test of triangular facet bounding box and geometric bounding box

[0280] Generate the bounding box of each triangular facet of geometry A. A triangular facet bounding box is like... Figure 6 As shown. The collision relationship between the bounding box of each triangular facet and the bounding box of geometry B is determined. If the bounding box of the triangular facet intersects with the bounding box of geometry B (for hard collisions), or the distance is less than a given threshold (for soft collisions), a collision may occur; proceed to step 403 for judgment. Specifically, if the collision type is hard collision, the bounding box intersection judgment method is used; if the two bounding boxes intersect, it is determined that a hard collision has occurred. If the collision type is soft collision, the bounding box distance calculation method is used; if the distance between the two bounding boxes is less than a given threshold, it is determined that a soft collision has occurred.

[0281] Step 403: Collision test of the two triangular bounding boxes

[0282] Obtain the bounding box of each triangular facet of geometry B. Determine whether the bounding box of each triangular facet of geometry B intersects with the bounding box of the triangular facet of geometry A from the previous step. For hard collisions, if the two bounding boxes intersect, proceed to step 404. For soft collisions, determine whether the distance between the two bounding boxes is less than a given threshold; if it is less than the given threshold, proceed to step 404. Specifically, if the collision type is hard, the bounding box intersection method is used; if the two bounding boxes intersect, it is determined that a hard collision has occurred. If the collision type is soft, the bounding box distance calculation method is used; if the distance between the two bounding boxes is less than the given threshold, it is determined that a soft collision has occurred.

[0283] Step 404: Collision test of two triangular facets

[0284] For the two triangular facets obtained in step 403, the positional relationship of the two geometric bodies is determined based on the collision test of the two triangular facets; for hard collision, if the two triangular facets intersect, the two geometric bodies will have a hard collision; for soft collision, if the distance between the two triangular facets is less than a given threshold, the two geometric bodies will have a soft collision.

[0285] For hard collisions between two triangular facets, an algorithm for determining whether the two facets intersect is used to calculate whether they intersect.

[0286] (1) Obtaining triangular facets vertex ( The plane containing the two triangular facets And calculate the normal vectors of the two triangular faces. ;

[0287] (2) Case where two triangular facets are skew and do not intersect:

[0288] If the dot product of two vectors If the two triangles have the same sign and neither is zero, then the two triangles are skew and do not intersect.

[0289] dot product of two vectors t The expression is:

[0290] (4)

[0291] (3) Coplanar case:

[0292] First, determine if the two triangular faces are coplanar.

[0293] Calculate the two triangular faces separately. cross product of normal vectors f : f Equation

[0294] (5)

[0295] like and A value of 0 indicates Coplanar.

[0296] Second, determine whether the three vertices of one triangular facet lie within the other triangular facet when they are coplanar. If at least one vertex lies within the other triangular facet, the two triangular facets intersect; otherwise, continue to the third step.

[0297] Third, determine whether the two triangular faces intersect, such as Figure 7 The situation is shown.

[0298] Only need to determine Are the three vertices in The opposite side of each edge, and Are the three vertices in The opposite sides of each edge; if all conditions are met, They must intersect; otherwise, they must not.

[0299] judge The three vertices Is it in Heterolateral.

[0300]

[0301] if , and If they are not both positive or both negative, then exist Heterolateral.

[0302] (4) Opposite plane case:

[0303] If in equation (5) If the calculation result is not zero, then the triangular facet Skew lines; Intersection judgment: judge line segments separately. Is it related to triangular facets? Intersecting, line segments Is it related to triangular facets? If any two triangular faces intersect, then the triangles are intersecting. intersect.

[0304] For soft collisions between two triangular facets, the algorithm calculates the minimum distance between the two facets as follows:

[0305] S301 Obtains Triangular Piece vertex Calculate the triangular facets respectively Each edge and triangular facet The distance to each edge;

[0306] The distances to nine pairs of sides were calculated in total. They are:

[0307] , , ,

[0308] , , ,

[0309] , , ;

[0310] S302 calculates the vertices respectively To triangular facet The distance is obtained. ; and vertex To triangular facet get ;like Figure 8 As shown; The symbol 4 is labeled d4, and the distance corresponding to d4 is... d10 is ;

[0311] Minimum distance between two triangular facets in S303 ;

[0312] In the case of intersecting non-uniform faces, the distance between the two edges of two triangular faces is calculated. In some embodiments, the Lumelsky algorithm is used, including but not limited to this algorithm.

[0313] 2) Collision calculation of geometry within the same professional model

[0314] For each selected specialty model, verify whether all geometries within that specialty will collide. Combine all geometries within that specialty model in pairs to obtain the geometries to be detected. Sequentially extract the geometry combinations (A, B) and determine their positional relationships, as described in steps 401 to 404.

[0315] 5. Record collision data

[0316] If two geometric objects collide, the collision relationship is recorded as "Professional Model". -Geometric shape -Professional Model -Geometric shape "Geometric shape" It is a professional model The geometry that collides within the geometry. It is a professional model The geometry that collides within.

[0317] The collision results are recorded as "collision relationship - collision type" and stored in the database.

[0318] This invention provides a multi-type collision detection method for lightweight BIM models, tailored to the specific characteristics of water conservancy and hydropower engineering. Combining intersection calculation, distance calculation, and indexing technologies, it can quickly and accurately detect hard and soft collisions between models, identify inconsistencies or errors in drawings in advance, and adjust conflicts in the design model in a timely manner. The first-layer indexing structure can quickly calculate potential collision combinations of professional models; the second-layer indexing structure determines the professional model to which the geometry belongs, and uses mathematical methods to continuously eliminate geometries that are far apart, reducing the computational workload of model intersection calculations; simultaneously, a spatial triangular facet intersection judgment algorithm is used to improve the calculation speed, enhancing the automated and efficient detection capabilities of hard and soft collisions for large-scale models.

[0319] Based on the above Figure 1 The corresponding embodiments describe a multi-type collision detection system for a lightweight BIM model. The following are system embodiments of the present invention, which can be used to execute the method embodiments of the present invention.

[0320] Example 3

[0321] This invention provides a multi-type collision detection system for lightweight BIM models, such as... Figure 9 As shown, the system includes an index module 901, a collision detection module 902, and a collision relationship module 903.

[0322] Index module 901 is used to establish a first-level professional index structure and establish a second-level index structure based on the professional index structure; the second-level index structure is a geometry index, and the ID of the geometry represents a unique index in the project; it obtains the specified collision detection type, and the collision type includes hard collision and soft collision; wherein, the establishment of the first-level professional index structure is based on the node to be collided selected by the user interface as the professional model to be collided.

[0323] The collision determination module 902 is used to determine whether a collision will occur between the professional models by combining them in pairs according to the first-level index structure, and to construct a potential collision professional model index set.

[0324] Based on the potential collision model, further determine the collision relationships between and within the geometry of the models to obtain collision detection results.

[0325] The collision relationship module 903 is used to store the collision detection results of judging the collision relationship between and within the professional model in the database. The collision detection result is that two geometric objects collide, the collision data is recorded, the collision data is recorded as collision relationship-collision type, and saved in the database.

[0326] In one embodiment, the collision determination module 902 further includes a professional model collision determination unit 9021 and a geometric collision determination unit 9022, such as... Figure 9 As shown.

[0327] The professional model collision determination unit 9021 is used to determine whether a collision occurs between two professional models based on the positional relationship of their bounding boxes. The expression for the bounding box is:

[0328] (1)

[0329] in, These represent the minimum X-coordinate value, minimum Y-coordinate value, and minimum Z-coordinate value in the coordinates of each vertex of the professional model, respectively; These represent the maximum X-coordinate value, maximum Y-coordinate value, and maximum Z-coordinate value in the coordinates of each vertex of the professional model, respectively;

[0330] If a hard collision type is specified, the bounding box intersection method is used to determine whether the intersection of the bounding boxes of the two professional models is empty. If the bounding boxes of the two professional models have an intersection, the two professional models may have a hard collision.

[0331] If a soft collision type is specified, the distance is calculated using the bounding box distance method and compared with a given threshold. If the distance between the two bounding boxes is less than the given threshold, the two models may collide.

[0332] The professional model collision judgment unit 9021 also includes a bounding box intersection judgment subunit 90211 and a bounding box distance judgment subunit 90212, such as... Figure 11 As shown;

[0333] The bounding box intersection judgment subunit 90211, the bounding box intersection judgment method is as follows;

[0334] The expression for bounding box 1:

[0335]

[0336] The expression for bounding box 2:

[0337]

[0338] a) If the vertex coordinates of the bounding boxes of two professional models do not coincide, and the following condition is met, then the bounding boxes of the two professional models do not intersect:

[0339] The minimum X-coordinate, or minimum Y-coordinate, or minimum Z-coordinate of each vertex in bounding box 1 is greater than the maximum X-coordinate, or maximum Y-coordinate, or maximum Z-coordinate of each vertex in bounding box 2; or,

[0340] The maximum X-coordinate, maximum Y-coordinate, or maximum Z-coordinate of each vertex of bounding box 1 is less than the minimum X-coordinate, minimum Y-coordinate, or minimum Z-coordinate of each vertex of bounding box 2.

[0341] That is, it satisfies the following specific formula:

[0342] ,or

[0343] or ,or (2)

[0344] or ,or

[0345] b) If condition a) is not met, bounding box 1 and bounding box 2 intersect.

[0346] The bounding box distance judgment subunit 90212 calculates the distance using the bounding box distance calculation method, and then determines whether two professional models will have a soft collision. The judgment method is as follows:

[0347] calculate , , Let x, y, and z be the minimum distances between the two bounding boxes in the x, y, and z directions, respectively.

[0348]

[0349] (3)

[0350] ;

[0351] a) If it does not exist If the distance d between the two bounding boxes is less than 0, then the distance d between the two bounding boxes is less than

[0352] b) If only one exists , The distance between the two bounding boxes is then considered to be... ;

[0353] c) If multiple Then the distance between the two bounding boxes is considered to be

[0354] Determine the distance between two bounding boxes and Size ,

[0355] if If the distance between the two bounding boxes is greater than a given threshold, then the distance between the two bounding boxes is greater than a given threshold.

[0356] if If the distance between the two bounding boxes is less than a given threshold, then the distance between the two bounding boxes is less than a given threshold.

[0357] The geometric collision determination unit 9022 is used to calculate geometric collisions between potential collision professional models and geometric collisions within the same professional model.

[0358] The calculation of geometric collisions between potential collision professional models is based on the potential collision professional model index array, extracting each potential collision combination to obtain the professional model. Includes a second-level index structure and a professional model. The second-level index structure combines the geometries contained in the two index structures in pairs to obtain the geometries to be detected, and performs collision relationship determination; it then sequentially extracts the geometries to be detected and determines the collision relationship between the two geometries in each combination;

[0359] Within the same professional model, geometric collision calculation involves pairing all geometric objects in the professional model to obtain the geometric object combinations to be detected, and then determining the collision relationship. The geometric object combinations to be detected are extracted sequentially, and the collision relationship between the two geometric objects in each combination is determined.

[0360] In one embodiment, the geometry collision determination unit 9022 further includes a geometry bounding box determination subunit 90221, a bounding box determination subunit 90222 for the triangular facets of geometry A and geometry B, a bounding box determination subunit 90223 for the triangular facets of geometry A and B, and a triangular facet determination subunit 90224 for geometry A and B, such as... Figure 10 As shown;

[0361] The process of sequentially extracting the geometric combinations to be detected and determining the collision relationship between the two geometric objects in each combination is carried out through the following sub-unit tests;

[0362] The bounding box judgment subunit 90221 obtains the bounding boxes of two geometries A and B, and determines the positional relationship between the two bounding boxes using the bounding box intersection judgment method to determine whether the two bounding boxes collide. If a collision is determined, the bounding box judgment subunit 90222 for the triangular facet of geometry A and the bounding box of geometry B is executed. If the collision type is hard collision, it is determined that the two bounding boxes intersect, and the two geometries have a hard collision. If the collision type is soft collision, it is determined that the distance between the two bounding boxes is less than a given threshold, and the two geometries have a soft collision.

[0363] The triangular facet and bounding box determination subunit 90222 of geometry A and geometry B is used to obtain all triangular facets of geometry A and their bounding boxes. Through collision testing of the two bounding boxes, the positional relationship between the bounding box of each facet of geometry A and the bounding box of geometry B is determined. If a collision is determined, the triangular facet bounding box determination subunit 90223 of geometry A and B is executed. Wherein, if the collision type is hard collision, the bounding box intersection determination method is used. If the two bounding boxes intersect, it is determined that a hard collision has occurred. If the collision type is soft collision, the bounding box distance calculation method is used. If the distance between the two bounding boxes is less than a given threshold, it is determined that a soft collision has occurred.

[0364] The triangular facet bounding box determination subunit 90223 for geometry A and B is used to obtain all triangular facet bounding boxes of geometry B. Based on the collision test between the triangular facet bounding boxes of geometry B and geometry A, if a collision is determined, the process is transferred to the triangular facet determination subunit 90224 for geometry A and B.

[0365] Specifically, in the case of a hard collision, if the bounding box of each triangular facet of geometry B intersects with the bounding box of the triangular facets of geometry A and the bounding box of geometry B (as defined in the triangular facet judgment subunit 90222), then the process is transferred to the triangular facet judgment subunit 90224 of geometry A and B for further processing. In the case of a soft collision, if the distance between the bounding box of each triangular facet of geometry B and the bounding box of the triangular facets of geometry A and the bounding box of geometry B (as defined in the triangular facet judgment subunit 90222) is less than a given threshold, then the process is transferred to the triangular facet judgment subunit 90224 of geometry A and B for further processing.

[0366] The triangular facet judgment subunit 90224 for geometries A and B is used to obtain the triangular faces corresponding to the bounding boxes of the two triangular faces that collide. Based on the collision test of the two triangular faces, the positional relationship of the bounding boxes of the two triangular faces is determined. For hard collision, if the two triangular faces intersect, the two geometries have a hard collision. For soft collision, if the distance between the two triangular faces is less than a given threshold, the two geometries have a soft collision.

[0367] For hard collisions, if two triangular facets intersect, then a hard collision occurs between the two geometric bodies. This refers to the hard collision of two triangular facets of the two geometric bodies, which involves calculating whether the two triangular facets of the two geometric bodies intersect. In this embodiment, a spatial triangular facet intersection judgment algorithm is used. The steps of this spatial triangular facet intersection judgment algorithm are as follows:

[0368] Obtaining triangular facets vertex ( The plane containing the two triangular facets And calculate the normal vectors of the two triangular faces. ;

[0369] In one embodiment, the two triangular facets are non-intersecting:

[0370] If the dot product of two vectors If the two triangles have the same sign and neither is zero, then the two triangles are skew and do not intersect.

[0371] dot product of two vectors t The expression is:

[0372] (4)

[0373] In one embodiment, the two triangular facets are coplanar:

[0374] The first step is to determine if the two triangular faces are coplanar; calculate the values ​​of each triangular face separately. cross product of normal vectors f : f Equation

[0375] (5)

[0376] like and A value of 0 indicates Coplanar.

[0377] The second step is to determine whether the three vertices of one triangular facet are inside the other triangular facet when they are coplanar. If at least one vertex is inside the other triangular facet, it means that the two triangular facets intersect; otherwise, continue to the third step of judgment.

[0378] The third step is to determine whether the two triangular faces intersect. This only requires checking... Are the three vertices on the triangle? The opposite sides of each edge, and the triangular facets Are the three vertices in The opposite sides of each edge; if all conditions are met, They must intersect; otherwise, they must not.

[0379] In one embodiment, the two triangular facets intersect as follows:

[0380] If in equation (5) If the calculation result is not zero, then the triangular facet Skew faces; Intersection judgment: judge the triangular facets separately. line segments Is it related to triangular facets? Intersecting triangular facets line segments Is it related to triangular facets? If any two triangular faces intersect, then the triangles are intersecting. intersect;

[0381] For the soft collision of the two triangular facets, the minimum distance between the two triangular facets is calculated. The algorithm steps are as follows:

[0382] S301 obtains triangular facets respectively vertex Calculate the triangular facets respectively Each edge and triangular facet The distance to each edge;

[0383] The distances to nine pairs of sides were calculated in total. They are:

[0384] , , ,

[0385] , , ,

[0386] , , ;

[0387] S302 calculates the vertices respectively To triangular facet distance,

[0388] get ; and vertex To triangular facet The distance is obtained. ;

[0389] S303 obtains the minimum distance between two triangular facets. ;

[0390] In one embodiment, the distance between the two sides of the two triangular facets in step S301 can also be calculated using the Lumelsky algorithm.

[0391] This invention provides a multi-type collision detection system for lightweight BIM models, specifically designed for the professional characteristics of water conservancy and hydropower engineering. Combining technologies such as intersection calculation, distance calculation, and indexing, it can quickly and accurately detect hard and soft collisions between models, identify inconsistencies or errors in drawings in advance, and adjust conflicts in the design model in a timely manner. The first-layer index structure in the index module can quickly calculate potential collision-professional model combinations; the second-layer index structure determines the professional model to which the geometry belongs; the collision judgment module uses mathematical methods to continuously exclude geometries that are far apart, reducing the computational load of model intersection calculations; simultaneously, it employs a spatial triangular facet intersection judgment algorithm to improve calculation speed; and the collision relationship module enhances the automated and efficient detection capabilities of hard and soft collisions for large-scale models.

Claims

1. A multi-type collision detection method for lightweight BIM models, characterized in that, The method includes: Step 101. Establish a first-level professional index structure, and establish a second-level index structure based on the first-level professional index structure; the second-level index structure is a geometry index, and the ID of the geometry represents a unique index in the project; wherein, the establishment of the first-level professional index structure is based on the node to be collided selected by the user interface as the professional model to be collided with; the specified collision detection type is obtained according to the professional model to be collided with, and the collision type includes hard collision and soft collision; Step 102. Arrange all professional models in the first-layer professional index structure to obtain combinations of two professional models; extract the combinations to be detected in sequence, determine the collision relationship between the two professional models in each professional model combination, and obtain the potential collision professional index array; determine whether the professional models will collide, and construct the potential collision professional model index set. The process of obtaining the potential collision professional index array refers to arranging all professional models to obtain a combination professional model of each pair of professional models. and professional models Let the total number of selected professional models be... M So, the total is A unique combination of samples to be tested; exist Extract the combinations to be detected sequentially and determine the professional model for each combination. and professional models The collision relationship between the two professional models; all possible collision combinations are added to the potential collision professional model index array; Step 103. Based on the potential collision professional index array, determine the collision relationship of the geometries in the potential collision combination; if two geometries collide, record the collision data and save it in the database.

2. The multi-type collision detection method for a lightweight BIM model according to claim 1, characterized in that, Step 102, determining whether a collision will occur between the professional models and constructing a potential collision professional model index set, refers to determining whether a collision occurs between two professional models through collision detection. The bounding box expression is: (1) in, These represent the minimum X-coordinate value, minimum Y-coordinate value, and minimum Z-coordinate value in the coordinates of each vertex of the professional model, respectively; These represent the maximum X-coordinate value, maximum Y-coordinate value, and maximum Z-coordinate value in the coordinates of each vertex of the professional model, respectively; If a hard collision type is specified, the bounding box intersection judgment method is used to determine whether the intersection of the bounding boxes of the two professional models is empty. If the bounding boxes of the two professional models have an intersection, the two professional models may have a hard collision. If a soft collision type is specified, the distance between two bounding boxes is obtained by the bounding box distance calculation method. The relationship between the distance and a given threshold is then determined. If the distance between the bounding boxes of the two professional models is less than the given threshold, the two professional models may experience a soft collision.

3. The multi-type collision detection method for a lightweight BIM model according to claim 2, characterized in that, If a hard collision type is specified, the bounding box intersection judgment method is used to determine whether the intersection of the bounding boxes of the two professional models is empty. If the bounding boxes of the two professional models have an intersection, the two professional models may have a hard collision. The bounding box intersection judgment method is used to determine whether the bounding boxes of the two professional models intersect. The bounding box intersection judgment method is as follows. The expression for bounding box 1: The expression for bounding box 2: a) If the vertex coordinates of two bounding boxes do not coincide, then the two bounding boxes do not intersect if the following conditions are met: The minimum X-coordinate, or minimum Y-coordinate, or minimum Z-coordinate of each vertex in bounding box 1 is greater than the maximum X-coordinate, or maximum Y-coordinate, or maximum Z-coordinate of each vertex in bounding box 2; or, The maximum X-coordinate, maximum Y-coordinate, or maximum Z-coordinate of each vertex of bounding box 1 is less than the minimum X-coordinate, minimum Y-coordinate, or minimum Z-coordinate of each vertex of bounding box 2. That is, it satisfies the following specific formula: ,or or ,or (2) or ,or b) If condition a) is not met, the bounding box 1 and the bounding box 2 intersect; If a soft collision type is specified, the distance between two bounding boxes is obtained by the bounding box distance calculation method, and the relationship between the distance and a given threshold is judged. If the distance between the bounding boxes of the two professional models is less than the given threshold, the two professional models may have a soft collision. The determination of whether the two professional models will have a soft collision is made by calculating the distance between the two bounding boxes. The bounding box distance is calculated as follows: calculate Let x, y, and z be the minimum distances between the two bounding boxes in the x, y, and z directions, respectively. (3) ; a) If it does not exist If the distance d between the two bounding boxes is less than 0, then the distance d between the two bounding boxes is less than b) If only one exists , The distance between the two bounding boxes is then considered to be... ; c) If multiple , Then the distance between the two bounding boxes is considered to be ; Determine the distance between two bounding boxes and The size, the if The distance between the two bounding boxes is greater than a given threshold. if The distance between the two bounding boxes is less than a given threshold.

4. The multi-type collision detection method for a lightweight BIM model according to claim 1, characterized in that, In step 102, the process of sequentially extracting the combinations to be detected, determining the collision relationship between two professional models in each professional model combination, and obtaining a potential collision professional index array refers to: for hard collisions, obtaining the collision relationship between two professional models based on the bounding box intersection judgment method; for soft collisions, obtaining the distance between two bounding boxes based on the bounding box distance calculation method, determining the relationship between the distance and a given threshold, obtaining the collision relationship between two professional models, and adding all possible collision professional model combinations to the potential collision professional model index array.

5. A multi-type collision detection method for a lightweight BIM model according to claim 4, characterized in that, Based on the potential collision professional model index array, the collision relationship of the geometry in the potential collision professional model is determined. The determination of the geometry collision relationship is divided into: calculation of geometry collision between potential collision professional models and calculation of geometry collision within the same professional model. The calculation of geometric collisions between the potential collision professional models is based on the potential collision professional model index array, extracting each potential collision combination to obtain the professional model. Includes a second-level index structure and a professional model. The second-level index structure combines the geometries contained in the two index structures in pairs to obtain the geometries to be detected, and performs collision relationship determination; it then sequentially extracts the geometries to be detected and determines the collision relationship between the two geometries in each combination; The collision calculation of geometric objects within the same professional model involves combining all geometric objects contained in the professional model in pairs to obtain the geometric object combination to be detected, and then determining the collision relationship; the geometric object combination to be detected is extracted sequentially, and the collision relationship between the two geometric objects in each combination is determined; If two geometric objects collide, the collision result is recorded as collision relationship-collision type and stored in the database.

6. The multi-type collision detection method for a lightweight BIM model according to claim 5, characterized in that, The step of sequentially extracting the geometric combinations to be detected and determining the collision relationship between the two geometric objects in each combination is tested through the following steps: Step 201. Obtain the bounding boxes of geometry A and geometry B in each combination. Determine the positional relationship between the two bounding boxes using the bounding boxes and determine whether the two bounding boxes collide. If the collision type is hard collision, determine that the two bounding boxes intersect using the bounding box intersection method, and then the two geometry objects have a hard collision. If the collision type is soft collision, calculate the distance between the two bounding boxes and determine that the distance between the two bounding boxes is less than a given threshold, and then the two geometry objects have a soft collision. Step 202 is then executed when the two geometry objects collide. Step 202. Obtain all triangular faces of geometry A and their bounding boxes. Through collision testing between the two bounding boxes, determine the positional relationship between the bounding box of each face of geometry A and the bounding box of geometry B. If a collision is determined, proceed to step 203. Wherein, if the collision type is hard collision, the bounding box intersection judgment method is used. If the two bounding boxes intersect, it is determined that a hard collision has occurred. If the collision type is soft collision, the bounding box distance calculation method is used. If the distance between the two bounding boxes is less than a given threshold, it is determined that a soft collision has occurred. Step 203. Obtain the bounding boxes of all triangular faces of geometry B. Based on the collision test of the bounding boxes of two triangular faces, if a collision is determined, proceed to step 204. If it is a hard collision, the bounding box of each triangular facet of geometry B intersects with the bounding box of the triangular facet of geometry A described in step 202. If the result is yes, step 204 is executed. If it is a soft collision, the distance between the bounding box of each triangular facet of geometry B and the bounding box of the triangular facet of geometry A described in step 202 is determined. If the distance is less than a given threshold, step 204 is executed. Step 204. Obtain the triangular facets corresponding to the bounding boxes of the two triangular facets that collide. Based on the collision test of the two triangular facets, determine the positional relationship of the geometry containing the two triangular facets. For hard collisions, if the two triangular facets intersect, the two geometry undergoes a hard collision. For soft collisions, if the distance between the two triangular facets is less than a given threshold, the two geometry undergoes a soft collision.

7. The multi-type collision detection method for a lightweight BIM model according to claim 6, characterized in that, In step 204, the positional relationship between the two triangular facets is determined based on the collision test. For hard collisions, if the two triangular facets intersect, then a hard collision occurs between the two geometric bodies. This refers to the hard collision between the two triangular facets of the two geometric bodies. The calculation of whether the two triangular facets intersect is performed using a spatial triangular facet intersection judgment algorithm. The steps of the spatial triangular facet intersection judgment algorithm are as follows: Obtain the triangular facets respectively vertex ( The plane containing the two triangular facets And calculate the normal vectors of the two triangular faces respectively. ; The two triangular facets are non-intersecting: If the dot product of two vectors If the two triangles have the same sign and neither is zero, then the two triangles are skew and do not intersect. dot product of two vectors t The expression is: (4) The two triangular facets are coplanar: The first step is to determine if the two triangular faces are coplanar; calculate the coplanarity of each triangular face. cross product of normal vectors f : f Equation: (5) like and A value of 0 indicates coplanar; The second step is to determine whether the three vertices of one triangular facet are inside the other triangular facet when they are coplanar. If at least one vertex is inside the other triangular facet, the two triangular facets intersect; otherwise, continue to the third step. The third step is to determine whether the two triangular facets intersect. This requires determining the triangular facets... Are the three vertices in The opposite side of each edge, and the triangular facet Are the three vertices in The opposite sides of each edge; if all conditions are met, the triangular facet... They must intersect; otherwise, they must not. The two triangular facets intersect on opposite sides: If in equation (5) If the calculation result is not zero, then the triangular facet Skew faces; Intersection judgment: Determine the intersection of the triangular facets respectively. line segments Is it related to the triangular facet? Intersecting triangular facets line segment Is it related to triangular facets? If any two triangular faces intersect, then the triangles are intersecting. intersect.

8. The multi-type collision detection method for a lightweight BIM model according to claim 7, characterized in that, In step 204, the positional relationship between the two triangular facets is determined based on the collision test. For soft collisions, if the distance between the two triangular facets is less than a given threshold, then a soft collision occurs between the two geometric bodies. This refers to a soft collision between the two triangular facets. The minimum distance between the two triangular facets is calculated. The algorithm steps are as follows: S301 obtains triangular facets respectively vertex Calculate the triangular facets respectively Each edge and triangular facet The distance to each edge; Calculate the distances to nine pairs of sides in total. They are: , , , , , , , , ; S302 calculates the vertices respectively To triangular facet The distance is obtained. and vertex To triangular facet The distance is obtained. ; S303 obtains the minimum distance between the two triangular facets. .

9. A multi-type collision detection method for a lightweight BIM model according to claim 5, characterized in that, The geometry collision calculation within the same professional model refers to verifying whether all geometries under the selected professional model will collide with each other; combining all geometries contained in the professional model in pairs to obtain the geometry combination to be detected; extracting two geometry combinations in sequence, and determining the positional relationship between the two geometry combinations; if the two geometries collide, the collision relationship is recorded as collision relationship-collision type and stored in the database.

10. A multi-type collision detection system for lightweight BIM models, characterized in that, The system includes an indexing module, a collision detection module, and a collision relationship module; The index module is used to establish a first-level professional index structure, and to establish a second-level index structure based on the first-level professional index structure; the second-level index structure is a geometry index, and the ID of the geometry represents a unique index in the project; to obtain a specified collision detection type, the collision type including hard collision and soft collision; wherein, the establishment of the first-level professional index structure is based on the node to be collided selected by the user interface as the professional model to be collided. The collision detection module is used to arrange all professional models according to the first-level professional index structure to obtain combinations of two professional models; sequentially extract the combinations to be detected, determine the collision relationship between the two professional models in each professional model combination, and obtain a potential collision professional index array; determine whether a collision will occur between the professional models, and construct a potential collision professional model index set; based on the potential collision professional models, further determine the collision relationship between the professional models and the geometry within the professional models, and obtain the collision detection result. The process of obtaining the potential collision professional index array refers to arranging all professional models to obtain a combination professional model of each pair of professional models. and professional models Let the total number of selected professional models be... M So, the total is A unique combination of samples to be tested; exist Extract the combinations to be detected sequentially and determine the professional model for each combination. and professional models The collision relationship between the two professional models; all possible collision combinations are added to the potential collision professional model index array; The collision relationship module is used to store the collision detection results of judging the collision relationship between and within the professional model in the database. The collision detection result is that two geometric objects collide, and the collision data is recorded. The recorded collision data is the collision relationship-collision type, and is saved in the database.

11. A multi-type collision detection system for a lightweight BIM model according to claim 10, characterized in that, The collision determination module also includes a professional model collision determination unit and a geometric collision determination unit; The professional model collision determination unit is used to determine the positional relationship between the bounding boxes of two professional models and to determine whether the two professional models collide. The expression for the bounding box is: (1) in, These represent the minimum x-coordinate, minimum y-coordinate, and minimum z-coordinate values ​​in the coordinates of each vertex of the professional model, respectively. These represent the maximum x-coordinate, maximum y-coordinate, and maximum z-coordinate values ​​in the coordinates of each vertex of the professional model, respectively. If a hard collision type is specified, the bounding box intersection method is used to determine whether the intersection of the bounding boxes of the two professional models is empty. If the bounding boxes of the two professional models have an intersection, the two professional models may have a hard collision. The bounding box intersection method is used to determine whether the bounding boxes of the two professional models intersect. If a soft collision type is specified, the distance between two bounding boxes is obtained by the bounding box distance calculation method. The relationship between the distance and a given threshold is then determined. If the distance between the bounding boxes of the two professional models is less than the given threshold, the two professional models may experience a soft collision. The professional model collision judgment unit also includes a bounding box intersection judgment subunit and a bounding box distance judgment subunit; The bounding box intersection judgment subunit adopts the bounding box intersection judgment method, as follows; The expression for bounding box 1: The expression for bounding box 2: a) If the vertex coordinates of two bounding boxes do not coincide, then the two bounding boxes do not intersect if the following conditions are met: The minimum X-coordinate, or minimum Y-coordinate, or minimum Z-coordinate of each vertex in bounding box 1 is greater than the maximum X-coordinate, or maximum Y-coordinate, or maximum Z-coordinate of each vertex in bounding box 2; or, The maximum X-coordinate, maximum Y-coordinate, or maximum Z-coordinate of each vertex of bounding box 1 is less than the minimum X-coordinate, minimum Y-coordinate, or minimum Z-coordinate of each vertex of bounding box 2. That is, it satisfies the following specific formula: ,or or ,or (2) or ,or b) If condition a) is not met, the bounding box 1 intersects with the bounding box 2; The bounding box distance determination subunit determines whether a soft collision will occur between two professional models by calculating the distance between two bounding boxes. The bounding box distance calculation method is as follows: calculate Let x, y, and z be the minimum distances between the two bounding boxes in the x, y, and z directions, respectively. (3) ; a) If it does not exist If the distance d between the two bounding boxes is less than 0, then the distance d between the two bounding boxes is less than b) If only one exists , The distance between the two bounding boxes is then considered to be... ; c) If multiple Then the distance between the two bounding boxes is considered to be ; Determine the distance between two bounding boxes and Size, if The distance between the two bounding boxes is greater than a given threshold. if The distance between the two bounding boxes is less than a given threshold; The geometric collision determination unit is used to calculate geometric collisions between potential collision professional models and geometric collisions within the same professional model. The calculation of geometric collisions between the potential collision professional models is based on the potential collision professional model index array, extracting each potential collision combination to obtain the professional model. Includes a second-level index structure and a professional model. The second-level index structure combines the geometries contained in the two index structures in pairs to obtain the geometries to be detected, and performs collision relationship determination; it then sequentially extracts the geometries to be detected and determines the collision relationship between the two geometries in each combination; The geometry collision calculation within the same professional model combines all the geometries contained in the professional model in pairs to obtain the geometry combination to be detected, and performs collision relationship determination; sequentially extracts the geometry combination to be detected, and determines the collision relationship between the two geometries in each combination.

12. A multi-type collision detection system for a lightweight BIM model according to claim 11, characterized in that, The geometry collision determination unit also includes a geometry bounding box determination subunit, a bounding box determination subunit for the triangular facets of geometry A and the bounding box determination subunit for geometry B, a bounding box determination subunit for the triangular facets of geometry A and B, and a triangular facet determination subunit for geometry A and B. The step of sequentially extracting the geometric combinations to be detected and determining the collision relationship between the two geometric objects in each combination is achieved through the following sub-unit tests; The bounding box judgment sub-unit obtains the bounding boxes of two geometries A and B, and determines whether the two bounding boxes collide based on their positional relationship. If a collision is determined, the bounding box of the triangular facet of geometry A and the bounding box of geometry B are judged by the subunit. If the collision type is hard collision, the bounding box intersection judgment method is used to determine that the two bounding boxes intersect, and then the two geometries have a hard collision. If the collision type is soft collision, the bounding box distance calculation method is used to determine that the distance between the two bounding boxes is less than a given threshold, and then the two geometries have a soft collision. The bounding box determination subunits for the triangular faces of geometry A and the bounding box of geometry B are used to acquire all triangular faces of geometry A and their bounding boxes. Through collision testing of the two bounding boxes, the positional relationship between the bounding boxes of each face of geometry A and the bounding box of geometry B is determined. If a collision is determined, the bounding box determination subunits for the triangular faces of geometry A and B are executed. Specifically, if the collision type is a hard collision, the bounding box intersection determination method is used. If the two bounding boxes intersect, it is determined that a hard collision has occurred. If the collision type is a soft collision, the bounding box distance calculation method is used. If the distance between the two bounding boxes is less than a given threshold, it is determined that a soft collision has occurred. The triangular facet bounding box determination subunit for geometry A and B is used to obtain all triangular facet bounding boxes of geometry B. Based on the collision test between the triangular facet bounding boxes of geometry B and the triangular facet bounding boxes of geometry A, if a collision is determined, the process is transferred to the triangular facet determination subunit for geometry A and B. Specifically, in the case of a hard collision, if the bounding box of each triangular facet of geometry B intersects with the bounding box of the triangular facet of geometry A and the bounding box unit of geometry B, then proceed to the triangular facet judgment subunit of geometry A and B for processing; if the case of a soft collision, if the distance between the bounding box of each triangular facet of geometry B and the bounding box of the triangular facet of geometry A and the bounding box unit of geometry B is less than a given threshold, then proceed to the triangular facet judgment subunit of geometry A and B for processing. The triangular facet judgment subunits of geometries A and B are used to obtain the triangular facests corresponding to the bounding boxes of the two triangular facets that collide, and to determine the positional relationship between the two geometries based on the collision test of the two triangular facets. For hard collisions, if the two triangular facets intersect, the two geometries will have a hard collision. For soft collisions, if the distance between the two triangular facets is less than a given threshold, the two geometries will have a soft collision. The statement regarding hard collisions, where two triangular facets intersect, indicates a hard collision between the two geometric bodies. This refers to the hard collision of two triangular facets of the two geometric bodies. The calculation of whether two triangular facets intersect is performed using a spatial triangular facet intersection judgment algorithm. The steps of this algorithm are as follows: Obtain triangular facets respectively vertex ( The plane containing the two triangular facets And calculate the normal vectors of the two triangular faces. ; The two triangular facets are non-intersecting: like If the two triangles have the same sign and neither is zero, then the two triangles are skew and do not intersect. dot product of two vectors t The expression is: (4) The two triangular facets are coplanar: The first step is to determine if the two triangular faces are coplanar; calculate the coplanarity of each triangular face. cross product of normal vectors f : f Equation: (5) like and A value of 0 indicates coplanar; The second step is to determine whether the three vertices of one triangular facet are inside the other triangular facet when they are coplanar. If at least one vertex is inside the other triangular facet, the two triangular facets intersect; otherwise, continue to the third step. The third step is to determine whether the two triangular faces intersect. This only requires determining whether the triangular faces intersect. Are the three vertices on the triangle? The opposite sides of each edge, and the triangular facets Are the three vertices on the triangle? The opposite sides of each edge; if all conditions are met, the triangular facet... They must intersect; otherwise, they must not. The two triangular facets intersect on opposite sides: If in equation (5) If the calculation result is not zero, then the triangular facet Skew faces; Intersection judgment: judge the triangular facets separately. line segments Is it related to triangular facets? Intersecting, the stated line segment Is it related to triangular facets? If any two triangular faces intersect, then the triangles are intersecting. intersect; For the soft collision of the two triangular facets, the minimum distance between the two triangular facets is calculated. The algorithm steps are as follows: S301 Obtain the triangular facets respectively vertex Calculate the triangular facets respectively Each edge and triangular facet The distance to each edge; Calculate the distances to nine pairs of sides in total. They are: , , , , , , , , ; S302 Calculate the triangular facets respectively vertex To triangular facet distance, get Triangular facet vertex To triangular facet The distance is obtained. ; Minimum distance between two triangular facets in S303 .