A method and device for applying CAD and BIM data linkage analysis
By generating bounding boxes and using unique IDs for linkage analysis, the problem of inconsistent CAD and BIM file formats is solved, rapid linkage of BIM and CAD data is achieved, and the efficiency of architectural design and review is improved.
Patent Information
- Application Number
- CN202311840316.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-28
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2043-12-28
AI Technical Summary
Due to the inconsistent formats of CAD files and BIM files, two-dimensional CAD data and three-dimensional BIM models cannot be used in conjunction. As a result, BIM and CAD software need to be opened at the same time during planning, design and review, which consumes a lot of man-hours and reduces the cost of architectural design and review. Review efficiency.
By obtaining BIM and CAD files, generating bounding boxes of instance components, and using unique IDs for linkage analysis, we can open up the boundaries between 2D CAD data and 3D BIM data, achieve semantic retention of data, and conduct BIM and CAD analysis in the same scene. Linkage analysis.
It achieves rapid linkage of BIM and CAD data, eliminating the need to open BIM and CAD software again, reducing the consumption of redundant man-hours and improving the efficiency of architectural design and review.
Smart Images

Figure CN117763689B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of digital modeling, and in particular to a method for applying CAD and BIM data linkage analysis. Background Art
[0002] CAD is a traditional architectural design tool, often used for two-dimensional plan design, such as architectural drawings, mechanical parts drawing, etc. CAD is mainly used to draw floor plans, scale and edit them according to specific proportions. BIM is a building information model, which is a new type of architectural design technology. It realizes the construction of three-dimensional models based on traditional two-dimensional models.
[0003] When conducting digital modeling, due to the inconsistency of the formats of CAD files and BIM files, CAD files or BIM files are usually used separately. In addition, since the two-dimensional CAD data and the three-dimensional BIM model cannot be used in conjunction, it is necessary to open the BIM and CAD software at the same time during planning, design, review and audit, and transmit data to each other in order to complete the design and review tasks with reference to the BIM model and CAD data. This results in a large amount of man-hours being consumed, making the efficiency of architectural design and review low. Summary of the invention
[0004] In view of the above problems, the present invention proposes a method for applying CAD and BIM data linkage analysis to overcome the above problems or at least partially solve the above problems.
[0005] According to one aspect of the present invention, a method for applying CAD and BIM data linkage analysis is provided, the method comprising:
[0006] Acquire a file of a BIM model and store the file of the BIM model in a hierarchical manner; generate a first bounding box of an instance component based on the file of the BIM model; the first bounding box and the instance component use the same first unique ID;
[0007] Acquire a CAD file and store the CAD file in a hierarchical manner; generate a second bounding box of the instance component based on the CAD file; the second bounding box and the CAD line use the same second unique ID;
[0008] During the linkage analysis of CAD and BIM data, the first bounding box and / or the second bounding box are extracted for geometric calculation.
[0009] Optionally, storing the files of the BIM model in a hierarchical manner includes:
[0010] Store BIM model files according to the hierarchy of categories, types, and instances;
[0011] A file ID corresponding to the file of the BIM model is obtained, and a first unique ID corresponding to each instance component is generated using the file ID and a construction ID of the file of the BIM model.
[0012] Optionally, generating a first unique ID corresponding to each instance component by using the file ID and the component ID of the BIM model file includes:
[0013] The file ID and the component ID of the BIM model file are combined to generate a first unique ID corresponding to each instance component.
[0014] Optionally, generating a first bounding box of an instance component based on the file of the BIM model includes:
[0015] Open the BIM model file and initialize the minimum and maximum coordinates;
[0016] Traverse all units in the BIM model and obtain the geometric representation of each unit;
[0017] Iterate over all items in the geometry representation and calculate the bounding box of each item using the IfcOpenShell function;
[0018] Update minimum and maximum coordinates;
[0019] Return the two diagonal vertices of the bounding box to obtain the first bounding box corresponding to the instance component.
[0020] Optionally, storing the CAD files in a hierarchical manner includes:
[0021] Store the data in the CAD file at the level of layers, points or lines;
[0022] Assign IDs to layers, points, and lines at the same time, and use the combination of the three IDs to express the second unique ID of the point or line.
[0023] Optionally, generating a second bounding box of the instance component based on the CAD file includes:
[0024] Automatically identify and detect closed CAD lines, and assign height values to the closed CAD lines;
[0025] The closed lines are used to generate closed surfaces and the height values are combined to generate a white model, and a bounding box is also generated.
[0026] According to another aspect of the present invention, there is also provided a device for applying CAD and BIM data linkage analysis, the device comprising a processor and a memory:
[0027] The memory is used to store program code and transmit the program code to the processor;
[0028] The processor is configured to execute any of the above methods according to instructions in the program code.
[0029] The present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store program codes, and the program codes are used to execute any of the above-mentioned methods.
[0030] The present invention also provides a computing device, which includes the above-mentioned device for applying CAD and BIM data linkage analysis.
[0031] The present invention provides a method for applying CAD and BIM data linkage analysis, breaking through the boundary between building two-dimensional CAD data and BIM three-dimensional data. The geometry of BIM and CAD is unified in the form of a bounding box, and the semantics of the data are retained by using a unique ID connection, thereby realizing linkage analysis of BIM and CAD. The method of the present invention can realize the analysis and utilization of BIM and CAD data in the same scene, realize the rapid linkage of multi-scheme BIM models and multi-scheme CAD data, and no longer need to operate the software to open BIM and CAD, thereby reducing the consumption of redundant working hours. Improve the efficiency of architectural design and review.
[0032] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below.
[0033] Based on the following detailed description of specific embodiments of the present invention in conjunction with the accompanying drawings, those skilled in the art will become more aware of the above and other objects, advantages and features of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:
[0035] Figure 1 A schematic flow chart of a method for applying CAD and BIM data linkage analysis according to an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0036] The exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present invention and to enable the scope of the present invention to be fully communicated to those skilled in the art.
[0037] The embodiment of the present invention provides a method for applying CAD and BIM data linkage analysis, such as Figure 1 As shown, the method for applying CAD and BIM data linkage analysis in an embodiment of the present invention includes:
[0038] S1, obtaining a file of a BIM model, and storing the file of the BIM model in a hierarchical manner; generating a first bounding box of an instance component based on the file of the BIM model; the first bounding box and the instance component use the same first unique ID;
[0039] S2, obtaining a CAD file, and storing the CAD file in a hierarchical manner; generating a second bounding box of the instance component based on the CAD file; the second bounding box and the CAD line use the same second unique ID;
[0040] S3, when analyzing the CAD and BIM data in linkage, extracting the first bounding box and / or the second bounding box for geometric calculation.
[0041] The method for the joint analysis of CAD and BIM data in the embodiment of the present invention breaks through the boundary between the two-dimensional CAD data and the three-dimensional BIM data of the building, unifies the geometry of BIM and CAD in the form of a bounding box, and uses a unique ID to connect to achieve the preservation of the semantics of the data, thereby realizing the joint analysis of BIM and CAD.
[0042] In the above step S1, the hierarchical storage of the BIM model files includes: storing the BIM model files according to the hierarchy of categories, types, and instances. That is, the storage hierarchy of the BIM model files is "category→type→instance" in sequence. Considering that there will be multiple BIM model files in an actual project, it is necessary to assign a file ID, and use the file ID and the component ID of the BIM model to express a unique ID. Specifically, it is necessary to obtain the file ID corresponding to the file of the BIM model, and use the file ID and the construction ID of the BIM model file to generate the first unique ID corresponding to each instance component.
[0043] Optionally, using the file ID and the component ID of the BIM model file to generate the first unique ID corresponding to each instance component includes: combining the file ID and the component ID of the BIM model file to generate the first unique ID corresponding to each instance component. For example: "first unique ID = BIM file ID + component ID".
[0044] Furthermore, it is necessary to generate a bounding box of the instance component, and the bounding box and the component use the same first unique ID.
[0045] Optionally, generating a first bounding box of an instance component based on the file of the BIM model includes: opening the file of the BIM model and initializing minimum and maximum coordinates; traversing all units in the BIM model and obtaining a geometric representation of each unit; traversing all items in the geometric representation and calculating a bounding box for each item using a function of IfcOpenShell; updating minimum and maximum coordinates; and returning two diagonal vertices of the bounding box to obtain a first bounding box corresponding to the instance component.
[0046] The code is as follows:
[0047] import ifcopenshell
[0048] def calculate_bounding_box(ifc_file):
[0049] #Open IFC file
[0050] model=ifcopenshell.open(ifc_file)
[0051] # Initialize the minimum and maximum coordinates (the coordinates of the three-dimensional model are three-dimensional, each dimension has a maximum value xyz and a minimum value xyz, these two values can represent the size of the model)
[0052] min_x,min_y,min_z=float('inf'),float('inf'),float('inf')
[0053] max_x,max_y,max_z=float('-inf'),float('-inf'),float('-inf')
[0054] # Iterate through all units in the model
[0055] for element in model.by_type('IfcProduct'):
[0056] #Get the geometric representation of the unit
[0057] representation=element.Representation
[0058] if representation is not None:
[0059] #Traverse all (unit) items in the geometry representation (the items here refer to "component", "unit", "geometry", "content collection")
[0060] for representation_item in representation.Representations:
[0061] #Use IfcOpenShell's function to calculate the bounding box of each item
[0062] bbox=ifcopenshell.geom.create_shape({
[0063] 'data':representation_item
[0064] }).geometry.GetBoundingBox()
[0065] #Update the minimum and maximum coordinates (the maximum and minimum values at initialization are incorrect. Here you need to update the maximum and minimum values according to the real data. If you want to represent the size of a three-dimensional object, you only need the maximum value xyz of the three axes and the minimum value xyz of the three axes)
[0066] min_x = min(min_x,bbox.Min.X)
[0067] min_y=min(min_y,bbox.Min.Y)
[0068] min_z = min(min_z,bbox.Min.Z)
[0069] max_x = max(max_x,bbox.Max.X)
[0070] max_y=max(max_y,bbox.Max.Y)
[0071] max_z = max(max_z,bbox.Max.Z)
[0072] #Return the two diagonal vertices of the bounding box
[0073] return(min_x,min_y,min_z),(max_x,max_y,max_z)
[0074] #Use IFC file path
[0075] ifc_file_path='path_to_your_ifc_file.ifc'
[0076] bbox_min,bbox_max=calculate_bounding_box(ifc_file_path)
[0077] print("BoundingBox Min:",bbox_min)
[0078] print("BoundingBox Max:",bbox_max)
[0079] Referring to the above step S2, the CAD file needs to be stored in a hierarchical manner. Optionally, the data in the CAD file can be first stored according to the hierarchy of layers, points or lines; at the same time, IDs of the layers, points and lines are assigned, and the second unique ID of the point or line is expressed by a combination of the three IDs.
[0080] CAD data is stored in the hierarchy of "layer→point / line". Considering that there may be multiple CAD files and multiple duplicate layers in the actual project, layer, point and line IDs are assigned at the same time, and the unique ID of the point or line is expressed by the combination of these three IDs, such as: "CAD file ID+building outline ID+point / line ID"
[0081] Optionally, generating a second bounding box of the instance component based on the CAD file includes: automatically identifying and detecting closed CAD lines, and assigning height values to the closed CAD lines; generating a closed surface from the closed lines and combining the height values to generate a white mold, and also generating a bounding box.
[0082] The sample code for generating a bounding box is as follows:
[0083] import ezdxf
[0084] def calculate_3d_bounding_box_with_height(dxf_file,height):
[0085] #Open DXF file
[0086] doc=ezdxf.readfile(dxf_file)
[0087] msp = doc.modelspace()
[0088] # Initialize minimum and maximum coordinates
[0089] min_x,min_y=float('inf'),float('inf')
[0090] max_x,max_y=float('-inf'),float('-inf')
[0091] #Traverse all entities in model space
[0092] for entity in msp:
[0093] # Check entity type
[0094] if entity.dxftype()in['LINE','CIRCLE','ARC','TEXT','SOLID','LWPOLYLINE','HATCH']:
[0095] bbox = entity.bounding_box
[0096] if bbox:
[0097] # Update the minimum and maximum X and Y coordinates
[0098] min_x=min(min_x,bbox.extmin[0])
[0099] min_y=min(min_y,bbox.extmin[1])
[0100] max_x=max(max_x,bbox.extmax[0])
[0101] max_y=max(max_y,bbox.extmax[1])
[0102] #Build a 3D bounding box
[0103] This embodiment adopts the AABB bounding box construction method. "AABB bounding box" is a term commonly used in computer graphics and game development, which stands for "Axis-Aligned Bounding Box". This is a simple geometric shape used to enclose three-dimensional objects, usually a rectangular box, used for various calculations, such as collision detection, frustum culling, and spatial queries. The "axis alignment" of AABB means that its edges are parallel to the axes of the world coordinate system (usually the X, Y, and Z axes). Each AABB can be simply defined by a pair of points on the diagonal (the minimum point and the maximum point), which represent the minimum and maximum coordinates of the box on each axis, respectively. This representation method makes intersection detection with other objects efficient because it only takes a numerical comparison to determine whether two boxes overlap.
[0104] In practical applications, AABB bounding boxes are widely used in various scenarios due to their simplicity and efficiency, especially in situations where a large number of objects need to be detected and processed quickly, such as in games, simulations, and visual effects. Although AABBs are not as accurate as other types of bounding boxes (such as oriented bounding boxes or bounding spheres), they are usually cheaper to calculate and manage, making them a very useful tool in many cases.
[0105] bbox_min=(min_x,min_y,0) #The minimum value of Z coordinate is 0
[0106] bbox_max=(max_x,max_y,height)#The maximum value of the Z coordinate is the assigned height
[0107] return bbox_min,bbox_max
[0108] #Use DXF file path and height value
[0109] dxf_file_path='path_to_your_dxf_file.dxf'
[0110] height=10 #For example, the height is set to 10 units
[0111] bbox_min,bbox_max=calculate_3d_bounding_box_with_height(dxf_file_path,height)
[0112] print("3D BoundingBox Min:",bbox_min)
[0113] print("3D BoundingBox Max:",bbox_max)
[0114] In some embodiments, the CAD file of the building plan may have multiple layers, each layer specifies the line type and color used, and objects with the same line type and color are placed on the same layer. Multiple layers stacked together form a complete graphic. When generating a bounding box, the CAD file of the building plan can be obtained first, and the multiple layers contained in the building plan can be identified based on the CAD file. Then, any layer among the multiple layers is used as a layer to be processed, and each building entity contained in the layer to be processed is identified. Finally, the bounding box corresponding to the building entity is determined.
[0115] Taking the building plan as an example, the multiple layers contained in the CAD file may be a wall layer, a door layer, a window layer, a stair layer, a building layer, etc., and each layer has a corresponding expression or name. When the CAD file is obtained and the multiple layers contained in the building plan are identified based on the CAD file, the multiple layers in the CAD file can be identified by reading the name or expression of each layer.
[0116] Any of the identified multiple layers can be used as a to-be-processed layer to calculate the bounding box of the CAD block identifiers in the to-be-processed layer. The to-be-processed layer can be block-processed to obtain each building entity contained in the to-be-processed layer.
[0117] In addition to the AABB bounding box algorithm described above, the embodiment of the present invention may also use the following bounding box algorithm:
[0118] A1, identify the layer category corresponding to the layer to be processed, and obtain the target layer data corresponding to the layer to be processed. The building plan can contain multiple layers. Generally, the same building entity unit has one layer, such as one layer containing doors and one layer containing windows. When this embodiment identifies the layer category of the layer to be processed, it is equivalent to the building categories such as doors, windows, walls, etc. corresponding to the layer. The target layer data of the layer to be processed can be understood as the record data of each building entity unit contained in the layer to be processed and the building entity unit in the CAD file, such as the position coordinates, direction, identifier, etc. in the building plan, which can be in the form of a table.
[0119] A2, according to the layer category corresponding to the layer to be processed, at least one reference layer corresponding to the layer to be processed and the reference layer data corresponding to the reference layer are obtained. After identifying the layer category of the layer to be processed, at least one reference layer corresponding to the layer to be processed and the reference layer data corresponding to the reference layer are also required to be obtained according to the layer category corresponding to the layer to be processed. The reference layer in this embodiment is a layer corresponding to a reference entity unit having a certain association relationship with the building entity unit in the layer to be processed, and the corresponding reference layer data are obtained. Similarly, the reference layer data can also be the data corresponding to the record of each reference entity unit contained in the reference layer in the building plan. For example, the door building entity unit is surrounded by a wall, then the wall layer can be used as the reference layer of the door layer. For another example, in some buildings, the door building entity unit may also have a positional relationship with the window, then, correspondingly, the window layer can also be used as the reference layer of the door layer. In this embodiment, the reference layer determination rule can be pre-set, and after the layer to be processed is determined, the corresponding at least one reference layer can be directly determined according to the pre-set determination rule. Of course, the reference layer can also be selected in response to the user's instruction, and the embodiment of the present invention does not limit this.
[0120] A3, for any building entity unit in the layer to be processed, determine the bounding box algorithm corresponding to the building entity unit; after obtaining the layer to be processed, the corresponding bounding box data can be calculated for each building entity unit in the layer to be processed. The bounding box algorithm used when calculating the bounding box data can be customized by the user, or a default algorithm can be preset. Since each bounding box algorithm has its own advantages and disadvantages and its own adapted scenes, the calculated bounding box can meet the user's needs by specifying the calculation method of the basic bounding box by the user.
[0121] A4, obtain the smallest geometric unit for each building entity unit in each reference layer, and establish a spatial index for each geometric unit. In other words, process each building entity unit into an indivisible line segment as the smallest geometric unit, that is, each line segment has only a start point and an end point, and then establish a spatial index for the exploded geometry. In other words, identify each geometric unit and establish a spatial index for the geometric unit in the building plan.
[0122] A5, extracting the entity unit data corresponding to the record of the building entity unit in the CAD file. The above step A1 mentioned that the target layer data corresponding to the layer to be processed can be obtained, and the target layer data has the data corresponding to each building entity unit. Here, when calculating the bounding box data of any building entity unit, it is necessary to obtain the corresponding entity unit data, that is, the position coordinates, shape and other parameters of the building entity unit in the building plan.
[0123] A6, obtaining reference unit data corresponding to the building entity unit; the reference unit data in this embodiment can be understood as the distance range between the building entity unit and the reference entity unit. For example, when the data is not standard, it may cause a distance between the door and the wall. The wall can be found by buffering a certain distance from the door. This distance is the reference unit data in this embodiment.
[0124] A7, a spatial index query of geometric units is performed based on the basic bounding box and the reference unit data to filter out multiple reference geometric units of the building entity unit from multiple geometric units. For example, there will be wall building units on both sides of the door building unit, so the geometric units corresponding to the line segments of the walls on both sides of the door can be used as reference geometric units. In other words, when a door building unit is converted into a bounding box, the bounding box of the door graphic cannot be simply regarded as the final answer. Because the door graphics in the CAD drawings are all in an open state or a semi-open state. At this time, it is necessary to refer to other things to assist in calculating the width of the door. At this time, reference geometry is introduced. For example, walls, windows, and other geometries. Since there are many geometric units contained in the reference layer, it is necessary to select geometric units that have a certain spatial position relationship with the currently processed building unit as reference geometric units. Specifically, the position of the basic bounding box in the building plan can be combined with the range of the reference unit data to find multiple reference geometric units of the building entity unit. For example, the basic bounding box is a quadrilateral structure, and the reference geometric unit can be a line segment that is parallel or perpendicular to the four sides of the quadrilateral structure and may constitute the wall surface.
[0125] A8, determining a target reference unit according to a plurality of reference geometric units, and calculating final bounding box data of the building entity unit based on data recorded by the target reference unit in the building plan and data of the basic bounding box.
[0126] As mentioned in the above step A7, multiple reference geometric units can be found, that is, reference geometric units that are set around the building unit and can determine the specific position and size of the building unit's bounding box. By calculating and identifying the positional relationship between the basic bounding box of the building unit and the reference geometric unit, such as embedded relationship, parallel relationship setting, vertical relationship, cross relationship, and other positional relationships, the final reference geometric unit is further determined according to the positional relationship and the shape classification of the building unit. For example, a door is clamped by the line geometry of two walls, and a window is clamped by two line bridges. After the shape and position of the reference line geometry are parallel, can just form a rectangular shape, and the shape on the vector is calculated, each set of paired geometry is evaluated in combination with multiple dimensions such as shape, position, and size to obtain the most matching target reference unit.
[0127] In some cases, the final bounding box cannot be determined only by shape and position. For example, in the state of a half-open door, the wall and the bounding box are intersecting. At this time, it is necessary to calculate the intersection position to correct the bounding box. Therefore, this intersection position can be combined with other reference data and positional relationships to calculate more accurate bounding box data.
[0128] Considering that there are some unclosed lines in CAD, a certain tolerance value is given, and the lines within the tolerance value are automatically connected and closed. Automatically identify and detect closed CAD lines, assign height values to these closed lines, generate white molds based on the closed faces and heights, and also generate bounding boxes. The bounding box, white mold, and CAD line use the same second unique ID.
[0129] Finally, when CAD and BIM are analyzed in conjunction, their respective bounding boxes can be directly extracted for geometric calculations. As mentioned above, the first bounding box obtained based on BIM analysis uses the same first unique ID as the instance component, and the second bounding box obtained based on CAD analysis uses the same second unique ID as the CAD line. Therefore, when CAD and BIM are analyzed in conjunction with the same building unit, the first bounding box in the BIM file and the second bounding box in the CAD file can be determined first, and the first bounding box and the second bounding box can be combined to achieve two-dimensional and three-dimensional analysis of the same building unit.
[0130] At the same time, because the bounding boxes are associated with their respective semantic information using unique IDs, the input and output conditions can be screened and restricted, thereby supporting the linkage analysis of BIM data and CAD data. For example, by setting semantic screening conditions, the first unique ID and the first bounding box, and the second unique ID and the second bounding box that match the semantic screening conditions are determined, so as to perform geometric calculations based on the first bounding box and the second bounding box.
[0131] An embodiment of the present invention also provides a device for applying CAD and BIM data linkage analysis, the device comprising a processor and a memory: the memory is used to store program code and transmit the program code to the processor; the processor is used to execute any of the above-mentioned methods according to the instructions in the program code.
[0132] The present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store program codes, and the program codes are used to execute any of the above-mentioned methods.
[0133] The present invention also provides a computing device, which includes the above-mentioned device for applying CAD and BIM data linkage analysis.
[0134] Those skilled in the art can clearly understand that the specific working processes of the systems, devices, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and for the sake of brevity, they are not further described here.
[0135] In addition, the functional units in various embodiments of the present invention may be physically independent of each other, or two or more functional units may be integrated together, or all functional units may be integrated into one processing unit. The above integrated functional units may be implemented in the form of hardware, or in the form of software or firmware.
[0136] Those skilled in the art can understand that if the integrated functional unit is implemented in the form of software and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention can essentially or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, which includes a number of instructions to enable a computing device (such as a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present invention when running the instructions. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), magnetic disk or optical disk and other media that can store program codes.
[0137] Alternatively, all or part of the steps of implementing the aforementioned method embodiments may be accomplished by hardware associated with program instructions (such as a computing device such as a personal computer, a server, or a network device), and the program instructions may be stored in a computer-readable storage medium. When the program instructions are executed by a processor of a computing device, the computing device executes all or part of the steps of the methods described in the embodiments of the present invention.
[0138] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that within the spirit and principles of the present invention, the technical solutions described in the aforementioned embodiments can still be modified, or some or all of the technical features therein can be replaced by equivalents. However, these modifications or replacements do not deviate from the protection scope of the present invention.
Claims
1. A method for applying CAD and BIM data linkage analysis, characterized in that: The method comprises: Acquire a file of a BIM model and store the file of the BIM model in a hierarchical manner; generate a first bounding box of an instance component based on the file of the BIM model; the first bounding box and the instance component use the same first unique ID; Acquire a CAD file and store the CAD file in a hierarchical manner; generate a second bounding box of the instance component based on the CAD file; the second bounding box and the CAD line use the same second unique ID; When analyzing the CAD and BIM linkage data, extracting the first bounding box and the second bounding box for geometric calculation; The hierarchical storage of the BIM model files includes: storing the BIM model files according to the levels of categories, types, and instances; obtaining a file ID corresponding to the BIM model file, and generating a first unique ID corresponding to each instance component using the file ID and a construction ID of the BIM model file; Generating a first bounding box of an instance component based on the file of the BIM model includes: opening the file of the BIM model and initializing minimum and maximum coordinates; traversing all units in the BIM model and obtaining geometric representations of each unit; traversing all items in the geometric representation and calculating the bounding box of each item using a function of IfcOpenShell; updating the minimum and maximum coordinates; returning two diagonal vertices of the bounding box to obtain a first bounding box corresponding to the instance component; The hierarchical storage of the CAD file includes: storing the data in the CAD file according to the layers, points or lines; assigning IDs to the layers, points and lines at the same time, and using the combination of the three IDs to express a second unique ID of the point or line; The second bounding box of the instance component generated based on the CAD file includes: automatically identifying and detecting closed CAD lines and assigning height values to the closed CAD lines; generating a closed surface from the closed lines and combining the height values to generate a white mold, and also generating a bounding box.
2. The method according to claim 1, characterized in that Generating a first unique ID corresponding to each instance component by using the file ID and the component ID of the BIM model file includes: The file ID and the component ID of the BIM model file are combined to generate a first unique ID corresponding to each instance component.
3. A device for applying CAD and BIM data linkage analysis, characterized in that: The device comprises a processor and a memory: The memory is used to store program code and transmit the program code to the processor; The processor is configured to execute the method according to any one of claims 1 to 2 according to the instructions in the program code.
4. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store program codes, and the program codes are used to execute the method according to any one of claims 1 to 2.
5. A computing device, characterized in that: The computing device includes the apparatus for applying CAD and BIM data linkage analysis as described in claim 3.
