A three-dimensional model collision detection method, device, electronic equipment and medium
By performing collision detection directly in 3D modeling software, the problem of needing to use other software for model data conversion in existing technologies is solved, achieving efficient collision detection and design optimization.
Patent Information
- Application Number
- CN202210425176.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-22
- Publication Date
- 2026-01-27
- Estimated Expiration
- 2042-04-22
AI Technical Summary
Existing BIM modeling software cannot complete building information creation and collision detection on a single software, requiring the use of other software for model data conversion, resulting in low work efficiency for designers.
This paper provides a 3D model collision detection method. By creating a target model in 3D modeling software, collision detection is performed directly. The collision detection algorithm is used to identify colliding objects and calculate collision points. The method supports collision detection algorithms for different types of building components.
It improves the work efficiency of designers, enabling comprehensive detection of collision points during the design phase, assisting in optimizing design solutions, and enhancing the reliability of design solutions.
Smart Images

Figure CN114782627B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of BIM technology, and more specifically, to a three-dimensional model collision detection method, device, electronic device, and medium. Background Technology
[0002] Building Information Modeling (BIM) is a new technology in architecture, engineering, and civil engineering. It describes computer-aided design methods that primarily use 3D graphics, are object-oriented, and relate to architecture. BIM can be applied not only in design but also throughout the entire lifecycle of a construction project; BIM-based design falls under digital design. During the BIM model design process, architects, structural engineers, and MEP (Mechanical, Electrical, and Plumbing) designers need to periodically compile their work for comprehensive pipeline analysis and layout. This is primarily to address later construction issues arising from pipeline conflicts or clashes between disciplines during the design phase, and to promptly adjust conflicts in the design drawings. This reduces construction changes and costs during the construction phase, ensuring that the design content is more accurately reflected on the drawings.
[0003] However, in traditional 2D design, it is difficult to detect collisions between building components from different disciplines through a single professional review. While existing BIM modeling software also has collision detection capabilities, it cannot complete the creation of building information and then perform collision detection within a single BIM modeling software. Often, it is necessary to use another BIM software and manually convert the model data to better complete the collision detection, which greatly reduces the work efficiency of designers.
[0004] Therefore, how to solve the above problems is an urgent issue that needs to be addressed. Summary of the Invention
[0005] This application provides a three-dimensional model collision detection method, apparatus, electronic device, and medium, aiming to improve the above-mentioned problems.
[0006] In a first aspect, this application provides a three-dimensional model collision detection method, which includes: creating a target three-dimensional model; identifying at least two collision objects to be collided in the target three-dimensional model; and performing collision detection on the at least two collision objects based on a collision detection algorithm to obtain collision points.
[0007] It is understandable that this application, by creating a 3D model in 3D modeling software and then directly performing collision detection on the created model, eliminates the need for collision detection using other 3D software, thereby significantly improving the work efficiency of designers.
[0008] In one possible embodiment, determining at least two collision objects to be collision detected in the target 3D model includes: receiving a model display instruction; splitting the target 3D model into multiple model objects according to the model display instruction, and displaying the multiple model objects; receiving an object confirmation instruction input by a user based on the multiple model objects; and determining at least two collision objects to be collision detected from the multiple model objects according to the object confirmation instruction.
[0009] It is understandable that in this implementation, since users only need to determine the objects to be detected after creating the building information model, collision detection can be started, making the collision detection operation more convenient and faster, and further improving the work efficiency of designers.
[0010] In one possible embodiment, the at least two collision objects include a first collision object and a second collision object. The first collision object includes a first model component, and the second collision object includes a second model component. The step of performing collision detection on the at least two collision objects based on a collision detection algorithm to obtain a collision point includes: determining whether the first model component and the second model component belong to the same type; if not, performing collision detection on the first model component and the second model component based on the first collision detection algorithm to obtain a collision point; if they belong to the same type, determining whether the model outline corresponding to the first model component and the model outline corresponding to the second model component overlap; if so, designating the first model component and the second model component as undetermined collision points; and determining whether the undetermined collision point is a collision point based on a second collision detection algorithm.
[0011] Understandably, different collision point calculation schemes are designed for different types of building components to facilitate comprehensive detection of collision points, ensuring that all collision points are detected during the design phase. This helps designers optimize design schemes and improve their reliability.
[0012] In one possible embodiment, the step of performing collision detection on the first model component and the second model component based on the first collision detection algorithm to obtain the collision point includes: when determining that the first model component is a building component and the second model component is a pipe, obtaining the pipe centerline of the pipe and the center plane of the building component; determining whether the pipe centerline and the center plane of the building component are parallel; if parallel, calculating a first average distance from the pipe centerline to the first surface of the building component and a second average distance from the pipe centerline to the edge of the pipe; if the first average distance is greater than the second average distance, determining that the first model component and the second model component do not collide; if the first average distance is less than the second average distance, determining that the first model component and the second model component collide, and obtaining the collision point.
[0013] Understandably, collision detection of different building components by their relative positions can increase the probability of detecting all collision points during the design phase, thus helping designers optimize design schemes and improve their reliability.
[0014] In one possible embodiment, the method further includes: when the centerline of the pipe is not parallel to the central plane of the building component, determining whether the centerline of the pipe is within the three-dimensional space of the building component; if not, determining that there is no collision; if the centerline of the pipe is within the three-dimensional space of the building component, determining whether the starting point and ending point of the centerline of the pipe are located on both sides of the central plane of the building component; if the starting point and ending point of the centerline of the pipe are distributed on both sides of the central plane of the building component, determining that the first model component and the second model component collide, and obtaining the collision point; if the starting point and ending point of the centerline of the pipe are distributed on the same side of the central plane of the building component, determining that there is no collision.
[0015] In one possible embodiment, determining whether the undetermined collision point is a collision point based on the second collision detection algorithm includes: identifying whether the first model component and the second model component are pipe-to-pipe collisions based on the model's architectural information; if so, determining whether the first pipe centerline of the first model component and the second pipe centerline of the second model component are parallel; if parallel, calculating a first distance from the first pipe centerline to the pipe edge of the first model component, a second distance from the second pipe centerline to the pipe edge of the second model component, and a third distance between the first pipe centerline and the second pipe centerline; determining whether the sum of the first distance and the second distance is greater than the third distance; if less than the third distance, determining that the undetermined collision point is not a collision point; if greater than the third distance, determining that the undetermined collision point is a collision point.
[0016] Understandably, by comparing the relative positions of similar building components to perform collision detection on different building components, the probability of detecting all collision points during the design phase can be increased, which helps designers optimize design schemes and improve their reliability.
[0017] In one possible embodiment, the method further includes: if the center line of the first pipe of the first model component is not parallel to the center line of the second pipe of the second model component, determining whether there is a first intersection point of the extension line of the first pipe center line on the center line of the second pipe; if the first intersection point exists, determining a second intersection point of the extension line of the first pipe center line within the first model component; calculating a fourth distance from the first intersection point to the edge of the pipe of the first model component, a fifth distance from the second intersection point to the edge of the pipe of the second model component, and a sixth distance between the first intersection point and the second intersection point; determining whether the sum of the fourth distance and the fifth distance is greater than the sixth distance; if it is less than the sixth distance, determining the undetermined collision point is not a collision point; if it is greater than the sixth distance, determining the undetermined collision point is a collision point.
[0018] Secondly, this application provides a three-dimensional model collision detection device, the device comprising: a model creation unit for creating a target three-dimensional model; a collision object determination unit for determining at least two collision objects to be collision detected in the target three-dimensional model; and a collision detection unit for performing collision detection on the at least two collision objects based on a collision detection algorithm to obtain collision points.
[0019] Furthermore, the technical effects of the three-dimensional model collision detection device described in the second aspect can be referred to the technical effects of the three-dimensional model collision detection method described in the first aspect, and will not be repeated here.
[0020] Thirdly, this application provides an electronic device, comprising: a memory for storing executable instructions; and a processor for implementing the three-dimensional model collision detection method as described in any of the first aspects when executing the executable instructions stored in the memory.
[0021] Fourthly, this application provides a computer-readable storage medium storing a computer program, which, when executed by a processing device, performs the steps of the three-dimensional model collision detection method as described in any of the first aspects. Attached Figure Description
[0022] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0023] Figure 1 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application;
[0024] Figure 2 A flowchart of a three-dimensional model collision detection method provided in this application embodiment;
[0025] Figure 3 for Figure 2 The figure shown is an example of collision detection in a three-dimensional model collision detection method.
[0026] Figure 4 for Figure 2 The figure shown is another example of collision detection in a three-dimensional model collision detection method;
[0027] Figure 5a for Figure 2 The figure shown is another example of collision detection in a three-dimensional model collision detection method;
[0028] Figure 5b for Figure 2 The figure shown is another example of collision detection in a three-dimensional model collision detection method;
[0029] Figure 6 for Figure 2 The figure shown is another example of collision detection in a three-dimensional model collision detection method;
[0030] Figure 7 This is a schematic diagram of the functional modules of a three-dimensional model collision detection device provided in an embodiment of this application. Detailed Implementation
[0031] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0032] Example
[0033] Figure 1This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. In this application, it can be... Figure 1 The schematic diagram shown illustrates an electronic device 100 used to implement an example of a three-dimensional model collision detection method and apparatus according to embodiments of this application.
[0034] like Figure 1 The diagram shows the structure of an electronic device 100. The electronic device 100 includes one or more processors 102, one or more storage devices 104, input devices 106, and output devices 108. These components are interconnected via a bus system and / or other forms of connection mechanisms (not shown). It should be noted that... Figure 1 The components and structure of the electronic device 100 shown are merely exemplary and not limiting; the electronic device may have, as needed. Figure 1 The components shown may also have Figure 1 Other components and structures not shown.
[0035] The processor 102 may be a central processing unit (CPU) or other processing unit with three-dimensional model collision detection capability and / or instruction execution capability, and may control other components in the electronic device 100 to perform the desired function.
[0036] It should be understood that the processor 102 in the embodiments of this application may be a central processing unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc.
[0037] The storage device 104 may include one or more computer program products, which may include various forms of computer-readable storage media.
[0038] It should be understood that the storage device 104 in the embodiments of this application may be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory may be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of random access memory (RAM) are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate synchronous DRAM (DDR SDRAM), enhanced synchronous DRAM (ESDRAM), synchronous linked DRAM (SLDRAM), and direct rambus RAM (DR RAM).
[0039] The computer-readable storage medium may store one or more computer program instructions, which the processor 102 may execute to implement the client functions (implemented by the processor) in the embodiments of this application described below, and / or other desired functions. Various applications and various data may also be stored in the computer-readable storage medium, such as various data used and / or generated by the applications.
[0040] The input device 106 may be a device used by a user to input commands, and may include one or more of the following: keyboard, mouse, microphone, and touch screen.
[0041] For example, Figure 2 A collision detection method for a 3D model is shown, which specifically includes the following steps:
[0042] Step S201: Create a target 3D model.
[0043] The specific model of the target 3D model can be created according to user needs, and no specific limitations are made here.
[0044] It is understood that, in this application, users (or designers) can directly create 3D models using 3D modeling software that performs the 3D model collision detection method.
[0045] Step S203: Identify at least two collision objects to be detected in the target 3D model.
[0046] It should be understood that the execution of step S203 and the execution of step S201 belong to the same environment.
[0047] As one implementation, step S203 includes: receiving a model display instruction; splitting the target 3D model into multiple model objects according to the model display instruction, and displaying the multiple model objects; receiving an object confirmation instruction input by a user based on the multiple model objects; and determining at least two collision objects to be collision detected from the multiple model objects according to the object confirmation instruction.
[0048] The model display command is input by the user through the interface of the 3D modeling software. For example, the model display command can be generated by clicking on the interface.
[0049] It should be understood that a target 3D model consists of at least multiple model objects.
[0050] For example, after a designer creates a 3D model, they input a model display command through the interface of the 3D modeling software. Upon receiving the model display command, the 3D modeling software splits the target 3D model into multiple model objects and displays these multiple model objects. At this time, the designer can select two objects from the displayed multiple model objects as collision detection collision objects (e.g., by clicking or double-clicking (i.e., the object confirmation command) to select model objects, and the selected model objects are the collision objects).
[0051] It is understandable that in this embodiment, the use of visualization allows designers to select collision objects according to their needs. Designers do not need to recall the names or types of model objects in the target 3D model they created. They can directly select collision objects by simply choosing from the displayed model objects, which simplifies the designer's operation and improves the designer's work efficiency.
[0052] In other words, in this application, after the designer creates the building information model, they only need to make simple settings for the objects to be detected to enter the collision detection process, without the need for data format conversion or the use of other software.
[0053] Step S205: Perform collision detection on the at least two colliding objects based on the collision detection algorithm to obtain the collision point.
[0054] In one implementation, the at least two collision objects include a first collision object and a second collision object. The first collision object includes a first model component, and the second collision object includes a second model component. Step S205 includes: determining whether the first model component and the second model component belong to the same type; if not, performing collision detection on the first model component and the second model component based on a first collision detection algorithm to obtain a collision point; if they belong to the same type, determining whether the model outline corresponding to the first model component and the model outline corresponding to the second model component have an intersection or overlap; if so, taking the first model component and the second model component as undetermined collision points; and determining whether the undetermined collision points are collision points based on a second collision detection algorithm.
[0055] In the above implementation method, different collision point calculation schemes are designed for different types of building components, so as to conduct comprehensive detection of collision points and detect all collision points in the design stage, which helps designers optimize the design scheme and improve the reliability of the design scheme.
[0056] Optionally, the step of performing collision detection on the first model component and the second model component based on the first collision detection algorithm to obtain the collision point includes: when determining that the first model component is a building component and the second model component is a pipe, obtaining the pipe centerline of the pipe and the center plane of the building component; determining whether the pipe centerline and the center plane of the building component are parallel; if parallel, calculating the first average distance from the pipe centerline to the first surface of the building component and the second average distance from the pipe centerline to the edge of the pipe; if the first average distance is greater than the second average distance, determining that the first model component and the second model component have no collision; if the first average distance is less than the second average distance, determining that the first model component and the second model component have a collision, and obtaining the collision point.
[0057] It should be noted that the first surface refers to the surface of the building component that is closest to the pipe.
[0058] For example, such as Figure 3As shown, assuming the building components are floor slabs and the pipes are air ducts, let's take air duct 1 as an example. Obtain the centerline of air duct 1 and the center plane of the floor slab; determine if the centerline of air duct 1 is parallel to the center plane of the floor slab; if parallel, calculate the first average distance from the centerline of air duct 1 to the first surface of the floor slab and the second average distance from the centerline of air duct 1 to the edge of air duct 1; if the first average distance is greater than the second average distance, determine that air duct 1 does not collide with the floor slab; if the first average distance is less than the second average distance, determine that air duct 1 collides with the floor slab (i.e.,...). Figure 3 (The collision point is obtained by colliding the central duct 2 with the floor slab).
[0059] It should be noted that, Figure 3 In the text, "duct 2" is a mark for duct 1 at different locations, not different ducts.
[0060] It should be understood that Figure 3 This is merely an example, not a limitation.
[0061] Optionally, when the centerline of the pipe is not parallel to the central plane of the building component, it is determined whether the centerline of the pipe is within the three-dimensional space of the building component; if not, it is determined that there is no collision; if the centerline of the pipe is within the three-dimensional space of the building component, it is determined whether the starting point and ending point of the centerline of the pipe are located on both sides of the central plane of the building component; if the starting point and ending point of the centerline of the pipe are distributed on both sides of the central plane of the building component, it is determined that the first model component and the second model component collide, and the collision point is obtained; if the starting point and ending point of the centerline of the pipe are distributed on the same side of the central plane of the building component, it is determined that there is no collision.
[0062] For example, such as Figure 4 As shown, when the centerline of the duct is not parallel to the center plane of the building component, it is determined whether the centerline of duct 1 is within the three-dimensional space of the floor slab; if not, it is determined to be non-collision (i.e., duct 1 does not collide with the floor slab); if the centerline of duct 1 is within the three-dimensional space of the floor slab, it is determined whether the starting point and ending point of the centerline of duct 1 are located on both sides of the center plane of the floor slab; if the starting point and ending point of the centerline of duct 1 are distributed on both sides of the center plane of the floor slab (e.g., ... Figure 4 If the first model component collides with the second model component (i.e., duct 2 collides with the floor slab), the collision point is determined; if the starting point and ending point of the center line of duct 1 are located on the same side of the center plane of the floor slab, then it is determined that there is no collision (i.e., duct 2 collides with the floor slab). Figure 4 (The air duct 3 in the middle does not collide with the floor slab).
[0063] It should be noted that, Figure 4In the text, duct 2 and duct 3 are markings of duct 1 at different locations, not different ducts.
[0064] It should be understood that Figure 4 This is merely an example, not a limitation.
[0065] Understandably, collision detection of different building components by their relative positions can increase the probability of detecting all collision points during the design phase, thus helping designers optimize design schemes and improve their reliability.
[0066] Optionally, determining whether the undetermined collision point is a collision point based on the second collision detection algorithm includes: identifying whether the first model component and the second model component are pipe-to-pipe collisions based on the model's architectural information; if so, determining whether the first pipe centerline of the first model component and the second pipe centerline of the second model component are parallel; if parallel, calculating the first distance from the first pipe centerline to the pipe edge of the first model component, the second distance from the second pipe centerline to the pipe edge of the second model component, and the third distance between the first pipe centerline and the second pipe centerline; determining whether the sum of the first distance and the second distance is greater than the third distance; if less than the third distance, determining that the undetermined collision point is not a collision point; if greater than the third distance, determining that the undetermined collision point is a collision point.
[0067] For example, such as Figure 5a and Figure 5b As shown, since box1 and box2 belong to the same type, and the outer frame of the first model component box1 and the outer frame of the second model component box2 overlap, they are recorded as undetermined collision points. Further, after determining an undetermined collision point, when the collision detection is between pipes of the first model component and the second model component, it is determined whether the first pipe centerline of the first model component and the second pipe centerline of the second model component are parallel. If they are parallel, the first distance A1 from the first pipe centerline to the pipe edge of the first model component, the second distance A2 from the second pipe centerline to the pipe edge of the second model component, and the third distance B between the first pipe centerline and the second pipe centerline are calculated respectively. It is determined whether the sum of the first distance A1 and the second distance A2 is greater than the third distance B. If it is less than the third distance B, the undetermined collision point is determined to be a non-collision point; if it is greater than the third distance B, the undetermined collision point is determined to be a collision point.
[0068] It should be understood that Figure 5a and Figure 5b This is merely an example, not a limitation.
[0069] Understandably, by comparing the relative positions of similar building components to perform collision detection on different building components, the probability of detecting all collision points during the design phase can be increased, which helps designers optimize design schemes and improve their reliability.
[0070] In one possible embodiment, the method further includes: if the center line of the first pipe of the first model component is not parallel to the center line of the second pipe of the second model component, determining whether there is a first intersection point of the extension line of the first pipe center line on the center line of the second pipe; if the first intersection point exists, determining a second intersection point of the extension line of the first pipe center line within the first model component; calculating a fourth distance from the first intersection point to the edge of the pipe of the first model component, a fifth distance from the second intersection point to the edge of the pipe of the second model component, and a sixth distance between the first intersection point and the second intersection point; determining whether the sum of the fourth distance and the fifth distance is greater than the sixth distance; if it is less than the sixth distance, determining the undetermined collision point is not a collision point; if it is greater than the sixth distance, determining the undetermined collision point is a collision point.
[0071] Optionally, the fourth distance from the first intersection point to the pipe edge of the first model component, the fifth distance from the second intersection point to the pipe edge of the second model component, and the sixth distance between the first intersection point and the second intersection point are calculated respectively, including:
[0072] When there are multiple first intersection points, the first intersection point with the shortest distance to the second intersection point is determined as the target first intersection point.
[0073] Calculate the fourth distance from the first intersection point of the target to the pipe edge of the first model component, the fifth distance from the second intersection point to the pipe edge of the second model component, and the sixth distance between the first intersection point and the second intersection point of the target.
[0074] For example, such as Figure 6As shown, at this time, the center line of the first pipe of the first model component is not parallel to the center line of the second pipe of the second model component (i.e., the center lines of duct B and duct A are not parallel). Since the intersection of the extension of the center line of the first pipe of duct B and the center line of the second pipe of duct A is located on the center line of the second pipe, there is a first intersection point (i.e., intersection points A1 and A2 in the figure); if the first intersection point exists, determine the second intersection point (i.e., intersection point B) of the extension of the center line of the first pipe within the first model component; when there are multiple first intersection points, determine the first intersection point with the shortest distance to the second intersection point among the multiple first intersection points as the target first intersection point (i.e., A1 in the figure is the target first intersection point); calculate the fourth distance from intersection point A1 to the pipe edge of the first model component, the fifth distance from intersection point B to the pipe edge of the second model component, and the sixth distance between intersection point A1 and intersection point B; determine whether the sum of the fourth distance and the fifth distance is greater than the sixth distance; if it is less than the sixth distance, determine the undetermined collision point as a non-collision point; if it is greater than the sixth distance, determine the undetermined collision point as a collision point.
[0075] It should be understood that Figure 6 This is merely an example, not a limitation.
[0076] In one possible embodiment, after step S205, the three-dimensional model collision detection method further includes:
[0077] Determine the three-dimensional coordinates of the collision point.
[0078] Optionally, determining the three-dimensional coordinates of the collision point includes:
[0079] Determine the intersection area between the first model component and the second model component;
[0080] The three-dimensional coordinates of a point randomly selected from the intersecting region are used as the three-dimensional coordinates of the collision point.
[0081] In one possible embodiment, after determining the three-dimensional coordinates of the collision point, the three-dimensional model collision detection method further includes:
[0082] Obtain the location command input by the user;
[0083] According to the positioning command, the view window is switched to the location of the collision point, and the location of the collision point is enlarged and displayed, while the collision point is marked with a red circle.
[0084] Understandably, marking and locating collision points can help users quickly find and identify them, which can greatly improve the drawing efficiency of designers in large-scale complex building projects.
[0085] In one possible embodiment, after step S205, the three-dimensional model collision detection method further includes:
[0086] Generate a data file to record the collision points between different colliding objects. For each collision record, add a status record of the collision point processing.
[0087] Optionally, the data file can be exported as a local file in HTML (Hypertext Markup Language) format. The data file records the type, three-dimensional coordinates, status, and preview image of the collision point for users to view, report solutions, and archive data.
[0088] Understandably, this application helps designers manage collision points by recording their status, which plays a significant role when there are a large number of collision points. In addition, exporting the data files makes it possible to trace problems that arise in the design scheme.
[0089] For example, Figure 7 A collision detection device for a three-dimensional model is shown. The three-dimensional model collision detection device 500 includes:
[0090] Model creation unit 510 is used to create a target 3D model;
[0091] The collision object determination unit 520 is used to determine at least two collision objects to be collision detected in the target 3D model;
[0092] The collision detection unit 530 is used to perform collision detection on the at least two colliding objects based on a collision detection algorithm to obtain the collision point.
[0093] In one possible embodiment, the collision object determination unit 520 is specifically configured to: receive a model display instruction; split the target 3D model into multiple model objects according to the model display instruction, and display the multiple model objects; receive an object confirmation instruction input by a user based on the multiple model objects; and determine at least two collision objects to be collision detected from the multiple model objects according to the object confirmation instruction.
[0094] In one possible embodiment, the at least two collision objects include a first collision object and a second collision object, wherein the first collision object includes a first model component and the second collision object includes a second model component. In this case, the collision detection unit 530 is specifically configured to: determine whether the first model component and the second model component belong to the same type; if not, perform collision detection on the first model component and the second model component based on a first collision detection algorithm to obtain a collision point; if they belong to the same type, determine whether the model outline corresponding to the first model component and the model outline corresponding to the second model component overlap; if so, designate the first model component and the second model component as undetermined collision points; and determine whether the undetermined collision points are collision points based on a second collision detection algorithm.
[0095] Optionally, the step of performing collision detection on the first model component and the second model component based on the first collision detection algorithm to obtain the collision point includes: when determining that the first model component is a building component and the second model component is a pipe, obtaining the pipe centerline of the pipe and the center plane of the building component; determining whether the pipe centerline and the center plane of the building component are parallel; if parallel, calculating the first average distance from the pipe centerline to the first surface of the building component and the second average distance from the pipe centerline to the edge of the pipe; if the first average distance is greater than the second average distance, determining that the first model component and the second model component have no collision; if the first average distance is less than the second average distance, determining that the first model component and the second model component have a collision, and obtaining the collision point.
[0096] When the centerline of the pipe is not parallel to the center plane of the building component, it is determined whether the centerline of the pipe is within the three-dimensional space of the building component; if not, it is determined that there is no collision; if the centerline of the pipe is within the three-dimensional space of the building component, it is determined whether the starting point and ending point of the centerline of the pipe are located on both sides of the center plane of the building component; if the starting point and ending point of the centerline of the pipe are distributed on both sides of the center plane of the building component, it is determined that the first model component and the second model component collide, and the collision point is obtained; if the starting point and ending point of the centerline of the pipe are distributed on the same side of the center plane of the building component, it is determined that there is no collision.
[0097] Optionally, determining whether the undetermined collision point is a collision point based on the second collision detection algorithm includes: identifying whether the first model component and the second model component are pipe-to-pipe collisions based on the model's architectural information; if so, determining whether the first pipe centerline of the first model component and the second pipe centerline of the second model component are parallel; if parallel, calculating the first distance from the first pipe centerline to the pipe edge of the first model component, the second distance from the second pipe centerline to the pipe edge of the second model component, and the third distance between the first pipe centerline and the second pipe centerline; determining whether the sum of the first distance and the second distance is greater than the third distance; if less than the third distance, determining that the undetermined collision point is not a collision point; if greater than the third distance, determining that the undetermined collision point is a collision point.
[0098] If the centerline of the first pipe of the first model component is not parallel to the centerline of the second pipe of the second model component, determine whether there is a first intersection point of the extension line of the first pipe centerline on the centerline of the second pipe; if there is a first intersection point, determine the second intersection point of the extension line of the first pipe centerline within the first model component; calculate the fourth distance from the first intersection point to the edge of the pipe of the first model component, the fifth distance from the second intersection point to the edge of the pipe of the second model component, and the sixth distance between the first intersection point and the second intersection point; determine whether the sum of the fourth distance and the fifth distance is greater than the sixth distance; if it is less than the sixth distance, determine that the undetermined collision point is not a collision point; if it is greater than the sixth distance, determine that the undetermined collision point is a collision point.
[0099] Furthermore, the technical effects of the aforementioned 3D model collision detection device 500 can be referenced from the technical effects of the aforementioned 3D model collision detection method, and will not be elaborated here.
[0100] Furthermore, this embodiment also provides a computer-readable storage medium storing a computer program, which, when run by a processing device, executes the steps of any of the three-dimensional model collision detection methods provided in the above embodiments.
[0101] The computer program product of the three-dimensional model collision detection method and apparatus provided in this application includes a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods described in the preceding method embodiments. For specific implementation, please refer to the method embodiments, which will not be repeated here.
[0102] It should be noted that the above embodiments can be implemented, in whole or in part, by software, hardware (such as circuits), firmware, or any other combination thereof. When implemented using software, the above embodiments can be implemented, in whole or in part, in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more sets of available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium. A semiconductor medium can be a solid-state drive.
[0103] It should be understood that the term "and / or" in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. A and B can be singular or plural. Additionally, the character " / " in this article generally indicates an "or" relationship between the preceding and following related objects, but it can also represent an "and / or" relationship. Please refer to the context for a more accurate understanding.
[0104] In this application, "at least one" means one or more, and "more than one" means two or more. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or multiple items. For example, at least one of a, b, or c can mean: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple.
[0105] It should be understood that in the various embodiments of this application, the order of the above-mentioned processes does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0106] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0107] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0108] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0109] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0110] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0111] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application. It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.
Claims
1. A collision detection method for a three-dimensional model, characterized in that, The method includes: Create a target 3D model, wherein the target 3D model is a building information model; Identify at least two collision objects to be detected in the target 3D model; Collision detection is performed on the at least two colliding objects based on a collision detection algorithm to obtain the collision point; Wherein, the at least two collision objects include a first collision object and a second collision object, the first collision object includes a first model component, the first model component includes a building component and / or a pipe, the second collision object includes a second model component, the second model component includes a building component and / or a pipe, and the collision detection of the at least two collision objects based on the collision detection algorithm to obtain the collision point includes: Determine whether the first model component and the second model component belong to the same type; If not, collision detection is performed between the first model component and the second model component based on the first collision detection algorithm to obtain the collision point; If they belong to the same type, determine whether the model outline corresponding to the first model component and the model outline corresponding to the second model component have any overlap; If so, the first model component and the second model component are taken as the collision points to be determined; The second collision detection algorithm is used to determine whether the undetermined collision point is a collision point.
2. The method according to claim 1, characterized in that, The process of determining at least two collision objects to be detected in the target 3D model includes: Receive model display instructions; According to the model display instructions, the target 3D model is split into multiple model objects, and multiple model objects are displayed; Receive object confirmation commands input by the user based on multiple model objects; Based on the object confirmation instruction, at least two collision objects to be collision detected are determined from a plurality of model objects.
3. The method according to claim 1, characterized in that, The step of performing collision detection on the first model component and the second model component based on the first collision detection algorithm to obtain the collision point includes: When the first model component is determined to be a building component and the second model component is a pipe, the centerline of the pipe and the center plane of the building component are obtained. Determine whether the centerline of the pipeline is parallel to the center plane of the building component; If parallel, calculate the first average distance from the centerline of the pipe to the first surface of the building component and the second average distance from the centerline of the pipe to the edge of the pipe; If the first average distance is greater than the second average distance, it is determined that the first model component and the second model component do not collide. If the first average distance is less than the second average distance, it is determined that the first model component and the second model component are in collision, and the collision point is obtained.
4. The method according to claim 3, characterized in that, The method further includes: When the centerline of the pipe is not parallel to the center plane of the building component, determine whether the centerline of the pipe is within the three-dimensional space of the building component; If not present, it is determined as no collision; If the centerline of the pipeline is within the three-dimensional space of the building component, determine whether the starting point and ending point of the centerline of the pipeline are located on both sides of the central plane of the building component; If the starting point and the ending point of the pipeline centerline are distributed on both sides of the center plane of the building component, then it is determined that the first model component and the second model component are in collision, and the collision point is obtained. If the starting point and ending point of the pipeline centerline are located on the same side of the central plane of the building component, it is determined that there is no collision.
5. The method according to claim 1, characterized in that, Determining whether the undetermined collision point is a collision point based on the second collision detection algorithm includes: Based on the architectural information of the model, identify whether the first model component and the second model component are pipe-to-pipe collision detection; If so, determine whether the center line of the first pipe of the first model component is parallel to the center line of the second pipe of the second model component; If they are parallel, calculate the first distance from the center line of the first pipe to the edge of the pipe of the first model component, the second distance from the center line of the second pipe to the edge of the pipe of the second model component, and the third distance between the center line of the first pipe and the center line of the second pipe. Determine whether the sum of the first distance and the second distance is greater than the third distance; If the distance is less than the third distance, the undetermined collision point is determined to be a non-collision point; If the distance is greater than the third distance, the undetermined collision point is determined as the collision point.
6. The method according to claim 5, characterized in that, The method further includes: If the center line of the first pipe of the first model component is not parallel to the center line of the second pipe of the second model component, determine whether there is a first intersection point of the extension line of the center line of the first pipe on the center line of the second pipe. If the first intersection point exists, determine the second intersection point of the extension line of the first pipeline centerline within the first model component; Calculate the fourth distance from the first intersection point to the pipe edge of the first model component, the fifth distance from the second intersection point to the pipe edge of the second model component, and the sixth distance between the first intersection point and the second intersection point; Determine whether the sum of the fourth distance and the fifth distance is greater than the sixth distance; If the distance is less than the sixth distance, the undetermined collision point is determined to be a non-collision point; If the distance is greater than the sixth distance, the undetermined collision point is determined as the collision point.
7. A three-dimensional model collision detection device, characterized in that, The device includes: The model creation unit is used to create a target 3D model, wherein the target 3D model is a building information model; The collision object determination unit is used to determine at least two collision objects to be collision detected in the target 3D model; The collision detection unit is used to perform collision detection on the at least two colliding objects based on a collision detection algorithm to obtain the collision point; Wherein, the at least two collision objects include a first collision object and a second collision object, the first collision object includes a first model component, the first model component includes a building component and / or a pipe, the second collision object includes a second model component, the second model component includes a building component and / or a pipe, and the collision detection unit is specifically used for: Determine whether the first model component and the second model component belong to the same type; If not, collision detection is performed between the first model component and the second model component based on the first collision detection algorithm to obtain the collision point; If they belong to the same type, determine whether the model outline corresponding to the first model component and the model outline corresponding to the second model component have any overlap; If so, the first model component and the second model component are taken as the collision points to be determined; The second collision detection algorithm is used to determine whether the undetermined collision point is a collision point.
8. An electronic device, characterized in that, include: Memory, used to store executable instructions; A processor, when executing executable instructions stored in the memory, implements the three-dimensional model collision detection method as described in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, which, when executed by a processing device, performs the steps of the three-dimensional model collision detection method as described in any one of claims 1-6.
Citation Information
Patent Citations
BIM (Building Information Modeling)-based metro comprehensive pipeline clearance detection method
CN102867076A