CN112802201A - Method and device for obtaining parallel closest distance between entity models - Google Patents

Method and device for obtaining parallel closest distance between entity models Download PDF

Info

Publication number
CN112802201A
CN112802201A CN201911021812.3A CN201911021812A CN112802201A CN 112802201 A CN112802201 A CN 112802201A CN 201911021812 A CN201911021812 A CN 201911021812A CN 112802201 A CN112802201 A CN 112802201A
Authority
CN
China
Prior art keywords
distance
bounding box
model
screening
bounding
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201911021812.3A
Other languages
Chinese (zh)
Other versions
CN112802201B (en
Inventor
王亮
肖鹏
钱洪亮
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Bochao Time Software Co ltd
Original Assignee
Beijing Bochao Time Software Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Bochao Time Software Co ltd filed Critical Beijing Bochao Time Software Co ltd
Priority to CN201911021812.3A priority Critical patent/CN112802201B/en
Publication of CN112802201A publication Critical patent/CN112802201A/en
Application granted granted Critical
Publication of CN112802201B publication Critical patent/CN112802201B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three dimensional [3D] modelling, e.g. data description of 3D objects
    • G06T17/20Finite element generation, e.g. wire-frame surface description, tesselation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2200/00Indexing scheme for image data processing or generation, in general
    • G06T2200/04Indexing scheme for image data processing or generation, in general involving 3D image data

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Geometry (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Computer Graphics (AREA)
  • Software Systems (AREA)
  • Image Analysis (AREA)

Abstract

The application relates to a method for acquiring parallel closest distance between entity models, which comprises the following steps: carrying out at least one segmentation on each entity model to obtain a plurality of bounding boxes, and creating a distance calculation model corresponding to each entity model according to the plurality of bounding boxes obtained by the segmentation; extracting a first distance calculation model corresponding to the first entity model and a second distance calculation model corresponding to the second entity model from the created distance calculation models; starting from a first-layer node in the first distance calculation model and a first-layer node in the second distance calculation model, calculating the distance between each enclosure box of the first entity model and each enclosure box of the second entity model layer by layer, and screening a plurality of distance results obtained by calculation to obtain corresponding screening results; determining a preferred bounding box according to the screening result; and calculating the parallel closest distance between the first solid model and the second solid model based on each triangle in the preferred bounding box. The method effectively improves the calculation efficiency and reduces the time cost.

Description

Method and device for obtaining parallel closest distance between entity models
Technical Field
The application relates to the technical field of geographic information, in particular to a method and a device for acquiring parallel closest distances between entity models.
Background
In the existing geographic information technology, building models, road modeling, pipeline models, cables and the like, irregular triangulation network models are widely applied, and the requirement for measuring the distance between triangulation network entity model models between two scenes is more and more. For example, in the same project, pipeline, road and building model construction is performed, and distance calculation is required to test the completion degree of combination during combination.
When the nearest distance between the entity models of the triangular network is calculated, the bounding boxes are divided into blocks in the related technology, the blocks are calculated, the nearest pair of bounding boxes is selected, and then accurate calculation is carried out. In the precise calculation, the operation is performed by using a normal method, a line vector, or the like by dividing the triangle inter-plane distance calculation into a plurality of calculations of edge-to-edge, edge-to-triangle, and vertex-to-line. When the precision requirement is high, the algorithm efficiency is low and the time cost is high by adopting the method.
Disclosure of Invention
In view of this, the present application provides a method for obtaining a parallel closest distance between solid models, which can effectively improve computation efficiency and reduce time cost.
According to an aspect of the present application, there is provided a method for obtaining parallel closest distances between solid models, including:
reading scene data, and constructing point data and triangular plane indexes of each entity model in the scene data;
dividing each entity model at least once to obtain a plurality of bounding boxes, and creating a distance calculation model corresponding to each entity model according to the plurality of bounding boxes obtained by division;
the number of triangles in each bounding box in the multiple bounding boxes obtained after each solid model is divided is smaller than a first preset value;
traversing the triangles in each bounding box obtained by segmentation, and correspondingly filling the triangular surface indexes into the corresponding bounding boxes;
receiving an identifier of a first entity model and an identifier of a second entity model which need to be calculated currently, and extracting a first distance calculation model corresponding to the first entity model and a second distance calculation model corresponding to the second entity model from the created distance calculation models;
wherein the first solid model and the second solid model are both solid models in the scene data;
starting from a first-layer node in the first distance calculation model and a first-layer node in the second distance calculation model, calculating distances between each enclosure box of the first entity model and each enclosure box of the second entity model layer by layer, and screening a plurality of calculated distance results to obtain corresponding screening results;
determining a preferred bounding box for calculating the parallel closest distance between the first entity model and the second entity model according to the screening result;
and calculating the distance between the triangles based on each triangle in the preferred bounding box to obtain the parallel shortest distance between the first entity model and the second entity model.
In one possible implementation, segmenting each solid model at least once to obtain a plurality of bounding boxes includes:
performing primary segmentation on the entity model to obtain a plurality of primary bounding boxes;
according to the size relation between the number of the triangles in each first-level bounding box and the first preset numerical value, performing segmentation step by step on the basis of each first-level bounding box until the number of the triangles in each bounding box obtained by segmentation is smaller than the first preset numerical value;
wherein, the value of the first preset numerical value is 3.
In a possible implementation manner, starting from a first-layer node in the first distance calculation model and a first-layer node in the second distance model, calculating distances between each bounding box of the first solid model and each bounding box of the second solid model layer by layer, and screening a plurality of calculated distance results, includes:
calculating the distance between each enclosure box of the first-layer node in the first distance calculation model and each enclosure box of the first-layer node in the second distance calculation model to obtain a plurality of first distance results;
sequencing the first distance results, and extracting a minimum first distance result from the first distance results;
determining a first screening threshold value according to the minimum first distance result, and extracting a first distance result smaller than the first screening threshold value from the first distance results to serve as a first preselected distance;
when the two bounding boxes corresponding to the first preselected distance are both leaf nodes, extracting the first preselected distance and recording the first preselected distance into the screening result;
and when at least one bounding box in the two bounding boxes corresponding to the first preselected distance is the root node, re-screening the bounding box at the next layer of the two bounding boxes corresponding to the first preselected distance.
In one possible implementation, determining a first filtering threshold according to the minimum first distance result includes:
determining a first bounding box and a second bounding box corresponding to the minimum first distance result according to the minimum first distance result;
obtaining an error value of the first bounding box and an error value of the second bounding box, and performing summation calculation on the minimum first distance result, the error value of the first bounding box and the error value of the second bounding box to obtain the first screening threshold;
wherein the error value of the first bounding box is the length of the shortest diagonal line of the three diagonal lines of the first bounding box;
the error value of the second bounding box is the length of the shortest diagonal line in the three diagonal lines of the second bounding box;
and storing the error value of the first bounding box and the error value of the second bounding box in a node corresponding to each distance calculation model when each distance calculation model is created.
In one possible implementation, the second filtering of the next bounding box of the two bounding boxes corresponding to the first preselected distance includes:
calculating the distance between each enclosure box of the second layer node in the first distance calculation model and each enclosure box of the second layer node in the second distance calculation model to obtain a plurality of second distance results;
sequencing the second distance results, and extracting a minimum second distance result from the second distance results;
determining a second screening threshold value based on the minimum second distance result, and extracting a second distance result smaller than the second screening threshold value from the plurality of second distance results to serve as a second preselected distance;
when the two bounding boxes corresponding to the second preselected distance are both leaf nodes, extracting the second preselected distance and recording the second preselected distance into the screening result;
and when at least one bounding box in the two bounding boxes corresponding to the second preselected distance is the root node, re-screening the bounding box at the next layer of the two bounding boxes corresponding to the second preselected result.
In one possible implementation, determining the second filtering threshold according to the minimum second distance result includes:
determining a third bounding box and a fourth bounding box corresponding to the minimum second distance result according to the minimum second distance result;
obtaining an error value of the third bounding box and an error value of the fourth bounding box, and summing the minimum second distance result, the error value of the third bounding box and the error value of the fourth bounding box to obtain a first summation result;
selecting the second screening threshold value with the smallest value from the first screening threshold value and the first summation result;
wherein the error value of the third bounding box is the length of the shortest diagonal line of the three diagonal lines of the third bounding box;
the error value of the fourth bounding box is the length of the shortest diagonal line in the three diagonal lines of the fourth bounding box;
and when each distance calculation model is created, the error values of the third bounding box and the error values of the fourth bounding box are stored in the nodes corresponding to the distance calculation models.
In a possible implementation manner, determining a preferred bounding box for calculating a parallel closest distance between the first solid model and the second solid model according to the screening result includes:
extracting an nth screening threshold determined when a plurality of distance results obtained by calculation are subjected to last screening; n is the total number of screening the multiple distance results;
comparing the magnitude relation between each distance result in the screening results and the nth screening threshold value, and extracting the distance result smaller than the nth screening threshold value from the screening results;
determining the preferred bounding box based on the extracted distance result smaller than the nth screening threshold;
wherein the number of the preferred bounding boxes is greater than or equal to two.
According to another aspect of the application, a device for obtaining parallel closest distances between entity models is further provided, and comprises a data reading and constructing module, an entity model dividing module, a data filling module, a distance calculating module, a data screening module, a bounding box determining module and a distance obtaining module;
the data reading construction module is configured to read scene data and construct point data and triangular plane indexes of all entity models in the scene data;
the entity model segmentation module is configured to segment each entity model at least once to obtain a plurality of bounding boxes, and create a distance calculation model corresponding to each entity model according to the segmented bounding boxes; the number of triangles in each bounding box in the multiple bounding boxes obtained after each solid model is divided is smaller than a first preset value;
the data filling module is configured to traverse the triangles in each bounding box obtained by segmentation, and correspondingly fill the triangular surface indexes into the corresponding bounding boxes;
the distance calculation module is configured to receive an identifier of a first entity model and an identifier of a second entity model which need to be calculated currently, and extract a first distance calculation model corresponding to the first entity model and a second distance calculation model corresponding to the second entity model from the created distance calculation models; wherein the first solid model and the second solid model are both solid models in the scene data;
the data screening module is configured to calculate, from a first-layer node in the first distance calculation model and a first-layer node in the second distance calculation model, distances between each enclosure box of the first physical model and each enclosure box of the second physical model layer by layer, and screen a plurality of calculated distance results to obtain corresponding screening results;
the bounding box determining module is configured to determine a preferred bounding box for calculating the parallel closest distance between the first solid model and the second solid model according to the screening result;
the distance obtaining module is configured to perform inter-triangle distance calculation based on each triangle in the preferred bounding box to obtain a parallel closest distance between the first solid model and the second solid model.
According to an aspect of the present application, there is also provided a device for obtaining parallel closest distances between solid models, including:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to execute the executable instructions to implement any of the methods described above.
According to an aspect of the application, there is also provided a non-transitory computer readable storage medium having stored thereon computer program instructions which, when executed by a processor, implement the method of any of the preceding.
The method for acquiring the parallel closest distance of the entity model part comprises the steps of segmenting each entity model in scene data, constructing a corresponding distance calculation model aiming at each entity model, after extracting the corresponding first distance calculation model and the second distance calculation model according to the identification of the first entity model and the identification of the second entity model which are required to be calculated at present, calculating the distance between each bounding box of the first solid model and each bounding box of the second solid model layer by layer based on the first distance calculation model and the second distance calculation model, after a plurality of distance results obtained by calculation are screened, determining an optimal bounding box for calculating the parallel closest distance according to the screening results, the method effectively reduces the calculation amount, does not need to carry out excessive redundant calculation, further effectively improves the parallel nearest distance acquisition efficiency and reduces the time cost.
Other features and aspects of the present application will become apparent from the following detailed description of exemplary embodiments, which proceeds with reference to the accompanying drawings.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate exemplary embodiments, features, and aspects of the application and, together with the description, serve to explain the principles of the application.
FIG. 1 is a flowchart illustrating a method for obtaining parallel minimum distances between solid models according to an embodiment of the present disclosure;
fig. 2 is a schematic diagram illustrating a first distance calculation model corresponding to a first entity model constructed by using the method for obtaining parallel closest distances between entity models according to the embodiment of the present application;
fig. 3 is a schematic diagram illustrating a second distance calculation model corresponding to a second entity model constructed by using the method for obtaining parallel closest distances between entity models according to the embodiment of the present application;
FIG. 4 is a block diagram of an apparatus for obtaining parallel closest distances between solid models according to an embodiment of the present disclosure;
fig. 5 is a block diagram illustrating an inter-solid-model parallel closest distance acquisition apparatus according to an embodiment of the present application.
Detailed Description
Various exemplary embodiments, features and aspects of the present application will be described in detail below with reference to the accompanying drawings. In the drawings, like reference numbers can indicate functionally identical or similar elements. While the various aspects of the embodiments are presented in drawings, the drawings are not necessarily drawn to scale unless specifically indicated.
The word "exemplary" is used exclusively herein to mean "serving as an example, embodiment, or illustration. Any embodiment described herein as "exemplary" is not necessarily to be construed as preferred or advantageous over other embodiments.
Furthermore, in the following detailed description, numerous specific details are set forth in order to provide a better understanding of the present application. It will be understood by those skilled in the art that the present application may be practiced without some of these specific details. In some instances, methods, means, elements and circuits that are well known to those skilled in the art have not been described in detail so as not to obscure the present application.
Fig. 1 shows a flowchart of a method for obtaining parallel closest distances between solid models according to an embodiment of the present application. Referring to fig. 1, in the method for obtaining parallel closest distances between solid models of the present application, first, through step S100, scene data is read, and point data and triangular plane indexes of each solid model in the scene data are constructed. Here, it should be noted that the scene data mainly refers to a three-dimensional model constructed for a certain scene, the three-dimensional model includes a plurality of entity model models, and each entity model is disposed at a different position. Such as: aiming at a transformer substation scene model constructed by a transformer substation, the transformer substation scene model comprises entity model models such as a transformer, a switch and lightning protection equipment.
It should be noted that, when the point data and the triangular plane index of each entity model in the scene data are constructed, construction and integration can be performed according to the index of each entity model in the scene data. Meanwhile, the point data and the triangular face index of each entity model obtained by construction and integration can be stored and recorded in an array mode.
And step S200, carrying out at least one division on each entity model to obtain a plurality of bounding boxes, and creating a distance calculation model corresponding to each entity model according to the plurality of bounding boxes obtained by the division. Here, it should be noted that the number of triangles in each bounding box of the plurality of bounding boxes obtained by dividing each solid model is smaller than a first preset value. Meanwhile, it should be noted that the distance calculation model constructed for each entity model may be implemented by using a multi-way tree model. For example, referring to fig. 2 and 3, there are structural examples of the first distance calculation model and the second distance calculation model constructed, respectively. That is, the constructed distance calculation model includes multiple layers of nodes, and each node in each layer of nodes may be a root node or a leaf node. And each node corresponding to the first-layer node is each bounding box obtained by carrying out primary segmentation on the initial whole bounding box of the entity model.
After the entity models are divided to obtain a plurality of bounding boxes with the number of triangles smaller than a first preset value, and a corresponding distance technology model is constructed, step S300 may be executed to traverse the triangles in each bounding box obtained by the division, and correspondingly fill the triangular surface indexes into the corresponding bounding boxes. Here, it should be noted that the triangular face index may employ three-dimensional coordinates.
Then, through step S400, the identifier of the first entity model and the identifier of the second entity model that need to be calculated currently are received, and a first distance calculation model corresponding to the first entity model and a second distance calculation model corresponding to the second entity model are extracted from the created distance calculation models. It should be noted, among other things, that receiving an identification of a first entity model and an identification of a second entity model may be accomplished by receiving one or more sets of entity ids. That is, the identifier of the first entity model and the identifier of the second entity model may be transmitted and received in the id manner of one group of entities, or may be transmitted and received together with the ids of multiple groups of entities. Meanwhile, the distance calculation models constructed for each entity model are stored in a buffer area, and a mode that the identification of the entity model corresponds to the distance calculation model is adopted in the storage, or a mode that the ID of the entity model corresponding to the identification is attached to the naming of the distance calculation model is adopted for storage. Therefore, when the id of the first entity model and the id of the second entity model are received and the first distance model and the second distance model need to be extracted, the search and extraction are carried out through the naming of each distance calculation model.
In addition, it should be noted that, when the first distance calculation model of the first entity model or the second distance calculation model of the second entity model is not found in the pre-constructed distance calculation models, the above steps may be sampled to construct the first distance calculation model or the second distance calculation model in real time, and the constructed first distance calculation model or the constructed second distance calculation model is stored in a buffer or released.
After the first distance calculation model and the second distance calculation model are extracted, step S500 may be executed, starting from the first layer node in the first distance calculation model and the first layer node in the second distance calculation model, to calculate the distance between each enclosure box of the first entity model and each enclosure box of the second entity model layer by layer, and to screen a plurality of calculated distance results to obtain corresponding screening results. The screening results comprise screened distance results, and the number of the distance results is determined according to actual screening conditions.
And executing step S600, and determining a preferred bounding box for calculating the parallel closest distance between the first entity model and the second entity model according to the screening result. Then, in step S700, distance calculation between triangles is performed based on the triangle in the preferred bounding box, so as to obtain the parallel closest distance between the first solid model and the second solid model.
Therefore, the method for obtaining the parallel closest distance of the entity model part of the application divides each entity model in the scene data, constructs a corresponding distance calculation model for each entity model, extracts the corresponding first distance calculation model and the second distance calculation model by the identification of the first entity model and the identification of the second entity model which are required to be calculated at present, calculates the distance between each bounding box of the first entity model and each bounding box of the second entity model layer by layer based on the first distance calculation model and the second distance calculation model, screens a plurality of distance results obtained by calculation, and determines the optimal bounding box for calculating the parallel closest distance according to the screening result, thereby effectively reducing the calculation amount, avoiding excessive redundant calculation and further effectively improving the obtaining efficiency of the parallel closest distance, time costs are reduced.
In one possible implementation manner, in step S200, the entity models are divided at least once to obtain a plurality of bounding boxes, which can be implemented as follows.
That is, the solid model is first divided to obtain a plurality of primary bounding boxes. Here, it should be noted that one solid model corresponds to one initial bounding box, and the initial bounding box may be a rectangular parallelepiped. The primary segmentation of the solid model corresponds to the segmentation of an initial bounding box of the solid model, and the initial bounding box is segmented into a plurality of primary bounding boxes. And the plurality of first-level bounding boxes are used as first-level nodes of the distance calculation model. The size of the primary bounding box to be initially divided may be determined based on the size of the data volume and the performance of the computing terminal, and may be, for example, 2 × 2, 3 × 3, 4 × 4, or the like.
And then, according to the size relation between the number of the triangles in each first-level bounding box and a first preset numerical value, performing segmentation step by step based on each first-level bounding box until the number of the triangles in each bounding box obtained by segmentation is smaller than the first preset numerical value. The value of the first preset value may be set to 3.
For example, referring to FIG. 2, an initial bounding box A' of solid model A is initially partitioned into 3 primary bounding boxes (i.e., bounding box A1, bounding box A2, and bounding box A3). Here, the number of the primary bounding boxes obtained by the primary segmentation of different solid models may be different, and generally, the number of the primary bounding boxes may be up to 8.
Then, the number of triangles in each of the bounding box a1, the bounding box a2, and the bounding box A3 is determined. And when the number of the triangles is less than 3, the primary bounding box is not divided again. When the number of the triangles is greater than or equal to 3, the primary bounding box needs to be divided again. Here, when dividing bounding boxes, the bounding boxes may be divided along the center axes of the bounding boxes according to the length, width, and height of each bounding box.
That is, when the number of triangles in both the bounding box a1 and the bounding box a2 is determined to be equal to or greater than 3, both the bounding box a1 and the bounding box a2 are subdivided. Wherein, the bounding box A1 is divided again to obtain a bounding box A4 and a bounding box A5; bounding box a2 is again partitioned into bounding box a6 and bounding box a 7. If the number of triangles in the bounding box A3 is less than 3, the bounding box A3 is not divided twice.
And after the secondary segmentation is finished, continuously judging the number of the triangles in the bounding box obtained by the segmentation. When the number of triangles in the bounding box a4 is judged to be greater than or equal to 3, the bounding box a4 is continuously divided again to obtain a bounding box A8 and a bounding box a 9. When the number of triangles in the bounding box a5, the bounding box a6, and the bounding box a7 is determined to be less than 3, no division is performed.
And after the third segmentation is finished, judging the number of triangles of the bounding box obtained by the second segmentation. That is, when the number of triangles in each of the bounding box A8 and the bounding box a9 is determined to be less than 3, the division is not continued.
Therefore, the solid model A can be segmented through the steps, and a corresponding distance calculation model is constructed according to the segmentation result. The constructed distance calculation model comprises a plurality of layers of nodes, and each node in each layer of nodes corresponds to one bounding box. In addition, in each layer of nodes, the nodes that do not need to be re-divided are leaf nodes in the distance calculation model, and the nodes that need to be re-divided are root nodes in the distance calculation model.
Referring to fig. 3, a distance calculation model is constructed according to the segmentation result after multi-level segmentation is performed on the initial bounding box B' of the solid model B. The segmentation principle is the same as or similar to that of the solid model a shown in fig. 2, and is not described herein again.
In addition, it should be noted that, when the initial bounding box of the solid model is segmented, the segmentation entity is based on proportion rather than size, and the number of the initial segmentation is determined based on the number of triangles.
After the segmentation of each entity model is completed and a corresponding distance calculation model is constructed, step S300 may be executed, the triangles in each bounding box obtained by the segmentation are traversed, and the triangular surface indexes are correspondingly filled into the corresponding bounding boxes. Then, step S400 is executed to receive the identifier of the first entity model and the identifier of the second entity model that need to be calculated currently, and a first distance calculation model corresponding to the first entity model and a second distance calculation model corresponding to the second entity model are extracted from the created distance calculation models.
After the step S400 is performed, the first distance calculation model corresponding to the first entity model and the second distance calculation model corresponding to the second entity model are extracted from the created distance calculation model, then step S500 is performed, and the distances between the bounding boxes of the first entity model and the bounding boxes of the second entity model are calculated layer by layer from the first-layer node in the first distance calculation model and the first-layer node in the second distance calculation model, and the plurality of calculated distance results are filtered to obtain corresponding filtering results.
Specifically, the distance between each bounding box of the first solid model and each bounding box of the second solid model is calculated layer by layer, and the screening of the plurality of distance results obtained by calculation can be realized in the following manner.
That is, first, the distance between each bounding box of the first-layer node in the first distance calculation model and each bounding box of the first-layer node in the second distance calculation model is calculated to obtain a plurality of first distance results. Then, the plurality of first distance results are sorted, and the minimum first distance result is extracted from the plurality of first distance results. And then, determining a first screening threshold value according to the minimum first distance result, and extracting a first distance result smaller than the first screening threshold value from the plurality of first distance results to serve as a first preselected distance. Finally, when the two bounding boxes corresponding to the first preselected distance are both leaf nodes, extracting the first preselected distance and recording the first preselected distance into a screening result; and when at least one bounding box in the two bounding boxes corresponding to the first preselected distance is the root node, re-screening the bounding box at the next layer of the two bounding boxes corresponding to the first preselected distance.
For example, entity model a and entity model B are used as the first entity model and the second entity model, respectively. Correspondingly, fig. 2 and 3 are respectively a structure of the first distance calculation model and a structure of the second distance calculation model.
First, the distance between each bounding box (bounding box a1, bounding box a2, bounding box A3) of the first-tier node in the first distance calculation model and each bounding box (bounding box B1, bounding box B2) of the first-tier node in the second distance calculation model is calculated, and six first distance results are obtained: A1B1, A1B2, A2B1, A2B2, A3B1, A3B 2.
Sorting the six first distance results obtained by the calculation (which may be sorted from large to small, or sorted from small to large), and extracting a minimum first distance result with the shortest distance from the six first distance results: A3B 2.
And then, determining a first screening threshold SX1 according to the minimum first distance result A3B2, and extracting a first distance result smaller than the first screening threshold SX1 from the plurality of first distance results to serve as a first preselected distance.
Here, it is to be noted that the first filtering threshold is determined according to the minimum first distance result by: determining a first bounding box and a second bounding box corresponding to the minimum first distance result according to the minimum first distance result; and obtaining an error value of the first bounding box and an error value of the second bounding box, and summing the minimum first distance result, the error value of the first bounding box and the error value of the second bounding box to obtain a first screening threshold value for determination. The error value of the first bounding box is the length of the shortest diagonal line in the three diagonal lines of the first bounding box. The error value of the second bounding box is the length of the shortest diagonal line of the three diagonal facing lines of the second bounding box.
That is, when determining the first filtering threshold SX1 according to the minimum first distance result A3B2, the first bounding box A3 and the second bounding box B2 corresponding to the result are first determined according to the minimum first distance result A3B 2. Then, an error value of the first bounding box A3 and an error value of the second bounding box B2 are obtained, and then the minimum first distance result A3B2, the error value of the first bounding box A3, and the error value of the second bounding box B2 are summed up to obtain the first screening threshold SX 1.
Further, the six first distance results (i.e., A1B1, A1B2, A2B1, A2B2, A3B1, and A3B2) obtained by the above calculation and the first filtering threshold SX1 are sorted, and a first distance result smaller than the first filtering threshold SX1 is extracted from the six first distance results.
Namely: by the sequence: A3B2 < A1B1 < SX1 < … …, and the extracted first distance result is smaller than a first screening threshold SX 1: A3B2, A1B 1. Wherein, A3B2 and A1B1 are both extracted first preselected distances.
Then, the two bounding boxes corresponding to each first preselected distance are judged to be the root node or the leaf node respectively. That is, it is determined whether the bounding box A3 and the bounding box B2 corresponding to A3B2 are both leaf nodes, and whether the bounding box A1 and the bounding box B1 corresponding to A1B1 are both leaf nodes.
And if the bounding box A3 and the bounding box B2 are judged to be leaf nodes, recording A3B2 in the screening result. If it is determined that the bounding box A1 and the bounding box B1 are root nodes, the next bounding box (i.e., bounding box a4, bounding box a5, bounding box B3, bounding box B4, and bounding box B5) of the two bounding boxes corresponding to A1B1 (i.e., bounding box A1 and bounding box B1) is re-screened.
Here, it should be further noted that, in the screening process, the error value of the first bounding box and the error value of the second bounding box are stored in the node corresponding to the distance calculation model when each distance calculation model is created. That is, in one possible implementation, the error value of the bounding box may be obtained and recorded at a corresponding node when the distance calculation model corresponding to each solid model is created from the plurality of bounding boxes obtained by the division. In the screening process, after the first enclosure box and the second enclosure box are determined, the error value of the first enclosure box and the error value of the second enclosure box are calculated and obtained, meanwhile, the obtained error value of the first enclosure box is stored to a corresponding node in the distance calculation model where the first enclosure box is located, and the obtained error value of the second enclosure box is stored to a corresponding node in the distance calculation model where the second enclosure box is located.
In this embodiment, the second mode may be used for obtaining. That is, the error value of the first bounding box and the error value of the second bounding box are acquired after the first bounding box and the second bounding box are determined. By adopting the implementation mode, the calculation of the data volume can be effectively reduced, and the occupied space of the memory is reduced.
When the next bounding box of the two bounding boxes corresponding to the first preselected distance is screened again, the method can include the following steps:
and calculating the distance between each enclosure box of the second layer node in the first distance calculation model and each enclosure box of the second layer node in the second distance calculation model to obtain a plurality of second distance results.
And sequencing the plurality of second distance results, and extracting a minimum second distance result from the plurality of second distance results.
And determining a second screening threshold value based on the minimum second distance result, and extracting a second distance result smaller than the second screening threshold value from the plurality of second distance results to serve as a second preselected distance.
And when the two bounding boxes corresponding to the second preselected distance are both leaf nodes, extracting the second preselected distance and recording the second preselected distance into a screening result. And when at least one bounding box in the two bounding boxes corresponding to the second preselected distance is the root node, re-screening the bounding box at the next layer of the two bounding boxes corresponding to the second preselected result.
It is noted that, in one possible implementation, the determination of the second filtering threshold according to the minimum second distance result may be implemented in the following manner.
And determining a third bounding box and a fourth bounding box corresponding to the minimum second distance result according to the minimum second distance result. And obtaining an error value of a third bounding box and an error value of a fourth bounding box, and summing the minimum second distance result, the error value of the third bounding box and the error value of the fourth bounding box to obtain a first summation result. And selecting the second screening threshold value from the first screening threshold value and the first summation result, wherein the smallest value is used as the second screening threshold value.
The error value of the third bounding box is the length of the shortest diagonal line in the three diagonal lines of the third bounding box. The error value of the fourth bounding box is the length of the shortest diagonal line of the three diagonal lines of the fourth bounding box.
It should be noted that the error values of the third bounding box and the error values of the fourth bounding box are obtained in the same or similar manner as the error values of the first bounding box and the error values of the second bounding box, which is described above, and thus, the details are not repeated here.
Similarly, the first distance calculation model and the second distance calculation model shown in fig. 2 and 3 will be described as an example.
In performing the secondary screening, the distance between each bounding box (i.e., bounding box a4 and bounding box a5) of the next level (or next node) of bounding box a1 and each bounding box (i.e., bounding box B3, bounding box B4, bounding box B5) of the next node of bounding box B1 is first calculated, resulting in six second distance results: A4B3, A4B4, A4B5, A5B3, A5B4, A5B 5.
And sorting the six second distance results, and extracting the minimum second distance A5B4 with the shortest distance from the six second distance results. And according to the minimum second distance A5B4, determining two bounding boxes corresponding to the minimum second distance: bounding box a5 and bounding box B4.
After the error value of bounding box A5 and the error value of bounding box B4 are calculated, the minimum second distance A5B4, the error value of bounding box A5, and the error value of bounding box B4 are summed to obtain a first summation result num 1.
The magnitude relation between the first screening threshold SX1 and the first summation result num1 is compared, and the second screening threshold SX2 with the smallest value is selected from the first screening threshold SX1 and the first summation result num 1.
And then sorting the six second distance results and the second screening threshold value obtained by calculation, and extracting a second distance result smaller than the second screening threshold value from the six second distance results. That is, by the sequence: A5B4 < A4B4 < SX2 < … …, a second distance result smaller than the second screening threshold SX2 is extracted as a second preselected distance: A5B4 and A4B 4.
Node determination is made for the two bounding boxes corresponding to the second preselected distance A5B4 (i.e., bounding box A5 and bounding box B4). As can be seen from the structural diagrams shown in fig. 2 and 3, the bounding box A5 and the bounding box B4 are both leaf nodes, and therefore A5B4 can be directly recorded in the screening result. Node determination is made for the two bounding boxes corresponding to the second preselected distance A4B4 (i.e., bounding box A4 and bounding box B4). As can be seen from the structural diagrams shown in fig. 2 and 3, the bounding box a4 is the root node, the bounding box B4 is the leaf node, and there is one root node in the two bounding boxes, so that the bounding box next to the bounding box a4 needs to be screened again at this time.
When the bounding boxes of the next node of the bounding box a4 are screened again, the distances between the bounding boxes of the next node of the bounding box a4 (i.e., the bounding box A8 and the bounding box a9) and the bounding box of the leaf node in the second distance calculation model screened at the previous stage (i.e., the bounding box B4) are firstly calculated, and two third distance results are obtained: A8B4 and A9B 4.
Extracting the minimum third distance with the shortest distance from the two third distance results: A8B4, and calculating the error value of the two bounding boxes corresponding to A8B 4: the error value for bounding box A8 and the error value for bounding box B4.
Then, the minimum third distance A8B4, the error value of bounding box A8, and the error value of bounding box B4 are summed to obtain a second sum num 2.
The first screening threshold SX1, the second screening threshold SX2 and the second summation result num2 are sorted, and the third screening threshold SX3 with the smallest value is selected from the first screening threshold SX1, the second screening threshold SX2 and the second summation result num 2. That is, SX3 is min (SX1, SX2, num 2).
A third distance result smaller than the third selection threshold SX3 is selected from the two third distance results by sorting as a third preselected distance. In one possible implementation manner, the selected third distance result smaller than the third filtering threshold SX3 includes A8B4 and A8B 4.
According to the structure diagrams shown in fig. 2 and 3, it is determined that both the bounding boxes corresponding to A8B4 (i.e., bounding box A8 and bounding box B4) are leaf nodes, and therefore, A8B4 can be directly recorded in the screening result. The two bounding boxes corresponding to A9B4 (i.e., bounding box A9 and bounding box B4) are determined to be leaf nodes, so that A9B4 can be directly recorded into the screening result
After the operations, the screening judgment of the first entity model and the second entity model after being segmented can be completed. By adopting a layer-by-layer screening mode, useless calculation in the parallel closest distance calculation process between the entity models is reduced, so that the calculation workload is greatly reduced, and the calculation rate is improved.
It should be noted that, in the method for obtaining parallel closest distances between solid models of the present application, the constructed distance calculation model is not limited in hierarchy, and may be three levels (as shown in fig. 2 and 3), or may be three levels or more, or even tens of levels or tens of levels, which is not limited herein.
Further, after the screening is completed in the above manner, step S600 may be executed to determine a preferred bounding box for calculating the parallel closest distance between the first entity model and the second entity model according to the screening result.
Specifically, first, an nth screening threshold determined when the plurality of distance results obtained by calculation are subjected to the last screening is extracted. Wherein n is the total number of screening the plurality of distance results.
And comparing the magnitude relation between each distance result in the screening results and the nth screening threshold value, and extracting the distance result smaller than the nth screening threshold value from the screening results. And then determining the preferred bounding box based on the extracted distance result smaller than the nth screening threshold. Among them, the number of bounding boxes is preferably two or more.
For example, the results (i.e., the calculation arrays) screened out include A3B2, A5B4, A8B4, and A9B4, as seen in the above-described illustrated example.
Comparing the magnitude relationship between A3B2, A5B4, A8B4, A9B4 and the third screening threshold SX3 by sorting yields: A8B4 < A9B4 < SX3 < A3B2 < A5B 4. Distance results (A8B4 and A9B4) smaller than the third screening threshold are extracted from the sorting sequence, and then a preferred bounding box is determined based on the bounding box corresponding to A8B4 and the bounding box corresponding to A9B 4. Wherein, in this embodiment, the determined preferred bounding box comprises: a8, B4 and a 9.
And then, performing triangle distance calculation on the basis of the determined triangles in the preferred bounding box to obtain the parallel shortest distance between the first solid model and the second solid model.
For example, a preferred bounding box is identified in which two triangles (i.e., Δ 1 and Δ 2) are included within bounding box A8, two triangles (i.e., Δ 3 and Δ 4) are included within bounding box B4, and one triangle (i.e., Δ 5) is included within bounding box A9. In the inter-triangle distance calculation, the distances between the triangles screened in the first physical model (i.e., Δ 1, Δ 2, and Δ 5) and the triangles screened in the second physical model (i.e., Δ 3 and Δ 4) need only be calculated. That is, six inter-triangle distances can be calculated therefrom. And then extracting the shortest distance from the distances among the six triangles obtained by calculation as the parallel shortest distance among the solid models.
It should be noted that, in the algorithm described in the present application, the recursive iteration to select the nearest bounding box and the loop to perform the triangle distance calculation may perform parallel operations on the CPU or the server to strive for the maximum performance, or transfer the data to the GPU for processing.
And, performing the triangle-to-triangle distance calculation in the three-dimensional space may be regarded as the inter-convex body distance calculation. In other words, in the present application, the distance between triangles may be calculated by using a convex body algorithm, thereby effectively avoiding the complicated and cumbersome steps between split points.
For example, performing an inter-convex subtraction transform converts the two triangle distance problem to an origin-to-convex distance problem; points obtained by convex body subtraction need to be subjected to overlap removal, and the number of the obtained point data is at least two theoretically. Then, sorting is carried out, and according to the distance from the convex body vertex to the origin, the distance between the triangle surface formed by the nearest three points and the origin is calculated.
The method can adopt a binary quadratic derivation method for calculation, two edges of a triangular surface are used as x-y vectors, a plane oblique angle coordinate system is established to represent points on the triangle, a group of double values can be returned along with the trend to calculate the nearest point, and meanwhile, a direction vector is returned.
And then, sorting again according to the return direction vector of the previous step, if the sorted result is equal to the previous time, calculating the closest point, and returning the closest distance. If the distances are different, continuing to execute sequencing, and taking the three closest points to form a triangular surface and calculating the distance between the triangular surface and the origin according to the distance between the vertex of the convex body and the origin. Generally, the number of calculations should be within three, and the number of calculations can be limited by setting a threshold.
It should be noted that, although the parallel closest distance obtaining method between the solid models of the present application is described by taking fig. 2 and fig. 3 as an example, those skilled in the art can understand that the present application should not be limited thereto. In fact, the user can flexibly set the specific calculation mode in the acquisition method according to personal preference and/or actual application scenes, as long as the calculation amount can be reduced and the calculation efficiency can be improved.
Therefore, the method and the device adopt a multi-time segmentation means and an adjustable screening mechanism. The entity model is divided in a buffer area in a multi-layer mode, and calculation screening is correspondingly carried out in a calculation area according to the division layers, so that redundant calculation is effectively reduced, useless calculation can be reduced to nothing under the optimal condition, and the calculation rate is improved to more than 30 times while the calculation accuracy is ensured. And when the requirement on the calculation accuracy is very low, the calculation rate can be increased by more than 100 times. Compared with the mode in the related art, the method realizes that the bottom layer calculation occupation ratio is reduced to be below 30%.
In addition, based on any one of the methods for obtaining the parallel closest distance between the solid models, the application also provides a device for obtaining the parallel closest distance between the solid models. Since the working principle of the inter-solid-model parallel closest distance acquisition apparatus of the present application is the same as or similar to that of the inter-solid-model parallel closest distance acquisition method of the present application, repeated descriptions are omitted.
Referring to fig. 4, the apparatus 100 for obtaining parallel closest distances between solid models of the present application includes a data reading construction module 110, a solid model segmentation module 120, a data filling module 130, a distance calculation module 140, a data filtering module 150, a bounding box determination module 160, and a distance obtaining module 170.
The data reading and constructing module 110 is configured to read scene data, and construct point data and triangular plane indexes of each entity model in the scene data. A solid model segmentation module 120 configured to segment each solid model at least once to obtain a plurality of bounding boxes, and create a distance calculation model corresponding to each solid model according to the segmented bounding boxes; the number of triangles in each bounding box in the multiple bounding boxes obtained after each solid model is divided is smaller than a first preset value. A data filling module 130 configured to traverse the triangles in each bounding box obtained by the segmentation, and correspondingly fill the triangular face indexes into the corresponding bounding boxes;
the distance calculation module 140 is configured to receive an identifier of a first entity model and an identifier of a second entity model which currently need to be calculated, and extract a first distance calculation model corresponding to the first entity model and a second distance calculation model corresponding to the second entity model from the created distance calculation models; the first entity model and the second entity model are both entity models in the scene data;
a data screening module 150 configured to calculate, from a first-layer node in the first distance calculation model and a first-layer node in the second distance calculation model, distances between each bounding box of the first entity model and each bounding box of the second entity model layer by layer, and screen a plurality of calculated distance results to obtain corresponding screening results;
a bounding box determining module 160 configured to determine a preferred bounding box for calculating a parallel closest distance between the first solid model and the second solid model according to the screening result;
and the distance acquisition module 170 is configured to perform inter-triangle distance calculation based on the triangles in the preferred bounding box to obtain the parallel closest distance between the first solid model and the second solid model.
Still further, according to another aspect of the present application, there is also provided an inter-mockup parallel closest distance acquisition apparatus 200. Referring to fig. 5, the inter-solid-model parallel closest distance obtaining apparatus 200 according to the embodiment of the present application includes a processor 210 and a memory 220 for storing instructions executable by the processor 210. Wherein the processor 210 is configured to execute the executable instructions to implement any of the above-described methods for parallel closest distance acquisition between solid models.
Here, it should be noted that the number of the processors 210 may be one or more. Meanwhile, the inter-solid-model parallel closest distance acquiring apparatus 200 according to the embodiment of the present application may further include an input device 230 and an output device 240. The processor 210, the memory 220, the input device 230, and the output device 240 may be connected via a bus, or may be connected via other methods, which is not limited in detail herein.
The memory 220, which is a computer-readable storage medium, may be used to store software programs, computer-executable programs, and various modules, such as: the method for obtaining the parallel closest distance between the entity models in the embodiment of the application corresponds to a program or a module. The processor 210 executes various functional applications and data processing of the inter-solid model parallel closest distance acquisition apparatus 200 by executing software programs or modules stored in the memory 220.
The input device 230 may be used to receive an input number or signal. Wherein the signal may be a key signal generated in connection with user settings and function control of the device/terminal/server. The output device 240 may include a display device such as a display screen.
According to another aspect of the present application, there is also provided a non-transitory computer readable storage medium having stored thereon computer program instructions, which when executed by the processor 210, implement any of the above-described methods for parallel inter-solid-model nearest distance acquisition.
Having described embodiments of the present application, the foregoing description is intended to be exemplary, not exhaustive, and not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terms used herein were chosen in order to best explain the principles of the embodiments, the practical application, or technical improvements to the techniques in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein.

Claims (10)

1. A method for obtaining parallel closest distance between entity models is characterized by comprising the following steps:
reading scene data, and constructing point data and triangular plane indexes of each entity model in the scene data;
dividing each entity model at least once to obtain a plurality of bounding boxes, and creating a distance calculation model corresponding to each entity model according to the plurality of bounding boxes obtained by division;
the number of triangles in each bounding box in the multiple bounding boxes obtained after each solid model is divided is smaller than a first preset value;
traversing the triangles in each bounding box obtained by segmentation, and correspondingly filling the triangular surface indexes into the corresponding bounding boxes;
receiving an identifier of a first entity model and an identifier of a second entity model which need to be calculated currently, and extracting a first distance calculation model corresponding to the first entity model and a second distance calculation model corresponding to the second entity model from the created distance calculation models;
wherein the first solid model and the second solid model are both solid models in the scene data;
starting from a first-layer node in the first distance calculation model and a first-layer node in the second distance calculation model, calculating distances between each enclosure box of the first entity model and each enclosure box of the second entity model layer by layer, and screening a plurality of calculated distance results to obtain corresponding screening results;
determining a preferred bounding box for calculating the parallel closest distance between the first entity model and the second entity model according to the screening result;
and calculating the distance between the triangles based on each triangle in the preferred bounding box to obtain the parallel shortest distance between the first entity model and the second entity model.
2. The method of claim 1, wherein segmenting each solid model at least once into a plurality of bounding boxes comprises:
performing primary segmentation on the entity model to obtain a plurality of primary bounding boxes;
according to the size relation between the number of the triangles in each first-level bounding box and the first preset numerical value, performing segmentation step by step on the basis of each first-level bounding box until the number of the triangles in each bounding box obtained by segmentation is smaller than the first preset numerical value;
wherein, the value of the first preset numerical value is 3.
3. The method of claim 1, wherein computing distances between each bounding box of the first physical model and each bounding box of the second physical model layer by layer starting from a first-layer node in the first distance computation model and a first-layer node in the second distance computation model, and screening the computed plurality of distance results comprises:
calculating the distance between each enclosure box of the first-layer node in the first distance calculation model and each enclosure box of the first-layer node in the second distance calculation model to obtain a plurality of first distance results;
sequencing the first distance results, and extracting a minimum first distance result from the first distance results;
determining a first screening threshold value according to the minimum first distance result, and extracting a first distance result smaller than the first screening threshold value from the first distance results to serve as a first preselected distance;
when the two bounding boxes corresponding to the first preselected distance are both leaf nodes, extracting the first preselected distance and recording the first preselected distance into the screening result;
and when at least one bounding box in the two bounding boxes corresponding to the first preselected distance is the root node, re-screening the bounding box at the next layer of the two bounding boxes corresponding to the first preselected distance.
4. The method of claim 3, wherein determining a first filtering threshold based on the minimum first distance result comprises:
determining a first bounding box and a second bounding box corresponding to the minimum first distance result according to the minimum first distance result;
obtaining an error value of the first bounding box and an error value of the second bounding box, and performing summation calculation on the minimum first distance result, the error value of the first bounding box and the error value of the second bounding box to obtain the first screening threshold;
wherein the error value of the first bounding box is the length of the shortest diagonal line of the three diagonal lines of the first bounding box;
the error value of the second bounding box is the length of the shortest diagonal line of the three diagonal lines of the second bounding box.
And storing the error value of the first bounding box and the error value of the second bounding box in a node corresponding to each distance calculation model when each distance calculation model is created.
5. The method of claim 3, wherein re-screening the next one of the two bounding boxes corresponding to the first preselected distance comprises:
calculating the distance between each enclosure box of the second layer node in the first distance calculation model and each enclosure box of the second layer node in the second distance calculation model to obtain a plurality of second distance results;
sequencing the second distance results, and extracting a minimum second distance result from the second distance results;
determining a second screening threshold value based on the minimum second distance result, and extracting a second distance result smaller than the second screening threshold value from the plurality of second distance results to serve as a second preselected distance;
when the two bounding boxes corresponding to the second preselected distance are both leaf nodes, extracting the second preselected distance and recording the second preselected distance into the screening result;
and when at least one bounding box in the two bounding boxes corresponding to the second preselected distance is the root node, re-screening the bounding box at the next layer of the two bounding boxes corresponding to the second preselected result.
6. The method of claim 5, wherein determining a second filtering threshold based on the minimum second distance result comprises:
determining a third bounding box and a fourth bounding box corresponding to the minimum second distance result according to the minimum second distance result;
obtaining an error value of the third bounding box and an error value of the fourth bounding box, and summing the minimum second distance result, the error value of the third bounding box and the error value of the fourth bounding box to obtain a first summation result;
selecting the second screening threshold value with the smallest value from the first screening threshold value and the first summation result;
wherein the error value of the third bounding box is the length of the shortest diagonal line of the three diagonal lines of the third bounding box;
the error value of the fourth bounding box is the length of the shortest diagonal line in the three diagonal lines of the fourth bounding box;
and when each distance calculation model is created, the error values of the third bounding box and the error values of the fourth bounding box are stored in the nodes corresponding to the distance calculation models.
7. The method of claim 3, wherein determining a preferred bounding box for computing the parallel closest distance between the first solid model and the second solid model according to the screening results comprises:
extracting an nth screening threshold determined when a plurality of distance results obtained by calculation are subjected to last screening; n is the total number of screening the multiple distance results;
comparing the magnitude relation between each distance result in the screening results and the nth screening threshold value, and extracting the distance result smaller than the nth screening threshold value from the screening results;
determining the preferred bounding box based on the extracted distance result smaller than the nth screening threshold;
wherein the number of the preferred bounding boxes is greater than or equal to two.
8. A parallel closest distance acquisition device among entity models is characterized by comprising a data reading construction module, an entity model segmentation module, a data filling module, a distance calculation module, a data screening module, a bounding box determination module and a distance acquisition module;
the data reading construction module is configured to read scene data and construct point data and triangular plane indexes of all entity models in the scene data;
the entity model segmentation module is configured to segment each entity model at least once to obtain a plurality of bounding boxes, and create a distance calculation model corresponding to each entity model according to the segmented bounding boxes; the number of triangles in each bounding box in the multiple bounding boxes obtained after each solid model is divided is smaller than a first preset value;
the data filling module is configured to traverse the triangles in each bounding box obtained by segmentation, and correspondingly fill the triangular surface indexes into the corresponding bounding boxes;
the distance calculation module is configured to receive an identifier of a first entity model and an identifier of a second entity model which need to be calculated currently, and extract a first distance calculation model corresponding to the first entity model and a second distance calculation model corresponding to the second entity model from the created distance calculation models; wherein the first solid model and the second solid model are both solid models in the scene data;
the data screening module is configured to calculate, from a first-layer node in the first distance calculation model and a first-layer node in the second distance calculation model, distances between each enclosure box of the first physical model and each enclosure box of the second physical model layer by layer, and screen a plurality of calculated distance results to obtain corresponding screening results;
the bounding box determining module is configured to determine a preferred bounding box for calculating the parallel closest distance between the first solid model and the second solid model according to the screening result;
the distance obtaining module is configured to perform inter-triangle distance calculation based on each triangle in the preferred bounding box to obtain a parallel closest distance between the first solid model and the second solid model.
9. An apparatus for obtaining parallel closest distances between solid models, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to carry out the executable instructions when implementing the method of any one of claims 1 to 7.
10. A non-transitory computer readable storage medium having computer program instructions stored thereon, wherein the computer program instructions, when executed by a processor, implement the method of any of claims 1 to 7.
CN201911021812.3A 2019-10-25 2019-10-25 Method and device for obtaining parallel nearest distance between entity models Active CN112802201B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911021812.3A CN112802201B (en) 2019-10-25 2019-10-25 Method and device for obtaining parallel nearest distance between entity models

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911021812.3A CN112802201B (en) 2019-10-25 2019-10-25 Method and device for obtaining parallel nearest distance between entity models

Publications (2)

Publication Number Publication Date
CN112802201A true CN112802201A (en) 2021-05-14
CN112802201B CN112802201B (en) 2023-12-29

Family

ID=75802912

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911021812.3A Active CN112802201B (en) 2019-10-25 2019-10-25 Method and device for obtaining parallel nearest distance between entity models

Country Status (1)

Country Link
CN (1) CN112802201B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115908542A (en) * 2022-10-31 2023-04-04 中交第四航务工程勘察设计院有限公司 BIM-based method for rapidly calculating distance between polyhedrons

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130083019A1 (en) * 2011-09-30 2013-04-04 Hon Hai Precision Industry Co., Ltd. Computing device and method for determining distance between two curved surfaces
CN104200031A (en) * 2014-09-04 2014-12-10 大连大学 Collision detecting method based on distance precedence and space-time relevancy
CN105869470A (en) * 2015-05-28 2016-08-17 国家电网公司 Extra-high voltage transformer station operation simulation method and system
CN108305289A (en) * 2018-01-25 2018-07-20 山东师范大学 Threedimensional model symmetric characteristics detection method based on least square method and system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130083019A1 (en) * 2011-09-30 2013-04-04 Hon Hai Precision Industry Co., Ltd. Computing device and method for determining distance between two curved surfaces
CN104200031A (en) * 2014-09-04 2014-12-10 大连大学 Collision detecting method based on distance precedence and space-time relevancy
CN105869470A (en) * 2015-05-28 2016-08-17 国家电网公司 Extra-high voltage transformer station operation simulation method and system
CN108305289A (en) * 2018-01-25 2018-07-20 山东师范大学 Threedimensional model symmetric characteristics detection method based on least square method and system

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
YAGUANG QIN 等: "Research and application of Boolean operation for triangular mesh model of underground space engineering—Boolean operation for triangular mesh model", 《ENERGY SCIENCE & ENGINEERING》, vol. 7, no. 5, pages 1154 - 1165 *
邵晓东 等: "基于自适应检测线的碰撞检测算法", 《计算机集成制造系统》, vol. 19, no. 12, pages 3147 - 3154 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115908542A (en) * 2022-10-31 2023-04-04 中交第四航务工程勘察设计院有限公司 BIM-based method for rapidly calculating distance between polyhedrons
CN115908542B (en) * 2022-10-31 2023-09-19 中交第四航务工程勘察设计院有限公司 BIM-based rapid calculation method for inter-polyhedron distance

Also Published As

Publication number Publication date
CN112802201B (en) 2023-12-29

Similar Documents

Publication Publication Date Title
CN110458957B (en) Image three-dimensional model construction method and device based on neural network
CN113096234B (en) Method and device for generating three-dimensional grid model by using multiple color pictures
US8711143B2 (en) System and method for interactive image-based modeling of curved surfaces using single-view and multi-view feature curves
US9430872B2 (en) Performance prediction for generation of point clouds from passive imagery
Yang et al. Non-parametric depth distribution modelling based depth inference for multi-view stereo
CN110832548A (en) Method and device for simplifying three-dimensional grid model
CN110930503B (en) Clothing three-dimensional model building method, system, storage medium and electronic equipment
CN112733318B (en) Adaptive grid subdivision method, device, equipment and storage medium
CN107492120B (en) Point cloud registration method
CN109035407B (en) Direction-based parameter curved surface triangularization method, device, equipment and storage medium
CN112825199B (en) Collision detection method, device, equipment and storage medium
CN113744408A (en) Grid generation method, device and storage medium
CN113971718B (en) Method for performing Boolean operation on three-dimensional point cloud model
CN113628343B (en) Three-dimensional grid combination processing method and device and storage medium
CN112802201A (en) Method and device for obtaining parallel closest distance between entity models
CN116933607B (en) Mine resource model creation method, device, equipment and storage medium
CN114663298A (en) Disparity map repairing method and system based on semi-supervised deep learning
CN117036623A (en) Matching point screening method based on triangulation
CN112337093B (en) Virtual object clustering method and device, storage medium and electronic device
CN113191310B (en) Boundary recognition method, device and equipment for vector PDF drawing entity filling
CN114511571A (en) Point cloud data semantic segmentation method and system and related components
JP7056452B2 (en) Simulation equipment, simulation method and simulation program
CN115690120B (en) Method, apparatus, device, medium and program product for generating three-dimensional grid
CN116089076B (en) Data processing method, device, computer equipment and storage medium
CN116309759B (en) Point cloud coarse registration method based on rapid triangular feature histogram

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant