Pipe collision detection method, positioning method and system in BIM model
Through particle swarm algorithm and spatial hashing algorithm, and combined with centerline relationship detection of pipeline collisions in the BIM model, the problems of slow detection speed and poor accuracy in the existing technology are solved, and efficient and reliable pipeline collision detection and positioning are achieved.
Patent Information
- Application Number
- CN202510510417.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-23
- Publication Date
- 2025-07-22
- Estimated Expiration
- 2045-04-23
AI Technical Summary
The existing BIM model pipeline collision detection methods are slow, expensive, and have high hardware requirements when processing large models. The detection results are complex, making it difficult to set complex collision tolerance conditions.
The particle swarm algorithm is used for meshing, combined with the spatial hashing algorithm for hard collision detection, and soft collision detection is performed through the positional relationship, distance relationship and angle relationship of the pipeline center line, set the minimum allowable distance for soft collision severity detection, and positioning is performed in combination with plan and three-dimensional diagrams.
High reliability and high efficiency of pipeline collision detection and positioning are achieved, and detection efficiency and accuracy are improved.
Smart Images

Figure CN120030664B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of computer-aided design, and particularly relates to a pipeline collision detection method, a positioning method and a system in a BIM model. Background Art
[0002] The BIM model is a commonly used solution in the field of computer-aided design; this solution is based on the three-dimensional digital full life cycle management technology of building engineering, which realizes the collaborative optimization in stages such as design, construction and operation and maintenance by integrating structured data.
[0003] Pipeline collision detection is an important link in the design and application process of the BIM model. At present, common pipeline collision detection solutions include the collision detection solution built in Revit and the collision detection solution in Naviswork. The collision detection solution built in Revit has achieved good results when dealing with small models, but when dealing with large models, this solution not only has a slow detection speed, a large overhead in the detection process, high requirements for system hardware, but also cannot classify the collision results. The collision detection solution in Naviswork requires exporting the model file in Revit to the format required by Naviswork and then importing it to use its collision detection function, but the import and export processes are relatively cumbersome; moreover, the screening condition configuration in the detection process of this solution is relatively complex, the rule configuration is relatively rough, it is difficult to set complex collision tolerance conditions, and the solution is relatively complex. Summary of the Invention
[0004] One of the purposes of the present invention is to provide a pipeline collision detection method in a BIM model with high reliability, good accuracy and high efficiency.
[0005] Another purpose of the present invention is to provide a positioning method including the pipeline collision detection method in the BIM model.
[0006] The third purpose of the present invention is to provide a system for implementing the pipeline collision detection method in the BIM model.
[0007] The pipeline collision detection method in the BIM model provided by the present invention includes the following steps:
[0008] S1. Obtain the data information of the target BIM model;
[0009] S2. Select all pipelines and structural information of the set floor according to the data information obtained in step S1;
[0010] S3. Based on the particle swarm optimization algorithm, perform grid division on the pipelines selected in step S2;
[0011] S4. Based on the mesh division result obtained in step S3, perform hard collision detection of the pipeline using the spatial hashing algorithm;
[0012] S5. Based on the positional relationship, distance relationship, and included angle relationship of the centerlines of any two pipelines, perform soft collision detection of the pipelines;
[0013] S6. Based on the shortest distance between the centerlines of any two pipelines and the set minimum allowable distance, perform detection of the severity of soft collisions of the pipelines, thereby completing the detection of pipeline collisions in the BIM model.
[0014] The described step S3 specifically includes the following steps:
[0015] Perform mesh division on the pipelines selected in step S2;
[0016] According to the median and interquartile range of the pipeline length list, calculate the ideal mesh cell size using the following formula: In the formula, s is the ideal mesh cell size; mid is the median value of the pipeline length list; iqr is the interquartile range of the pipeline length list;
[0017] Use the particle swarm optimization algorithm to optimize the mesh size:
[0018] During the optimization process, each particle represents a candidate mesh size, set the search range, and randomly assign an initial velocity to each particle;
[0019] In the performance dimension, based on the number of builds, average build area, and average build size, calculate the performance dimension score using the following formula: In the formula is the performance dimension score; is the current position of the particle, used to represent the size of the current mesh cell; is the average build size, and , a is the mesh area, c is the number of builds;
[0020] In the quality dimension, analyze the ratio of the mesh size to the minimum size of the component, and calculate the quality dimension score using the following formula: In the formula is the quality dimension score; is the minimum size of the component, and , is the maximum value of the component on the X-axis, is the minimum value of the component on the X-axis, is the maximum value of the component on the Y-axis, is the minimum value of the component on the Y-axis;
[0021] In the ideal value dimension, based on the deviation degree between the current value of the grid and the ideal value of the grid, the ideal value dimension score is calculated using the following formula: where dev is the relative deviation between the current grid cell size and the ideal grid cell size, and , is the size of the ideal grid cell;
[0022] By scoring in three dimensions of performance, quality, and ideal value, and through weighted calculation, the particle fitness is evaluated;
[0023] The velocity of the particle is updated using the following formula: where is the velocity of the nth particle after update; w is the inertia weight; is the velocity of the nth particle before update; is the cognitive parameter; R is the random weight; is the historical optimal position of the particle; is the position of the nth particle before update; is the social parameter; is the global optimal position of the particle;
[0024] The position of the particle is updated using the following formula: where is the position of the nth particle before update; is the velocity of the nth particle after update; t is the unit time;
[0025] After completing the set number of iterations, the final global optimal position of the particle is used as the final grid size.
[0026] The step S4 mentioned above specifically includes the following steps:
[0027] According to the grid division result of step S3, the continuous three-dimensional space is divided into cubic grids;
[0028] The spatial coordinates of the pipelines or structures in the space are mapped to the hash table using a hash function to achieve fast access and query of spatial objects;
[0029] According to the divided grids, the pipelines or structures within the same grid cell are used as the potential collision pipeline targets of a pipeline; for the potential collision elements, the AABB bounding box method is used for detection: if the AABB bounding boxes of the pipelines or between the pipeline and the structure intersect, it is determined that a hard collision exists.
[0030] The step S5 mentioned above includes the following steps:
[0031] Soft collision detection of pipelines, including soft collision detection between pipelines and soft collision detection between hoses and structures;
[0032] (1)Soft collision detection between pipelines:
[0033] According to the radii of any two pipelines and the set minimum distance between the two pipelines, calculate the pipeline soft collision detection threshold;
[0034] If the actual shortest distance between the two pipelines is less than the calculated pipeline soft collision detection threshold, it is determined that there is a soft collision between the two pipelines; otherwise, it is determined that there is no soft collision between the two pipelines;
[0035] For two pipelines with a soft collision:
[0036] If the centerlines of the two pipelines are not coplanar, it is directly determined that the soft collision between the two pipelines is a skew cross soft collision;
[0037] If the centerlines of the two pipelines are coplanar:
[0038] Calculate the cross product of the direction vectors of the centerlines of the two pipelines, and determine whether the soft collision is a coplanar collinear soft collision or a coplanar parallel soft collision according to the magnitude of the cross product and the set compatible error tolerance and the straight-line distance between the centerlines of the two pipelines;
[0039] If there is an intersection point between the centerlines of the two pipelines, calculate the distance and direction vector from the intersection point to each end point; if the intersection point is on any pipeline centerline, it is determined that the soft collision is a coplanar internal intersection soft collision;
[0040] If there is no intersection point between the centerlines of the two pipelines, calculate the actual shortest distance between the two pipelines: if the actual shortest distance between the two pipelines is less than the set minimum allowable distance, it is determined that the soft collision is a coplanar extended line intersection soft collision; otherwise, it is determined as other types;
[0041] (2)Soft collision detection between pipeline and structure:
[0042] According to the pipeline radius and the set minimum distance between pipelines, calculate the pipeline structure soft collision detection threshold;
[0043] Obtain the shortest distance between the pipeline centerline and the structure body, and compare it with the calculated pipeline structure soft collision detection threshold: if the shortest distance between the pipeline centerline and the structure body is greater than the pipeline structure soft collision detection threshold, it is determined that there is no soft collision between the pipeline and the structure; otherwise, it is determined that there is a soft collision between the pipeline and the structure;
[0044] For the existing soft collision between the pipeline and the structure, detect the type of soft collision between the pipeline and the structure according to the shortest distance between the pipeline centerline and the structure body and the number of intersection points between each surface of the structure body and the pipeline centerline.
[0045] The described step S5 specifically includes the following steps:
[0046] Soft collision detection of pipelines includes soft collision detection between pipelines and soft collision detection between hoses and structures;
[0047] (1) Soft collision detection between pipelines:
[0048] Based on the radii r1 and r2 of any two pipelines and the set minimum distance input between the two pipelines, the pipeline soft collision detection threshold min is calculated as ;
[0049] If the actual shortest distance d between the two pipelines is less than the calculated pipeline soft collision detection threshold min, it is determined that there is a soft collision between the two pipelines; otherwise, it is determined that there is no soft collision between the two pipelines;
[0050] It is set that the soft collision types between pipelines include non - coplanar cross - soft collision, coplanar collinear soft collision, coplanar parallel soft collision, coplanar internal intersection soft collision, and coplanar extended line intersection soft collision;
[0051] If the centerlines of the two pipelines with soft collision are not coplanar, it is directly determined that the soft collision between the two pipelines is a non - coplanar cross - soft collision; set the nearest collision points as p1 and p2, the X - axis coordinate, Y - axis coordinate, and Z - axis coordinate of p1 are and the X - axis coordinate, Y - axis coordinate, and Z - axis coordinate of p2 are Calculate the actual distance between the two collision points as Calculate the included angle between the direction vectors of the centerlines of the two pipelines as where d1 is the direction vector of the centerline of the first pipeline among the two pipelines, d2 is the direction vector of the centerline of the second pipeline among the two pipelines, is the modulus of the direction vector of the centerline of the first pipeline, is the modulus of the direction vector of the centerline of the second pipeline;
[0052] If the centerlines of the two pipelines are coplanar:
[0053] Calculate the cross - product of the direction vectors of the centerlines of the two pipelines: If the modulus of the cross - product is less than the set relative error tolerance and the straight - line distance between the centerlines of the two pipelines is less than the set threshold, it is determined that the soft collision is a coplanar collinear soft collision; if the modulus of the cross - product is less than the set relative error tolerance and the straight - line distance between the centerlines of the two pipelines is not less than the set threshold, it is determined that the soft collision is a coplanar parallel soft collision;
[0054] If the centerlines of two pipes intersect, calculate the distance and direction vector from the intersection point to the endpoints of the centers of the two pipes: If the intersection point lies on the centerline of any one pipe, determine that the soft collision is a coplanar internal intersection soft collision;
[0055] If the centerlines of the two pipes have no intersection point, calculate the actual shortest distance between the two pipes is , where is the distance from the intersection point p of the extended lines of the centerlines of the two pipes to the first endpoint A of the centerline of the first pipe, is the distance from the intersection point p of the extended lines of the centerlines of the two pipes to the second endpoint B of the centerline of the first pipe, is the distance from the intersection point p of the extended lines of the centerlines of the two pipes to the first endpoint C of the centerline of the second pipe, is the distance from the intersection point p of the extended lines of the centerlines of the two pipes to the second endpoint D of the centerline of the second pipe; If the actual shortest distance between the two pipes is less than the set minimum allowable distance, determine that the soft collision is a coplanar extended line intersection soft collision; Otherwise, determine it as other types;
[0056] (2)Soft collision detection between pipes and structures:
[0057] According to the pipe radius and the set minimum distance between pipes , calculate the pipe structure soft collision detection threshold is ;
[0058] Obtain the shortest distance between the pipe centerline and the structure, and compare it with the calculated pipe structure soft collision detection threshold : If the shortest distance between the pipe centerline and the structure is greater than the pipe structure soft collision detection threshold , determine that there is no soft collision between the pipe and the structure; Otherwise, determine that there is a soft collision between the pipe and the structure;
[0059] Set the types of soft collisions between pipes and structures to include pipe penetrating structure soft collision, pipe tangent to structure soft collision, and pipe approaching structure soft collision;
[0060] For the existing soft collision between the pipe and the structure, conduct the detection of the type of soft collision between the pipe and the structure:
[0061] If the shortest distance If it is 0 and the number of intersection points of each face of the structure with the pipeline center line is not less than 2, then it is determined that the soft collision between the pipeline and the structure is a pipeline penetrating the structure soft collision;
[0062] If the shortest distance between the pipeline center line and the structure is not 0 and the difference from 0 is less than the set value, then it is determined that the soft collision between the pipeline and the structure is a pipeline tangent to the structure soft collision;
[0063] If the shortest distance between the pipeline center line and the structure is not 0, and the difference from 0 is greater than or equal to the set value, then it is determined that the soft collision between the pipeline and the structure is a pipeline approaching the structure soft collision;
[0064] Among them, the shortest distance between the pipeline center line and the structure , is obtained by the following steps:
[0065] Obtain the data information of the two endpoints of the pipeline center line and each face of the structure;
[0066] Traverse the relationship between each face and the pipeline center line, and check the intersection of the pipeline center line and the face: if there is an intersection point, it is directly determined to be 0, and stop traversing; if there is no intersection point, project the endpoints of the pipeline center line onto the current face, and take the minimum value of the distance between the endpoints and the corresponding projection points as the shortest distance between the pipeline center line and the structure .
[0067] The step S6 described above specifically includes the following steps:
[0068] It is set that the severity of the soft collision of the pipeline includes fatal, severe, medium and minor;
[0069] For the detection of the severity of the soft collision between pipelines:
[0070] If the actual shortest distance d between two pipelines is less than 0, or the pipeline soft collision detection threshold min is not greater than 0, then it is determined that the severity is fatal;
[0071] If the actual shortest distance d between two pipelines is not less than 0 and the pipeline soft collision detection threshold min is greater than 0, then calculate the pipeline collision degree value ratio as ;
[0072] For coplanar internal intersection soft collisions and coplanar collinear soft collisions, it is determined that the severity is fatal;
[0073] For non-coplanar cross soft collisions, coplanar parallel soft collisions and coplanar extended line intersection soft collisions, if then it is determined that the severity is fatal, if then it is determined that the severity is severe, if The severity is determined to be medium. If the severity is determined to be minor;
[0074] Detection of the severity of soft collision between pipeline and structure:
[0075] If the shortest distance between the pipeline center line and the structure is less than 0 or the soft collision detection threshold of the pipeline structure is not greater than 0, the severity is determined to be fatal;
[0076] If the shortest distance between the pipeline center line and the structure is not less than 0 or the soft collision detection threshold of the pipeline structure is greater than 0, calculate the collision degree value between the pipeline and the structure as ;
[0077] For the soft collision of pipeline penetrating the structure, the severity is determined to be fatal;
[0078] For the soft collision of pipeline tangent to the structure, the severity is determined to be serious;
[0079] For the soft collision of pipeline approaching the structure, if the severity is determined to be fatal, if the severity is determined to be serious, if the severity is determined to be medium, if the severity is determined to be minor.
[0080] The present invention also provides a positioning method including the pipeline collision detection method in the BIM model, further including the following steps:
[0081] S7. According to the position information and intersection information of any two pipelines in the plan view or three-dimensional view, perform positioning detection of the soft collision of the pipelines.
[0082] The step S7 described above includes the following steps:
[0083] The positioning detection of the soft collision of the pipeline includes plan view positioning detection and three-dimensional view positioning detection;
[0084] The plan view positioning detection is applicable to viewing the layout of the BIM model on the plane and the planar relationship between the buildings; the three-dimensional view positioning detection is applicable to viewing the positional relationship of the BIM model in three dimensions and the interaction effect between the buildings;
[0085] Plan view positioning detection:
[0086] For other soft collisions that are not non - coplanar cross - soft collisions, directly obtain the coordinates of the corresponding collision points; according to the Z - axis coordinate of the collision point coordinates, directly perform the positioning of the corresponding floor plane;
[0087] For non - coplanar cross - soft collisions, project the direction vectors of the centerlines of the two pipelines onto the XY plane and perform cross - calculations to obtain the projection information of the direction vectors of the centerlines on the XY plane, and calculate the intersection point coordinate information of the non - coplanar cross based on the projection information and the starting point coordinates of the centerlines of the two pipelines; according to the intersection point coordinate information of the non - coplanar cross, perform the positioning of the corresponding floor plane;
[0088] 3D drawing positioning detection:
[0089] For other soft collisions that are not non - coplanar cross - soft collisions, directly obtain the coordinates of the corresponding collision points; according to the Z - axis coordinate of the collision point coordinates, directly perform the positioning of the corresponding floor plane;
[0090] For non - coplanar cross - soft collisions, construct vectors based on the starting and ending points of the centerlines of the two pipelines and perform determinant calculations; according to the determinant calculation results, calculate the proportional positions of the nearest points on the centerlines of the two pipelines relative to the starting points of their respective line segments and normalize them, and finally calculate the nearest points on the centerlines of the two pipelines based on the normalized proportional positions; according to the obtained nearest points on the centerlines of the two pipelines, perform the positioning of the corresponding floor plane.
[0091] The specific steps of step S7 are as follows:
[0092] A. Planar drawing positioning detection:
[0093] For other soft collisions that are not non - coplanar cross - soft collisions, directly obtain the coordinates of the corresponding collision points; according to the Z - axis coordinate of the collision point coordinates, directly perform the positioning of the corresponding floor plane;
[0094] For non - coplanar cross - soft collisions:
[0095] Set P1 to represent the starting point of the centerline of the first pipeline, and the corresponding X - axis coordinate and Y - axis coordinate are ; Set P2 to represent the starting point of the centerline of the second pipeline, and the corresponding X - axis coordinate and Y - axis coordinate are ; Let v1 be the direction vector of the centerline of the first pipeline and v2 be the direction vector of the centerline of the second pipeline; the coordinate of v1 on the X - axis is , the coordinate of v1 on the Y - axis is , the coordinate of v2 on the X - axis is , the coordinate of v2 on the Y - axis is ;
[0096] Use the following formula to calculate the projection vectors of v1 and v2 on the XY plane: In the formula is the projection vector of v1 on the XY plane; is the projection vector of v2 on the XY plane;
[0097] The intersection point parameter t is calculated using the following formula: In the formula is the Y-axis coordinate of; is the X-axis coordinate of; is the X-axis coordinate of; is the Y-axis coordinate of;
[0098] The intersection point coordinate information of the skew intersection is calculated using the following formula: In the formula is the X-axis coordinate of the intersection point Q of the skew intersection; is the Y-axis coordinate of the intersection point Q of the skew intersection; is the Z-axis coordinate of the intersection point Q of the skew intersection;
[0099] According to the coordinate information of the intersection point Q of the skew intersection, perform the positioning of the corresponding floor plane: According to the current active view, obtain the associated elevation, and obtain the current floor plane through the elevation; if the elevation cannot be obtained, return the default value 0;
[0100] B. 3D drawing positioning detection:
[0101] For other soft collisions that are not skew intersection soft collisions, directly obtain the corresponding collision point coordinates; according to the Z-axis coordinate of the collision point coordinates, directly perform the positioning of the corresponding floor plane;
[0102] For skew intersection soft collisions:
[0103] Set the starting endpoint of the center line of the first pipeline to , and the ending endpoint to ; Set the starting endpoint of the center line of the second pipeline to , and the ending endpoint to ; Then the first vector is expressed as , the second vector is expressed as , and the third vector is expressed as ;
[0104] Perform a determinant calculation, and the determinant calculation result D is ;
[0105] If D is less than the set minimum value, then:
[0106] The first proportional position sc is 0;
[0107] If then the second proportional position tc is , otherwise the second proportional position tc is ;
[0108] If D is not less than the set minimum value, then:
[0109] The first proportional position sc is , and the second proportional position tc is ;
[0110] Normalize the first proportional position and the second proportional position to obtain the normalized first proportional position as , and the normalized second proportional position as ;
[0111] Calculate the nearest point on the centerlines of the two pipelines using the following formula: In the formula is the nearest point on the centerline of the first pipeline; is the nearest point on the centerline of the second pipeline;
[0112] According to and , perform the positioning of the corresponding floor plane: accurately position on the floor plane through the elevation of the center position between the two nearest points.
[0113] The present invention also provides a system for implementing the method for detecting pipeline collisions in the BIM model, including a data acquisition module, a data selection module, a mesh division module, a hard collision detection module, a soft collision detection module, a severity detection module, and a positioning detection module; the data acquisition module, the data selection module, the mesh division module, the hard collision detection module, the soft collision detection module, the severity detection module, and the positioning detection module are connected in series in sequence; the data acquisition module is used to acquire the data information of the target BIM model and upload the data information to the data selection module; the data selection module is used to select all the pipelines and structural information of the set floors according to the received data information and upload the data information to the mesh division module; the mesh division module is used to perform mesh division on the selected pipelines based on the particle swarm algorithm according to the received data information and upload the data information to the hard collision detection module; the hard collision detection module is used to perform hard collision detection on the pipelines by using the spatial hashing algorithm according to the received data information and the mesh division result and upload the data information to the soft collision detection module; the soft collision detection module is used to perform soft collision detection on the pipelines according to the positional relationship, distance relationship, and included angle relationship of the centerlines of any two pipelines and upload the data information to the severity detection module; the severity detection module is used to perform soft collision severity detection on the pipelines according to the shortest distance between the centerlines of any two pipelines and the set minimum allowable distance and upload the data information to the positioning detection module; the positioning detection module is used to perform positioning detection on the soft collision of the pipelines according to the positional information and intersection information of any two pipelines in the plan view or three-dimensional view.
[0114] The method for detecting pipeline collisions, positioning method, and system in the BIM model provided by the present invention optimize the pipeline mesh division through the particle swarm optimization algorithm, and then combine the hashing algorithm to perform hard collision detection, and combine the positional relationship, distance relationship, and included angle relationship of the centerlines of the pipelines to perform soft collision detection and positioning. Therefore, the present invention can not only implement the detection and positioning of pipeline collisions in the BIM model, but also has higher reliability, better accuracy, and higher efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0115] Figure 1 It is a schematic flowchart of the detection method of the present invention.
[0116] Figure 2 It is a schematic flowchart of the positioning method of the present invention.
[0117] Figure 3 It is a schematic diagram of the experimental comparison curve between the method of the present invention and the existing solution.
[0118] Figure 4 It is a schematic diagram of the functional modules of the system of the present invention. Specific Embodiments
[0119] As Figure 1 shown in the following is a schematic flowchart of the method for detecting in the present invention: The method for detecting pipeline collisions in this BIM model disclosed by the present invention includes the following steps:
[0120] S1. Obtain the data information of the target BIM model.
[0121] S2. Select all pipeline and structural information of the set floor according to the data information obtained in step S1.
[0122] S3. Based on the particle swarm algorithm, perform mesh division on the pipelines selected in step S2; specifically, it includes the following steps:
[0123] Perform mesh division on the pipelines selected in step S2;
[0124] According to the median and interquartile range of the pipeline length list, calculate the ideal mesh cell size using the following formula: In the formula, s is the ideal mesh cell size; mid is the median value of the pipeline length list; iqr is the interquartile range of the pipeline length list;
[0125] Use the particle swarm optimization algorithm to optimize the mesh size:
[0126] During the optimization process, each particle represents a candidate mesh size. Set the search range and randomly assign an initial velocity to each particle;
[0127] In the performance dimension, based on the number of constructs, average construct area, and average construct size, calculate the performance dimension score using the following formula: In the formula is the performance dimension score; is the current position of the particle, used to represent the size of the current mesh cell; is the average construct size, and , a is the mesh area, c is the number of constructs;
[0128] In the quality dimension, analyze the ratio of the mesh size to the minimum size of the component, and calculate the quality dimension score using the following formula: In the formula is the quality dimension score; is the minimum size of the component, and , is the maximum value of the component on the X-axis, is the minimum value of the component on the X-axis, is the maximum value of the component on the Y-axis, is the minimum value of the component on the Y-axis;
[0129] In the ideal value dimension, based on the deviation degree between the current value of the grid and the ideal value of the grid, the ideal value dimension score is calculated using the following formula: In the formula, dev is the relative deviation between the current grid cell size and the ideal grid cell size, and , is the size of the ideal grid cell;
[0130] Through the scores of the three dimensions of performance, quality and ideal value, the particle fitness is evaluated by weighted calculation;
[0131] Each example records the individual's historical optimal position, the group shares the global optimal position information, and the particle movement is adjusted according to the velocity and position update formulas;
[0132] The velocity of the particle is updated using the following formula: In the formula is the velocity of the nth particle after update; w is the inertia weight; is the velocity of the nth particle before update; is the cognitive parameter; R is the random weight; is the historical optimal position of the particle; is the position of the nth particle before update; is the social parameter; is the global optimal position of the particle;
[0133] The position of the particle is updated using the following formula: In the formula is the position of the nth particle before update; is the velocity of the nth particle after update; t is the unit time;
[0134] After completing the set number of iterations, the final global optimal position of the particle is used as the final grid size.
[0135] S4. According to the grid division result obtained in step S3, the spatial hashing algorithm is used to perform hard collision detection of the pipeline; specifically, it includes the following steps:
[0136] According to the grid division result of step S3, the continuous three-dimensional space is divided into cubic grids;
[0137] The spatial coordinates of the pipelines or structures in the space are mapped to the hash table using a hash function to achieve fast access and query of spatial objects;
[0138] According to the divided grid, the pipes or structures within the same grid cell are used as potential collision pipe targets for a pipe, thus avoiding the detection of all pipe elements with each other and greatly improving the detection efficiency. For potential collision elements, the AABB bounding box method is used for detection: if the AABB bounding boxes of pipes with pipes or pipes with structures intersect, it is determined that a hard collision exists.
[0139] S5. According to the positional relationship, distance relationship and included angle relationship of the centerlines of any two pipes, perform soft collision detection of the pipes; the steps are as follows:
[0140] The soft collision detection of pipes includes the soft collision detection of pipes with pipes and the soft collision detection of hoses with structures;
[0141] (1) Soft collision detection of pipes with pipes:
[0142] According to the radii of any two pipes and the set minimum distance between the two pipes, calculate the soft collision detection threshold of the pipes;
[0143] If the actual shortest distance between the two pipes is less than the calculated soft collision detection threshold of the pipes, it is determined that the two pipes have a soft collision; otherwise, it is determined that the two pipes do not have a soft collision;
[0144] For two pipes with a soft collision:
[0145] If the centerlines of the two pipes are not coplanar, it is directly determined that the soft collision of the two pipes is a skew cross soft collision;
[0146] If the centerlines of the two pipes are coplanar:
[0147] Calculate the cross product of the direction vectors of the centerlines of the two pipes, and determine whether the soft collision is a coplanar collinear soft collision or a coplanar parallel soft collision according to the magnitude of the cross product and the tolerance of the set compatibility error and the straight-line distance between the centerlines of the two pipes;
[0148] If there is an intersection point between the centerlines of the two pipes, calculate the distance and direction vector from the intersection point to each end point; if the intersection point is on the centerline of any pipe, it is determined that the soft collision is a coplanar internal intersection soft collision;
[0149] If there is no intersection point between the centerlines of the two pipes, calculate the actual shortest distance between the two pipes: if the actual shortest distance between the two pipes is less than the set minimum allowable distance, it is determined that the soft collision is a coplanar extended line intersection soft collision; otherwise, it is determined as other types;
[0150] (2) Soft collision detection of pipes with structures:
[0151] According to the pipe radius and the set minimum distance between pipes, calculate the soft collision detection threshold of the pipe structure;
[0152] Obtain the shortest distance between the pipeline centerline and the structure, and compare it with the calculated soft collision detection threshold of the pipeline structure: If the shortest distance between the pipeline centerline and the structure is greater than the soft collision detection threshold of the pipeline structure, it is determined that there is no soft collision between the pipeline and the structure; otherwise, it is determined that there is a soft collision between the pipeline and the structure;
[0153] For the existing soft collision between the pipeline and the structure, detect the type of soft collision between the pipeline and the structure according to the shortest distance between the pipeline centerline and the structure and the number of intersection points between each surface of the structure and the pipeline centerline.
[0154] Specifically, it includes the following steps:
[0155] The soft collision detection of the pipeline includes the soft collision detection between pipelines and the soft collision detection between the flexible pipeline and the structure;
[0156] (1) Soft collision detection between pipelines:
[0157] According to the radii r1 and r2 of any two pipelines and the set minimum distance input between the two pipelines, calculate the soft collision detection threshold min of the pipeline as ;
[0158] If the actual shortest distance d between the two pipelines is less than the calculated soft collision detection threshold min of the pipeline, it is determined that there is a soft collision between the two pipelines; otherwise, it is determined that there is no soft collision between the two pipelines;
[0159] Set the types of soft collisions between pipelines to include off-plane cross soft collision, coplanar collinear soft collision, coplanar parallel soft collision, coplanar internal intersection soft collision, and coplanar extension line intersection soft collision;
[0160] If the centerlines of the two pipelines with soft collision are not coplanar, directly determine that the soft collision between the two pipelines is an off-plane cross soft collision; set the nearest collision points as p1 and p2, and the X-axis coordinate, Y-axis coordinate, and Z-axis coordinate of p1 are , and the X-axis coordinate, Y-axis coordinate, and Z-axis coordinate of p2 are , calculate the actual distance between the two collision points as , calculate the included angle between the direction vectors of the centerlines of the two pipelines as , where d1 is the direction vector of the centerline of the first pipeline among the two pipelines, d2 is the direction vector of the centerline of the second pipeline among the two pipelines, is the modulus of the direction vector of the centerline of the first pipeline, is the modulus of the direction vector of the centerline of the second pipeline;
[0161] If the centerlines of two pipes are coplanar:
[0162] Calculate the cross product of the direction vectors of the centerlines of the two pipes: If the magnitude of the cross product is less than the set relative error tolerance (preferably 1e-6), and the straight-line distance between the centerlines of the two pipes is less than the set threshold, then it is determined that the soft collision is a coplanar and collinear soft collision; if the magnitude of the cross product is less than the set relative error tolerance (preferably 1e-6), and the straight-line distance between the centerlines of the two pipes is not less than the set threshold, then it is determined that the soft collision is a coplanar and parallel soft collision;
[0163] If there is an intersection point between the centerlines of the two pipes, then calculate the distance and direction vector from the intersection point to the end points of the center points of the two pipes: If the intersection point is on any of the pipe centerlines, then it is determined that the soft collision is a coplanar and internally intersecting soft collision;
[0164] If there is no intersection point between the centerlines of the two pipes, then calculate the actual shortest distance between the two pipes as where is the distance from the intersection point p of the extension lines of the centerlines of the two pipes to the first end point A of the centerline of the first pipe, is the distance from the intersection point p of the extension lines of the centerlines of the two pipes to the second end point B of the centerline of the first pipe, is the distance from the intersection point p of the extension lines of the centerlines of the two pipes to the first end point C of the centerline of the second pipe, is the distance from the intersection point p of the extension lines of the centerlines of the two pipes to the second end point D of the centerline of the second pipe; if the actual shortest distance between the two pipes is less than the set minimum allowable distance, then it is determined that the soft collision is a coplanar and intersecting extension line soft collision; otherwise, it is determined as other types;
[0165] (2) Soft collision detection between pipes and structures:
[0166] According to the pipe radius and the set minimum distance between pipes calculate the pipe structure soft collision detection threshold as ;
[0167] Obtain the shortest distance between the pipe centerline and the structure, and compare it with the calculated pipe structure soft collision detection threshold : If the shortest distance between the pipe centerline and the structure is greater than the pipe structure soft collision detection threshold , then it is determined that there is no soft collision between the pipe and the structure; otherwise, it is determined that there is a soft collision between the pipe and the structure;
[0168] The set soft collision types between the pipeline and the structure include pipeline penetration into the structure soft collision, pipeline tangent to the structure soft collision, and pipeline approaching the structure soft collision;
[0169] For the existing soft collision between the pipeline and the structure, detect the soft collision type between the pipeline and the structure:
[0170] If the shortest distance between the pipeline center line and the structure body is 0, and the number of intersection points between each surface of the structure body and the pipeline center line is not less than 2, then determine that the soft collision between the pipeline and the structure is pipeline penetration into the structure soft collision;
[0171] If the shortest distance between the pipeline center line and the structure body is not 0 and the difference from 0 is less than the set value, then determine that the soft collision between the pipeline and the structure is pipeline tangent to the structure soft collision;
[0172] If the shortest distance between the pipeline center line and the structure body is not 0 and the difference from 0 is greater than or equal to the set value, then determine that the soft collision between the pipeline and the structure is pipeline approaching the structure soft collision;
[0173] Among them, the shortest distance between the pipeline center line and the structure body is obtained by the following steps:
[0174] Obtain the data information of the two end points of the pipeline center line and each surface of the structure body;
[0175] Traverse the relationship between each surface and the pipeline center line, and check the intersection situation between the pipeline center line and the surface: if there is an intersection point, directly determine it is 0 and stop traversing; if there is no intersection point, project the end point of the pipeline center line onto the current surface, and take the minimum value of the distance between the end point and the corresponding projection point as the shortest distance between the pipeline center line and the structure body .
[0176] S6. According to the shortest distance between the center lines of any two pipelines and the set minimum allowable distance, detect the severity of the soft collision of the pipelines, so as to complete the detection of pipeline collisions in the BIM model; specifically, it includes the following steps:
[0177] Set the severity of the soft collision of the pipelines to include fatal, severe, medium, and minor;
[0178] For the detection of the severity of the soft collision between pipelines and pipelines:
[0179] If the actual shortest distance d between two pipelines is less than 0, or the pipeline soft collision detection threshold min is not greater than 0, then determine that the severity is fatal;
[0180] If the actual shortest distance d between two pipes is not less than 0 and the soft collision detection threshold min of the pipes is greater than 0, then calculate the collision degree value ratio between the pipes as ;
[0181] For coplanar internal intersection soft collisions and coplanar collinear soft collisions, determine the severity as fatal;
[0182] For non - coplanar cross soft collisions, coplanar parallel soft collisions and coplanar extended - line intersection soft collisions, if then determine the severity as fatal, if then determine the severity as severe, if then determine the severity as medium, if then determine the severity as minor;
[0183] For the detection of the severity of soft collisions between pipes and structures:
[0184] If the shortest distance between the center line of the pipe and the structure body is less than 0 or the soft collision detection threshold of the pipe - structure is not greater than 0, then determine the severity as fatal;
[0185] If the shortest distance between the center line of the pipe and the structure body is not less than 0 or the soft collision detection threshold of the pipe - structure is greater than 0, then calculate the collision degree value of the pipe and the structure as ;
[0186] For pipe - penetrating - structure soft collisions, determine the severity as fatal;
[0187] For pipe - tangent - to - structure soft collisions, determine the severity as severe;
[0188] For pipe - close - to - structure soft collisions, if then determine the severity as fatal, if then determine the severity as severe, if then determine the severity as medium, if then determine the severity as minor.
[0189] As Figure 2 shown is the schematic flow chart of the positioning method of the present invention: The positioning method including the pipe collision detection method in the BIM model disclosed by the present invention further includes the following steps:
[0190] S7. According to the position information and intersection information of any two pipes in the plan view or three - dimensional view, perform the positioning detection of soft collisions of the pipes; including the following steps:
[0191] Position detection of soft collision of pipelines, including floor plan position detection and 3D drawing position detection;
[0192] Floor plan position detection is applicable to view the layout of the BIM model on the plane and the planar relationship between components; 3D drawing position detection is applicable to view the positional relationship of the BIM model in three dimensions and the interaction effect between components;
[0193] Floor plan position detection:
[0194] For other soft collisions of non-skew cross soft collisions, directly obtain the corresponding collision point coordinates; according to the Z-axis coordinate of the collision point coordinates, directly perform the positioning of the corresponding floor plane;
[0195] For skew cross soft collisions, project the direction vectors of the centerlines of the two pipelines onto the XY plane and perform cross calculations to obtain the projection information of the direction vectors of the centerlines on the XY plane, and calculate the intersection point coordinate information of the skew cross through the projection information and the starting point coordinates of the centerlines of the two pipelines; according to the intersection point coordinate information of the skew cross, perform the positioning of the corresponding floor plane;
[0196] 3D drawing position detection:
[0197] For other soft collisions of non-skew cross soft collisions, directly obtain the corresponding collision point coordinates; according to the Z-axis coordinate of the collision point coordinates, directly perform the positioning of the corresponding floor plane;
[0198] For skew cross soft collisions, construct vectors based on the starting and ending points of the centerlines of the two pipelines and perform determinant calculations; according to the determinant calculation results, calculate the proportional positions of the nearest points on the centerlines of the two pipelines relative to the starting points of their respective line segments and perform normalization, and finally calculate the nearest points on the centerlines of the two pipelines according to the normalized proportional positions; according to the obtained nearest points on the centerlines of the two pipelines, perform the positioning of the corresponding floor plane.
[0199] When specifically implemented, it includes the following steps:
[0200] A. Floor plan position detection:
[0201] For other soft collisions of non-skew cross soft collisions, directly obtain the corresponding collision point coordinates; according to the Z-axis coordinate of the collision point coordinates, directly perform the positioning of the corresponding floor plane;
[0202] For skew cross soft collisions:
[0203] Set P1 to represent the starting point of the centerline of the first pipeline, and the corresponding X-axis coordinate and Y-axis coordinate are ; Set P2 to represent the starting point of the centerline of the second pipeline, and the corresponding X-axis coordinate and Y-axis coordinate are ; v1 is the direction vector of the center line of the first pipe, and v2 is the direction vector of the center line of the second pipe; the coordinate of v1 on the X-axis is , and the coordinate of v1 on the Y-axis is , the coordinate of v2 on the X-axis is , and the coordinate of v2 on the Y-axis is ;
[0204] The projection vectors of v1 and v2 on the XY plane are calculated using the following formula: In the formula is the projection vector of v1 on the XY plane; is the projection vector of v2 on the XY plane;
[0205] The intersection parameter t is calculated using the following formula: In the formula is the Y-axis coordinate of is the X-axis coordinate of is the X-axis coordinate of is the Y-axis coordinate of
[0206] The intersection point coordinate information of the skew intersection is calculated using the following formula: In the formula is the X-axis coordinate of the intersection point Q of the skew intersection; is the Y-axis coordinate of the intersection point Q of the skew intersection; is the Z-axis coordinate of the intersection point Q of the skew intersection;
[0207] According to the coordinate information of the intersection point Q of the skew intersection, perform the positioning of the corresponding floor plane: According to the current active view, obtain the associated elevation, and obtain the current floor plane through the elevation; if the elevation cannot be obtained, return the default value 0;
[0208] B. 3D drawing positioning detection:
[0209] For other soft collisions that are not skew intersection soft collisions, directly obtain the coordinates of the corresponding collision points; according to the Z-axis coordinate of the collision point coordinates, directly perform the positioning of the corresponding floor plane;
[0210] For skew intersection soft collisions:
[0211] Set the starting endpoint of the center line of the first pipe as , and the ending endpoint as ; the starting endpoint of the center line of the second pipe is , and the ending endpoint as ; Then the first vector is expressed as , the second vector is expressed as , the third vector is expressed as ;
[0212] Perform a determinant calculation, and the resulting determinant calculation result D is ;
[0213] If D is less than the set minimum value, then:
[0214] The first proportional position sc is 0;
[0215] If then the second proportional position tc is , otherwise the second proportional position tc is ;
[0216] If D is not less than the set minimum value, then:
[0217] The first proportional position sc is , the second proportional position tc is ;
[0218] Normalize the first proportional position and the second proportional position to obtain the normalized first proportional position as , the normalized second proportional position is ;
[0219] Calculate the nearest point on the centerlines of the two pipelines using the following formula: In the formula is the nearest point on the centerline of the first pipeline; is the nearest point on the centerline of the second pipeline;
[0220] According to and , perform the positioning of the corresponding floor plane: accurately position on the floor plane through the elevation of the center position between the two nearest points.
[0221] The following combines an embodiment to illustrate the effect of the method of the present invention:
[0222] The object of this embodiment is the Revit model file of the second basement floor designed by a certain construction company. The test environment is Revit2020 and Visual Studio2022, and the test data set is the floor planes in this model, including 24 floor planes, and the size of the model file is 242.64MB.
[0223] The method of the present invention is compared with the existing original scheme, grid optimization scheme, and spatial hashing scheme: among them, the original scheme is the one proposed by Li Changjie et al. in the paper "BIM-based Pipeline Optimization Method" in 2019; the grid optimization scheme is the one proposed by Wang Zhenwen et al. in the paper "Collision Detection Algorithm Based on Topological Space Grid in Complex Scenes" in 2017; the spatial hashing scheme is based on the method proposed by Kyungjin Kang in the paper "Hash-Based Method for Generating Building Information Models From 2D CAD Drawings" in 2024, which applies the hashing strategy to the automatic generation of 3D models from 2D drawings, and this scheme applies the hashing strategy to 3D space.
[0224] The test results are shown in Table 1, and the comparison curve graph is as Figure 3 shown;
[0225]
[0226] Through Table 1 and Figure 3 it can be seen that the detection results obtained by the four methods are the same, but there are significant differences in the detection time; during the 10 experiments, the detection time of the loop traversal detection method of the original scheme is the highest, with an average value of 4504.10 ms; the detection time of the grid optimization method is the second, with an average value of 4092.00 ms; the spatial hashing method has a great improvement compared with the former two, and the average detection time is reduced to 885.90 ms, and the detection results are more stable; while the method of the present invention further reduces the average detection time to 609.00 and further improves the stability of the detection time.
[0227] Therefore, through the comparative experiment, it can be known that the scheme of the present invention has a great improvement in both the average detection time and the detection stability compared with the original scheme, the method using the grid optimization scheme, and the spatial hashing scheme.
[0228] Such as Figure 4The following is a schematic diagram of the functional modules of the system of the present invention: The system for implementing the pipeline collision detection method in the BIM model disclosed by the present invention includes a data acquisition module, a data selection module, a mesh division module, a hard collision detection module, a soft collision detection module, a severity detection module, and a positioning detection module; the data acquisition module, the data selection module, the mesh division module, the hard collision detection module, the soft collision detection module, the severity detection module, and the positioning detection module are connected in series in sequence; the data acquisition module is used to acquire the data information of the target BIM model and upload the data information to the data selection module; the data selection module is used to select all the pipeline and structure information of the set floor according to the received data information and upload the data information to the mesh division module; the mesh division module is used to perform mesh division on the selected pipelines based on the particle swarm algorithm according to the received data information and upload the data information to the hard collision detection module; the hard collision detection module is used to perform hard collision detection on the pipelines using the spatial hashing algorithm according to the received data information and the mesh division result and upload the data information to the soft collision detection module; the soft collision detection module is used to perform soft collision detection on the pipelines according to the positional relationship, distance relationship, and included angle relationship of the centerlines of any two pipelines and upload the data information to the severity detection module; the severity detection module is used to perform soft collision severity detection on the pipelines according to the shortest distance between the centerlines of any two pipelines and the set minimum allowable distance and upload the data information to the positioning detection module; the positioning detection module is used to perform positioning detection on the soft collision of the pipelines according to the positional information and intersection point information of any two pipelines in the plan view or three-dimensional view according to the received data information.
[0229] In specific implementation, the method or system of the present invention can be formed into a Revit plug-in, so as to be embedded into the Revit software to achieve the detection and positioning of collisions. In addition, in the plug-in, a corresponding visualization module can also be added to display and specially mark the detection and positioning results of collisions and other contents.
Claims
1. A method for detecting pipe collisions in a BIM model, characterized in that It includes the following steps: S1. Obtain the data information of the target BIM model; S2. Select all the pipeline and structure information of the set floor according to the data information obtained in step S1; S3. Based on the particle swarm algorithm, perform mesh division on the pipelines selected in step S2; specifically, it includes the following steps: Perform mesh division on the pipelines selected in step S2; According to the median and interquartile range of the pipeline length list, the ideal grid cell size is calculated using the following formula: where s is the ideal grid cell size; mid is the median value of the pipeline length list; iqr is the interquartile range of the pipeline length list; Adopt the particle swarm optimization algorithm to optimize the mesh size: During the optimization process, each particle represents a candidate mesh size, set the search range, and randomly assign an initial velocity to each particle; In the performance dimension, based on the number of builds, the average build area, and the average build size, the performance dimension score is calculated using the following formula: Where is the performance dimension score; is the current position of the particle, used to represent the size of the current grid cell; is the average build size, and , a is the grid area, and c is the number of builds; In the quality dimension, analyze the ratio of the grid size to the minimum size of the component, and calculate the quality dimension score using the following formula: Wherein is the quality dimension score; is the minimum size of the component, and , is the maximum value of the component on the X-axis, is the minimum value of the component on the X-axis, is the maximum value of the component on the Y-axis, is the minimum value of the component on the Y-axis; In the ideal value dimension, based on the deviation degree between the grid-based current value and the grid ideal value, the ideal value dimension score is calculated using the following formula: where dev is the relative deviation between the current grid cell size and the ideal grid cell size, and , is the size of the ideal grid cell; Evaluate the particle fitness through weighted calculation by scoring in three dimensions of performance, quality, and ideal value; The velocity of the particle is updated using the following formula: where is the velocity of the nth particle after update; w is the inertia weight; is the velocity of the nth particle before update; is the cognitive parameter; R is the random weight; is the historical best position of the particle; is the position of the nth particle before update; is the social parameter; is the global best position of the particle; The position of the particle is updated using the following formula: where is the position of the nth particle before update; is the velocity of the nth particle after update; t is the unit time; After completing the set number of iterations, use the final global optimal position of the particle as the final mesh size; S4. According to the mesh division result obtained in step S3, adopt the spatial hashing algorithm to perform hard collision detection on the pipelines; S5. According to the positional relationship, distance relationship, and included angle relationship of the centerlines of any two pipelines, perform soft collision detection on the pipelines; S6. According to the shortest distance between the centerlines of any two pipelines and the set minimum allowable distance, perform detection on the severity of the soft collision of the pipelines, so as to complete the detection of pipeline collisions in the BIM model.
2. The pipeline collision detection method in the BIM model according to claim 1, wherein The specific steps of step S4 are as follows: According to the mesh division result of step S3, divide the continuous three-dimensional space into cubic meshes; Use a hash function to map the spatial coordinates of pipelines or structures in the space to a hash table to achieve fast access and query of spatial objects; According to the divided meshes, use the pipelines or structures in the same mesh unit as the potential collision pipeline targets of a pipeline; for potential collision elements, use the AABB bounding box method for detection: if there is an intersection between the AABB bounding boxes of pipelines or between a pipeline and a structure, it is determined that there is a hard collision.
3. The method for detecting pipe collisions in a BIM model according to claim 2, characterized in that The steps of step S5 include the following: The soft collision detection of pipelines includes the soft collision detection between pipelines and the soft collision detection between pipelines and structures; (1) Soft collision detection between pipelines: According to the radii of any two pipelines and the set minimum distance between the two pipelines, calculate the pipeline soft collision detection threshold; If the actual shortest distance between the two pipelines is less than the calculated pipeline soft collision detection threshold, it is determined that the two pipelines have a soft collision; otherwise, it is determined that the two pipelines do not have a soft collision; For two pipelines with a soft collision: If the centerlines of the two pipelines are not coplanar, it is directly determined that the soft collision of the two pipelines is a skew cross soft collision; If the centerlines of the two pipelines are coplanar: Calculate the cross product of the direction vectors of the centerlines of the two pipelines, and determine whether the soft collision is a coplanar collinear soft collision or a coplanar parallel soft collision according to the size of the cross product and the set compatible error tolerance and the straight-line distance between the centerlines of the two pipelines; If there is an intersection point between the centerlines of the two pipelines, calculate the distance and direction vector from the intersection point to each end point; if the intersection point is on the centerline of any pipeline, it is determined that the soft collision is a coplanar internal intersection soft collision; If the centerlines of two pipes have no intersection point, calculate the actual shortest distance between the two pipes: If the actual shortest distance between the two pipes is less than the set minimum allowable distance, then determine that the soft collision is a soft collision of coplanar extended line intersection; otherwise, determine it as other types; (2)Soft collision detection between pipes and structures: Calculate the soft collision detection threshold of the pipe structure according to the pipe radius and the set minimum distance between pipes; Obtain the shortest distance between the pipe centerline and the structure body, and compare it with the calculated soft collision detection threshold of the pipe structure: If the shortest distance between the pipe centerline and the structure body is greater than the soft collision detection threshold of the pipe structure, then determine that there is no soft collision between the pipe and the structure; otherwise, determine that there is a soft collision between the pipe and the structure; For the existing soft collision between the pipe and the structure, detect the type of soft collision between the pipe and the structure according to the shortest distance between the pipe centerline and the structure body and the number of intersection points of each surface of the structure body and the pipe centerline.
4. The method for detecting pipeline collisions in a BIM model according to claim 3, wherein The step S5 specifically includes the following steps: Soft collision detection of pipes includes soft collision detection between pipes and soft collision detection between pipes and structures; (1)Soft collision detection between pipes: According to the radii r1 and r2 of any two pipes and the set minimum distance input between the two pipes, the pipeline soft collision detection threshold min is calculated as ; If the actual shortest distance d between two pipes is less than the calculated soft collision detection threshold min of the pipes, then determine that there is a soft collision between the two pipes; otherwise, determine that there is no soft collision between the two pipes; Set the types of soft collisions between pipes to include non-coplanar cross soft collision, coplanar collinear soft collision, coplanar parallel soft collision, coplanar internal intersection soft collision, and coplanar extended line intersection soft collision; If the centerlines of two pipes with soft collisions are not coplanar, directly determine that the soft collision between the two pipes is a skew cross soft collision; set the nearest collision points as p1 and p2, and the X-axis coordinate, Y-axis coordinate, and Z-axis coordinate of p1 are , and the X-axis coordinate, Y-axis coordinate, and Z-axis coordinate of p2 are . Calculate the actual distance between the two collision points as . Calculate the included angle between the direction vectors of the centerlines of the two pipes as , where d1 is the direction vector of the centerline of the first pipe among the two pipes, d2 is the direction vector of the centerline of the second pipe among the two pipes, is the modulus of the direction vector of the centerline of the first pipe, is the modulus of the direction vector of the centerline of the second pipe; If the centerlines of two pipes are coplanar: Calculate the cross product of the direction vectors of the centerlines of the two pipes: If the modulus of the cross product is less than the set relative error tolerance, and the straight-line distance between the centerlines of the two pipes is less than the set threshold, then determine that the soft collision is a coplanar collinear soft collision; if the modulus of the cross product is less than the set relative error tolerance, and the straight-line distance between the centerlines of the two pipes is not less than the set threshold, then determine that the soft collision is a coplanar parallel soft collision; If the centerlines of two pipes have an intersection point, calculate the distance and direction vector from the intersection point to the endpoints of the centers of the two pipes: If the intersection point is on any pipe centerline, then determine that the soft collision is a coplanar internal intersection soft collision; If the centerlines of the two pipes have no intersection point, calculate the actual shortest distance between the two pipes is , where is the distance from the intersection point p of the extended lines of the centerlines of the two pipes to the first endpoint A of the centerline of the first pipe, is the distance from the intersection point p of the extended lines of the centerlines of the two pipes to the second endpoint B of the centerline of the first pipe, is the distance from the intersection point p of the extended lines of the centerlines of the two pipes to the first endpoint C of the centerline of the second pipe, is the distance from the intersection point p of the extended lines of the centerlines of the two pipes to the second endpoint D of the centerline of the second pipe; if the actual shortest distance between the two pipes is less than the set minimum allowable distance, it is determined that the soft collision is a soft collision of coplanar extended line intersection; otherwise, it is determined as other types; (2)Soft collision detection between pipes and structures: According to the pipe radius and the minimum distance between the set pipes , the soft collision detection threshold of the pipe structure is calculated to be ; Obtain the shortest distance between the pipeline centerline and the structure and compare it with the calculated soft collision detection threshold for the pipeline structure : If the shortest distance between the pipeline centerline and the structure is greater than the soft collision detection threshold for the pipeline structure , it is determined that there is no soft collision between the pipeline and the structure; otherwise, it is determined that there is a soft collision between the pipeline and the structure; Set the types of soft collisions between pipes and structures to include pipe penetrating structure soft collision, pipe tangent to structure soft collision, and pipe approaching structure soft collision; For the existing soft collision between the pipe and the structure, detect the type of soft collision between the pipe and the structure: If the shortest distance between the pipeline centerline and the structure is 0, and the number of intersection points between each surface of the structure and the pipeline centerline is not less than 2, then it is determined that the soft collision between the pipeline and the structure is a pipeline penetration structure soft collision; If the shortest distance between the pipeline centerline and the structure is not 0 and the difference from 0 is less than the set value, it is determined that the soft collision between the pipeline and the structure is a tangential soft collision between the pipeline and the structure; If the shortest distance between the pipeline centerline and the structure is not 0 and the difference from 0 is greater than or equal to the set value, it is determined that the soft collision between the pipeline and the structure is a near soft collision between the pipeline and the structure; Among them, the shortest distance between the pipeline centerline and the structure is obtained by the following steps: Obtain the data information of the two endpoints of the pipe centerline and each surface of the structure body; Traverse the relationship between each face and the pipe center line, and check the intersection of the pipe center line and the face: if there is an intersection point, directly determine it as 0 and stop traversing; if there is no intersection point, project the endpoints of the pipe center line onto the current face, and take the minimum value of the distance between the endpoints and the corresponding projection points as the shortest distance between the pipe center line and the structure . If there is no intersection point, project the endpoints of the pipe center line onto the current face, and take the minimum value of the distance between the endpoints and the corresponding projection points as the shortest distance between the pipe center line and the structure .
5. The pipeline collision detection method in the BIM model according to claim 4, wherein The step S6 specifically includes the following steps: Set the severity of the soft collision of the pipe to include fatal, severe, medium, and minor; For the detection of the severity of the soft collision between pipes: If the actual shortest distance d between two pipes is less than 0, or the soft collision detection threshold min of the pipes is not greater than 0, then determine that the severity is fatal; If the actual shortest distance d between two pipes is not less than 0 and the soft collision detection threshold min of the pipes is greater than 0, then calculate the collision degree value ratio between the pipes as ; For coplanar internal intersection soft collision and coplanar collinear soft collision, determine that the severity is fatal; For non-coplanar cross soft collision, coplanar parallel soft collision, and coplanar extended line intersection soft collision, if then the severity is determined to be fatal, if then the severity is determined to be severe, if then the severity is determined to be medium, if then the severity is determined to be minor; For the detection of the severity of the soft collision between pipes and structures: If the shortest distance between the pipeline centerline and the structure is less than 0 or the pipeline structure soft collision detection threshold is not greater than 0, it is determined that the severity is fatal; If the shortest distance between the pipeline centerline and the structure is not less than 0 or the soft collision detection threshold of the pipeline structure is greater than 0, then calculate the pipeline-structure collision degree value as ; For the soft collision of the pipe penetration structure, the severity is determined to be fatal; For the soft collision of the pipe tangent to the structure, the severity is determined to be severe; For the soft collision between the pipeline and the structure, if then the severity is determined to be fatal. If then the severity is determined to be severe. If then the severity is determined to be medium. If then the severity is determined to be minor.
6. A positioning method including the pipeline collision detection method in the BIM model according to any one of claims 1 to 5, characterized in that It also includes the following steps: S7. According to the position information and intersection information of any two pipes in the plan view or 3D view, perform the positioning detection of the soft collision of the pipes.
7. The positioning method according to claim 6, wherein The step S7 includes the following steps: The positioning detection of the soft collision of the pipes includes the plan view positioning detection and the 3D view positioning detection; The plan view positioning detection is suitable for viewing the layout of the BIM model on the plane and the planar relationship between the components; the 3D view positioning detection is suitable for viewing the positional relationship of the BIM model in three dimensions and the interaction effect between the components; Plan view positioning detection: For other soft collisions of non-skew cross soft collisions, directly obtain the corresponding collision point coordinates; according to the Z-axis coordinate of the collision point coordinates, directly perform the positioning of the corresponding floor plane; For skew cross soft collisions, project the direction vectors of the centerlines of the two pipes onto the XY plane and perform cross calculations to obtain the projection information of the direction vectors of the centerlines on the XY plane, and calculate the intersection point coordinate information of the skew cross through the projection information and the starting point coordinates of the centerlines of the two pipes; according to the intersection point coordinate information of the skew cross, perform the positioning of the corresponding floor plane; 3D view positioning detection: For other soft collisions of non-skew cross soft collisions, directly obtain the corresponding collision point coordinates; according to the Z-axis coordinate of the collision point coordinates, directly perform the positioning of the corresponding floor plane; For skew cross soft collisions, construct vectors based on the starting and ending points of the centerlines of the two pipes and perform determinant calculations; according to the determinant calculation results, calculate the proportional position of the nearest point on the centerlines of the two pipes relative to the starting point of their respective line segments and normalize it, and finally calculate the nearest point on the centerlines of the two pipes according to the normalized proportional position; according to the obtained nearest points on the centerlines of the two pipes, perform the positioning of the corresponding floor plane.
8. The positioning method according to claim 7, wherein The step S7 specifically includes the following steps: A. Plan view positioning detection: For other soft collisions of non-skew cross soft collisions, directly obtain the corresponding collision point coordinates; according to the Z-axis coordinate of the collision point coordinates, directly perform the positioning of the corresponding floor plane; For skew cross soft collisions: Set P1 to represent the starting point of the center line of the first pipe, and the corresponding X-axis coordinate and Y-axis coordinate are ; Set P2 to represent the starting point of the center line of the second pipe, and the corresponding X-axis coordinate and Y-axis coordinate are ; v1 is the direction vector of the center line of the first pipe, and v2 is the direction vector of the center line of the second pipe; the coordinate of v1 on the X-axis is , the coordinate of v1 on the Y-axis is , the coordinate of v2 on the X-axis is , the coordinate of v2 on the Y-axis is ; The projection vectors of v1 and v2 on the XY plane are calculated using the following formula: In the formula is the projection vector of v1 on the XY plane; is the projection vector of v2 on the XY plane; The intersection parameter t is calculated using the following formula: where is the Y-axis coordinate of is the X-axis coordinate of is the X-axis coordinate of is the Y-axis coordinate of The coordinate information of the intersection point of skew crossing is calculated using the following formula: In the formula is the X-axis coordinate of the intersection point Q of the skew crossing; is the Y-axis coordinate of the intersection point Q of the skew crossing; is the Z-axis coordinate of the intersection point Q of the skew crossing; According to the coordinate information of the intersection point Q of the skew cross, perform the positioning of the corresponding floor plane: obtain the associated elevation according to the current active view, and obtain the current floor plane through the elevation; if the elevation cannot be obtained, return the default value 0; B. 3D view positioning detection: For other soft collisions of non-skew cross soft collisions, directly obtain the corresponding collision point coordinates; according to the Z-axis coordinate of the collision point coordinates, directly perform the positioning of the corresponding floor plane; For skew cross soft collisions: Set the starting endpoint of the centerline of the first pipeline as , and the terminating endpoint as ; The starting endpoint of the centerline of the second pipeline is , and the terminating endpoint is ; then the first vector is expressed as , the second vector is expressed as , and the third vector is expressed as ; Perform the determinant calculation to obtain the determinant calculation result D as ; If D is less than the set minimum value, then: The first proportional position sc is 0; If then the second proportional position tc is , otherwise the second proportional position tc is ; If D is not less than the set minimum value, then: The first proportional position sc is , and the second proportional position tc is ; Normalize the first proportional position and the second proportional position to obtain a normalized first proportional position be , a normalized second proportional position be ; The closest points on the centerlines of two pipelines are calculated using the following formula: In the formula is the closest point on the centerline of the first pipeline; is the closest point on the centerline of the second pipeline; According to and , perform the positioning of the corresponding floor plan: accurately position on the floor plan through the elevation of the central position between the two nearest points.
9. A system for implementing the positioning method according to any one of claims 6 to 8, characterized in that It includes a data acquisition module, a data selection module, a grid division module, a hard collision detection module, a soft collision detection module, a severity detection module, and a positioning detection module; the data acquisition module, the data selection module, the grid division module, the hard collision detection module, the soft collision detection module, the severity detection module, and the positioning detection module are connected in series in sequence; the data acquisition module is used to acquire the data information of the target BIM model and upload the data information to the data selection module; The data selection module is used to select all the pipeline and structural information of the set floor according to the received data information and upload the data information to the grid division module; The grid division module is used to perform grid division on the selected pipelines based on the particle swarm optimization algorithm according to the received data information and upload the data information to the hard collision detection module; the hard collision detection module is used to perform hard collision detection on the pipelines using the spatial hashing algorithm according to the received data information and the grid division result and upload the data information to the soft collision detection module; the soft collision detection module is used to perform soft collision detection on the pipelines according to the positional relationship, distance relationship, and included angle relationship of the centerlines of any two pipelines and upload the data information to the severity detection module; The severity detection module is used to perform soft collision severity detection on the pipelines according to the shortest distance between the centerlines of any two pipelines and the set minimum allowable distance and upload the data information to the positioning detection module; the positioning detection module is used to perform positioning detection of the soft collision of the pipelines according to the received data information and the positional information and intersection information of any two pipelines in the plan view or 3D view.
Citation Information
Patent Citations
Municipal pipeline construction method based on BIM technology
CN110889160A
Grid and bounding box-based collision detection method
CN112669434A
Feature-based spatial hash continuous collision detection method
CN112802203A