An implementation method for quickly matching and finding similar geometric bodies

By judging the interrelationships and layout consistency between geometric bodies of the three-dimensional model, the rapid matching search of similar geometric bodies is achieved, solving the problem of identifying and matching the same or similar three-dimensional models in traditional methods, and improving work efficiency and rendering performance.

CN119357425BActive Publication Date: 2025-05-27DMS CORP
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411920752.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-25
Publication Date
2025-05-27
Estimated Expiration
2044-12-25

AI Technical Summary

Technical Problem

In three-dimensional graphics processing, traditional methods are difficult to efficiently identify and match the same or similar three-dimensional models, resulting in low storage efficiency, poor rendering performance and low working efficiency.

Method used

By judging whether the relationship between geometric bodies that constitute one three-dimensional model is the same as that between geometric bodies of another three-dimensional model, and further judge whether each geometric body is consistent when the layout is consistent, it realizes rapid matching search for similar geometric bodies.

Benefits of technology

It improves the efficiency and accuracy of three-dimensional model matching search, reduces file storage volume, optimizes file structure, simplifies editing work, and significantly improves work efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119357425B_ABST
    Figure CN119357425B_ABST
Patent Text Reader

Abstract

The present invention relates to a method for realizing rapid matching and searching of similar geometric bodies, belonging to the technical field of three-dimensional graphics processing, and includes: S1, determining whether the mutual relationship between multiple geometric bodies constituting a three-dimensional model is the same as the mutual relationship between multiple geometric bodies of another three-dimensional model; S2, when the layouts of the two three-dimensional models are the same, determining whether each geometric body constituting the two three-dimensional models is consistent. Specifically, it includes the following sub-steps: analyzing the center point coordinates of all three-dimensional models in the three-dimensional graphics file; analyzing the vector included angle relationship between the center point coordinates of all geometric bodies corresponding to each three-dimensional model and the center point coordinates of the corresponding three-dimensional model; comparing the vector included angle relationships in at least two three-dimensional models to preliminarily determine whether the spatial layouts of at least two three-dimensional models are the same; matching the comparison objects; and sequentially determining whether the geometric bodies to be compared are consistent according to the comparison sequence.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of three-dimensional graphics processing, and particularly to a method for quickly matching and searching similar geometric bodies. Background Art

[0002] In the fields of modern three-dimensional modeling and computer graphics, especially in applications where a large number of devices of the same type are arranged in complex scenes or systems, such as industrial design, architectural visualization, and virtual reality, it is often necessary to repeatedly arrange and install the same type of device in a three-dimensional scene, that is, the same model of device needs to be installed at different positions respectively, such as pressure gauges, motors, etc. Generally speaking, the same type of device is based on the same three-dimensional model, and multiple models are formed after being repeatedly arranged at different positions in the scene and performing operations such as translation, rotation, and scaling, as Figure 1 shown.

[0003] Traditionally, for the same three-dimensional objects at different positions (such as the repeated arrangement of the same model of device at different positions), there are two main data storage methods: one is to make a complete data copy of each arranged device, and the other is to only record the transformation information relative to the original device.

[0004] The first method, namely full-copy storage, although it can ensure the independence of each device object and has a certain degree of flexibility especially when modifying the attributes of a single object, it also brings significant problems. First, the storage efficiency is low, and the file size will rapidly expand as the number of devices increases. Especially in a densely arranged scene, the storage requirement may increase by dozens of times or more. In addition, when it is necessary to uniformly update or replace the same model of device, the existence of duplicate data means that a large amount of manpower and time are required for manual operations. More critically, during the three-dimensional rendering process, this duplicate data directly leads to a great waste of memory and video memory resources, affecting the rendering efficiency and performance, especially obvious when dealing with high-complexity scenes.

[0005] In contrast, the second method only records the transformation information (such as translation, rotation, scaling) to reference the original model, which not only significantly reduces the storage space requirement but also provides higher efficiency during the update and rendering processes.

[0006] However, many current design software only adopts the first method or a combination of the first and second methods for data storage based on their own considerations, which will undoubtedly have a serious impact on work efficiency. If the same three-dimensional objects in the data stored in the first way can be found and the data format can be converted into the data stored in the second way, it can provide a more convenient and efficient operation way for many subsequent operations. However, the core of this operation lies in finding the same data, which is a difficult point in three-dimensional data processing. The traditional method is to compare the parameters of each vertex of the triangle one by one. Due to the data volume and accuracy reasons, the corresponding accuracy and speed are both relatively big problems.

[0007] The core use of instancing is a technology for efficiently processing a large number of identical or similar objects in graphics rendering. It saves memory by reducing the storage of duplicate data and improves rendering performance through GPU optimization. Instancing allows a geometry to be drawn multiple times, and each time it can have different transformations (position, rotation, scaling), colors, or other attributes. In computer graphics, the instancing technology allows a geometric model to be drawn multiple times, and each time it can have different transformations (such as position, rotation, scaling), colors, or other attributes. The benefit of this is to reduce memory occupancy and improve the rendering speed through GPU parallel processing. For example, in CN116109745A, an object rendering method and device based on instancing technology, in which, for the situation where the performance details of the model in the three-dimensional scene gradually increase, starting from the GPU instancing technology, it realizes the batched rendering of multiple card instances based on the same card model. When making the model, multiple sets of texture maps and corresponding UV texture maps are made for the model. Further, in the same material ball, texture maps with similar attributes or other types of texture maps are merged; when rendering the instances of the model, the material attributes of different model instances are dynamically set through the script established for the model, and the positioning is performed in the merged texture map through the offset value of the UV, thus meeting the requirements of GPU instancing rendering, and then realizing the batched rendering of multiple different instances through the same model.

[0008] However, for the already generated three-dimensional graphics files, the instancing technology is of no use because the prerequisite for using the instancing technology is to know that a certain three-dimensional model needs to be rendered repeatedly in its three-dimensional graphics file. However, when reading a certain three-dimensional graphics file, the system cannot know which three-dimensional models in the three-dimensional graphics file are the same as each other. This is because when the made three-dimensional graphics file is generated into the release format, usually only the information of several triangles constituting each three-dimensional model is stored, such as the three-dimensional graphics files in OBJ and FBX formats. Therefore, for the three-dimensional graphics files in the release format, efficient processing of a large number of identical three-dimensional objects can be realized on the premise of determining the identity.

[0009] As can be seen from the above content, in the field of 3D graphics processing technology, whether it is data storage or graphics rendering, it is necessary to achieve fast matching and searching for similar geometric bodies, so as to improve work efficiency and quality. Based on this, there is an urgent need in this field for an optimized solution for processing 3D graphics files.

[0010] In addition, on the one hand, there are differences in the understanding of those skilled in the art; on the other hand, although the applicant has studied a large number of documents and patents when making this invention, due to space limitations, not all details and content are listed in detail. However, this does not mean that this invention does not possess the features of these prior arts. On the contrary, this invention already possesses all the features of the prior arts, and the applicant reserves the right to add relevant prior arts in the background art. Summary of the Invention

[0011] Aiming at the deficiencies of the prior art, the present invention provides a method for realizing fast matching and searching for similar geometric bodies to solve at least some of the above technical problems.

[0012] The present invention discloses a method for realizing fast matching and searching for similar geometric bodies, which includes the following steps:

[0013] S1. Determine whether the mutual relationship between multiple geometric bodies constituting a 3D model is the same as the mutual relationship between multiple geometric bodies of another 3D model;

[0014] S2. When the layouts of the two 3D models are the same, determine whether each geometric body constituting the two 3D models is consistent.

[0015] The implementation method of the present invention realizes the similarity matching search of 3D models through two main steps. First, by determining whether the mutual relationship between multiple geometric bodies constituting a 3D model is the same as the mutual relationship between multiple geometric bodies of another 3D model (step S1), this step can effectively identify models with the same internal structure by comparing the relative positions and layout relationships between the geometric bodies inside the model, even if these models may have transformations such as rotation and translation in shape. Then, when the layouts of the two 3D models are the same, further determine whether each geometric body constituting the two 3D models is consistent (step S2), which ensures that the models are not only similar in macroscopic layout but also consistent in microscopic geometric details.

[0016] The core advantage of this implementation method lies in that it greatly improves the efficiency and accuracy of 3D model matching and searching. In the field of 3D design and manufacturing, especially in large projects, a large number of 3D model files often need to be processed, and these files may contain duplicate design elements. The traditional manual search and replacement methods are not only time-consuming and laborious, but also error-prone. By using the method of the present invention, all duplicate 3D models can be quickly and accurately found, which is of great significance for reducing the file storage volume. On the one hand, identifying and removing duplicate model data can significantly reduce the overall size of the file, thus saving storage resources; on the other hand, for the known duplicate parts, the existing model instances can be directly referenced, avoiding the storage of redundant data and further optimizing the file structure. In addition, this method also greatly facilitates the editing work of 3D models. For example, when a specific design element needs to be replaced, only one place needs to be modified to automatically update all relevant instances, realizing efficient batch editing and significantly improving work efficiency.

[0017] According to a preferred implementation manner, step S1 includes the following sub-steps:

[0018] S1.1. Analyze the central point coordinates of all 3D models in the 3D graphic file respectively;

[0019] S1.2. Analyze the vector included angle relationship between the central point coordinates of all geometric bodies corresponding to each 3D model and the central point coordinates of the corresponding 3D model;

[0020] S1.3. Compare the vector included angle relationships in at least two 3D models to preliminarily determine whether the spatial layouts of at least two 3D models are the same.

[0021] The above content further refines the specific implementation manner of step S1, and proposes a method for preliminarily determining whether the spatial layouts of 3D models are the same by analyzing the central point coordinates of 3D models and the vector included angle relationship between the central point coordinates of each geometric body and the central point coordinates of the model. This method starts from the perspective of geometry and uses the internal structural characteristics of 3D models to make similarity judgments, which has high scientificity and practicality.

[0022] By analyzing the central point coordinates, the spatial position of the model can be quickly located, and the introduction of the vector angle relationship further refines the comparison of the internal structure of the model. This method can not only efficiently identify exactly the same models, but also discover those models that are similar in overall layout but have differences in subtle details, thus improving the accuracy of matching search. In practical applications, this method helps to improve the performance of the 3D model management system. Especially when dealing with a large-scale model library, it can significantly speed up the search speed and reduce unnecessary computational overhead. In addition, through in-depth analysis of the internal structure of the model, valuable information can also be provided for subsequent model optimization, such as identifying redundant parts in the model to help designers simplify the model structure and improve design efficiency.

[0023] According to a preferred embodiment, in step S1.1, the central point coordinates of the 3D model are calculated in two ways. One is to calculate the central point coordinates of the 3D model based on all vertex coordinates of the 3D model; the other is to calculate the central point coordinates of the 3D model based on the central point coordinates of all geometric bodies of the 3D model.

[0024] The above content further refines the method for calculating the central point coordinates of the 3D model in step S1.1, providing two different calculation methods: one is to calculate the central point coordinates based on all vertex coordinates of the 3D model, and the other is to calculate the central point coordinates based on the central point coordinates of all geometric bodies of the 3D model. These two methods have their own advantages and disadvantages, but both can provide effective support in different scenarios.

[0025] The calculation method based on vertex coordinates is suitable for models with complex geometric structures. By integrating the position information of all vertices, it can more accurately reflect the overall geometric center of the model. The advantage of this method is that the calculation result is more refined and can better adapt to the changes in the internal structure of the model, especially suitable for occasions that require high-precision matching. The calculation method based on the central point coordinates of geometric bodies is more suitable for models with fewer geometric bodies and simple structures. By directly using the central point coordinates of geometric bodies, the calculation process can be simplified and the calculation efficiency can be improved. On the premise of ensuring basic accuracy, this method can significantly shorten the calculation time and is especially suitable for real-time processing or large-scale data processing scenarios.

[0026] In summary, the introduction of these two calculation methods provides a flexible choice for calculating the central point coordinates of the 3D model, enabling users to select the most suitable method according to specific needs. This flexibility not only improves the adaptability of the system, but also provides a more reliable basis for subsequent model matching and analysis. In practical applications, this method helps to improve the efficiency and accuracy of 3D model processing. Especially in scenarios that require quick response or process a large amount of data, it can significantly enhance the overall performance of the system.

