A method for similarity evaluation of CAD grid models allowing for translation and rotation
By aligning the spatial pose of 3D models and calculating Hausdorff distance based on the principle of locality, combined with normalized evaluation of bounding box feature scale, the problems of low efficiency and unintuitive standards in 3D model similarity evaluation are solved, achieving high-precision and fast similarity evaluation, which is suitable for high-precision industrial inspection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIHANG UNIV
- Filing Date
- 2026-04-09
- Publication Date
- 2026-07-10
Smart Images

Figure CN122368535A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of industrial manufacturing technology, and in particular to a method for evaluating the similarity of CAD mesh models that allows translation and rotation. Background Technology
[0002] With the rapid development of 3D scanning technology, computer-aided design and manufacturing, and computer graphics, 3D mesh models have become the mainstream data format for representing complex geometric shapes. In reverse engineering, scanned point clouds need to be compared with the original CAD model to reconstruct accurate surfaces; in the field of digital twins, the digital model of a physical entity needs to be compared with its ideal design model in real time to monitor its operational status; in 3D printing quality monitoring, the geometric deviation between the printed part and the design model needs to be evaluated to ensure manufacturing accuracy; and in model retrieval applications, models with similar shapes to the query model need to be found quickly. Therefore, evaluating the geometric similarity between two 3D models has become a fundamental and crucial core task.
[0003] Hausdorff distance, as a classic geometric metric, effectively measures the maximum geometric deviation between two point sets or two surfaces, providing a rigorous mathematical upper bound for the accuracy evaluation of 3D models, mesh simplification error control, and surface reconstruction quality. Currently, the mainstream methods for calculating Hausdorff distance between mesh models are mainly divided into two categories:
[0004] The first category is sampling-based approximation algorithms. These methods perform dense and uniform discrete sampling on the mesh surface, calculate the nearest distance from each sampling point to another model surface, and take the maximum value to estimate the Hausdorff distance. These methods are simple to implement and relatively fast. However, their accuracy is highly dependent on the sampling density; insufficient sampling leads to large deviations, while excessive sampling incurs huge computational costs. More importantly, sampling-based methods cannot provide strict theoretical error guarantees, making it difficult to meet the stringent upper bound requirements of error in high-precision industrial inspections such as aerospace and precision instrument manufacturing.
[0005] The second category is analytical algorithms based on branch and bound. This is currently the mainstream framework for calculating accurate Hausdorff distance. Its core idea is to recursively subdivide the surface patches of the model under test, placing them in a priority queue, and calculating the theoretical lower bound and the current best upper bound of the distance to the target model for each subdivided patch. By continuously subdividing the patches, it eventually converges to the accurate Hausdorff distance. Although this method guarantees accuracy, its calculation process still involves a large number of global space queries, especially when dealing with large-scale industrial models containing millions of patches. Its computational time complexity remains high, making it difficult to meet the needs of real-time or near-real-time processing.
[0006] Therefore, it is necessary to propose a CAD mesh model similarity evaluation method that can automatically overcome the influence of spatial pose transformation, achieve extremely fast and accurate calculation, and provide an intuitive and unified evaluation standard. Summary of the Invention
[0007] In view of this, the purpose of this invention is to provide a CAD mesh model similarity evaluation method that allows translation and rotation, aiming to solve the problems of low efficiency, sensitivity to spatial pose transformation, and unintuitive evaluation criteria in the prior art of 3D model similarity evaluation. It can automatically overcome the influence of spatial transformation and can perform extremely fast and accurate evaluation for large-scale 3D models.
[0008] The present invention solves the technical problem by adopting the following technical solution:
[0009] A method for evaluating the similarity of CAD mesh models that allows translation and rotation includes the following steps:
[0010] Step 1, Spatial pose alignment of the 3D model: Perform rigid body registration on the source model A and the target model B to be evaluated to obtain the aligned source model A′;
[0011] Step 2, Hausdorff distance calculation based on the principle of locality and cascaded upper bounds: Based on the principle of spatial locality, accurately calculate the one-way Hausdorff distance between the aligned source model A′ and the target model B. This distance is used to characterize the maximum geometric deviation between the surfaces of the two models;
[0012] Step 3, Similarity normalization evaluation based on bounding box feature scale: Extract feature scales based on the merged bounding boxes of models A′ and B. And combined with the Hausdorf distance The normalized similarity score S is calculated.
[0013] Furthermore, step 1 specifically includes:
[0014] Step 1.1, coarse registration: Use the principal component analysis algorithm to extract the centroid and principal direction of the source model A and the target model B respectively. Make the centroids of the two models coincide by translation and align the principal directions by rotation to obtain the initial rigid body transformation matrix.
[0015] Step 1.2, Fine registration: Using the coarse registration result as the initial value, the iterative nearest point algorithm or its variant is used to iteratively optimize the translation vector T and rotation matrix R to minimize the objective function and obtain the accurate rigid body transformation matrix;
[0016] Step 1.3, Transformation Application: Apply the precise transformation matrix obtained in Step 1.2 to the source model A to obtain model A′ that is aligned with the target model B in space.
[0017] Furthermore, the Hausdorff distance calculation based on the principle of locality and cascaded upper bounds in step 2 specifically includes the following steps:
[0018] Step 2.1, Constructing the spatial acceleration structure and topology matrix: Construct a hierarchical bounding box tree for the target model B, and construct a face adjacency matrix for the target model B in the preprocessing stage to store the adjacent face indices corresponding to each face;
[0019] Step 2.2, Branch and Bound and Cascade Upper Bound Calculation: Place the initial patch of the source model A′ into a priority queue, iteratively calculate the lower bound of the distance from the subdivided patch to the target model B and the cascade upper bound, and maintain the global Hausdorff distance lower bound. ;
[0020] Step 2.3, Dual Pruning Mechanism: Using the patch adjacency matrix constructed in Step 2.1, a local topological search is performed to obtain the local minimum distance. ;like Less than the current global lower bound If the global query is entered, skip the global query; otherwise, skip the query if the minimum distance to the query point is greater than [a certain value]. subtree;
[0021] Step 2.4, Iteration and Update: Based on the pruning results or global query results, update the lower and upper bounds of the global Hausdorff distance, and reinsert the sub-faces that meet the conditions into the priority queue; repeat steps 2.2 to 2.4 until the error between the global upper and lower bounds meets the preset tolerance requirements, and output the final one-way Hausdorff distance. .
[0022] Furthermore, step 3 specifically includes:
[0023] Step 3.1, Extract bounding box feature scale: Calculate the diagonal length of the merged bounding box of the aligned source model A′ and target model B, and use it as the feature scale. The calculation formula is as follows:
[0024]
[0025] Where W is the span of the merged bounding box in the X-axis direction, H is the span of the merged bounding box in the Y-axis direction, and D is the span of the merged bounding box in the Z-axis direction.
[0026] Step 3.2, Calculate the normalized similarity score: Calculate the Hausdorff distance obtained in Step 2. With feature scale Substitute into the following formula to calculate the similarity score S:
[0027]
[0028] When the two models completely overlap If S = 100%, then S = 100%; when The maximum deviation reaches or exceeds the characteristic scale At that time, S=0%.
[0029] Furthermore, the Hausdorf distance in step 2 The bidirectional Hausdorff distance is determined by the maximum of the one-way Hausdorff distance from the source model A′ to the target model B and the one-way Hausdorff distance from the target model B to the source model A′.
[0030] Furthermore, in step 2.2, the cascaded upper bound is used as an upper bound for the distance between a patch and its neighboring patches when calculating the distance between a patch and its neighboring patches, thereby accelerating the convergence speed of the distance upper bound.
[0031] Furthermore, the local topology search in step 2.3 is based on the principle of spatial locality, that is, the nearest point of a sampling point on the target model is likely located in the neighboring area of the corresponding facet on the source model, thereby narrowing the global search range to the local neighborhood.
[0032] The present invention discloses a method for evaluating the similarity of CAD mesh models that allows translation and rotation, which has the following beneficial effects:
[0033] 1. Excellent spatial pose robustness: By employing a two-stage automatic alignment strategy of coarse and fine registration, this invention can completely and automatically eliminate the influence of arbitrary translation and rotation transformations between the source and target models. This not only ensures that the accuracy of similarity evaluation results is not affected by the initial pose, but also greatly improves the ease of use of the method, eliminating the need for manual pre-alignment and meeting the process requirements of industrial automated inspection.
[0034] 2. Significantly Improved Computational Efficiency: This invention innovatively integrates the principle of spatial locality into the precise computational framework of Hausdorff distance. By constructing a patch adjacency topology matrix and introducing cascaded upper bounds and a dual pruning mechanism based on local neighborhoods, many operations that originally required global searches are transformed into fast scans within a constant time or local range. Experimental data shows that when processing large-scale, high-precision industrial mesh models, this method achieves an average speedup of 2.27 times compared to traditional branch-and-bound algorithms, significantly reducing computation time and making high-precision similarity evaluation possible on large-scale datasets.
[0035] 3. Intuitive and Scientific Normalized Evaluation Criteria: The similarity normalization method proposed in this invention, based on the feature scale of merged bounding boxes, transforms the abstract, length-dimensioned Hausdorff distance into a dimensionless, intuitive percentage similarity score. This innovative design solves the problem that traditional metrics cannot compare across scales. Whether the model is a tiny precision part or a massive aerospace structural component, decision-makers can intuitively judge product quality or shape differences through a score ranging from 0% to 100%, providing a unified, scientific, and easily understood quantitative basis for quality inspection, error analysis, and conformity determination in industrial manufacturing.
[0036] 4. Full-process automation and rigorous error protection: This invention achieves a fully automated closed-loop process from automatic pose registration to rigorous analytical distance calculation, and then to normalized similarity output. The final output similarity score is based on the rigorously mathematically defined Hausdorff distance, providing a reliable and theoretically guaranteed geometric deviation error limit for industrial inspection applications. Attached Figure Description
[0037] Figure 1 This is a flowchart of the method of the present invention;
[0038] Figure 2 This is a simplified rocket model diagram;
[0039] Figure 3 This is a translational diagram of a simple rocket model;
[0040] Figure 4 This is a diagram showing the pose alignment of a simple rocket model after rotation.
[0041] Figure 5 A visualization of the similarity results between the two models;
[0042] Figure 6 A geometrically missing rocket model diagram;
[0043] Figure 7 A translation of a geometrically missing rocket model;
[0044] Figure 8 This is the pose alignment diagram of a geometrically missing rocket model after rotation.
[0045] Figure 9 A visualization of the similarity results between the two models;
[0046] Figure 10 This is a model diagram of textured ceramic tiles;
[0047] Figure 11 This is a translation of the textured ceramic tile model;
[0048] Figure 12 This is the pose alignment diagram of the textured ceramic tile model after rotation.
[0049] Figure 13 A visualization of the similarity results between the two models;
[0050] Figure 14 The image shows a missing ceramic tile model.
[0051] Figure 15 This is a translation of the missing ceramic tile model;
[0052] Figure 16 This is the pose alignment diagram of the missing ceramic tile model after rotation;
[0053] Figure 17 This is a visualization of the similarity between the two models. Detailed Implementation
[0054] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0055] refer to Figure 1 This invention provides a method for evaluating the similarity of CAD mesh models that allows translation and rotation, comprising the following steps:
[0056] Step 1, Spatial pose alignment of the 3D model: Perform rigid body registration on the source model A and the target model B to be evaluated to obtain the aligned source model A′;
[0057] Step 1 specifically includes:
[0058] Step 1.1, Coarse Registration: Calculate the vertex covariance matrices of the source model A and the target model B using the principal component analysis algorithm, extract their eigenvectors as the principal directions of the model, and calculate the centroid of the model to obtain an initial, coarse rigid body transformation matrix.
[0059] Step 1.2, Fine Registration: Based on the coarse registration, fine registration is performed using the iterative nearest point algorithm or its various improved variants. This process is repeated iteratively until the objective function converges or the maximum number of iterations is reached, ultimately obtaining a high-precision rigid body transformation matrix.
[0060] Step 1.3, Transformation Application: Apply the transformation matrix obtained in Step 1.2 to the source model A to obtain model A′ that is spatially aligned with the target model B. All subsequent distance calculations and similarity assessments are performed between the aligned models A′ and B.
[0061] Step 2, Hausdorff distance calculation based on the principle of locality and cascaded upper bounds: Based on the principle of spatial locality, accurately calculate the one-way Hausdorff distance between the aligned source model A′ and the target model B. ;
[0062] Step 2 specifically includes the following steps:
[0063] Step 2.1, Constructing the spatial acceleration structure and topology matrix: Construct a hierarchical bounding box tree for the target model B, and construct a face adjacency matrix to store the indices of all adjacent faces corresponding to each triangular face.
[0064] Step 2.2, Branch and Bound and Cascade Upper Bound Calculation: Initialize a priority queue Q, put the initial facets of the source model A′ into the queue, and maintain a global Hausdorff distance lower bound. When processing patches in the queue, calculate a lower bound and a cascaded upper bound on the distance from the sampling points within the patch to the target model B, and update... The cascaded upper bound here refers to the fact that when calculating the distance from a patch to its neighboring patches, the already calculated precise distance values of the neighboring patches can be used as an upper bound estimate.
[0065] Step 2.3, Double Pruning Mechanism: Before performing the time-consuming global BVH query, a local adjacency search is first performed using the patch adjacency matrix constructed in Step 2.1 to obtain a local minimum distance. Then perform the first pruning: if the local minimum distance... It is already less than the current global Hausdorff distance to the lower bound. If the global BVH query is entered, then skip the query; then perform the second pruning: if the global BVH query is entered, skip the query if the minimum distance to the query point is greater than... Subtrees.
[0066] Step 2.4, Iteration and Update: Based on the pruning results or global query results, update the lower and upper bounds of the global Hausdorff distance, and reinsert the sub-faces that meet the conditions into the priority queue; repeat steps 2.2 to 2.4 until the error between the global upper and lower bounds meets the preset tolerance requirements, and output the final one-way Hausdorff distance. .
[0067] Step 3, Similarity normalization evaluation based on bounding box feature scale: Extract feature scales based on the merged bounding boxes of models A′ and B. And combined with the Hausdorf distance The normalized similarity score S is calculated.
[0068] Step 3 specifically includes:
[0069] Step 3.1, Extract Bounding Box Feature Scale: Calculate the merged bounding box of the aligned source model A′ and target model B. Calculate the diagonal length of this merged bounding box and use it as the feature scale to measure the model scale. The calculation formula is as follows:
[0070]
[0071] Where W is the span of the merged bounding box along the X-axis, H is the span along the Y-axis, and D is the span along the Z-axis. This feature scale can comprehensively reflect the overall size of the two models and has good robustness to models with extreme aspect ratios.
[0072] Step 3.2, calculate the normalized similarity score: This involves adjusting the absolute geometric deviation... With feature scale The similarity score is compared and converted into a relative percentage score within the range [0, 1]. The formula for calculating the similarity score S is:
[0073]
[0074] The physical meaning of this formula is clear: when the two models completely overlap, the maximum deviation... If the value is 0, then the similarity S is 100%; when the maximum geometric deviation is 0... As the value gradually increases, the similarity score decreases linearly; when the maximum deviation reaches or exceeds the diagonal length of the model's merged bounding box... At this point, the morphological differences between the two models are extremely large, and the similarity score is truncated to 0%. This normalization design ensures that the similarity scores between industrial models of different sizes and types have scientific comparability and intuitive physical meaning.
[0075] To further optimize the technical solution, the Hausdorf distance in step 2... The bidirectional Hausdorff distance is determined by the maximum value of the one-way Hausdorff distance from the source model A′ to the target model B and the one-way Hausdorff distance from the target model B to the source model A′.
[0076] To further optimize the technical solution, the cascaded upper bound in step 2.2 is to use the already calculated distance values of the neighboring faces as an upper bound for the distance of a face when calculating the distance from a face to its neighboring faces, thereby accelerating the convergence speed of the distance upper bound.
[0077] To further optimize the technical solution, the local topology search in step 2.3, based on the principle of spatial locality, narrows the global search range to the local neighborhood.
[0078] Example 1: Similarity evaluation of a simplified rocket model under translation and rotation
[0079] This embodiment aims to verify the effectiveness and high accuracy of the present invention when handling models with complex spatial transformations. Rockets are crucial launch vehicles in the aerospace field, and the design accuracy of their aerodynamic shape directly affects their dynamic performance and structural safety during flight. In manufacturing quality inspection, it is usually necessary to accurately compare the measured scanning model with the original design model.
[0080] A set of 3D rocket mesh models was selected as the evaluation object. Source model A is the original rocket CAD model, containing approximately 1 million triangular faces with detailed geometric features. Target model B was obtained by performing specific transformations on model A to simulate pose deviations caused by the inconsistency between the scanning equipment and the design coordinate system: First, model A was reduced in face count by 50% to simulate different resolutions the scanning model might have; then, a spatial translation vector T = (80, 0, 0) was applied; finally, it was rotated sequentially by 90 degrees clockwise around the X-axis, 45 degrees clockwise around the Y-axis, and 45 degrees clockwise around the Z-axis. (Example...) Figures 2 to 4 As shown.
[0081] Evaluation is performed using the method of this invention:
[0082] First, step one, spatial pose alignment, is performed. The PCA algorithm is used to extract the centroid and principal orientation of models A and B respectively, achieving coarse registration so that they roughly coincide. Then, the ICP algorithm is used for fine registration, iteratively optimizing until convergence. After this step, model A is successfully transformed into a coordinate system aligned with model B, resulting in a visually perfect fit between the two models, as shown below. Figure 4 As shown.
[0083] Next, step two, Hausdorff distance calculation, is performed. A spatial acceleration structure is constructed for the aligned model A (A′) and the target model B. An algorithm based on the principle of locality and cascaded upper bounds is applied to accurately calculate the bidirectional Hausdorff distance between the two models. The maximum geometric deviation is then calculated. =0.0016956853.
[0084] Finally, perform step three: similarity normalization evaluation. Calculate the diagonal length of the merged bounding box of models A′ and B. =208.903852. Substitute into the formula to calculate the similarity score:
[0085] S=(208.903852-0.0016956853) / 208.903852×100%≈99.999188%
[0086] The calculated similarity is as high as 99.999%, accurately reflecting that despite significant spatial transformations and simplified mesh resolutions, the two models are geometrically almost identical. The similarity visualization of the evaluation results is shown below. Figure 5 As shown, the color distribution is uniform and close to the ideal value, indicating that the method of the present invention can accurately identify and eliminate pose differences caused by spatial transformation, thereby arriving at a high similarity conclusion that conforms to objective facts.
[0087] Example 2: Similarity assessment of rocket models with large areas of missing geometric features
[0088] This embodiment aims to verify the robustness of the present invention in handling incomplete data models and the objectivity and rationality of the evaluation criteria. In actual 3D scanning of aerospace components, due to the limitations of the scanning equipment's field of view or the obstruction of the component's external structure, the acquired measured model often has local or large-area data gaps.
[0089] The original rocket model from Example 1 was selected as the basis. Two models to be evaluated were constructed: Model A was the original, complete rocket CAD model. Model B was obtained by trimming the original model. Specifically, along a plane of the spatial coordinate system, the bottom 50% of the vertices and faces of the original model were removed. That is, Model B only retained the upper half of the rocket to simulate incomplete data where only the upper half of the component was scanned. The spatial position of Model B remained unchanged. Figures 6 to 8 As shown.
[0090] Evaluation is performed using the method of this invention:
[0091] First, step one is performed to align the spatial pose. Despite severe data gaps in model B, the PCA and ICP algorithms can still effectively register based on shared upper geometric features, enabling the two models to achieve an optimal fit in space. For example... Figure 8 As shown.
[0092] Next, perform step two to accurately calculate the Hausdorf distance. Because model B lacks a bottom, the deviation between the two models in the bottom region will be very large. The calculated maximum geometric deviation is:
[0093] =79.237199
[0094] Finally, step three is performed for normalization evaluation. The diagonal length of the merged bounding box of the aligned models A′ and B is then calculated. The score is also 208.903852. Substituting this into the formula, the similarity score is calculated as follows:
[0095] S=(208.903852-79.237199) / 208.903852×100%≈62.070%
[0096] The calculated similarity was only 62.07%, which is consistent with the objective fact that model B is missing up to 50% of its geometric volume. The similarity score dropped significantly. Figure 9 As shown in the figure. This embodiment powerfully demonstrates that the similarity evaluation standard proposed in this invention can keenly capture huge shape differences caused by missing geometric features, and the evaluation results are intuitive and consistent with human cognition.
[0097] Example 3: Comprehensive Evaluation of Rotation and Translation of Ceramic Tile Models with Complex Textures
[0098] This embodiment aims to verify the effectiveness of the present invention in processing complex models with high-frequency detailed features. The surface texture accuracy of architectural decorative ceramic tiles is an important indicator for measuring product quality.
[0099] A set of 3D ceramic tile mesh models with intricate embossed patterns was selected as the evaluation object. Source model A is the original design model, containing approximately 700,000 faces with rich surface detail. Target model B was obtained by applying complex transformations to model A: first, face reduction was performed, then a translation vector T=(80, 0, 50) was applied, followed by sequential rotations of 45 degrees clockwise around the Y-axis and 45 degrees counterclockwise around the Z-axis. (Example...) Figures 10 to 12 As shown.
[0100] Evaluation is performed using the method of this invention:
[0101] Step 1 involves pose alignment. The presence of numerous repetitive texture details on the model surface poses a challenge for ICP registration. However, coarse registration using PCA provides good initial values, enabling successful convergence of fine registration and accurately aligning model A to the coordinate system of model B. Figure 12 As shown.
[0102] Step two involves accurately calculating the Hausdorff distance. Despite the presence of high-frequency textures in the model, the algorithm accurately captures deviations at minute surface features through an efficient pruning strategy. The maximum geometric deviation is calculated. =0.0115612966.
[0103] Step 3 involves normalization evaluation. This includes merging the diagonal lengths of the bounding boxes. =84.947040. Substitute into the formula to calculate the similarity score:
[0104] S=(84.947040-0.0115612966) / 84.947040×100%≈99.986390%
[0105] The similarity score of 99.99% indicates that after pose alignment, the geometry of the two models is highly consistent with that of the model, and the differences are negligible. Figure 13 The visualization results also show that the deviations are mainly distributed within a very limited area and are very small. This embodiment verifies the accuracy and robustness of the present invention when processing complex texture models.
[0106] Example 4: Similarity evaluation of ceramic tile models with large areas of missing geometric features
[0107] This embodiment further verifies the objective rationality of the present invention in processing incomplete models, simulating a data loss scenario caused by equipment blind spots in industrial production.
[0108] The original textured ceramic tile model from Example 3 is selected as the base. Model A is constructed as the original complete model. Model B is obtained by trimming, specifically: along the central plane of the spatial coordinate system, the bottom 50% of the vertices and faces of the model are completely removed, retaining only the upper half. For example... Figures 14 to 16 As shown.
[0109] Evaluation is performed using the method of this invention:
[0110] Step one involves pose alignment. The algorithm successfully registers the poses based on shared upper half features, such as... Figure 16 As shown.
[0111] Step 2: Accurately calculate the Hausdorff distance. Due to the missing bottom 50% of features, model B deviates significantly from the aligned model A′ in its bottom region. The maximum geometric deviation is calculated. =30.0338082570.
[0112] Step 3 involves normalization evaluation. This includes merging the diagonal lengths of the bounding boxes. =84.947040. Substitute into the formula to calculate the similarity score:
[0113] S=(84.947040-30.0338082570) / 84.947040×100%≈64.644%
[0114] The calculated similarity was approximately 64.64%, consistent with the evaluation results of the rocket model in Example 2, where the similarity dropped to the 60%-65% range when about half of the volume was missing. Figure 17 As shown, this further confirms that the normalized evaluation standard proposed in this invention has good stability and objectivity when dealing with incomplete models, and can provide a scientific quantitative reference for the problem of quality misjudgment caused by incomplete data in actual industrial testing.
[0115] In summary, the CAD mesh model similarity evaluation method provided by this invention, which allows for translation and rotation, successfully solves several pain points of existing technologies through innovative technical solutions, demonstrating significant progress and high industrial application value.
[0116] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for evaluating the similarity of CAD mesh models that allows translation and rotation, characterized in that, Includes the following steps: Step 1, Spatial pose alignment of the 3D model: Rigid body registration is performed on the source model A and the target model B to be evaluated to eliminate the differences in translation and rotation between the two and obtain the aligned source model A′; Step 2, Hausdorff distance calculation based on the principle of locality and cascaded upper bounds: Based on the principle of spatial locality, accurately calculate the one-way Hausdorff distance between the aligned source model A′ and the target model B. This distance is used to characterize the maximum geometric deviation between the surfaces of the two models; Step 3, Similarity normalization evaluation based on bounding box feature scale: Extract feature scales based on the merged bounding boxes of models A′ and B. And combined with the Hausdorf distance The normalized similarity score S is calculated.
2. The method for evaluating the similarity of CAD mesh models that allow translation and rotation according to claim 1, characterized in that, Step 1 specifically includes: Step 1.1, coarse registration: Use the principal component analysis algorithm to extract the centroid and principal direction of the source model A and the target model B respectively. Make the centroids of the two models coincide by translation and align the principal directions by rotation to obtain the initial rigid body transformation matrix. Step 1.2, Fine registration: Using the coarse registration result as the initial value, the iterative nearest point algorithm or its variant is used to iteratively optimize the translation vector T and rotation matrix R to minimize the objective function and obtain the accurate rigid body transformation matrix; Step 1.3, Transformation Application: Apply the precise transformation matrix obtained in Step 1.2 to the source model A to obtain model A′ that is aligned with the target model B in space.
3. The method for evaluating the similarity of CAD mesh models that allow translation and rotation according to claim 2, characterized in that, Step 2, based on the locality principle and the Hausdorff distance calculation with cascaded upper bounds, specifically includes the following steps: Step 2.1, Constructing the spatial acceleration structure and topology matrix: Construct a hierarchical bounding box tree for the target model B, and construct a face adjacency matrix for the target model B in the preprocessing stage to store the adjacent face indices corresponding to each face; Step 2.2, Branch and Bound and Cascade Upper Bound Calculation: Place the initial patch of the source model A′ into a priority queue, iteratively calculate the lower bound of the distance from the subdivided patch to the target model B and the cascade upper bound, and maintain a global Hausdorff distance lower bound. ; Step 2.3, Double Pruning Mechanism: Before performing a global query, a local topological search is first performed using the patch adjacency matrix constructed in Step 2.1 to obtain the local minimum distance. ;like Less than the current global lower bound If the global query is entered, skip the global query; otherwise, skip the query if the minimum distance to the query point is greater than [a certain value]. subtree; Step 2.4, Iteration and Update: Based on the pruning results or global query results, update the lower and upper bounds of the global Hausdorff distance, and reinsert the sub-faces that meet the conditions into the priority queue; repeat steps 2.2 to 2.4 until the error between the global upper and lower bounds meets the preset tolerance requirements, and output the final one-way Hausdorff distance. .
4. The method for evaluating the similarity of CAD mesh models that allow translation and rotation according to claim 3, characterized in that, Step 3 specifically includes: Step 3.1, Extract bounding box feature scale: Calculate the diagonal length of the merged bounding box of the aligned source model A′ and target model B, and use it as the feature scale. The calculation formula is as follows: Where W is the span of the merged bounding box in the X-axis direction, H is the span of the merged bounding box in the Y-axis direction, and D is the span of the merged bounding box in the Z-axis direction. Step 3.2, Calculate the normalized similarity score: Calculate the Hausdorff distance obtained in Step 2. With feature scale Substitute into the following formula to calculate the similarity score S: When the two models completely overlap If S = 100%, then S = 100%; when The maximum deviation reaches or exceeds the characteristic scale At that time, S=0%.
5. The method for evaluating the similarity of CAD mesh models that allow translation and rotation according to claim 4, characterized in that, Hausdorff distance in step 2 The bidirectional Hausdorff distance is determined by the maximum value of the one-way Hausdorff distance from the source model A′ to the target model B and the one-way Hausdorff distance from the target model B to the source model A′.
6. The method for evaluating the similarity of CAD mesh models that allow translation and rotation according to claim 5, characterized in that, The cascaded upper bound in step 2.2 is to use the calculated distance values of neighboring faces as an upper bound for the distance of a face when calculating the distance from a face to its neighboring faces, thereby accelerating the convergence speed of the distance upper bound.
7. The method for evaluating the similarity of CAD mesh models that allow translation and rotation according to claim 6, characterized in that, The local topology search in step 2.3, based on the principle of spatial locality, narrows the global search scope to the local neighborhood.