A method, device, equipment and storage medium for roughly calculating intersecting components

By constructing a two-layer index structure, the intersecting component model set is quickly calculated, which solves the problem of low efficiency in roughly calculating the intersecting model set in the existing technology, and improves the response speed of the three-dimensional modeling software.

CN114239115BActive Publication Date: 2024-09-03GLODON CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111573241.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-21
Publication Date
2024-09-03
Estimated Expiration
2041-12-21

AI Technical Summary

Technical Problem

The efficiency of rough calculation of intersecting model sets in the prior art is low, especially in scenarios with a large number of models, resulting in a slow response of the 3D modeling software.

Method used

By constructing a two-level index structure, the first-level index structure is used to quickly calculate the intersection relationship between the target component bounding box and the floor bounding box. The second-level index structure is used to calculate the intersection relationship between the component model and filter out the intersections with the target component bounding box. A collection of component models.

Benefits of technology

The efficiency of model intersection operation is significantly improved, the model range of rough intersection of component models is reduced, and the problem of low efficiency in the existing technology is solved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114239115B
    Figure CN114239115B
Patent Text Reader

Abstract

The present invention discloses a method for roughly calculating intersecting components, the method comprising: receiving a target component type and a target component bounding box belonging to the target component type; extracting a target floor bounding box intersecting with the target component bounding box from a preset first-layer index structure according to the target component type, and extracting the target floor to which the target floor bounding box belongs; extracting a component model belonging to the target floor from a preset second-layer index structure according to the target component type, and calculating the positional relationship between the target component bounding box and each extracted component model; when the calculated positional relationship includes an intersection relationship, filtering out from the extracted component models all component models whose positional relationship with the target component bounding box is an intersection relationship. The present invention also discloses a device for roughly calculating intersecting components, a computer device, and a computer-readable storage medium.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of computer-aided design, and in particular to a method, a device, a computer equipment and a computer-readable storage medium for roughly calculating intersecting components. Background Art

[0002] With the development of information technology, more and more engineering cost personnel have begun to use 3D modeling software to build 3D models. 3D modeling software includes functions such as model recognition, model editing, model checking and model calculation, which usually involve the intersection operation of 3D models.

[0003] The general idea of ​​model intersection in the prior art is: first roughly calculate a number of intersecting model sets from the global model octree through the model bounding box, and then calculate the actual intersecting model set through three-dimensional Boolean operations.

[0004] However, the inventors found that in scenarios with a large number of models, each rough calculation of whether the models intersect requires an intersection check from the global model octree, which results in a slow response and low efficiency of the 3D modeling software. For example, if there are 100,000 columns distributed on a 20-story building, there will be 100,000 nodes in the global model octree. When calculating the intersection model, each column must be model checked, so the time complexity of roughly calculating the intersection model set is equal to 100,000*100,000.

[0005] There is currently no effective solution to the technical problem that the solution for roughly calculating the set of intersecting models in the prior art is inefficient. Summary of the invention

[0006] The purpose of the present invention is to provide a method, device, computer equipment and computer-readable storage medium for roughly calculating intersecting components, which can solve the technical problem of low efficiency of the solution for roughly calculating the intersection model set in the prior art.

[0007] One aspect of the present invention provides a method for roughly calculating intersecting components, the method comprising: receiving a target component type and a target component bounding box belonging to the target component type; extracting a target floor bounding box intersecting with the target component bounding box from a preset first-level index structure according to the target component type, and extracting a target floor to which the target floor bounding box belongs; extracting a component model belonging to the target floor from a preset second-level index structure according to the target component type, and calculating a positional relationship between the target component bounding box and each extracted component model; when the calculated positional relationship includes an intersection relationship, screening out all component models whose positional relationship with the target component bounding box is an intersection relationship from the extracted component models.

[0008] Optionally, extracting a target floor bounding box intersecting with the target component bounding box from a preset first-layer index structure according to the target component type, and extracting a target floor to which the target floor bounding box belongs, includes: identifying a floor associated with the target component type from the first-layer index structure; filtering out floor bounding boxes belonging to the identified floor from the first-layer index structure; calculating a positional relationship between the target component bounding box and each filtered floor bounding box; when the calculated positional relationship includes an intersection relationship, extracting all floor bounding boxes whose positional relationship with the target component bounding box is an intersection relationship from the filtered floor bounding boxes as the target floor bounding box; and extracting the floor to which the target floor bounding box belongs from the identified floor as the target floor.

[0009] Optionally, extracting the component model belonging to the target floor from a preset second-layer index structure according to the target component type, and calculating the positional relationship between the target component bounding box and each extracted component model, includes: extracting an octree structure associated with the target component type and the target floor from the second-layer index structure, each node in each octree structure is a component model under the corresponding floor; traversing the extracted octree structure, and calculating the positional relationship between the target component bounding box and the currently traversed component model; accordingly, when the calculated positional relationship includes an intersection relationship, filtering out from the extracted component models all component models whose positional relationship with the target component bounding box is an intersection relationship, includes: when the calculated positional relationship includes an intersection relationship, filtering out from the extracted octree structure all component models whose positional relationship with the target component bounding box is an intersection relationship.

[0010] Optionally, before receiving the target component type and the target component bounding box belonging to the target component type, the method further includes: acquiring a component model set constituting the target building model; traversing the component model set, acquiring the component type of the first component model, the floor to which the first component model belongs, and the component bounding box of the first component model from the first component model currently traversed; searching whether there is index information containing the component type of the first component model and the floor to which the first component model belongs in the cache; if so, updating the found index information according to the component bounding box of the first component model; if not, determining the component bounding box of the first component model as the floor bounding box, establishing index information with an index relationship of "component type of the first component model-floor to which the first component model belongs-determined floor bounding box", and storing the established index information in the cache; after traversing the component model set, using all index information with an index relationship of "component type-floor-floor bounding box" in the cache as the first-layer index structure.

[0011] Optionally, updating the found index information based on the component bounding box of the first component model includes: obtaining the floor bounding box contained in the found index information; merging the component bounding box of the first component model and the floor bounding box contained in the found index information; and replacing the floor bounding box contained in the found index information with the bounding box obtained after the merger as a new floor bounding box.

[0012] Optionally, before receiving the target component type and the target component bounding box belonging to the target component type, the method further includes: acquiring a set of component models constituting the target building model; traversing the set of component models to acquire the second component model currently traversed, and acquiring the component type of the second component model and the floor to which the second component model belongs from the second component model; searching the cache for index information containing the component type of the second component model and the floor to which the second component model belongs; if so, updating the retrieved index information according to the second component model; if not, establishing index information with an index relationship of "component type of the second component model-floor to which the second component model belongs-second component model", and storing the established index information in the cache; after traversing the set of component models, using all index information with an index relationship of "component type-floor-component model" in the cache as the second-layer index structure.

[0013] Optionally, updating the retrieved index information according to the second component model includes: obtaining the floors contained in the retrieved index information; associating the second component model with the floors contained in the retrieved index information, and adding the second component model to the retrieved index information.

[0014] Another aspect of the present invention provides a device for roughly calculating intersecting components, the device comprising: a receiving module for receiving a target component type and a target component bounding box belonging to the target component type; an extraction module for extracting a target floor bounding box intersecting with the target component bounding box from a preset first-level index structure according to the target component type, and extracting the target floor to which the target floor bounding box belongs; a calculation module for extracting a component model belonging to the target floor from a preset second-level index structure according to the target component type, and calculating a positional relationship between the target component bounding box and each extracted component model; and a screening module for screening out all component models whose positional relationship with the target component bounding box is an intersecting relationship from the extracted component models when the calculated positional relationship contains an intersecting relationship.

[0015] Another aspect of the present invention provides a computer device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method for roughly calculating intersection components described in any of the above embodiments when executing the computer program.

[0016] Yet another aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the method for roughly calculating intersection components described in any of the above embodiments is implemented.

[0017] The method for roughly calculating intersecting components provided by the present invention can quickly calculate the target floor bounding box and the target floor to which the target floor bounding box intersects with the target component bounding box through the first-level index structure; all component models intersecting with the target component bounding box under the target floor can be quickly calculated through the second-level index structure, that is, the present invention can quickly and roughly calculate the component model set intersecting with the target component bounding box through the two-level index structure, improve the efficiency of the model intersection operation, and solve the technical problem of low efficiency of the solution of roughly calculating the intersection model set in the prior art. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] 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:

[0019] Figure 1 A flow chart showing a method for roughly calculating intersecting components in the first embodiment is shown;

[0020] Figure 2 A schematic diagram of a component model set in the first embodiment is shown;

[0021] Figure 3 A schematic diagram of a component bounding box and a floor bounding box in the first embodiment is shown;

[0022] Figure 4 A schematic diagram of merging bounding boxes in Embodiment 1 is shown;

[0023] Figure 5 A schematic diagram showing the first-level index structure in the first embodiment is shown;

[0024] Figure 6 A schematic diagram showing the second layer index structure in the first embodiment is shown;

[0025] Figure 7 A block diagram of a device for roughly calculating intersecting components in Embodiment 2 is shown;

[0026] Figure 8 A block diagram of a computer device suitable for implementing the method for roughly calculating intersection components provided in the third embodiment is shown. DETAILED DESCRIPTION

[0027] In order to make the purpose, technical scheme and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0028] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0029] Explanation of terms used in this invention:

[0030] Floor or floor ID: corresponds to the floor in the actual building. The floor ID represents the unique floor index in the project and has no business significance.

[0031] Component type or component type ID: corresponds to the type of components in actual buildings, such as walls, beams, columns, plates, etc. The component type ID represents the unique index of the component type in the project and has no business significance.

[0032] Bounding box: It is a simple geometric space that contains objects of complex shapes. The purpose of adding a bounding box to an object is to quickly perform collision detection or filter before performing accurate collision detection (that is, when the bounding bodies collide, accurate collision detection and processing are performed). The bounding box used in the present invention preferably selects an axis-aligned bounding box (that is, an AABB bounding box), and of course other types of bounding boxes can also be selected. The present invention does not limit the specific type of the bounding box.

[0033] Octree structure: It is a tree-shaped data structure, where each internal node has exactly eight child nodes. Octree is often used to segment three-dimensional space, recursively subdividing it into eight quadrants, and is often used for efficient collision detection in three-dimensional space.

[0034] Embodiment 1

[0035] Figure 1 A flow chart of a method for roughly calculating intersecting components in Embodiment 1 is shown. Figure 1 As shown, the method includes steps S1 to S4, wherein:

[0036] Step S1: receiving a target component type and a target component bounding box belonging to the target component type.

[0037] When you want to know which component models intersect with a component model (referred to as the target component model) in the target building model, you can first quickly and roughly calculate the component models intersecting with the target component model according to the method provided in this embodiment, and then calculate the actual intersecting model set through three-dimensional Boolean operations. When roughly calculating the intersecting component models, the outside world needs to first input the component type to which the target component model belongs (i.e., the target component type) and the component bounding box of the target component model (i.e., the target component bounding box). The execution body of the present invention receives the target component type and the target component bounding box input by the outside world, and then quickly and roughly calculates the component model intersecting with the target component bounding box according to the preset first-level index structure and second-level index structure.

[0038] As an optional embodiment, before step S1, it is necessary to construct a first-level index structure, so the method further includes steps A1 to A6, wherein:

[0039] Step A1, obtaining a set of component models constituting a target building model;

[0040] Step A2, traversing the component model set, and acquiring the component type of the first component model, the floor to which the first component model belongs, and the component bounding box of the first component model from the first component model currently traversed;

[0041] Step A3, searching whether there is index information containing the component type of the first component model and the floor to which the first component model belongs in the cache;

[0042] Step A4: if it exists, updating the found index information according to the component bounding box of the first component model;

[0043] Step A5: if it does not exist, the component bounding box of the first component model is determined as the floor bounding box, index information with an index relationship of "component type of the first component model - the floor to which the first component model belongs - the determined floor bounding box" is established, and the established index information is stored in the cache;

[0044] Step A6: After traversing the component model set, all index information in the cache with the index relationship of "component type-floor-floor bounding box" is used as the first-level index structure.

[0045] The component model set includes multiple component models constituting the target building model. The component model can be a two-dimensional model or a three-dimensional model of the component. For example, if the component is a wall, the component model is a two-dimensional model or a three-dimensional model of the wall. The component model set can be stored in a container for unified management. The container can be organized in the form of an array or an octree structure. Figure 2 As shown, the global model container is the component model set, and Model 1, Model 2, ..., Model N are the component models in the component model set.

[0046] When traversing the component model set in the process of building the first-level index structure, the currently traversed component model is used as the first component model. Each component model includes the size information, position information, color information, business attributes, etc. of the component. The business attributes include the building model to which the component model belongs, the component type and the floor to which it belongs. When the component bounding box takes the form of AABB, the component bounding box may include the coordinates of two diagonally opposite vertices of the component model in the building model to which it belongs, such as the coordinates of the lower left corner and the coordinates of the upper right corner; or the coordinates of the upper left corner and the coordinates of the lower right corner. Figure 3 As shown, the bounding box 1 is the bounding box of the component "column".

[0047] The cache stores index information, and searches the cache for index information of the component type of the first component model and the floor to which the first component model belongs. Advantages include: 1. reducing memory usage (no duplicate data is stored), and 2. accelerating the search for index information.

[0048] If the above index information is not found in the cache, it means that such index information has not been established at this time. Then a new index information with an index relationship of "component type of the first component model-the floor to which the first component model belongs-the determined floor bounding box" can be created, specifically: the component bounding box of the first component model is determined as the floor bounding box, and the component type of the first component model is used as the key and the floor to which the first component model belongs as the value to establish an association relationship between the two. Again, the floor to which the first component model belongs is used as the key and the component bounding box of the first component model, that is, the determined floor bounding box, is used as the value to establish an association relationship between the two. When the input data is the component type of the first component model, the floor to which the first component model belongs and the determined floor bounding box can be automatically indexed from the index information.

[0049] If the above index information is found in the cache, the found index information may be updated according to the component bounding box of the first component model.

[0050] As an optional embodiment, step A4 specifically includes steps A41 to A43, wherein:

[0051] Step A41, obtaining the floor bounding box contained in the found index information;

[0052] Step A42, merging the component bounding box of the first component model and the floor bounding box contained in the found index information;

[0053] Step A43: Use the bounding box obtained after merging as a new floor bounding box to replace the floor bounding box contained in the found index information.

[0054] The purpose of merging is to calculate the bounding box formed by all components under a floor associated with a certain component type, that is, the floor bounding box. Figure 4 As shown, the bounding box under the two-dimensional model can be represented by the minimum point and the maximum point. Merging the bounding boxes means calculating the minimum point and the maximum point from several bounding boxes. The calculation process is a simple comparison of numerical values.

[0055] After traversing the component model set, the floor bounding box contained in each index information with the index relationship of "component type-floor-floor bounding box" is already the latest floor bounding box. At this time, these index information are combined to form the first-level index structure. Figure 3 As shown, bounding box 2 is the floor bounding box of floor 1 (first floor), and bounding box 3 is the floor bounding box of floor 2 (second floor). Figure 5 As shown, each component type in the first-level index structure is associated with the corresponding floor, that is, when a component model belonging to the component type exists under the floor, the floor is associated with the component type, and the floor is associated with the floor bounding box of the floor.

[0056] As an optional embodiment, before step S1, it is necessary to construct a second-level index structure first, so the method further includes steps B1 to B6, wherein:

[0057] Step B1, obtaining a set of component models constituting a target building model;

[0058] Step B2, traversing the component model set, acquiring the second component model currently traversed, and acquiring the component type of the second component model and the floor to which the second component model belongs from the second component model;

[0059] Step B3, searching the cache for index information containing the component type of the second component model and the floor to which the second component model belongs;

[0060] Step B4, if it exists, updating the retrieved index information according to the second component model;

[0061] Step B5: if it does not exist, then create index information with the index relationship of "component type of the second component model - the floor to which the second component model belongs - the second component model", and store the created index information in the cache;

[0062] Step B6, after traversing the component model set, all index information with the index relationship of "component type-floor-component model" in the cache is used as the second-level index structure.

[0063] When traversing the component model set in the process of building the second-level index structure, the component model currently traversed is used as the second component model.

[0064] Searching the cache for index information of the component type of the second component model and the floor to which the second component model belongs has the following advantages: 1. reducing memory usage (not storing duplicate data); 2. accelerating the search of index information.

[0065] If the above index information is not found in the cache, it means that such index information has not been established at this time. Then a new index information with an index relationship of "component type of the second component model-the floor to which the second component model belongs-the second component model" can be created, specifically: using the component type of the second component model as the key and the floor to which the second component model belongs as the value, an association relationship between the two is established, and again using the floor to which the second component model belongs as the key and the second component model as the value, an association relationship between the two is established. When the input data is the component type of the second component model, the floor to which the second component model belongs and the second component model can be automatically indexed from the index information; when the input data is the component type of the second component model and the floor to which the second component model belongs, the second component model can be automatically indexed from the index information.

[0066] If the above index information is found in the cache, the retrieved index information may be updated according to the second component model.

[0067] As an optional embodiment, step B4 specifically includes step B41 and step B42, wherein:

[0068] Step B41, obtaining the floors included in the retrieved index information;

[0069] Step B42: Associating the second component model with the floor included in the retrieved index information, and adding the second component model to the retrieved index information.

[0070] Adding the second component model to the retrieved index information may include: adding the second component model to an octree structure in the retrieved index information.

[0071] After traversing the component model set, each index information with the index relationship of "component type-floor-component model" contains several component models. These component models are the most complete component models at present. At this time, these index information are combined to form the second-level index structure. Figure 6 As shown, each component type in the second-level index structure is associated with the corresponding floor, that is, when a component model belonging to the component type exists under the floor, the floor is associated with the component type, and all component models under the floor are associated with the floor.

