Special-shaped group hole recognition method and system based on three-dimensional model feature ring traversal
Patent Information
- Application Number
- CN202611547238.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-08
- Publication Date
- 2026-11-03
AI Technical Summary
Existing technologies are inefficient and inaccurate in measuring and detecting irregularly shaped holes, especially for the irregularly shaped hole features of high-performance fighter jet parts. Traditional methods rely on manual operation or high computational complexity and cannot efficiently identify complex structures such as polygonal holes.
A method based on 3D model feature loop traversal is adopted. By generating a face adjacency graph, the topological entity face with the most boundary loops is identified as the group hole face. The bounding box area and concave edge attribute of the inner hole loop are used for traversal. Combined with the preset hole feature template matching, the hole feature type is automatically identified.
It achieves efficient and automatic identification of irregularly shaped holes, reduces computational complexity, and improves identification accuracy and automation, making it suitable for laser processing and precision inspection of complex structural parts.
Smart Images

Figure CN123033235A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of irregular hole recognition technology, and in particular to a method and system for irregular hole recognition based on feature loop traversal of a three-dimensional model. Background Technology
[0002] With the increasing demands on material performance for high-performance fighter jets, certain parts with irregularly shaped holes possess advantages such as lightweight and high strength, making them ideal materials and structures for key components of high-performance fighter jets. Addressing the laser processing requirements for irregularly shaped holes in certain aerospace high-performance parts presents a significant challenge due to the presence of hundreds or even thousands of circular holes and irregularly shaped holes (such as polygons) with varying angles. Current methods for measuring and inspecting the precision of laser processing of such irregularly shaped holes mainly fall into two categories: one involves manual measurement using calipers, micrometers, and other measuring tools. This method relies heavily on manual operation and experience, has a long inspection cycle, and consumes substantial human resources. Furthermore, basic measuring tools cannot directly measure irregularly shaped holes with large angles. The other method involves scanning the actual part using laser scanning equipment to generate point clouds or triangular bodies, further enabling reverse modeling. Precision analysis and measurement software is then used to compare the design model of the irregularly shaped holes with the reverse model to achieve precision inspection. However, this laser scanning method still requires extensive manual selection of the holes within the measurement software. Therefore, current methods for measuring and detecting irregularly shaped holes in such parts generally suffer from low efficiency, frequent omissions of holes, and difficulty in guaranteeing accuracy. Summary of the Invention
[0003] The main purpose of this application is to provide a method and system for identifying irregular holes based on the traversal of feature loops of a three-dimensional model, which aims to solve the technical problems of low efficiency, frequent missed holes, and difficulty in guaranteeing accuracy in existing methods for measuring and detecting irregular holes.
[0004] To achieve the above objectives, in a first aspect, this application provides a method for identifying irregularly shaped holes based on traversing feature loops of a three-dimensional model, comprising: Based on the 3D model data, the angle between the normal vectors of the topological entity faces and the shared edges of adjacent topological entity faces is obtained. Based on the angle between the normal vectors, the shared edges are assigned concave and convex attributes including concave edge attributes, and a face adjacency graph is generated. Traverse the number of boundary rings of each topological entity face in the face adjacency graph, and determine the topological entity face with the most boundary rings as the group hole face. Compare the bounding box areas of each boundary ring of the group of holes, and define the boundary ring with the largest bounding box area as the outer contour ring, and the remaining boundary rings as inner hole rings. Starting with the inner hole ring, the adjacent topological entity faces are collected by traversing along the shared edges with concave edge attributes in the face adjacency graph to obtain a set of concave topological faces and construct the inner hole feature ring. The topology of the inner hole feature ring is matched with the preset hole feature template to determine the corresponding hole feature type.
[0005] Optionally, the step of defining the boundary ring with the largest bounding box area as the outer contour ring and the remaining boundary rings as the inner hole rings includes: Calculate the directed area of each of the inner ring holes in the two-dimensional local coordinate system where the group hole surface is located; The ring orientation of each of the inner rings is determined based on the directional area; Based on the ring direction of the inner ring, the direction of the starting edge for traversal is determined. A depth-first search algorithm is used to traverse from the inner ring into the interior of the 3D model. Traversal of the path is stopped when a shared edge with convex edge attributes or an already visited topological entity surface is encountered in the search path.
[0006] Optionally, the step of matching the topology of the inner hole feature ring with a preset hole feature template to determine the corresponding hole feature type includes: Extract the surface type encoding sequence and geometric attribute data of the inner hole feature ring; Obtain the topological similarity between the surface type encoding sequence and the preset hole feature template, and the geometric similarity between the geometric attribute data and the preset hole feature template; The topological similarity and the geometric similarity are weighted and summed to obtain the comprehensive similarity. The type corresponding to the preset hole feature template whose overall similarity is greater than a preset threshold is determined as the hole feature type corresponding to the inner hole feature ring.
[0007] Optionally, the step of extracting the surface type encoding sequence and geometric attribute data of the inner hole feature ring includes: The least squares circle fitting method is used to calculate the fitting diameter for the inner hole ring contour point set corresponding to the inner hole feature ring, and the fitting diameter is used as the geometric attribute data.
[0008] Optionally, the step of matching the topology of the inner hole feature ring with a preset hole feature template to determine the corresponding hole feature type includes: Obtain the successfully matched inner hole feature ring, and extract the normal vectors of each plane contained in the inner hole feature ring; A normal vector matrix is constructed from all extracted normal vectors, and principal component analysis is performed. The eigenvector corresponding to the minimum eigenvalue is determined as the axial direction of the hole feature corresponding to the inner hole feature ring.
[0009] Optionally, after determining the axis direction, the method further includes: The three-dimensional contour edge of the inner hole feature ring is projected onto a plane perpendicular to the axis direction to obtain a two-dimensional ordered point set; The curvature analysis of the two-dimensional ordered point set is performed and it is divided into several straight line segment sequences; Calculate the length of each straight line segment sequence to obtain the cross-sectional side length of the hole feature.
[0010] Optionally, after determining the axis direction, the method further includes: Draw a straight line along the axis direction, intersecting it with the group hole surface and the outlet surface at the end of the inner hole feature ring, respectively, to obtain the inlet intersection point and the outlet intersection point; The coordinates of the midpoint between the intersection of the inlet and the intersection of the outlet are used as the three-dimensional coordinates of the hole center of the hole feature; The distance between the inlet intersection and the outlet intersection is taken as the depth of the hole feature.
[0011] Optionally, after extracting the three-dimensional coordinates of the hole center and the depth, the method further includes: The hole feature type, the axial direction, the cross-sectional side length, the three-dimensional coordinates of the hole center, and the depth are used as parameters to output a structured data table.
[0012] Optionally, after the structured data table is output, the method further includes: In the view of the original 3D model data, the set of faces contained in each of the identified inner hole feature rings is highlighted and rendered. The label placement position is calculated based on the coordinates of the entrance intersection point, the outer normal of the group of holes, and the preset offset distance. A three-dimensional text label containing the parameter combination is generated at the label placement location; Provides an interactive interface that, in response to the selection of the 3D text label or structured data table, highlights the corresponding hole feature in the view of the 3D model data and receives manual corrections to the parameter combination.
[0013] Secondly, this application provides a system for identifying irregularly shaped holes based on traversing feature loops of a three-dimensional model, comprising: The face adjacency graph acquisition module is configured to obtain the normal vector angle of the topological entity face and the shared edge of the adjacent topological entity face based on the 3D model data, and assign concave and convex attributes including concave edge attributes to the shared edge based on the normal vector angle to generate a face adjacency graph. The group hole surface acquisition module is configured to traverse the number of boundary rings of each topological entity surface in the surface adjacency graph and determine the topological entity surface with the most boundary rings as the group hole surface. The inner hole ring determination module is configured to compare the bounding box areas of each boundary ring of the group of holes, define the boundary ring with the largest bounding box area as the outer contour ring, and define the remaining boundary rings as inner hole rings. The inner hole feature ring determination module is configured to start with the inner hole ring, traverse and collect adjacent topological entity faces along the shared edge with concave edge attribute in the face adjacency graph, obtain a set of concave topological faces, and construct the inner hole feature ring. The hole feature type determination module is configured to match the topology of the inner hole feature ring with a preset hole feature template to determine the corresponding hole feature type.
[0014] The beneficial effects that this application can achieve are: This application proposes a method and system for identifying irregularly shaped holes based on 3D model feature ring traversal. This method overcomes the time bottleneck and computational redundancy of traditional CAD recognition algorithms by constructing a face adjacency graph with concave-convex attributes based on the angle between geometric and normal vectors, rapidly locating hole faces based on the rule of maximizing the number of boundary rings, accurately segmenting inner and outer rings based on bounding box area comparison, collecting and constructing inner hole feature rings along the concave edge direction, and deeply fusing similarity batch matching based on feature templates. It elevates the traversal and recognition granularity from the complex face level to the feature ring level, reducing the feature search space and time complexity. This not only automatically and accurately identifies various non-circular or polygonal irregularly shaped holes regardless of their geometric shape limitations, but also eliminates the need for manual selection or intervention throughout the process. This improves the computational efficiency, accuracy, and automation of automatic localization and batch recognition of densely packed hole features, providing robust data support for subsequent laser processing and precision inspection of complex structural components. Attached Figure Description
[0015] Figure 1 This is a flowchart illustrating the irregular hole identification method according to an embodiment of this application; Figure 2 This is a simplified example model of an irregularly shaped multi-hole part according to an embodiment of this application; Figure 3 This is the adjacency matrix data structure generated in the software interface for the irregularly shaped hole-filled part in this application embodiment; Figure 4 This is a schematic diagram of hole location identification and three-dimensional parameter label generation in an embodiment of this application. Figure 1 ; Figure 5 This is a schematic diagram of hole location identification and three-dimensional parameter label generation in an embodiment of this application. Figure 2 .
[0016] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0017] 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 a part of the embodiments of the present invention, and not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.
[0018] It should be noted that all directional indications (such as up, down, left, right, front, back, etc.) in the embodiments of the present invention are only used to explain the relative positional relationship and movement of each component in a certain specific posture (as shown in the figure). If the specific posture changes, the directional indication will also change accordingly.
[0019] In this invention, unless otherwise explicitly specified and limited, the terms "connection," "fixed," etc., should be interpreted broadly. For example, "fixed" can mean a fixed connection, a detachable connection, or an integral part; it can mean a mechanical connection or an electrical connection; it can mean a direct connection or an indirect connection through an intermediate medium; it can mean the internal communication of two components or the interaction between two components, unless otherwise explicitly limited. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.
[0020] Furthermore, if the embodiments of this invention involve descriptions such as "first" or "second," these descriptions are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined with "first" or "second" may explicitly or implicitly include at least one of those features. Additionally, the meaning of "and / or" throughout the text includes three parallel solutions; for example, "A and / or B" includes solution A, solution B, or a solution where both A and B are satisfied simultaneously. Furthermore, the technical solutions of the various embodiments can be combined with each other, but this must be based on the ability of those skilled in the art to implement them. When the combination of technical solutions is contradictory or impossible to implement, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection claimed by this invention.
[0021] In existing technologies, with the increasing demands on material performance for high-performance fighter jets, certain parts with irregularly shaped holes possess advantages such as lightweight and high strength, making them ideal materials and structures for key components of high-performance fighter jets. For the laser processing requirements of irregularly shaped holes in certain high-performance aerospace parts, existing precision measurement and inspection methods face severe challenges due to the presence of hundreds or thousands of circular holes and irregularly shaped holes (such as polygons) with different inclination angles. Current methods for measuring and inspecting the precision of laser processing of such irregularly shaped holes mainly fall into two categories: one is manual measurement using measuring tools such as vernier calipers and micrometers. This method not only relies on manual operation and experience but also has a long inspection cycle and consumes a great deal of human resources. Furthermore, for some irregularly shaped holes with large inclination angles, basic measuring tools cannot directly measure them. The other method involves scanning the actual part with laser scanning equipment to generate point clouds or triangular bodies, further enabling reverse modeling. Precision analysis and measurement software is then used to compare the design model of the irregularly shaped holes with the reverse model to achieve precision inspection. However, this laser scanning method still requires a large amount of manual point selection of the holes within the measurement software. Therefore, current methods for measuring and detecting irregularly shaped holes in such parts generally suffer from low efficiency, frequent omissions of holes, and difficulty in guaranteeing accuracy.
[0022] To address the aforementioned issues, efficient and automatic identification of irregularly shaped holes in such parts is crucial for improving part development efficiency. Currently, the main methods include: The method based on the surface attributes of the part's digital model involves iterating through each topological surface in the model and identifying holes by determining the geometric type of the surface, such as cylindrical or conical surfaces, and their adjacency relationships. This method requires checking and matching all surfaces in the model one by one, and the time complexity is typically O(n log n). When the model contains thousands of faces, the recognition speed is extremely slow, severely impacting engineering efficiency. Furthermore, this method may suffer from inaccuracies and inefficiencies in recognizing rhomboid or polygonal holes (where the sidewalls are not cylindrical or conical).
[0023] Point cloud or voxel-based reconstruction methods discretize the 3D model into point clouds or voxel meshes, and then detect circular hole features using Hough transform or region growing algorithms. This method relies heavily on discretization accuracy; high accuracy results in extremely large data volumes and slow computation. Conversely, low accuracy can easily miss tiny or deep holes, and the discretization process can destroy the original topological information, making it impossible to directly obtain accurate hole parameters later.
[0024] Feature recognition methods based on graph matching construct the face adjacency graph of the model and match it with predefined feature templates using a subgraph isomorphism algorithm. While this method can handle complex intersecting features, it requires traversing all possible subgraph combinations. For a large number of clustered hole features, its search space is large, memory consumption is high, and real-time performance is poor.
[0025] In summary, this application proposes a rapid identification method for irregularly shaped holes in the laser processing of high-performance aerospace parts using water-guided lasers and ultrafast lasers, based on 3D model feature loop traversal. This method addresses the problems of low identification efficiency and high missed processing rate caused by the complex boundaries of irregularly shaped holes, achieving automated hole group statistics without manual intervention. It significantly reduces the intensity of manual intervention in hole group feature selection and provides a data foundation for accurate detection of hole group features. This solution will effectively address the industry pain points of low efficiency and high error rate in hole group detection for such parts, providing new technical support for the research and production of densely holed parts with complex aerospace structures.
[0026] Example 1 Reference Figures 1-5 The first embodiment of this application provides a method for identifying irregularly shaped holes based on traversing feature loops of a three-dimensional model, including: S10. Based on the 3D model data, obtain the angle between the normal vectors of the topological entity faces and the shared edges of adjacent topological entity faces, assign concave and convex attributes including concave edge attributes to the shared edges according to the angle between the normal vectors, and generate a face adjacency graph.
[0027] S20. Traverse the number of boundary rings of each topological entity face in the adjacency graph, and determine the topological entity face with the most boundary rings as the group hole face.
[0028] S30. Compare the bounding box areas of each boundary ring of the group of holes, define the boundary ring with the largest bounding box area as the outer contour ring, and define the remaining boundary rings as inner hole rings.
[0029] S40. Starting with the inner hole ring, traverse along the shared edges with concave edge attributes in the face adjacency graph to collect adjacent topological entity faces, obtain the set of concave topological faces, and construct the inner hole feature ring.
[0030] S50. Match the topology of the inner hole feature ring with the preset hole feature template to determine the corresponding hole feature type.
[0031] In this embodiment, the approach breaks through the traditional method of traversing the entire surface. Instead, it adopts a pre-defined sorting rule based on the number of inner hole boundaries, directly using the surface with the most inner rings as the candidate set for the group of holes. The identification method is based on the candidate set selection method to locate the group of holes. Unlike the traditional method of traversing all surfaces to find cylindrical surfaces, this embodiment directly locates the surface where the irregular group of holes is located by counting the number of inner rings. At the same time, the introduction of the candidate set selection method directly reduces the global search to local surfaces, compressing the traversal space and shortening the calculation time for locating the group of holes. By calculating the bounding box area of the boundary rings of the group of holes in the surface parameter space, the outer contour rings and inner hole rings are distinguished, and the inner hole rings and their adjacent concave surfaces are uniformly constructed as inner hole feature rings. This suppresses the problem of needing manual or manual parameter setting to distinguish between inner and outer rings in the traditional method. It uses feature rings as traversal units instead of the traditional method of traversing the entire surface, and performs topological and geometric attribute similarity matching based on a predefined hole feature template library. Taking the identification of a group of holes containing 32 holes as an example, traditional face-by-face traversal requires processing approximately 128 faces (4 holes / hole), while feature ring traversal only requires processing 32 units, improving the overall identification efficiency. This embodiment uses a ring classification algorithm to remove outer contour interference, decomposing the group hole identification problem into a set of single-hole feature rings. Furthermore, the feature ring algorithm does not rely on restrictions on hole shape, enabling the identification of holes with non-curved structures, such as rhomboid holes and polygonal holes. The traversal granularity of the original topology-based traversal identification method is improved from the face level to the feature ring level, achieving batch matching and reducing the algorithm's time complexity.
[0032] In step S10, the STEP model file of the 3D part to be processed is read, and the boundary representation (B-Rep) topology of the model is parsed through the geometric modeling kernel to extract all topological entity faces and topological edges in the model. Using the topological entity faces in the model as graph nodes, the adjacency relationships of the topological entity faces in the model are determined. For two adjacent topological entity faces sharing the same topological edge, the angle between the outward normal vectors of the two topological entity faces is calculated. The concavity / convexity attribute of the shared edge is determined based on the normal vector angle, such as concave, convex, or flat edge. An undirected or directed Attributed Adjacency Graph (AAG) G = (V, E) is constructed by generating nodes and weighted edges with concavity / convexity attributes and geometric information such as edge length. Here, V represents the set of nodes, each node corresponding to a topological entity face, storing the face type and normal vector information; E represents the set of edges, each edge corresponding to a shared edge of two topological entity faces, storing concavity / convexity attributes and edge length.
[0033] The pseudocode description of the process of constructing a face adjacency graph is as follows: pseudo function BuildFaceAdjacencyGraph(BRepModel model): Graph graph ← new Graph() / / Step 1: Create graph nodes for each face For each face in the model. Faces: Node node ← new Node(Id = face.ID) node.Type ← face.SurfaceType node.Normal ← face.Normal graph.AddNode(node) / / Step 2: Create graph edges for shared edges For each edge in the model, Edges: List faces ← GetAdjacentFaces(edge) if faces.Count == 2: Face f1 ← faces[0]; Face f2 ← faces[1] Convexity conv ← ComputeConvexity(edge, f1, f2) EdgeAttr attr ←new EdgeAttr(conv, edge.Length) graph.AddEdge(f1.Id, f2.Id, attr) return graph In the completed graph structure G, nodes store attributes such as the type and normal vector of the face, while edges store attributes such as the adjacency relationship and concavity / convexity between two faces, providing efficient data structure support for subsequent graph traversal and feature search.
[0034] In step S20, all face nodes in the face adjacency graph G are traversed. For each topological entity face F, its list of bounding loops L(F) is parsed, and the total number of bounding loops is counted. The structure contains a planar structure with n holes, and the total number of boundary loops is n+1, i.e., it contains 1 outer contour loop and n inner hole loops. The topological solid surface containing the most boundary loops is directly selected as the hole-group surface. .
[0035] A group of holes is defined as the plane with the most loops in the model. The selection logic can be described by the following mathematical expression: In the formula, Represents any topological entity surface in the model; Represents the set of all topological entity faces in a 3D model; This represents the number of boundary rings on the topological entity surface F; This indicates the search for the topological entity face that maximizes the number of boundary loops. This indicates the determined group of holes.
[0036] The pseudocode implementation of the steps for the multi-hole surface is as follows: ```pseudo function LocateMultiHoleBaseFace(Model model): Face candidate ← null Integer maxLoops ← 0 For each face in the model. Faces: Integer loopCount ← CountLoops(face) if loopCount > maxLoops: maxLoops ← loopCount candidate ← face else if loopCount == maxLoops and candidate != null: if ComputeArea(face)>ComputeArea(candidate): candidate ← face return candidate ``` After this step, the surface is determined. This is the porosity surface. Multiple inner rings are distributed on this surface, and each inner ring corresponds to the entrance boundary of a potential porosity feature.
[0037] In step S30, the group hole surface is... Project all boundary rings onto the two-dimensional local coordinate system of the hole group surface. Calculate the two-dimensional axis-aligned bounding box area of each boundary ring in this two-dimensional local coordinate system. Compare the bounding box areas of all boundary rings on the hole group surface, determine and define the boundary ring with the largest bounding box area as the outer contour ring of the hole group surface, and define the remaining boundary rings located inside the outer contour ring and with smaller bounding box areas as inner hole rings.
[0038] In step S40, each inner hole ring determined in step S30 serves as the starting search boundary, and a graph traversal algorithm is employed in the face adjacency graph G. The traversal proceeds only along shared edges with concave edge attributes towards the interior of the 3D model, collecting all concave topological entity faces topologically connected to the inner hole ring, forming a set of concave topological faces. Each inner hole ring and its corresponding set of concave topological faces are encapsulated and combined into an independent inner hole feature ring data structure. This inner hole feature ring serves as an independent basic unit for subsequent identification, completely recording the topological boundary and geometric configuration of the specific hole features.
[0039] In step S50, a hole feature template library is pre-constructed. The template library contains various hole feature templates, including blind holes, through holes, rhomboid holes, polygonal holes, and conical holes. Each template defines a corresponding face type sequence; for example, the face type sequence for a simple through hole template is plane-cylindrical-plane, and the face type sequence for a blind hole template is plane-cylindrical-bottom plane. Using the generated inner hole feature ring as an independent traversal unit, the face type sequence formed by the type codes of each topological face in the inner hole feature ring is extracted and compared with the face type sequences of each template in the template library for topological and geometric similarity. When the matching similarity exceeds a preset threshold, the inner hole feature ring is marked and determined as the corresponding preset hole feature type.
[0040] In an optional implementation, the step of defining the boundary ring with the largest bounding box area as the outer contour ring and the remaining boundary rings as the inner hole rings includes: Calculate the directed area of each inner ring in the two-dimensional local coordinate system of the group hole surface; The ring orientation of each inner ring is determined based on the directional area; Based on the ring direction of the inner hole ring, the direction of the starting edge for traversal is determined. A depth-first search algorithm is used to traverse from the inner hole ring into the interior of the 3D model. The traversal of the path is stopped when a shared edge with convex edge attributes or an already visited topological entity face is encountered in the search path.
[0041] Analysis of the group of holes All boundary rings on Connect each boundary ring Projected onto the surface of the group of holes In the local two-dimensional coordinate system. For the boundary ring. For each vertex on the bounding box, calculate the maximum and minimum coordinates of its bounding box in a two-dimensional local coordinate system, and the area of the bounding box. The calculation formula is: In the formula, Let represent the area of the bounding box of the i-th boundary ring; This represents the maximum coordinate value of all vertices on the i-th boundary ring in the u-axis direction of the two-dimensional local coordinate system; This represents the minimum coordinate value of all vertices on the i-th boundary ring in the u-axis direction of the two-dimensional local coordinate system; This represents the maximum coordinate value of all vertices on the i-th boundary ring in the v-axis direction of the two-dimensional local coordinate system; Let represent the minimum coordinate value of all vertices on the i-th boundary ring along the v-axis in the two-dimensional local coordinate system. Compare the bounding box areas of all boundary rings, and determine the boundary ring with the largest bounding box area as the outer contour ring, and determine the remaining boundary rings located inside the outer contour ring as inner hole rings.
[0042] Set group of holes The unit outward normal vector is n. Any vertex on the surface of the group of holes is transformed from a 3D to a 2D coordinate system based on the surface of the group of holes through a coordinate transformation. In the middle. For any inner ring. Assume it consists of n sequentially connected two-dimensional vertices, with vertex coordinates represented as follows: Where k = 1, 2, ..., n. Calculate the oriented area of the inner ring in a two-dimensional local coordinate system using the shoelace formula. The calculation formula is as follows: In the formula, Indicates the i-th inner ring The signed directed area is expressed in square millimeters; n represents the total number of two-dimensional vertices contained in the i-th inner ring, which is a positive integer; k represents the sequential index of the two-dimensional vertices in the inner ring, which is an integer ranging from 1 to n. This represents the x-coordinate of the k-th two-dimensional vertex in the two-dimensional local coordinate system, in millimeters; This represents the ordinate of the k-th two-dimensional vertex in the two-dimensional local coordinate system, in millimeters; This represents the x-coordinate of the (k+1)th two-dimensional vertex in the two-dimensional local coordinate system, in millimeters. This represents the ordinate of the (k+1)th two-dimensional vertex in the two-dimensional local coordinate system, in millimeters. In the formula, when... season That is, the two-dimensional vertices are closed in sequence, and the (n+1)th vertex is the same as the first vertex.
[0043] Based on the calculated directed area The sign of the integer part determines the ring direction of the inner hole ring, i.e., the clockwise or counterclockwise arrangement of the vertices. Based on the ring direction of the inner hole ring, the starting edge direction for the depth-first search (DFS) traversal is determined. The traversal recursively proceeds from the inner hole ring towards the depth of the 3D model. During the path advancement of the DFS, the concavity / convexity properties of the current shared edges and the access status of adjacent topological entities are monitored in real time. When the search path extends to a shared edge containing convex edge properties, indicating that the hole sidewall and the outer bottom surface or intersecting surface form a convex ridge, or when a topological entity surface already marked as visited in the current traversal is encountered, further recursive traversal of this path is immediately terminated, thereby accurately capturing all concave sidewall surfaces that constitute the hole feature.
[0044] The pseudocode description of the search process for the inner ring is as follows: ```pseudo function BuildFeatureRings(Face baseFace, Graph graph): List <featurering>rings ← [] List <loop>innerLoops ← ClassifyInnerLoops(baseFace) for each innerLoop in innerLoops: List <face>featureFaces ← [] / / Depth-first search to collect concave surfaces DFS_CollectConcaveFaces(baseFace, innerLoop, graph, featureFaces) FeatureRing ring ← new FeatureRing() ring.BaseFace ← baseFace ring.StartLoop ← innerLoop ring.Faces ← featureFaces rings.Add(ring) return rings function DFS_CollectConcaveFaces(Face currentFace, Loop currentLoop,Graph graph, List <face>outFaces): for each edge in currentLoop.Edges: Face neighbor ← graph.GetAdjacentFace(currentFace, edge) if neighbor is not null and neighbor is not visited: if edge.Convexity == CONCAVE: / / Search only along the concave direction Mark's neighbor as visited outFaces.Add(neighbor) / / Find the cycle connected to this edge in the neighboring face, and continue searching inwards. List <loop>nextLoops ← GetLoopsContainingEdge(neighbor, edge) for each nextLoop in nextLoops: DFS_CollectConcaveFaces(neighbor, nextLoop, graph, outFaces) ``` Through this step, each inner hole ring and its associated set of recessed surfaces are encapsulated into an independent inner hole feature ring object, which serves as the unit for subsequent feature type identification.
[0045] In an optional implementation, the step of matching the topology of the inner hole feature ring with a preset hole feature template to determine the corresponding hole feature type includes: Extract the surface type encoding sequence and geometric attribute data of the inner hole feature ring; Obtain the topological similarity between the surface type encoding sequence and the preset hole feature template, as well as the geometric similarity between the geometric attribute data and the preset hole feature template; The combined similarity is obtained by weighted summation of topological similarity and geometric similarity. The type corresponding to the preset hole feature template with a comprehensive similarity greater than a preset threshold is determined as the hole feature type corresponding to the inner hole feature ring.
[0046] Traverse all topological entity faces contained in the inner hole feature ring, extract face type codes according to the topological connection order (e.g., plane code is 1, cylindrical surface code is 2, conical surface code is 3, etc.), and combine them to generate a face type code sequence. Simultaneously, representative geometric attribute data of the inner hole feature ring are extracted, such as the fitted diameter. Let the surface type encoding sequence defined by the preset hole feature template T be as follows: Its nominal geometric attribute data is .
[0047] Based on the Levenshtein Distance algorithm, the topological similarity between the face type encoding sequence of the internal hole feature loop and the template sequence is calculated. The calculation formula is as follows: In the formula, The topological similarity between the surface type encoding sequence and the preset hole feature template is represented by a dimensionless numerical value ranging from 0 to 1. This indicates the encoding sequence of face types. Convert to template surface type encoding sequence The minimum number of single-character editing operations required, such as insertion, deletion, and replacement, is a non-negative integer. The surface type encoding sequence of the inner hole feature ring is obtained by sequentially encoding and extracting the type of each topological surface in the inner hole feature ring. This represents the surface type encoding sequence of the preset hole feature template, obtained from a pre-built standard hole feature template library; Represents the face type encoding sequence The total number of elements in the array is a positive integer. Indicates the template surface type encoding sequence The total number of elements in the array is a positive integer. Represents a sequence Length and sequence The maximum value in the length is a positive integer.
[0048] The geometric similarity between the geometric attribute data and the preset hole feature template is calculated using relative error. The calculation formula is as follows: In the formula, The geometric similarity between the geometric attribute data of the inner hole feature ring and the preset hole feature template is represented by a dimensionless numerical value ranging from 0 to 1. This represents the geometric feature size obtained by fitting the inner hole feature ring, such as the fitted diameter, in millimeters. The source of this size is the least squares fitting calculation of the inner hole ring contour point set. This indicates the nominal geometric feature size given by the preset hole feature template, in millimeters, obtained from a pre-built hole feature template library; This represents the preset tolerance ratio coefficient, which is a dimensionless constant. This represents a maximum function used to ensure that the geometric similarity result is not less than 0.
[0049] The topological similarity and geometric similarity are linearly weighted and summed to obtain the comprehensive similarity between the inner hole feature ring and the preset hole feature template. The calculation formula is as follows: ,in, This represents the overall similarity between the inner hole feature ring and the preset hole feature template. It is a dimensionless numerical value, ranging from 0 to 1. The weighting coefficients representing topological similarity are dimensionless constants. The weight coefficients representing geometric similarity are dimensionless constants; where the weights satisfy... For example, it is advisable , .
[0050] For example, the preset threshold for comprehensive similarity is set to 0.85. When the calculated comprehensive similarity is greater than 0.85, the type corresponding to the preset hole feature template with the highest comprehensive similarity is determined as the hole feature type of the inner hole feature ring, such as blind hole, through hole, rhomboid hole, polygonal hole, conical hole, etc.; if the calculated comprehensive similarity of each template is not greater than 0.85, the inner hole feature ring is marked as an unrecognized hole type.
[0051] In an optional implementation, the step of extracting the surface type encoding sequence and geometric attribute data of the inner hole feature ring includes: calculating the fitted diameter using the least squares circle fitting method on the inner hole ring contour point set corresponding to the inner hole feature ring, and using the fitted diameter as geometric attribute data.
[0052] Specifically, a three-dimensional discrete point set on the contour of the inner hole corresponding to the inner hole feature ring is extracted, and this set is projected onto a two-dimensional local coordinate system on a plane perpendicular to the hole axis or on the group of holes to obtain a two-dimensional discrete contour point set. ,in Assume the coordinates of the center of the fitted circle are... The fitting radius is By establishing the objective error function : ; In the formula, The sum of squared geometric distances from the discrete contour point set to the fitted circle and the target error function are expressed in square millimeters. The integer i represents the total number of discrete contour points of the inner ring, and is a positive integer; i represents the sequential index of the discrete contour points, and its value ranges from 1 to... Integers; This represents the x-coordinate of the i-th contour point in the projection plane coordinate system, in millimeters; This represents the ordinate of the i-th contour point in the projection plane coordinate system, in millimeters; The x-coordinate of the fitted circle's center is expressed in millimeters. The ordinate of the fitted circle's center is represented in millimeters. This represents the radius of the fitted circle to be solved, in millimeters.
[0053] Solve the above nonlinear least squares optimization problem to obtain the objective error function. Optimal fitting radius that reaches the minimum value Then the fitted diameter is calculated. The fitted diameter is used as the geometric attribute data of the inner hole feature ring for subsequent matching and size output.
[0054] In an optional implementation, the step of matching the topology of the inner hole feature ring with a preset hole feature template to determine the corresponding hole feature type includes: Obtain the successfully matched inner hole feature ring, and extract the normal vectors of each plane contained in the inner hole feature ring; Construct a normal vector matrix for all extracted normal vectors and perform principal component analysis. Determine the eigenvector corresponding to the minimum eigenvalue as the axial direction of the hole feature corresponding to the inner hole feature ring.
[0055] For successfully matched non-rotational irregular-shaped holes, such as rhomboid holes and polygonal holes, which are stretched structures, the accurate tilt axis direction needs to be calculated because their sidewalls are composed of multiple planes. Extract the set of all planes belonging to the hole sidewalls from the inner hole feature ring. Calculate the unit normal vector for each sidewall plane in sequence. The normal vectors of these sidewall planes are all approximately perpendicular to the direction of the tension axis of the hole feature. Construct a matrix M containing the normal vectors of the k sidewall planes: ,in, The matrix representing the normal vectors of the sidewall plane; Let represent the unit normal vector of the i-th sidewall plane; k represents the total number of sidewall planes in the internal hole feature ring. (Matrix multiplication) Principal component analysis (PCA) is performed to solve for its eigenvalues and eigenvectors. The eigenvector corresponding to the minimum eigenvalue is then found; this eigenvector represents the axial direction d of the hole feature. Its mathematical optimization expression is as follows: In the formula, This represents the direction vector of the unit axis of the final determined hole feature; This indicates that the direction traverses the unit vector, satisfying the condition. ; This indicates the search for a unit vector that minimizes the sum of its components. Represents the unit normal vector of the i-th sidewall plane; k represents the total number of sidewall planes; " " indicates the vector dot product operation.
[0056] In an optional implementation, after determining the axis direction, the method further includes: Projecting the three-dimensional contour edges of the inner hole feature ring onto a plane perpendicular to the axis direction yields a two-dimensional ordered point set. Perform curvature analysis on a two-dimensional ordered set of points and divide it into a sequence of line segments; Calculate the length of each straight line segment sequence to obtain the cross-sectional side length of the hole feature.
[0057] Specifically, after obtaining the axial direction of the hole feature, the three-dimensional contour edges of the inner hole feature ring are extracted. A projection plane perpendicular to the axial direction is established, and the points on the three-dimensional contour edges are projected onto this plane in the order of connection to obtain a two-dimensional ordered point set. Discrete curvature analysis is performed on a two-dimensional ordered set of points to identify curvature abrupt changes, and the set of points is divided into a sequence of line segments corresponding to each side of a polygon.
[0058] For the j-th segment sequence after segmentation, calculate the distance between its start and end points to obtain the segment length. : ,in, This represents the length of the j-th line segment sequence; Represents the coordinates of the two-dimensional point where the j-th line segment sequence terminates; Represents the coordinates of the starting two-dimensional point of the j-th line segment sequence; This represents the Euclidean distance norm in two-dimensional space.
[0059] When the matched hole feature type is a rhombus hole, the formula for calculating its cross-sectional side length is: In the formula, This indicates the average side length of the diamond-shaped hole; This represents the length of the dividing line segment on the j-th side of a rhombus-shaped hole. For general polygonal holes, the output is simply an array of side lengths formed by the lengths of each line segment sequence. , where p is the number of sides of the polygon.
[0060] In an optional implementation, after determining the axis direction, the method further includes: Draw a straight line along the axial direction, intersecting it with the group hole surface and the outlet surface at the end of the inner hole feature ring, to obtain the inlet intersection point and the outlet intersection point; The coordinates of the midpoint between the intersection of the inlet and the outlet are used as the three-dimensional coordinates of the hole center of the hole feature; The distance between the entrance intersection and the exit intersection is used as the depth of the hole feature.
[0061] Specifically, after obtaining the axial direction, a three-dimensional straight line is constructed along the axial direction through the center of the inner hole ring. The intersection point of this straight line with the surface of the group of holes is determined as the inlet intersection point; at the same time, the intersection point of this straight line with the outlet surface at the end of the inner hole feature ring is determined as the outlet intersection point.
[0062] The formula for calculating the three-dimensional coordinates of the hole center of the hole feature is as follows: In the formula, The three-dimensional spatial coordinate vector representing the center of the hole feature , The three-dimensional spatial coordinate vector representing the intersection of the inlet points; H represents the calculated characteristic depth of the hole. This represents the direction vector of the unit axis.
[0063] The formula for calculating the depth of the hole feature is: , where H represents the effective depth of the hole feature along the axial direction; Represents the three-dimensional spatial coordinate vector of the exit intersection point; The three-dimensional spatial coordinate vector representing the intersection point of the entrance.
[0064] In an optional implementation, after extracting the three-dimensional coordinates and depth of the hole center, the method further includes: The hole feature type, axial direction, cross-sectional side length, three-dimensional coordinates of the hole center, and depth are combined as parameters to output a structured data table.
[0065] Specifically, the parameters extracted for each successfully identified inner hole feature ring, including hole feature type, axial direction vector, cross-sectional side length or diameter, three-dimensional coordinates of the hole center, and hole depth, are formatted and assembled to generate a structured parameter table containing multiple rows of data. This data is then exported as a structured data file easily readable by manufacturing and measuring equipment, enabling automated data statistics.
[0066] To accommodate the description of polygonal holes and inclined axes, the output structured table has been updated with corresponding fields, as shown in Table 1 below.
[0067] Table 1:
[0068] In an optional implementation, after the structured data table is output, the method further includes: In the view of the original 3D model data, the set of faces contained in each identified inner hole feature ring is highlighted and rendered. The label placement position is calculated based on the coordinates of the entrance intersection, the outer normal of the group of holes, and the preset offset distance. Generate a 3D text label containing parameter combinations at the label placement location; It provides an interactive interface that responds to selections of 3D text labels or structured data tables, highlights the corresponding hole features in the view of the 3D model data, and accepts manual corrections to parameter combinations.
[0069] Specifically, the secondary development interface of the 3D graphics rendering engine is called to traverse each identified hole feature. The set of topological entity surfaces contained in each inner hole feature ring is obtained, and their surface rendering color attributes are modified for highlighting.
[0070] The placement position of the 3D text label for each hole feature is calculated using the following formula: In the formula, This indicates the mounting coordinates of the 3D text label in space; The coordinate vector representing the entrance intersection point of the hole feature; This represents the preset offset distance, the value of which is derived from an offset constant set to avoid visual occlusion between the label and the surface of the model entity; This represents the unit outward normal vector of the group of holes.
[0071] In position The system renders and generates 3D text labels, which intuitively include the hole feature type, size, and depth. A graphical user interface is constructed to achieve bidirectional linkage between the structured data table view and the 3D graphical view. When a row of table data is clicked in the interface or a 3D text label is clicked in the view, the corresponding set of faces representing the hole feature is automatically picked and highlighted, and the feature parameters can be manually modified to ensure the comprehensiveness and reliability of the recognition results.
[0072] Example 2 Based on Example 1, this example provides a system for identifying irregularly shaped holes based on traversing feature loops of a three-dimensional model, including: The face adjacency graph acquisition module is configured to obtain the normal vector angle of the topological entity face and the shared edge of the adjacent topological entity face based on the 3D model data, assign concave and convex attributes including concave edge attributes to the shared edge based on the normal vector angle, and generate a face adjacency graph. The group hole surface acquisition module is configured to traverse the number of boundary rings of each topological entity surface in the surface adjacency graph and determine the topological entity surface with the most boundary rings as the group hole surface. The inner hole ring determination module is configured to compare the bounding box areas of each boundary ring of the group hole surface, define the boundary ring with the largest bounding box area as the outer contour ring, and define the remaining boundary rings as inner hole rings. The inner hole feature ring determination module is configured to start with the inner hole ring, traverse along the shared edges with concave edge attributes in the face adjacency graph to collect adjacent topological entity faces, obtain a set of concave topological faces, and construct the inner hole feature ring. The hole feature type determination module is configured to match the topology of the inner hole feature ring with a preset hole feature template to determine the corresponding hole feature type.
[0073] In this embodiment, the face adjacency graph acquisition module reads the 3D model data, calculates the angle between the shared edge normals and assigns concave and convex attributes, generating an attribute face adjacency graph; the group hole face acquisition module traverses the total number of boundary rings of each topological face in the face adjacency graph, and selects the face containing the most boundary rings as the group hole base surface; the inner hole ring determination module calculates the bounding box area of each boundary ring through projection, and determines the boundary ring with the largest area as the outer contour ring, that is, the boundary ring does not participate in the formation of the hole, and the remaining boundary rings are defined as inner hole rings; the inner hole feature ring determination module starts from the inner hole ring, performs a depth-first traversal along the concave edge to collect concave surfaces, and constructs independent inner hole feature ring units; the inner hole feature type determination module compares the face type sequence and geometric data of the inner hole feature ring with the preset template, calculates the comprehensive similarity and determines the specific hole feature type.
[0074] The above are merely preferred embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural changes made based on the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.< / loop> < / face> < / face> < / loop> < / featurering>
Claims
1. A method for identifying irregularly shaped holes based on feature loop traversal of a 3D model, characterized in that, include: Based on the 3D model data, the angle between the normal vectors of the topological entity faces and the shared edges of adjacent topological entity faces is obtained. Based on the angle between the normal vectors, the shared edges are assigned concave and convex attributes including concave edge attributes, and a face adjacency graph is generated. Traverse the number of boundary rings of each topological entity face in the face adjacency graph, and determine the topological entity face with the most boundary rings as the group hole face. Compare the bounding box areas of each boundary ring of the group of holes, and define the boundary ring with the largest bounding box area as the outer contour ring, and the remaining boundary rings as inner hole rings. Starting with the inner hole ring, the adjacent topological entity faces are collected by traversing along the shared edges with concave edge attributes in the face adjacency graph to obtain a set of concave topological faces and construct the inner hole feature ring. The topology of the inner hole feature ring is matched with the preset hole feature template to determine the corresponding hole feature type.
2. The method for identifying irregularly shaped holes based on traversing feature loops of a three-dimensional model as described in claim 1, characterized in that, The step of defining the boundary ring with the largest bounding box area as the outer contour ring and the remaining boundary rings as the inner hole rings includes: Calculate the directed area of each of the inner ring holes in the two-dimensional local coordinate system where the group hole surface is located; The ring orientation of each of the inner rings is determined based on the directional area; Based on the ring direction of the inner ring, the direction of the starting edge for traversal is determined. A depth-first search algorithm is used to traverse from the inner ring into the interior of the 3D model. Traversal of the path is stopped when a shared edge with convex edge attributes or an already visited topological entity surface is encountered in the search path.
3. The method for identifying irregularly shaped holes based on traversing feature loops of a three-dimensional model as described in claim 1, characterized in that, The step of matching the topology of the inner hole feature ring with a preset hole feature template to determine the corresponding hole feature type includes: Extract the surface type encoding sequence and geometric attribute data of the inner hole feature ring; Obtain the topological similarity between the surface type encoding sequence and the preset hole feature template, and the geometric similarity between the geometric attribute data and the preset hole feature template; The topological similarity and the geometric similarity are weighted and summed to obtain the comprehensive similarity. The type corresponding to the preset hole feature template whose overall similarity is greater than a preset threshold is determined as the hole feature type corresponding to the inner hole feature ring.
4. The method for identifying irregularly shaped holes based on traversing feature loops of a three-dimensional model as described in claim 3, characterized in that, The step of extracting the surface type encoding sequence and geometric attribute data of the inner hole feature ring includes: The least squares circle fitting method is used to calculate the fitting diameter for the inner hole ring contour point set corresponding to the inner hole feature ring, and the fitting diameter is used as the geometric attribute data.
5. The method for identifying irregularly shaped holes based on traversing feature loops of a three-dimensional model as described in claim 1, characterized in that, The step of matching the topology of the inner hole feature ring with a preset hole feature template to determine the corresponding hole feature type includes: Obtain the successfully matched inner hole feature ring, and extract the normal vectors of each plane contained in the inner hole feature ring; A normal vector matrix is constructed from all extracted normal vectors, and principal component analysis is performed. The eigenvector corresponding to the minimum eigenvalue is determined as the axial direction of the hole feature corresponding to the inner hole feature ring.
6. The method for identifying irregularly shaped holes based on traversing feature loops of a three-dimensional model as described in claim 5, characterized in that, After determining the direction of the axis, the method further includes: The three-dimensional contour edge of the inner hole feature ring is projected onto a plane perpendicular to the axis direction to obtain a two-dimensional ordered point set; The curvature analysis of the two-dimensional ordered point set is performed and it is divided into several straight line segment sequences; Calculate the length of each straight line segment sequence to obtain the cross-sectional side length of the hole feature.
7. The method for identifying irregularly shaped holes based on traversing feature loops of a three-dimensional model as described in claim 6, characterized in that, After determining the direction of the axis, the method further includes: Draw a straight line along the axis direction, intersecting it with the group of holes and the outlet surface at the end of the inner hole feature ring, respectively, to obtain the inlet intersection point and the outlet intersection point; The coordinates of the midpoint between the intersection of the inlet and the intersection of the outlet are used as the three-dimensional coordinates of the hole center of the hole feature; The distance between the inlet intersection and the outlet intersection is taken as the depth of the hole feature.
8. The method for identifying irregularly shaped holes based on traversing feature loops of a three-dimensional model as described in claim 7, characterized in that, After extracting the three-dimensional coordinates of the hole center and the depth, the method further includes: The hole feature type, the axial direction, the cross-sectional side length, the three-dimensional coordinates of the hole center, and the depth are used as parameters to output a structured data table.
9. The method for identifying irregularly shaped holes based on traversing feature loops of a three-dimensional model as described in claim 8, characterized in that, After the structured data table is output, the method further includes: In the view of the original 3D model data, the set of faces contained in each of the identified inner hole feature rings is highlighted and rendered. The label placement position is calculated based on the coordinates of the entrance intersection point, the outer normal of the group of holes, and the preset offset distance. A three-dimensional text label containing the parameter combination is generated at the label placement location; Provides an interactive interface that, in response to the selection of the 3D text label or structured data table, highlights the corresponding hole feature in the view of the 3D model data and receives manual corrections to the parameter combination.
10. A system for identifying irregularly shaped holes based on feature loop traversal of a three-dimensional model, characterized in that, include: The face adjacency graph acquisition module is configured to obtain the normal vector angle of the topological entity face and the shared edge of the adjacent topological entity face based on the 3D model data, and assign concave and convex attributes including concave edge attributes to the shared edge based on the normal vector angle to generate a face adjacency graph. The group hole surface acquisition module is configured to traverse the number of boundary rings of each topological entity surface in the surface adjacency graph and determine the topological entity surface with the most boundary rings as the group hole surface. The inner hole ring determination module is configured to compare the bounding box areas of each boundary ring of the group of holes, define the boundary ring with the largest bounding box area as the outer contour ring, and define the remaining boundary rings as inner hole rings. The inner hole feature ring determination module is configured to start with the inner hole ring, traverse and collect adjacent topological entity faces along the shared edge with concave edge attribute in the face adjacency graph, obtain a set of concave topological faces, and construct the inner hole feature ring. The hole feature type determination module is configured to match the topology of the inner hole feature ring with a preset hole feature template to determine the corresponding hole feature type.