[0027] According to a preferred embodiment, for the vector angle relationship, first, the center points of all geometric bodies of the corresponding 3D model itself are respectively connected to the center point of the 3D model itself to form vectors from the center points of their respective geometric bodies to the center point of the corresponding 3D model. Then, the vector angles of the center point connections between the vectors from the center points of their respective geometric bodies to the center point of the corresponding 3D model are determined, and an index for characterizing the relationship between the vector angles in the 3D model is obtained based on these angles.

[0028] The above further defines the specific calculation method of the vector angle relationship, that is, the center points of all geometric bodies of the corresponding 3D model itself are respectively connected to the center point of the 3D model itself to form vectors from the center points of each geometric body to the center point of the corresponding 3D model. Then, the vector angles of the center point connections between these vectors are determined, and an index for characterizing the relationship between the vector angles in the 3D model is obtained based on these angles. By introducing the concept of vector angles, this method can more accurately describe the similarity of the internal structure of the 3D model.

[0029] The introduction of the vector angle relationship not only increases the dimension of model matching but also improves the matching accuracy. By calculating the vector angles from the center points of each geometric body to the center point of the model, the relative positional relationship of the geometric bodies inside the model can be comprehensively reflected. The advantage of this method is that even if the model rotates or translates in space, as long as the internal structure remains unchanged, its vector angle relationship will not change. Therefore, it can effectively identify models with the same internal structure. In practical applications, this method can significantly improve the robustness of model matching and reduce the possibility of misjudgment. In addition, by calculating the vector angle relationship, models that are similar in macroscopic layout but different in microscopic details can also be discovered, providing important reference information for subsequent model optimization and analysis.

[0030] Generally speaking, the introduction of the vector angle relationship not only improves the accuracy and robustness of model matching but also provides a new tool for in-depth analysis of 3D models. The application prospect of this method is wide. Especially in scenarios that require high-precision matching and analysis, it can significantly improve the performance and reliability of the system. With the continuous progress of 3D modeling technology, this method will play an important role in more advanced applications.

[0031] According to a preferred embodiment, the index for characterizing the relationship between the vector angles in the 3D model is the sum of the vector angles.

[0032] The present invention makes it possible to simply and effectively quantify the similarity of the internal structure of the model by clarifying that the index for characterizing the relationship between the vector angles in the 3D model is the sum of the vector angles.

[0033] By calculating the sum of the included angles of each vector, the complex three-dimensional structure information can be transformed into a simple numerical value, which is convenient for subsequent comparison and analysis. The advantage of this method is that it can not only quickly evaluate the similarity between models, but also reflect the complexity of the internal structure of the models to a certain extent. Therefore, by comparing the sum of the included angles of vectors of different models, models with similar internal structures can be quickly identified, thus improving the efficiency of matching search.

[0034] In addition, the calculation method of the sum of the included angles of vectors also has good scalability and comparability. When dealing with a large-scale model library, the sum of the included angles of vectors of each model can be calculated in advance and stored as the eigenvalue of the model. When performing model matching, only these eigenvalues need to be compared to quickly screen out candidate models, greatly reducing the calculation time and resource consumption. This method is not only applicable to the management of static model libraries, but also can achieve real-time matching in a dynamic environment, providing strong support for the efficient management and application of three-dimensional models.

[0035] According to a preferred implementation manner, in step S1.3, by analyzing the sum of the included angles of the vectors connecting the center points in each three-dimensional model, the deviation value of the sum of the included angles of vectors of any two three-dimensional models is calculated, and the calculated deviation value is compared with a preset threshold to determine whether the spatial layouts of at least two three-dimensional models are the same.

[0036] The above content further details how to determine whether the spatial layouts of at least two three-dimensional models are the same by analyzing the sum of the included angles of the vectors connecting the center points in each three-dimensional model in step S1.3. Specifically, by calculating the deviation value of the sum of the included angles of vectors of any two three-dimensional models and comparing the deviation value with a preset threshold, it can effectively determine whether the spatial layouts of the models are consistent.

[0037] The core advantage of this method is that it provides a method for quantifying model similarity, making the similarity judgment more objective and accurate. By calculating the deviation value of the sum of the included angles of vectors, the similarity between models can be transformed into a specific numerical value, which is convenient for subsequent comparison and analysis. This method can not only quickly identify completely identical models, but also discover those models that are similar in macroscopic layout but different in microscopic details, thus improving the accuracy of matching search.

[0038] In addition, by setting a preset threshold, the strictness of matching can be flexibly adjusted. For example, in occasions where high-precision matching is required, a smaller threshold can be selected to ensure that only highly similar models can pass the matching; while in occasions where a large number of models need to be quickly screened, a larger threshold can be selected to improve the matching speed. The flexibility of this method allows users to select the most suitable matching strategy according to specific needs, thus achieving good results in different application scenarios.

[0039] Generally speaking, by calculating the deviation value of the sum of vector included angles and performing threshold comparison, not only the efficiency and accuracy of model matching are improved, but also new tools and methods are provided for the management and analysis of 3D models. The application prospect of this method is wide. Especially in scenarios that require high-precision matching and analysis, it can significantly improve the performance and reliability of the system.

[0040] According to a preferred implementation manner, step S2 includes the following sub-steps:

[0041] S2.1. Match the comparison objects;

[0042] S2.2. Sequentially determine whether the geometric bodies to be compared are consistent with each other according to the comparison sequence.

[0043] The above content further refines the specific implementation manner of step S2, and proposes a method of matching comparison objects and sequentially determining whether the geometric bodies to be compared are consistent according to the comparison sequence. By gradually refining the comparison of the internal structure of the model, this method can more accurately identify exactly the same geometric bodies, thus ensuring the consistency of the model in micro details.

[0044] First of all, by matching comparison objects, the geometric bodies with the same characteristics in two 3D models can be paired, thereby narrowing the comparison scope and reducing unnecessary calculation overhead. The advantage of this method is that it can efficiently screen out potential matching objects and provide a reliable basis for subsequent detailed comparison. Secondly, by sequentially determining whether the geometric bodies to be compared are consistent according to the comparison sequence, the similarity of each geometric body can be systematically verified to ensure the consistency of the model in micro details. This method not only improves the accuracy of matching, but also provides important reference information for subsequent model optimization and analysis.

[0045] In addition, this method also has good scalability and comparability. When dealing with a large-scale model library, the eigenvalue of each geometric body can be calculated in advance and stored as a comparison object. When performing model matching, only need to sequentially compare these eigenvalues according to the preset comparison sequence to quickly screen out candidate models, greatly reducing the calculation time and resource consumption. This method is not only applicable to the management of static model libraries, but also can achieve real-time matching in a dynamic environment, providing strong support for the efficient management and application of 3D models.

[0046] Generally speaking, by matching comparison objects and sequentially determining the consistency of geometric bodies according to the comparison sequence, not only the efficiency and accuracy of model matching are improved, but also new tools and methods are provided for the management and analysis of 3D models. The application prospect of this method is wide. Especially in scenarios that require high-precision matching and analysis, it can significantly improve the performance and reliability of the system.

[0047] According to a preferred embodiment, in step S2.1, by analyzing the relationship between the vectors from the geometric center points of the two three-dimensional models selected through screening to the center points of the corresponding three-dimensional models, the geometric bodies to be compared among the geometric bodies constituting the two three-dimensional models are determined, and these geometric bodies are sorted and paired one by one based on the comparison sequence of each geometric body in the three-dimensional model to obtain paired comparison objects.

[0048] The above content further details the specific implementation manner of step S2.1, and proposes to determine the geometric bodies to be compared among the geometric bodies constituting the two three-dimensional models by analyzing the relationship between the vectors from the geometric center points of the two three-dimensional models selected through screening to the center points of the corresponding three-dimensional models, and sort and pair these geometric bodies one by one based on the comparison sequence of each geometric body in the three-dimensional model to obtain paired comparison objects. By introducing the concept of the comparison sequence, this method makes the pairing of geometric bodies more orderly and efficient.

[0049] By analyzing the relationship between the vectors and determining the comparison sequence, unnecessary computational overhead can be effectively reduced and the matching efficiency can be improved. Specifically, the introduction of the comparison sequence makes the pairing of geometric bodies more systematic and orderly, avoiding the uncertainty brought by random pairing. The advantage of this method is that it can not only efficiently screen out potential matching objects, but also ensure that the pairing order of each geometric body is reasonable, thereby improving the accuracy of subsequent comparisons. In addition, through the sorting of the comparison sequence, it is easier to discover those geometric bodies that are similar in macroscopic layout but different in microscopic details, providing important reference information for subsequent model optimization and analysis.

[0050] Generally speaking, by introducing the concept of the comparison sequence, not only the efficiency and accuracy of the pairing of geometric bodies are improved, but also new tools and methods are provided for the management and analysis of three-dimensional models. The application prospect of this method is wide, especially in scenarios that require high-precision matching and analysis, it can significantly improve the performance and reliability of the system.

[0051] According to a preferred embodiment, in step S2.2, a pair of geometric bodies with the same comparison sequence in the two three-dimensional models are compared according to a preset comparison rule, where the preset comparison rule includes the following process:

[0052] a. Initially judge whether these two geometric bodies are the same based on the basic attributes of the geometric bodies. If the basic attributes are different, exit; if they are the same, execute the subsequent process;

[0053] b. For the geometric bodies to be compared in the first 3D model, use a preset algorithm to extract the faces that need to participate in the calculation, and calculate the face normals of each extracted face and its next face. Among them, each extracted face has two normals;

[0054] c. Calculate the included angles between the normals corresponding to all the faces that need to participate in the calculation and their next faces, and accumulate them together to obtain the sum of the included angles;

[0055] d. For the geometric bodies to be compared in the second 3D model, execute the process from b to c to form another sum of the included angles;

[0056] e. Compare whether the sums of the included angles of the two geometric bodies are the same. If they are the same, it means the geometric bodies are the same; otherwise, it means they are different and exit.

[0057] The above content further refines the specific implementation method of step S2.2 and proposes a method to judge whether two geometric bodies are consistent through preset comparison rules. Specifically, this method includes the following steps: First, preliminarily judge whether the two geometric bodies are consistent based on the basic attributes of the geometric bodies; Second, for the geometric bodies to be compared in the first 3D model, use a preset algorithm to extract the faces that need to participate in the calculation, and calculate the face normals of each extracted face and its next face; Third, calculate the included angles between the normals corresponding to all the faces that need to participate in the calculation and their next faces, and accumulate them to obtain the sum of the included angles; Finally, for the geometric bodies to be compared in the second 3D model, execute the same process and compare whether the sums of the included angles of the two geometric bodies are the same.

[0058] The core advantage of this method is that it ensures the similarity of geometric bodies in multiple aspects through multi-level comparison. First, through the preliminary judgment of the basic attributes, geometric bodies that are obviously inconsistent can be quickly excluded, reducing unnecessary computational overhead. Second, through the calculation of face normals and the comparison of the sum of the included angles, the similarity of geometric bodies can be verified more accurately. This method not only improves the accuracy of matching but also provides detailed geometric information for subsequent model optimization and analysis.

[0059] In addition, by using a preset algorithm to extract the faces that need to participate in the calculation, the granularity and precision of the calculation can be flexibly adjusted. For example, in occasions where high-precision matching is required, a smaller sampling interval can be selected to ensure that each face is fully considered; while in occasions where a large number of geometric bodies need to be quickly screened, a larger sampling interval can be selected to improve the calculation efficiency. The flexibility of this method enables users to select the most suitable matching strategy according to specific needs, thus achieving good results in different application scenarios.

[0060] Generally speaking, through multi-level comparison and detailed geometric information verification, not only the efficiency and accuracy of geometric body matching are improved, but also new tools and methods are provided for the management and analysis of 3D models. The application prospect of this method is extensive. Especially in scenarios that require high-precision matching and analysis, it can significantly improve the performance and reliability of the system.

[0061] According to a preferred embodiment, the method further includes step S0 for grouping 3D models before step S1. In step S0, these 3D models are grouped according to the number of geometric bodies, description, storage structure that make up the 3D model, or the set of triangular faces that make up the 3D model, so as to facilitate finding the same 3D models within the same group.

[0062] The present invention sets step S0 before step S1 to significantly improve the efficiency of subsequent matching and searching by pre-classifying the models. First of all, through grouping, models with similar characteristics can be classified together, thus reducing unnecessary cross-group comparisons. The advantage of this method is that it can efficiently narrow the search scope and reduce computing time and resource consumption. Specifically, grouping by the number of geometric bodies can quickly screen out models with the same complexity; grouping by description can classify according to information such as the name, use, and creator of the model, thus improving the pertinence of the search; grouping by storage structure can classify according to the characteristics of the file format and data structure, thus improving the accuracy of matching; grouping by the set of triangular faces can classify according to the geometric shape of the model, thus improving the robustness of matching. In addition, through grouping, valuable reference information can be provided for subsequent model optimization and analysis. For example, by analyzing the models within the same group, common patterns and repeated elements in the design can be found, which can help designers simplify the model structure and improve design efficiency. In addition, grouping can also support model version management and collaborative work. For example, by classifying the models of the same project together, it is more convenient to perform version control and team collaboration.

[0063] Generally speaking, by pre-grouping 3D models, not only the efficiency and accuracy of subsequent matching and searching are improved, but also new tools and methods are provided for the management and analysis of 3D models. The application prospect of this method is extensive. Especially in scenarios that require processing large-scale model libraries, it can significantly improve the overall performance and reliability of the system. Brief Description of the Drawings

[0064] Figure 1 is a schematic diagram showing a 3D scene containing 3D models of multiple devices of the same type;

[0065] Figure 2 is a flowchart of the steps of an implementation method of a preferred embodiment provided by the present invention;

[0066] Figure 3 is the front view of a sample three - dimensional model containing three geometric bodies;

[0067] Figure 4 is the axonometric view of a sample three - dimensional model containing three geometric bodies;

[0068] Figure 5 is Figure 3 、 Figure 4 a schematic diagram of the vector included - angle relationship in the three - dimensional model shown;

[0069] Figure 6 is a schematic diagram of the normal information of a surface (such as a triangle);

[0070] Figure 7 is a schematic diagram of the normal information of the surfaces that need to participate in the calculation and are extracted from the geometric bodies;

[0071] Figure 8 is a flowchart of the implementation method of a preferred embodiment provided by the present invention. Specific Embodiments

[0072] The following is a detailed description with reference to the accompanying drawings.

[0073] The present invention discloses an implementation method for quickly matching and searching similar geometric bodies, which is used to optimize the subsequent processing of a three - dimensional graphic file by determining the same three - dimensional models in the three - dimensional graphic file in a published format. Herein, the "same" means that all three - dimensional components (i.e., geometric bodies) constituting the three - dimensional model have the same shape; and the relative position relationships between all three - dimensional components constituting the three - dimensional model are consistent. To achieve the above - mentioned purpose, the present invention stipulates that when processing a three - dimensional graphic file in a published format on a server, the three - dimensional graphic file includes at least two three - dimensional models.

[0074] As Figure 2 shown, preferably, the implementation method of the present invention may include the following steps:

[0075] S1. Determine whether the mutual relationships between multiple geometric bodies constituting one three - dimensional model are the same as those between multiple geometric bodies of another three - dimensional model;

[0076] S2. When the layouts of the two three - dimensional models are the same, determine whether each geometric body constituting the two three - dimensional models is consistent.

[0077] Preferably, as Figure 2As shown, before step S1, it may further include step S0 for grouping 3D models. In step S0, these 3D models can be grouped according to the number of geometric bodies, description, storage structure that make up the 3D model, or the set of triangular faces that make up the 3D model, so as to facilitate finding the same 3D models within the same group.

[0078] Preferably, the number of geometric bodies refers to the number of basic geometric elements that make up a 3D model. Among them, the total number of all basic geometric elements in each 3D model can be counted and grouped according to this total number, so that 3D models with the same number of geometric bodies can be grouped into the same group; more detailed grouping can also be carried out by considering the number of specific types of geometric bodies in the model or calculating the number of certain specific features.

[0079] Preferably, the description refers to various information that can express the characteristics of the 3D model, including but not limited to text descriptions such as the name, use, creator, copyright information of the model, and can also be the model feature description obtained through mathematical formulas or algorithms. Further, natural language processing technology can be used to extract keywords from the text description of the model, and then the models can be grouped according to the similarity of the keywords; the characteristics of each model can also be converted into a feature vector, and then clustering algorithms (such as K-means) can be used to group the models according to the similarity of the feature vectors.

[0080] Preferably, the storage structure relates to the representation method of the 3D model in the computer system. Different file formats may result in different storage structures. Among them, common 3D graphics file formats include STL, OBJ, FBX, etc. Further, grouping can be carried out according to the file format used by the 3D model; the data structure of each model can also be analyzed in depth, such as the depth of the node tree, the connection method between nodes, etc., and grouping can be carried out according to these structural properties.

[0081] Preferably, almost all 3D models can be decomposed into a series of triangular faces, and the set of these triangular faces determines the appearance and shape of the model. Therefore, grouping can be carried out by comparing the similarity degree of the set of triangular faces in different models.

[0082] Preferably, as Figure 2 shown, step S1 may include one or more of the following sub-steps:

[0083] S1.1. Analyze the central point coordinates of each 3D model in the 3D graphics file;

[0084] S1.2. Analyze the vector angle relationship between the central point coordinates of all geometric bodies corresponding to each 3D model and the central point coordinates of the corresponding 3D model;

[0085] S1.3. Compare the vector angle relationships in at least two 3D models to preliminarily determine whether the spatial layouts of at least two 3D models are the same.

[0086] Preferably, in step S1.1, the center point coordinates of the 3D model can be calculated in two ways. One is to calculate the center point coordinates of the 3D model based on all the vertex coordinates of the 3D model; the other is to calculate the center point coordinates of the 3D model based on the center point coordinates of all the geometric bodies of the 3D model.

[0087] Preferably, the center point (centroid) coordinates of each 3D model can be determined by analyzing all the vertex coordinates of all the 3D models. The specified formula is as follows:

[0088]

[0089] Where ptC is the center point coordinates of a 3D model, including three components x, y, and z; pt[i].x, pt[i].y, and pt[i].z respectively represent the x, y, and z coordinates of the i-th vertex; ptcount is the total number of vertices, that is, n.

[0090] Furthermore, in the above formula, the following items are respectively the sum of the x coordinates, y coordinates, and z coordinates of all the vertices:

[0091]

[0092] Preferably, in the above formula, the x, y, and z coordinates of all the vertices can be summed separately first, and then the sum of each group of coordinates is divided by the number of vertices ptcount to obtain the average value of each axis. The finally obtained ptC is the center point coordinates of all the vertices. This formula can be applied to any 3D model with multiple vertices and can effectively calculate the geometric center of these vertices.

[0093] Preferably, the center point (centroid) coordinates of each 3D model can be determined by calculating the center point coordinates of all the geometric bodies of each 3D model respectively. Among them, the center point coordinates of a geometric body in a 3D model can be calculated from the vertex coordinates of the geometric body. Therefore, the center point (centroid) coordinates of a 3D model can be calculated by the following formula:

[0094]

[0095] Where ptC is the center point coordinates of a 3D model, including three components x, y, and z; ptE[j].x, ptE[j].y, and ptE[j].z respectively represent the x, y, and z coordinates of the center point of the j-th geometric body; ptEcount is the number of geometric bodies in the 3D model, that is, m.

[0096] Preferably, in the above formula, the x, y, and z coordinates of all geometric bodies in the 3D model can be summed separately first, and then the sum of each group of coordinates is divided by the number of geometric bodies ptEcount to obtain the average value of each axis. The finally obtained ptC is the center point coordinates of the 3D model.

[0097] Preferably, in step S1.2, the "vector angle relationship" means that all center points of all geometric bodies of the corresponding 3D model itself are respectively connected to the center point of the corresponding 3D model itself to form vectors from the center point of each geometric body to the center point of the corresponding 3D model. Then, the vector angle of the center point connection line between the vectors from the center point of each geometric body to the center point of the corresponding 3D model is determined, and an index for characterizing the relationship between the vector angles in the 3D model is obtained based on these angles.

[0098] Preferably, the vector angle of the center point connection line can be obtained by referring to the calculation method of the angle between two 3D vectors. Given two vectors a and b, the angle θ between them can be calculated by the following formula:

[0099]

[0100] where a·b is the dot product of vectors a and b, and ||a|| and ||b|| are the magnitudes (lengths) of vectors a and b respectively.

[0101] Specifically, the calculation steps are as follows:

[0102] Calculate the dot product:

[0103]

[0104] Calculate the magnitude:

[0105]

[0106] Calculate the cosine value of the angle:

[0107]

[0108] Calculate the angle:

[0109]

[0110] where a x 、a y 、a z are the components of vector a on the x-axis, y-axis, and z-axis respectively; b x 、b y 、b z are the components of vector b on the x-axis, y-axis, and z-axis respectively.

[0111] Exemplarily, Figure 3 andFigure 4 A three-dimensional model composed of three geometric bodies is shown. As Figure 5 shown, the center point of this three-dimensional model is ptC. Among them, the three geometric bodies include: a first geometric body with a geometric body center point ptE1, a second geometric body with a geometric body center point ptE2, and a third geometric body with a geometric body center point ptE3.