[0072] Step S2: extracting a target floor bounding box intersecting with the target component bounding box from a preset first-layer index structure according to the target component type, and extracting the target floor to which the target floor bounding box belongs.

[0073] In this embodiment, the floor associated with the target component bounding box is identified from the first-layer index structure, and then the floor bounding box associated with the identified floor is further screened from the first-layer index structure, and all floor bounding boxes intersecting with the target component bounding box are further extracted from the screened floor bounding boxes as the target floor bounding box; and all floors associated with the target floor bounding box are extracted from the identified floors as the target floors. Specifically, as an optional embodiment, step S2 includes steps S21 to S24, wherein:

[0074] Step S21, identifying a floor associated with the target component type from the first layer index structure;

[0075] Step S22, filtering out the floor bounding box belonging to the identified floor from the first layer index structure;

[0076] Step S23, calculating the positional relationship between the target component bounding box and each screened floor bounding box;

[0077] Step S24, when the calculated positional relationship includes an intersection relationship, all floor bounding boxes whose positional relationship with the target component bounding box is an intersection relationship are extracted from the screened floor bounding boxes as the target floor bounding boxes; and the floor to which the target floor bounding box belongs is extracted from the identified floors as the target floor.

[0078] Optionally, find out which floor bounding boxes intersect with the target component bounding box from the first-level index structure, and return the intersecting floor set, i.e., the target floor. The input parameters are the target component type and the target component bounding box; the output parameter is the target floor. The specific index logic is:

[0079] 2.2.1) If the target component type does not exist in the first-level index structure, return directly; otherwise, execute 2.2.2);

[0080] 2.2.2) Identify all floors corresponding to the target component type in the first-level index structure;

[0081] 2.2.3) Traverse all identified floors;

[0082] 2.2.4) If the floor bounding box under the currently traversed floor intersects with the target component bounding box, the currently traversed floor is added to the returned result;

[0083] 2.2.5) Repeat 2.2.3 to 2.2.4 to obtain the set of floors that intersect with the bounding box of the target component, namely the target floors.

[0084] Step S3: extracting component models belonging to the target floor from a preset second-layer index structure according to the target component type, and calculating the positional relationship between the target component bounding box and each extracted component model.

[0085] Step S4: when the calculated positional relationship includes an intersection relationship, all component models whose positional relationship with the target component bounding box is an intersection relationship are screened out from the extracted component models.

[0086] In this embodiment, floors associated with the target component type are extracted from the second-layer index structure, floors matching the target floors are further extracted from these floors, all component models under the matched floors are extracted from the second-layer index structure, and then the positional relationship between the target component bounding box and each extracted component model is calculated, and all component models whose positional relationship with the target component bounding box is an intersecting relationship are screened out from the extracted component models. It should be noted that each positional relationship in this embodiment is an intersecting relationship or a non-intersecting relationship.

[0087] As an optional embodiment, step S3 includes step S31 and step S32, wherein:

[0088] Step S31, extracting an octree structure associated with the target component type and the target floor from the second layer index structure, wherein each node in each octree structure is a component model under the corresponding floor;

[0089] Step S32, traversing the extracted octree structure, and calculating the positional relationship between the target component bounding box and the currently traversed component model;

[0090] Correspondingly, step S4 includes: when the calculated positional relationship includes an intersection relationship, screening out from the extracted octree structure all component models whose positional relationship with the target component bounding box is an intersection relationship.

[0091] Optionally, the component model set that intersects with the target component bounding box in the octree structure is searched from the second-level index structure. The input parameters are: target component type, target floor, and target component bounding box; the output parameter is: the component model set that intersects with the target component bounding box. The specific index logic is:

[0092] 2.3.1) Traverse the target floor;

[0093] 2.3.2) Determine whether there is index information containing the target component type and the currently traversed floor in the cache; if not, continue to execute the task of traversing the target floor; if so, obtain the corresponding octree structure from the second-level index structure according to the target component type and the currently traversed floor;

[0094] 2.3.3) Calculate the positional relationship between each component model in the obtained octree structure and the bounding box of the target component, and add the component models with an intersection positional relationship to the returned result;

[0095] 2.3.4) Repeat 2.3.2 to 2.3.3 to obtain a set of component models that intersect with the bounding box of the target component.

[0096] The present invention combines the business characteristics of the building model (business concepts such as floors and component types) and uses indexing, caching, bounding boxes, octrees and other technologies to provide a method for quickly and roughly calculating intersecting component models. The method first constructs a two-layer index structure, each of which contains multi-level index information. Secondly, it determines which floors' bounding boxes the target component bounding box intersects with, and then intersects with the octree structure in the corresponding floor to obtain all intersecting component models. The present invention reduces the model range of the component model for rough intersection, and the bottom layer of the cache adopts a block index mechanism, which greatly improves the efficiency of the model intersection operation and solves the technical problem of low efficiency of the solution for roughly calculating the intersection model set in the prior art.

[0097] Embodiment 2

[0098] Embodiment 2 of the present invention provides a device for roughly calculating intersecting components, which corresponds to the method provided in the above embodiment 1. The corresponding technical features and technical effects are not described in detail in this embodiment, and the relevant parts can refer to the above embodiment 1. Specifically, Figure 7 FIG. 2 shows a block diagram of a device for roughly calculating intersecting components in Embodiment 2. Figure 7As shown, the device 700 for roughly calculating intersection components may include a receiving module 701, an extracting module 702, a calculating module 703 and a screening module 704, wherein:

[0099] A receiving module 701 is used to receive a target component type and a target component bounding box belonging to the target component type;

[0100] An extraction module 702 is used to extract a target floor bounding box intersecting with the target component bounding box from a preset first-layer index structure according to the target component type, and to extract a target floor to which the target floor bounding box belongs;

[0101] A calculation module 703 is used to extract the component model belonging to the target floor from the preset second-layer index structure according to the target component type, and calculate the position relationship between the target component bounding box and each extracted component model;

[0102] The screening module 704 is used to screen out all component models whose positional relationships with the target component bounding box are intersecting relationships from the extracted component models when the calculated positional relationship includes an intersecting relationship.

[0103] Optionally, the extraction module is specifically used to: identify the floor associated with the target component type from the first-layer index structure; filter out the floor bounding box belonging to the identified floor from the first-layer index structure; calculate the positional relationship between the target component bounding box and each filtered floor bounding box; when the calculated positional relationship includes an intersection relationship, extract all floor bounding boxes whose positional relationship with the target component bounding box is an intersection relationship from the filtered floor bounding boxes as the target floor bounding box; and extract the floor to which the target floor bounding box belongs from the identified floor as the target floor.

[0104] Optionally, the calculation module is specifically used to: extract an octree structure associated with the target component type and the target floor from the second-layer index structure, each node in each octree structure is a component model under the corresponding floor; traverse the extracted octree structure, and calculate the positional relationship between the target component bounding box and the currently traversed component model; accordingly, the screening module is specifically used to: when the calculated positional relationship contains an intersection relationship, filter out all component models whose positional relationship with the target component bounding box is an intersection relationship from the extracted octree structure.

[0105] Optionally, the device further comprises: a first acquisition module, used for acquiring a set of component models constituting a target building model before receiving a target component type and a target component bounding box belonging to the target component type; a first traversal module, used for traversing the set of component models, and acquiring the component type of the first component model, the floor to which the first component model belongs, and the component bounding box of the first component model from the first component model currently traversed; a search module, used for searching whether there is index information containing the component type of the first component model and the floor to which the first component model belongs in the cache; a first update module, used for updating the component type of the first component model and the floor to which the first component model belongs when there is index information containing the component type of the first component model and the floor to which the first component model belongs in the cache; When the index information of the floor is obtained, the found index information is updated according to the component bounding box of the first component model; a first establishing module is used to determine the component bounding box of the first component model as the floor bounding box when there is no index information containing the component type of the first component model and the floor to which the first component model belongs in the cache, establish index information with an index relationship of "component type of the first component model-floor to which the first component model belongs-determined floor bounding box", and store the established index information in the cache; a first determining module is used to use all index information with an index relationship of "component type-floor-floor bounding box" in the cache as the first-layer index structure after traversing the component model set.

[0106] Optionally, the first update module is specifically used to: obtain the floor bounding box contained in the found index information; merge the component bounding box of the first component model and the floor bounding box contained in the found index information; and use the bounding box obtained after the merger as a new floor bounding box to replace the floor bounding box contained in the found index information.

[0107] Optionally, the device further comprises: a second acquisition module, used for acquiring a set of component models constituting a target building model before receiving the target component type and the target component bounding box belonging to the target component type; a second traversal module, used for traversing the set of component models, acquiring the second component model currently traversed, and acquiring the component type of the second component model and the floor to which the second component model belongs from the second component model; a retrieval module, used for retrieving whether there is index information of the component type containing the second component model and the floor to which the second component model belongs in the cache; a second update module, used for updating the component model when there is a component containing the second component model in the cache type and the index information of the floor to which the second component model belongs, update the retrieved index information according to the second component model; a second establishing module, for establishing index information with an index relationship of "component type of the second component model-the floor to which the second component model belongs-the second component model" when there is no index information containing the component type of the second component model and the index information of the floor to which the second component model belongs in the cache, and storing the established index information in the cache; a second determining module, for taking all index information with an index relationship of "component type-floor-component model" in the cache as the second-layer index structure after traversing the component model set.

[0108] Optionally, the second updating module is specifically used to: obtain the floors contained in the retrieved index information; associate the second component model with the floors contained in the retrieved index information, and add the second component model to the retrieved index information.

[0109] Embodiment 3

[0110] Figure 8 A block diagram of a computer device suitable for implementing the method for roughly calculating intersecting components provided in the third embodiment is shown. In this embodiment, the computer device 800 may be a smart phone, tablet computer, laptop computer, desktop computer, rack server, blade server, tower server or cabinet server (including an independent server or a server cluster composed of multiple servers) that executes a program. Figure 8 As shown, the computer device 800 of this embodiment includes at least but is not limited to: a memory 801, a processor 802, and a network interface 803 that can be interconnected through a system bus. It should be noted that Figure 8 Only a computer device 800 having components 801 - 803 is shown, but it should be understood that implementing all of the components shown is not a requirement, and more or fewer components may alternatively be implemented.

[0111] In this embodiment, the memory 803 includes at least one type of computer-readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 801 can be an internal storage unit of the computer device 800, such as a hard disk or memory of the computer device 800. In other embodiments, the memory 801 can also be an external storage device of the computer device 800, such as a plug-in hard disk equipped on the computer device 800, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. Of course, the memory 801 can also include both the internal storage unit of the computer device 800 and its external storage device. In this embodiment, the memory 801 is generally used to store an operating system and various application software installed in the computer device 800, such as program codes of a method for roughly calculating intersection components.

[0112] In some embodiments, the processor 802 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chips. The processor 802 is generally used to control the overall operation of the computer device 800. For example, the processor 802 performs control and processing related to data interaction or communication with the computer device 800. In this embodiment, the processor 802 is used to run the program code of the method for roughly calculating the intersection component stored in the memory 801.

[0113] In this embodiment, the method for roughly calculating intersection components stored in the memory 801 may also be divided into one or more program modules and executed by one or more processors (processor 802 in this embodiment) to complete the present invention.

[0114] The network interface 803 may include a wireless network interface or a wired network interface, and the network interface 803 is generally used to establish a communication link between the computer device 800 and other computer devices. For example, the network interface 803 is used to connect the computer device 800 to an external terminal through a network, and to establish a data transmission channel and a communication link between the computer device 800 and the external terminal. The network may be a wireless or wired network such as an intranet, the Internet, the Global System of Mobile communication (GSM), Wideband Code Division Multiple Access (WCDMA), 4G network, 5G network, Bluetooth, Wi-Fi, etc.

[0115] Embodiment 4

[0116] This embodiment also provides a computer-readable storage medium, including flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, server, App application store, etc., on which a computer program is stored, and when the computer program is executed by a processor, the steps of the method for roughly calculating the intersection components are implemented.

[0117] Obviously, those skilled in the art should understand that the modules or steps of the above-mentioned embodiments of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, and optionally, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. In this way, the embodiments of the present invention are not limited to any specific combination of hardware and software.

[0118] It should be noted that the serial numbers of the embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0119] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method.

[0120] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A method for roughly calculating intersecting components, characterized in that: The method comprises: receiving a target component type and a target component bounding box belonging to the target component type; According to the target component type, a target floor bounding box intersecting with the target component bounding box is extracted from a preset first-layer index structure, and a target floor to which the target floor bounding box belongs is extracted; wherein the first-layer index structure includes a plurality of index information with an index relationship of "component type-floor-floor bounding box"; Extracting the component model belonging to the target floor from the preset second-layer index structure according to the target component type, and calculating the positional relationship between the target component bounding box and each extracted component model; wherein the second-layer index structure includes a plurality of index information with an index relationship of "component type-floor-component model"; When the calculated positional relationship includes an intersection relationship, all component models whose positional relationship with the target component bounding box is an intersection relationship are screened out from the extracted component models; The step of extracting a target floor bounding box intersecting with the target component bounding box from a preset first-layer index structure according to the target component type, and extracting a target floor to which the target floor bounding box belongs, comprises: Identifying a floor associated with the target component type from the first layer index structure; Filtering out the floor bounding box belonging to the identified floor from the first-layer index structure; Calculate the positional relationship between the target component bounding box and each screened floor bounding box; When the calculated positional relationship includes an intersection relationship, all floor bounding boxes whose positional relationship with the target component bounding box is an intersection relationship are extracted from the screened floor bounding boxes as the target floor bounding box; and the floor to which the target floor bounding box belongs is extracted from the identified floors as the target floor; The step of extracting a component model belonging to the target floor from a preset second-layer index structure according to the target component type, and calculating a positional relationship between the target component bounding box and each extracted component model, comprises: Extracting an octree structure associated with the target component type and the target floor from the second-layer index structure, wherein each node in each octree structure is a component model under a corresponding floor; The extracted octree structure is traversed, and the positional relationship between the target component bounding box and the currently traversed component model is calculated.

2. The method according to claim 1, characterized in that When the calculated positional relationship includes an intersection relationship, all component models whose positional relationship with the target component bounding box is an intersection relationship are screened out from the extracted component models, including: When the calculated positional relationship includes an intersection relationship, all component models whose positional relationship with the target component bounding box is an intersection relationship are screened out from the extracted octree structure.

3. The method according to claim 1, characterized in that Before receiving the target component type and the target component bounding box belonging to the target component type, the method further includes: Obtain a set of component models constituting a target building model; Traversing the component model set, acquiring the component type of the first component model, the floor to which the first component model belongs, and the component bounding box of the first component model from the first component model currently traversed; Searching whether there is index information containing the component type of the first component model and the floor to which the first component model belongs in the cache; If it exists, updating the found index information according to the component bounding box of the first component model; If it does not exist, the component bounding box of the first component model is determined as the floor bounding box, and index information with an index relationship of "component type of the first component model-the floor to which the first component model belongs-the determined floor bounding box" is established, and the established index information is stored in the cache; After traversing the component model set, all index information in the cache with an index relationship of "component type-floor-floor bounding box" is used as the first-level index structure.

4. The method according to claim 3, characterized in that The updating of the index information found according to the component bounding box of the first component model includes: Obtaining the floor bounding box contained in the found index information; Merging the component bounding box of the first component model and the floor bounding box contained in the found index information; The bounding box obtained after merging is used as a new floor bounding box to replace the floor bounding box contained in the found index information.

5. The method according to claim 1, characterized in that Before receiving the target component type and the target component bounding box belonging to the target component type, the method further includes: Obtain a set of component models constituting a target building model; Traversing the component model set, acquiring the second component model currently traversed, and acquiring the component type of the second component model and the floor to which the second component model belongs from the second component model; Searching the cache for index information containing the component type of the second component model and the floor to which the second component model belongs; If it exists, updating the retrieved index information according to the second component model; If it does not exist, then create index information with an index relationship of "component type of the second component model-floor to which the second component model belongs-the second component model", and store the created index information in the cache; After traversing the component model set, all index information with the index relationship of "component type-floor-component model" in the cache is used as the second-level index structure.

6. The method according to claim 5, characterized in that The updating of the retrieved index information according to the second component model includes: Obtaining the floor included in the retrieved index information; The second component model is associated with the floor included in the retrieved index information, and the second component model is added to the retrieved index information.

7. A device for roughly calculating intersecting components, characterized in that: The device comprises: A receiving module, used for receiving a target component type and a target component bounding box belonging to the target component type; an extraction module, configured to extract, according to the target component type, a target floor bounding box intersecting with the target component bounding box from a preset first-layer index structure, and to extract a target floor to which the target floor bounding box belongs; wherein the first-layer index structure includes index information with an index relationship of "component type-floor-floor bounding box"; A calculation module, used to extract the component model belonging to the target floor from the preset second-layer index structure according to the target component type, and calculate the position relationship between the target component bounding box and each extracted component model; wherein the second-layer index structure includes index information with an index relationship of "component type-floor-component model"; A screening module, used for screening out all component models whose positional relationships with the target component bounding box are intersecting relationships from the extracted component models when the calculated positional relationship includes an intersecting relationship; The extraction module is specifically used to: identify the floor associated with the target component type from the first layer index structure; filter out the floor bounding box belonging to the identified floor from the first layer index structure; calculate the positional relationship between the target component bounding box and each filtered floor bounding box; when the calculated positional relationship includes an intersection relationship, extract all floor bounding boxes whose positional relationship with the target component bounding box is an intersection relationship from the filtered floor bounding boxes as the target floor bounding box; and extract the floor to which the target floor bounding box belongs from the identified floor as the target floor; The calculation module is specifically used to: extract an octree structure associated with the target component type and the target floor from the second-layer index structure, each node in each octree structure is a component model under the corresponding floor; traverse the extracted octree structure, and calculate the positional relationship between the target component bounding box and the currently traversed component model.

8. A computer device, comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method according to any one of claims 1 to 6 when executing the computer program.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.