[0112] Preferably, by analyzing the normal information of the connection lines formed by connecting the "center points of each geometric body" and the "center point of the three-dimensional model itself where it is located", the vector included angle of the center point connection line between the vectors from the center point of each geometric body to the center point of the corresponding three-dimensional model is determined (such as Figure 5 the α, β, γ shown in Figure 5 The included angle α of the center point connection line in is the included angle between the vector ptE1-ptC and the vector ptE2-ptC. Preferably, as Figure 6 shown, the normal information is the direction information pointing from the model center to the geometric body center. For example, Figure 5 the normal information of the first geometric body in is: ptE1 coordinate - ptC coordinate = (Δx, Δy, Δz). Preferably, the normal is the vector from the model center point to the geometric body center point. For example, Figure 5 the normal of the first geometric body in is the direction vector from ptC to PtE1. Preferably, the index used to characterize the relationship between the included angles of each vector in the three-dimensional model can be the sum of the included angles of each vector.

[0113] Preferably, in step S1.3, by comparing the included angle relationships of the vectors in at least two three-dimensional models, it is determined whether the spatial layouts of at least two three-dimensional models are the same. Among them, in the simplest case, the relationship between the included angles of the center point connection lines in each three-dimensional model can be analyzed (such as calculating the sum of the included angles of the center point connection lines) to calculate the deviation value, and the calculated deviation value is compared with the preset threshold, so as to determine whether the spatial layouts of multiple three-dimensional models are the same.

[0114] Exemplarily, for the first three-dimensional model of the first group of devices, calculate the sum of the included angles of each center point connection line to obtain Total1. Then, for the second three-dimensional model of the second group of devices, use the same calculation principle as the first three-dimensional model of the first group of devices to calculate the same index Total2. Among them, compare Total1 and Total2. If abs(Total1 - Total2) is less than the preset threshold (such as 1×10 -5 ), it can be considered that the spatial layouts of these two three-dimensional models are the same, or the geometric body layouts are consistent. When there are more than two three-dimensional models, any two three-dimensional models can be selected through permutation and combination for the above comparison to determine whether the spatial layouts of these models are the same.

[0115] Preferably, when the implementation method includes step S0, based on the grouping of 3D models, the included angle relationship of vectors in all 3D models in the same group can be compared to preliminarily determine whether these 3D models are the same, so as to obtain a preliminary judgment conclusion. This is because if the geometric body distributions in two models are exactly the same, then the relative relationship of their center points should also be very close.

[0116] When using the method in the first part to determine that the layouts of two 3D models are the same, it still cannot be considered that the two 3D models are identical to each other. This is because the above preliminary judgment is a simplified judgment of the center point relationship in order to reduce the computing intensity. Therefore, there is a situation where the layouts are the same but the actual geometric shapes are different under the criterion of the center point. On this basis, step S2 is used to judge whether the geometric body shapes that make up the 3D model are consistent. Since step S1 has completed the vast majority of exclusions and filtrations, the computing power required for step S2 is limited.

[0117] Preferably, as Figure 2 shown, step S2 may include one or more of the following sub-steps:

[0118] S2.1. Match the comparison objects;

[0119] S2.2. Sequentially judge whether the geometric bodies to be compared are consistent with each other according to the comparison sequence.

[0120] Preferably, in step S2.1, the geometric bodies to be compared among the geometric bodies constituting the two three-dimensional models can be determined by analyzing the relationship between the vectors from the respective geometric center points of the two three-dimensional models screened out to the center points of the corresponding three-dimensional models. It is preliminarily determined that several geometric bodies included in two three-dimensional models with the same spatial layout need to be paired one by one according to a preset matching rule to obtain multiple pairs of mutually matching geometric bodies, and these geometric bodies are the "comparison objects". Further, the preset matching rule can be any rule that can clearly distinguish each geometric body in the three-dimensional model. For example, the comparison sequence of each geometric body in the three-dimensional model can be determined according to the magnitude relationship of the norms of the vectors from the center points of each geometric body to the center point of the corresponding three-dimensional model. Among them, the comparison sequence can be sorted in descending or ascending order according to the above numerical values. Optionally, the magnitude relationship of the norms of the vectors from the center points of each geometric body to the center point of the corresponding three-dimensional model can be determined by calculating the ratio. For example, ||ptE1 - ptC||:||ptE2 - ptC||:||ptE3 - ptC|| = 1:2:3, then the sorting can be carried out in the order of the first geometric body, the second geometric body, the third geometric body or in the order of the third geometric body, the second geometric body, the first geometric body. Further, if the magnitudes of some vectors are the same, other attributes of the geometric body can be used for distinction in step S2.1, such as shape characteristics: comparing the shape descriptors of the geometric body (such as volume, surface area, length-width ratio, etc.), the number of vertices: checking the number of vertices of the geometric body, the normal vector direction: calculating the normal vector of the geometric body and comparing them; or these geometric bodies belonging to the same situation can be given the same comparison sequence first, that is, sorted side by side, so that the matching situation of these geometric bodies can be verified one by one through permutation and combination when comparing the geometric bodies subsequently.

[0121] Preferably, after determining the comparison sequence of the geometric bodies, step S2.2 can compare a pair of geometric bodies with the same comparison sequence in the two three-dimensional models according to a preset comparison rule, where the preset comparison rule may include the following process:

[0122] a. Initially judge whether these two geometric bodies are consistent based on the basic attributes of the geometric body. For example, by judging whether the number of vertices of at least one geometric body constituting the three-dimensional model is the same as that of the geometric body of another three-dimensional model. If they are different, exit; if they are the same, execute the subsequent process;

[0123] b. For the geometric body to be compared in the first three-dimensional model, use a preset algorithm to extract the faces that need to participate in the calculation (such as 1, 6, 11, 17......), and calculate the face normals of each extracted face and its next face, where each extracted face can correspond to two normals;

[0124] c. Calculate the angles between all the faces that need to participate in the calculation and the normal vectors of their corresponding next faces, and accumulate them together to obtain the sum of the angles.

[0125] d. For the geometric bodies to be compared in the second 3D model, execute the process from b to c to form another sum of angles.

[0126] e. Compare whether the sums of the angles of the two geometric bodies are the same. If they are the same, it means the geometric bodies are the same; otherwise, it means they are different and exit.

[0127] Preferably, in the above process a, it is possible to preliminarily determine whether two geometric bodies are consistent by judging the number of vertices of the two geometric bodies. In addition, it can also be judged whether the number of triangles of the two geometric bodies is equal. If they are not equal, it is considered that the two geometric bodies are not the same geometric body. In other words, the basic attributes of the geometric bodies used for preliminary judgment in process a may include but are not limited to the number of vertices and the number of triangles of the geometric bodies. Further, in step a, it is possible to preliminarily determine whether two geometric bodies are consistent only by judging the number of vertices or the number of triangles of the two geometric bodies, or it is also possible to adopt the method of simultaneously judging the number of vertices and the number of triangles of the two geometric bodies to obtain a relatively more accurate judgment result. Preferably, for the situation where the numerical magnitudes of the moduli of some vectors are the same in step S2.1, with the help of process a, the matching relationships of multiple geometric bodies arranged in parallel can be verified one by one to quickly filter out unreasonable matching relationships. Among them, when the above situation occurs, it is preferable to adopt the method of simultaneously judging the number of vertices and the number of triangles of the two geometric bodies to accurately screen out the correct matching relationship.

[0128] Preferably, in the above process b, the preset algorithm can be to set a reasonable sampling interval (for example, set the sampling interval to 5) to complete the extraction of faces (usually triangles) according to this sampling interval, so as to be applicable to the situation where the geometric body is composed of a large number of triangles. Among them, the larger the interval value, the higher the comparison efficiency, while the comparison accuracy is reduced. Figure 7 The normal vector information of a face that needs to participate in the calculation extracted from the geometric body is shown.

[0129] Preferably, in the above process c, starting from the first extracted face, calculate the angle between the normal vector of the next face of this face in the geometric body and the normal vector of this face, record it and add it to the total value dTotalVE1. Exemplarily, the normal vector of the first extracted face is V1, and the normal vector of the next face of this face is V2. Calculate the angle between V2 and V1, record it as DV2, and add it to the total value of the first vector angle dTotalVE1. Then, based on the set sampling interval step = 5, calculate the subsequent normal vector information and angles one by one. For example, DV7 is the angle between V7 and V6, so as to accumulate and obtain the total value dTotalVE1.

[0130] Preferably, in the above process d, the geometric body to be compared in the second three-dimensional model is the geometric body in the second three-dimensional model that has the same comparison sequence as the geometric body to be compared in the first three-dimensional model. Using the same method as above, the total second vector included angle dTotalVE2 of this geometric body can be calculated.

[0131] Preferably, in the above process e, compare dTotalVE1 with dTotalVE2. If abs(dTotalVE1 - dTotalVE2) is less than a preset threshold (such as 1×10 -5 ), then it can be considered that these two geometric bodies are the same geometric body.

[0132] Further, according to the determined comparison sequence, a pair of geometric bodies to be compared can be extracted in sequence to execute the above process according to a preset comparison rule, so as to judge whether all matching comparison objects are the same geometric body. Among them, when a pair of geometric bodies is judged to be a non - same geometric body through the above process, then exit. Otherwise, continue to compare the geometric bodies to be compared in sequence according to the comparison sequence until all geometric bodies have been compared. If all geometric bodies have been compared and the comparison results are all the same geometric body, then it can be shown that these two three - dimensional models are the same three - dimensional models.

[0133] Based on this, the implementation method of the present invention can go through four different judgments as shown in Figure 8 to determine whether at least two groups of incoming three - dimensional models are the same three - dimensional models. Among them, the four judgments can include judging whether the number of geometric bodies is the same, judging whether the vector included angle relationship between geometric bodies is the same, quickly judging whether each pair of geometric bodies is the same geometric body, and sequentially judging whether each pair of geometric bodies is the same geometric body.

[0134] It should be noted that the above specific embodiments are exemplary. Those skilled in the art can come up with various solutions inspired by the disclosure content of the present invention, and these solutions also belong to the disclosure scope of the present invention and fall within the protection scope of the present invention. Those skilled in the art should understand that the specification and drawings of the present invention are illustrative and do not constitute a limitation on the claims. The protection scope of the present invention is defined by the claims and their equivalents. The specification of the present invention contains multiple inventive concepts. For example, "Preferably" or "According to a preferred embodiment" both indicate that the corresponding paragraph discloses an independent inventive concept. The applicant reserves the right to file divisional applications according to each inventive concept. Throughout the text, the features guided by "Preferably" are only an optional way and should not be understood as a must - set. Therefore, the applicant reserves the right to abandon or delete relevant preferred features at any time.

Claims

1. A method for realizing fast matching and searching of similar geometric bodies, characterized in that: It includes the following steps: S1, determining whether the mutual relationship between multiple geometric bodies constituting one three-dimensional model is the same as the mutual relationship between multiple geometric bodies of another three-dimensional model; S2. When the layouts of the two three-dimensional models are the same, determine whether the geometric bodies constituting the two three-dimensional models are consistent. Step S1 includes the following sub-steps: S1.

1. Analyze the center point coordinates of all three-dimensional models in the three-dimensional graphic file; S1.2, analyzing the vector angle relationship between the center point coordinates of all geometric bodies corresponding to each three-dimensional model and the center point coordinates of the corresponding three-dimensional model; S1.3, comparing the vector angle relationship in at least two three-dimensional models to preliminarily determine whether the spatial layouts of the at least two three-dimensional models are the same, Step S2 includes the following sub-steps: S2.1, matching comparison objects; S2.2, according to the comparison sequence, determine whether the geometric bodies to be compared are consistent with each other. In step S2.2, a pair of geometric bodies having the same comparison sequence in the two three-dimensional models are compared according to a preset comparison rule, wherein the preset comparison rule includes the following process: a. Preliminarily determine whether the two geometric bodies are consistent based on the basic properties of the geometric bodies. If the basic properties are different, exit; if they are the same, execute the subsequent process; b. For the geometric body to be compared in the first three-dimensional model, a preset algorithm is used to extract the faces that need to be involved in the calculation, and the face normals of each extracted face and the next face are calculated, wherein each extracted face corresponds to two normals; c. Calculate the angles between all the faces that need to be calculated and the normals of the next face, and add them together to get the angle sum; d. For the geometric body to be compared in the second 3D model, execute the process from b to c to form another angle sum; e. Compare the angle sums of the two geometric bodies to see if they are the same. If they are the same, the geometric bodies are the same; otherwise, they are different and the program exits.

2. The method according to claim 1, characterized in that In step S1.1, the center point coordinates of the three-dimensional model are calculated in two ways. One is to calculate the center point coordinates of the three-dimensional model based on the coordinates of all vertices of the three-dimensional model; the other is to calculate the center point coordinates of the three-dimensional model based on the center point coordinates of all geometric bodies of the three-dimensional model.

3. The method according to claim 1, characterized in that The vector angle relationship is to first connect all the center points of all the geometric bodies of the corresponding three-dimensional model with the center point of the three-dimensional model itself to form vectors from the center points of each geometric body to the center point of the corresponding three-dimensional model, and then determine the vector angle of the center point connection line between the vectors from the center points of each geometric body to the center point of the corresponding three-dimensional model, and obtain an indicator for characterizing the relationship between the vector angles in the three-dimensional model based on these angles.

4. The method according to claim 3, characterized in that The index used to characterize the relationship between the angles of various vectors in a three-dimensional model is the sum of the angles of various vectors.

5. The method according to claim 4, characterized in that In step S1.3, the deviation value of the sum of the vector angles of any two three-dimensional models is calculated by analyzing the sum of the vector angles of the center points in each three-dimensional model, and the calculated deviation value is compared with a preset threshold to determine whether the spatial layouts of at least two three-dimensional models are the same.

6. The method according to claim 1, characterized in that In step S2.1, the geometric bodies to be compared among the geometric bodies constituting the two three-dimensional models are determined by analyzing the relationship between the vectors from the center points of the geometric bodies of the two selected three-dimensional models to the center points of the corresponding three-dimensional models. These geometric bodies are sorted and paired one by one based on the comparison sequence of each geometric body in the three-dimensional model to obtain paired comparison objects.

7. The method according to claim 1, characterized in that The method also includes a step S0 for grouping the three-dimensional models, which is arranged before step S1, wherein in step S0, the three-dimensional models are grouped according to the number, description, storage structure of the geometric bodies constituting the three-dimensional models or the set of triangular faces constituting the three-dimensional models, so as to facilitate finding the same three-dimensional model in the same group.

Citation Information

Patent Citations

  • 3-D model (three-dimensional model) search method based on weighted topology constraint comparison

    CN101937453A

  • Three-dimensional model retrieval method based on geometrical shapes and structural characteristics

    CN110275976A