Circular hole automatic identification and cylinder assembly method based on grid projection analysis

By automatically identifying holes and calculating the position of the central axis through grid projection analysis, the inefficiency of automatic identification of circular holes and assembly of cylindrical bodies is solved, realizing an efficient and accurate automated assembly process.

CN121071602APending Publication Date: 2025-12-05山东捷瑞信息技术产业研究院有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511230547.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-29
Publication Date
2025-12-05

AI Technical Summary

Technical Problem

In existing technologies, the automatic identification of circular holes and the assembly of cylindrical parts rely on human vision and manual operation, resulting in low efficiency and an inability to accurately quantify the topological integrity and axial consistency of hole boundaries, thus hindering the integration of design and manufacturing.

Method used

By employing a mesh projection analysis-based method, through boundary loop detection, annular patch collection, principal component analysis, and vector operations, the central axis and position of the hole are automatically identified, enabling the automatic approximate placement of the cylinder.

Benefits of technology

Significantly improves assembly efficiency, reduces design cycle, eliminates manual intervention, ensures consistent assembly accuracy, and supports batch processing and improved accuracy of virtual-physical mapping.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121071602A_ABST
    Figure CN121071602A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of digital manufacturing, in particular to a circular hole automatic identification and cylinder assembly method based on grid projection analysis, which comprises the following steps: S1, model input and hole boundary ring detection are carried out, and an inner boundary ring meeting size and position conditions is reserved; when the method is used, the boundary rings are automatically detected based on grid topology analysis, candidate holes are screened, the optimal assembly poses of the cylinders and the holes are automatically solved through principal component analysis and vector operation, the assembly efficiency is greatly improved, the design period is shortened, and the method is suitable for large-scale popularization and application. By calculating the circularity and the normal vector sum of a projection point set, objective quantitative evaluation of hole features is achieved, subjective judgment errors are avoided, the assembly process is converted into a mathematical model, rotation parameters are calculated on the basis of geometric center alignment and normal vector cross product, the precision consistency of each time of assembly is conveniently kept, manual intervention is eliminated, and the assembly efficiency is improved. And a standardized operation process is established.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of digital manufacturing technology, specifically to a method for automatic identification of circular holes and assembly of cylinders based on grid projection analysis. Background Technology

[0002] With the full implementation of the national digital strategy, 3D digital content creation technology has evolved from an auxiliary design tool to a core driving force for industrial transformation. In the field of high-end equipment manufacturing, 3D models carry the physical parameters and assembly logic of precision parts, serving as the data source for virtual simulation, stress analysis, and automated production. In digital twin applications, the accuracy of the model directly determines the reliability of the mapping between the virtual entity and the physical world. Furthermore, in the construction of the industrial metaverse, the efficient collaboration of massive 3D assets has become the fundamental support for realizing virtual-real interaction.

[0003] Terminology Explanation: Boundary loop: A closed path in a mesh model formed by connecting the beginning and end of boundary edges (edges shared by only one facet).

[0004] Two-dimensional point set principal component analysis: A linear transformation is performed on a point set on a two-dimensional plane to convert it to a new orthogonal coordinate system, so that the variance of the data is maximized in the direction of the first principal component and minimized in the direction of the second principal component.

[0005] Set of ring-shaped facets: The set of all triangular facets that are directly adjacent to a given boundary ring.

[0006] Traversal: The process of accessing all nodes in a data structure according to specific rules.

[0007] Half-edge data structure: A half-edge data structure is an efficient data organization method widely used in computer graphics and network analysis. It decomposes an edge into two halves, each with a defined direction and attributes. Half-edge data structures can more clearly represent topological relationships, such as the connection between faces and edges. Using half-edges, adjacent elements can be quickly tracked, improving algorithm efficiency. Compared to traditional data structures, half-edge structures have significant advantages when handling complex graphics. They effectively reduce data redundancy and save storage space. Half-edge data structures help simplify the implementation of graph traversal algorithms.

[0008] Depth-First Search (DFS): Depth-First Search is a type of graph algorithm. In short, it delves into every possible branch path until it can go as far as it can, and each node can only be visited once.

[0009] In the prior art, the existing process forces the user to visually identify the hole space position and relies on the mouse drag to realize the part positioning. Taking the automobile engine cylinder as an example, the number of assembly holes that need to be processed for a single model can reach 300-500, and the operator needs to repeatedly rotate the viewing angle to confirm the hole orientation, and then manually adjusts the part angle for trial insertion. Industry test data shows that such operation consumes more than 60% of the overall design cycle, and increases exponentially with the model complexity, resulting in high artificial dependence and restricting industrial efficiency; the axial alignment of the part and the hole needs to go through the cycle of "fine tuning-verification-repeated adjustment", the user needs to constantly switch the observation angle (usually 6-10 times of viewing angle rotation) in the three-dimensional window, and judges the coincidence of the cylindrical axis and the hole center axis by visual observation. Such repetitive operation consumes a lot of human resources; in addition, the assembly script tool of the mainstream three-dimensional software only provides basic displacement matrix calculation, which is essentially to convert the manual operation path into coordinate transformation instructions. Such tool has two major defects, one is the blind area of hole feature recognition: it cannot automatically recognize the circular hole topological features on the model surface, and needs manual pre-labeling of hole position; the other is the lack of axial intelligent judgment: it cannot automatically deduce the center axis direction according to the hole geometry, resulting in the need for manual repeated correction of the angle of the cylindrical part, which ultimately leads to the lack of batch processing capacity and restricts the large-scale application.

[0010] In summary, it is still a key problem in the field of digital manufacturing technology to develop a circular hole automatic recognition and cylindrical assembly method based on grid projection analysis. SUMMARY

[0011] The purpose of the present application is to solve the problem that the existing technology is cut off between manual operation and automatic recognition of geometric features, and the traditional method relies on visual matching, and the existing technology cannot accurately quantify the topological integrity of the hole boundary and the axial consistency.

[0012] To achieve the above purpose, the present application provides the following technical solutions: The present application provides a circular hole automatic recognition and cylindrical assembly method based on grid projection analysis, comprising the following steps: S1, model input and hole boundary ring detection, retaining the inner boundary ring meeting the size and position conditions; S2, collecting ring-shaped patches according to the inner boundary ring, and calculating the normal vector of a single patch, and then calculating the vector sum of all patch normal vectors to obtain a unit vector; S3, calculating the projection plane and vertex projection according to the unit vector, and performing principal component analysis using the statistical method of circularity determination; S4, estimating the hole center axis and position according to the principal component analysis; S5, automatically approximating and placing the cylindrical model according to the hole center axis and position.

[0013] Further, in step S1, the model input and hole boundary ring detection, the method for retaining the inner boundary ring satisfying the size and position conditions is: The model input requires inputting a triangular mesh model, which needs to include a complete set of vertex coordinates and a set of face indices, where each face is composed of three ordered vertex indices, expressed as: , In the formula, represents a triangular mesh model, represents a vertex set, represents a face index set, is a specific vertex in the vertex set, represents the total number of vertices, and each represents a vertex, represents each vertex is a point in a three-dimensional real space , is a specific face in the face index set, represents the total number of faces, and each represents a face, represents the th face is composed of three vertices , is the index of the vertex in the vertex set , the manifold topological structure of the triangular mesh model is verified by the half-edge data structure, each edge of the triangular mesh model is strictly shared by 1-2 faces, and the adjacent faces of each vertex of the triangular mesh model form a single connected ring. When the number of shared edges is greater than 2, it is any one of a non-manifold edge or an isolated vertex, a pre-processing repair process is triggered, the hole boundary ring detection is based on the half-edge data structure to traverse all edges, and the number of references of each physical edge is counted. When one of the edges is referenced by only one face, one of the edges is marked as a candidate boundary edge.

[0014] Further, in step S1, the model input and hole boundary ring detection, the method for retaining the inner boundary ring satisfying the size and position conditions is: Starting from the unprocessed boundary edges, a depth-first search is used to search for the next candidate edge along the adjacent edges of the vertex, excluding visited edges. This iterative connection continues until the first and last vertices of the path coincide, forming a closed path. An inner loop filtering mechanism is then used to traverse this closed path, performing size filtering and position verification. The size filtering calculates the diagonal length of the bounding box of the triangular mesh model, ignoring edges with a perimeter less than 50% of the model's bounding box diagonal length. The expression is: , In the formula, Indicates the first Closed path circumference, Representing the A closed path, It constitutes the closed path The number of edges, Represents a closed path The first The coordinate vector of each vertex. It is a closed path Upper The coordinate vector of the next vertex of the given vertex. It calculates two vertices. Operations involving Euclidean distances between them It is a closed path From the first edge to the second edge The lengths of the strips are added together sequentially.

[0015] Further, in step S1, the method for retaining inner boundary loops that satisfy the size and position conditions during model input and hole boundary loop detection is as follows: The location verification first calculates the geometric center of the closed path, expressed as: , In the formula, Indicates the first The geometric center of a closed path This represents the total number of vertices that make up the closed path. It is the index for summation. Indicates the first position on the closed path The coordinate vector of each vertex. The operation of computing the geometric center is performed first on... The coordinate vectors of the vertices Sum and then divide by the total number of vertices The result is the geometric center of the closed path. , any one of the positive or negative ray is emitted along the geometric center, the number of intersection points with the surface of the triangular mesh model is counted, and the number of intersection points is odd, which is located inside the triangular mesh model entity, the closed path is retained, the outermost boundary ring of the triangular mesh model is filtered, the perimeter and the center are located outside the entity, and the inner boundary ring satisfying the size and position conditions is retained Representative hole candidate.

[0016] Further, in step S2, according to the inner boundary ring, the loop patch is collected, and the single patch normal is calculated, and the vector sum of all patch normals is calculated, and the method for normalizing to obtain a unit vector is: For each filtered inner boundary ring, denoted as hole ring , is an integer number starting from 1, and all hole rings are collected The triangular patch sharing the vertex of any one edge is generated, and the loop patch set associated with the hole ring The single patch normal is calculated, the cross product of the two edge vectors of the patch in the loop patch set is taken and normalized, the vector sum of all patch normals is calculated, and the unit vector M is normalized to obtain a unit vector, the expression is: , In the formula, represents the final obtained unit vector, The summation symbol represents the summation operation on the normal vectors of the patches associated with the hole ring , represents the number of patches in the loop patch set associated with the hole ring , represents the unit normal vector of the th patch in the loop patch set associated with the hole ring , is the sum of all patch normal vectors associated with the hole ring , the norm of the vector , the norm of the vector ,The number of hole rings is an integer starting from 1.

[0017] Further, in step S3, according to the unit vector, the projection plane and the vertex projection are calculated, and the method for principal component analysis using the circularity determination statistical method is: The projection plane is calculated, and the origin is selected at any point on the inner boundary ring, and the unit vector​ To define the projection direction, establish an orthogonal two-dimensional plane coordinate system, expressed as: , In the formula, Represents a unit vector. It is an arbitrary vector in three-dimensional space. Represents a unit vector and The result of the cross product, It is a unit vector in a two-dimensional coordinate system orthogonal to the projection plane. It is another unit vector in the orthogonal two-dimensional plane coordinate system of the projection plane, and the vertex projection is along the unit vector. Projecting along orthogonal directions, we can map the three-dimensional vertices onto a two-dimensional plane to obtain a two-dimensional point set. .

[0018] Further, in step S3, the method for calculating the projection plane and vertex projection based on the unit vector, and performing principal component analysis using statistical methods for circularity determination, is as follows: The statistical method for determining circularity is used to perform principal component analysis, and the average value of all U coordinates of the projection point set is calculated, denoted as... Calculate the average of all V coordinates, denoted as . Calculate the following four key values: , In the formula, Used to measure the projection point set in The degree of dispersion in the coordinate direction, This represents the total number of projection points. No. Projection points Coordinate values All projection points The average value of the coordinates, Used to measure the projection point set in The degree of dispersion in the coordinate direction, It is the total number of projection points. It is the index of the projection point. No. Projection points Coordinate values All projection points The average value of the coordinates, Used to measure the set of projection points coordinates and The degree of covariance between coordinates is used to construct a 2×2 covariance matrix, and the maximum eigenvalues ​​of the principal component directions are obtained through eigenvalue decomposition. and minimum eigenvalue , according to the determination rule , then it is determined that the hole is approximately circular.

[0019] Further, in step S4, the method for estimating the hole center axis and position according to the principal component analysis is: According to the principal component analysis, the hole with the largest eigenvalue is retained , the center point of the output hole center axis and position is obtained by calculating the geometric center of all vertices of the annular face sheet, and the direction is an infinite straight line, and the calculation number , the expression is: , wherein represents the center axis straight line equation related to the hole , is a known point on the straight line, is a parameter belonging to the real number set , is the direction vector of the straight line, respectively corresponding the components in the direction of the coordinate axes.

[0020] Further, in step S5, the method for automatically approximating the placement of the cylindrical model according to the hole center axis and position is: According to the hole center axis and position, the cylindrical model to be placed is imported, and the automatic approximation placement includes a translation transformation execution process, a rotation transformation execution process, and a copy. The translation transformation execution process moves the cylindrical body according to its geometric center to , the expression is: , wherein represents the displacement vector of the th translation transformation, represents the target placement position point corresponding to the th hole center axis, points to the initial geometric center position of the cylindrical model, represents the new position vector of the th vertex of the cylindrical body after translation transformation, is the original position vector of the th vertex of the cylindrical body before translation transformation, is an index for traversing the vertices of the cylindrical body, represents the total number of vertices of the cylindrical body, and the rotation transformation execution process calculates the default axis of the cylindrical body and The cross product of the hole center axis and the position is obtained.

[0021] Further, in step S5, the method for automatically approximating and placing the cylindrical model according to the hole center axis and the position is as follows: The rotation transformation execution flow is used to calculate the rotation angle: , In the formula, The first rotation angle, The inverse cosine function, The initial reference vector, The other vector corresponding to the first The dot product operation is performed on the other vector and The value range of The center point is taken as the reference, and each vertex of the cylindrical body is rotated by an angle of around the rotation axis, the replication is realized through a batch assembly mechanism, the number of holes that pass the verification is first counted, and then the calculation is independently performed on each hole, and finally the multi-instance synchronous assembly is realized. Advantages: Compared with the known prior art, the technical scheme provided by the present application has the following advantages:

[0022] When the present application is used, based on the grid topology analysis, the boundary ring is automatically detected and the candidate holes are screened, through principal component analysis and vector operation, the optimal assembly pose of the cylindrical body and the hole is automatically solved, which is beneficial to greatly improve the assembly efficiency and shorten the design cycle, through calculating the circularity and normal vector sum of the projection point set, the objective quantitative evaluation of the hole features is realized, the subjective judgment error is avoided, through converting the assembly process into a mathematical model, based on the geometric center alignment and the cross product calculation of the normal vector, the rotation parameters are calculated, which is convenient to keep the consistency of the assembly accuracy, eliminate manual intervention and establish a standardized operation process. When the present application is used, the boundary ring detection, face collection and other steps can be processed in parallel, the multi-core computing resources are fully utilized, only the basic grid data is needed, without complex preprocessing or special hardware support, batch processing is supported, the bottleneck of complex model assembly is broken through, hidden holes in complex curved surfaces are automatically identified, the assembly features of physical entities are conveniently retained in integrity, which is beneficial to empower digital twin and improve the virtual-real mapping accuracy.

[0023] When the present application is used, the boundary ring detection, face collection and other steps can be processed in parallel, the multi-core computing resources are fully utilized, only the basic grid data is needed, without complex preprocessing or special hardware support, batch processing is supported, the bottleneck of complex model assembly is broken through, hidden holes in complex curved surfaces are automatically identified, the assembly features of physical entities are conveniently retained in integrity, which is beneficial to empower digital twin and improve the virtual-real mapping accuracy.

[0024] ​The application does not depend on specific software or data formats in use, supports general triangular mesh model input, is convenient for seamless integration into the existing industrial software ecology, the core algorithm of the application can be extended to other geometric feature recognition, such as square holes and keyways, provides a basis for future full-automatic assembly, and can be adapted to different industry demands, such as precision instruments and medical devices, through simple parameter configuration, and has a wide engineering application prospect. BRIEF DESCRIPTION OF DRAWINGS

[0025] Figure 1 A flowchart of a circular hole automatic recognition and cylindrical assembly method based on mesh projection analysis. DETAILED DESCRIPTION

[0026] In order for those skilled in the art to better understand the application scheme, the technical solutions in the embodiments of the application will be clearly and completely described below in combination with the drawings in the embodiments of the application. Obviously, the described embodiments are only a part of the embodiments of the application, not all the embodiments. Based on the embodiments in the application, all other embodiments obtained by those skilled in the art without creative labor should belong to the protection scope of the application.

[0027] It should be noted that the terms "first", "second", etc. in the specification and claims of the application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily describe a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units does not necessarily limit to those steps or units clearly listed, but includes other steps or units not clearly listed or inherent to these processes, methods, products or devices.

[0028] The application will be further described in detail below in combination with the drawings:

[0029] Embodiment: As Figure 1 shown, the application provides a circular hole automatic recognition and cylindrical assembly method based on mesh projection analysis, including the following steps: S1, model input and hole boundary ring detection, retaining the inner boundary ring meeting the size and position conditions; Further, in step S1, the method for model input and hole boundary ring detection, retaining the inner boundary ring meeting the size and position conditions is: The model input requires inputting a triangular mesh model, which needs to include a complete vertex coordinate set and a face index set, where each face is composed of three ordered vertex indexes, expressed as: , In the formula, represents a triangular mesh model, denotes a vertex set, represents a face index set, is a specific vertex in the vertex set, denotes the total number of vertices, and each represents a vertex, denotes each vertex is a point in a three-dimensional real space , is a specific face in the face index set, denotes the total number of faces, and each represents a face, denotes the th face is composed of three vertices , is the index of the vertex in the vertex set , the manifold topology of the triangular mesh model is verified by the half-edge data structure, each edge of the triangular mesh model is strictly shared by 1-2 faces, and the adjacent faces of each vertex of the triangular mesh model form a single-connected ring, when the number of shared edges is >2, any one of non-manifold edges or isolated vertices is found, a pre-processing repair process is triggered, the hole boundary ring detection is based on the half-edge data structure to traverse all edges, and the number of references of each physical edge is counted, when one of the edges is only referenced by one face, one of the edges is marked as a candidate boundary edge.

[0030] Further, in step S1, the model input and hole boundary ring detection, the method for retaining the inner boundary ring that meets the size and position conditions is: Select a starting point from the unprocessed boundary edge, use depth-first search to search for the next candidate edge along the vertex adjacent edge, exclude the visited edges, iterate and connect until the path is closed with the first and last vertices coinciding, then form a closed path, traverse the closed path through the inner ring screening mechanism, perform size filtering and position verification, the size filtering calculates the diagonal length of the bounding box of the triangular mesh model, and ignores the perimeter that is less than 50% of the diagonal length of the model bounding box, expressed as: , In the formula, denotes the perimeter of the th closed path , represents the the number of edges of the closed path, is the number of edges of the closed path, the number of edges of the closed path, is the coordinate vector of the first vertex on the closed path, is the coordinate vector of the first vertex on the closed path, is the coordinate vector of the first vertex on the closed path, is the coordinate vector of the first vertex on the closed path, is the coordinate vector of the first vertex on the closed path, is the coordinate vector of the first vertex on the closed path, is the coordinate vector of the first vertex on the closed path, is the coordinate vector of the first vertex on the closed path, is the coordinate vector of the first vertex on the closed path, is the coordinate vector of the first vertex on the closed path, is the coordinate vector of the first vertex on the closed path,

[0031] Further, in step S1, the model input and hole boundary ring detection, the method for retaining the inner boundary ring satisfying the size and position conditions is: the position verification, first calculate the geometric center of the closed path, expression: , wherein, is the geometric center of the first closed path, is the total number of vertices constituting the closed path, is the index of summation, is the coordinate vector of the first vertex on the closed path, is the coordinate vector of the first vertex on the closed path, is the coordinate vector of the first vertex on the closed path, is the coordinate vector of the first vertex on the closed path, is the coordinate vector of the first vertex on the closed path, is the coordinate vector of the first vertex on the closed path, is the coordinate vector of the first vertex on the closed path, is the coordinate vector of the first vertex on the closed path, is the coordinate vector of the first vertex on the closed path,

[0032] In the embodiment, firstly, a triangular mesh model containing a complete vertex coordinate set and a face index set is input, the model manifold topological structure is verified by means of a half-edge data structure, and based on this, edges are traversed, edges referenced by only one face are marked as candidate boundary edges, then a starting point is selected from unprocessed boundary edges, a closed path is formed by means of a depth-first search, the path length is calculated by means of a bounding box of the triangular mesh model, paths with a perimeter less than 50% of the path length are filtered, the geometric center of the closed path is calculated, a ray is emitted along the center, whether the ray is inside the entity is judged according to the odd-even number of intersection points with the model surface, the inner boundary ring inside and meeting the size is reserved as a hole candidate, and the outer large boundary ring is filtered. When processing a triangular mesh model of a mechanical part, after the triangular mesh model is input, topological structure repair problems are verified, candidate boundary edges are found, a closed path is formed and screened, and the inner boundary ring corresponding to the hole on the part is determined. Through manifold detection and repair, hole recognition errors are avoided, the model topological integrity and correctness are improved, the boundary edge depth search and path closing mechanism are combined, and the holes of any topological complexity are adapted.

[0033] S2, according to the inner boundary ring, ring-shaped face collection is performed, and after calculating a single face normal, a vector sum of all face normals is obtained, and a unit vector is normalized; Further, in step S2, according to the inner boundary ring, ring-shaped face collection is performed, and after calculating a single face normal, a vector sum of all face normals is obtained, and a unit vector is normalized; For each filtered inner boundary ring, denoted as hole ring , is an integer number starting from 1, and all hole rings are collected , the triangular face sharing any edge of the hole ring is generated , the calculation of a single face normal, the cross product of two edge vectors of a face in the ring-shaped face set is taken and normalized, a vector sum of all face normals is obtained, and a unit vector M is normalized, and the expression is: , In the formula, represents the finally obtained unit vector, the summation symbol represents a summation operation on the normal vectors of the face associated with the hole ring , represents the number of faces in the ring-shaped face set associated with the hole ring , represents the number of faces in the ring-shaped face set associated with the hole ring , represents the number of faces in the ring-shaped face set associated with the hole ring . unit normal vector of each face patch, is the sum of all face patch normal vectors associated with the hole ring , vector , norm, The number of the hole ring is an integer starting from 1.

[0034] In this embodiment, when processing the triangular mesh model of an automobile engine cylinder block, for the inner boundary ring of one of the circular bolt holes, a circle of face patches around it is collected, the normal vectors of the multiple triangular face patches in the ring are vector-summed and smoothed, and then normalized to obtain the normal unit vector of the hole The normal unit vector of the hole can be directly used as the projection direction of the two-dimensional projection plane and the spatial pose basis for the assembly of the cylinder, and the vector cross product and normalization operation are adopted without relying on surface fitting or global reconstruction, which is suitable for parallel processing of a large number of holes.

[0035] S3, calculating the projection plane and vertex projection according to the unit vector, and performing principal component analysis using the statistical method of circularity determination; Further, in step S3, the method for calculating the projection plane and vertex projection according to the unit vector and performing principal component analysis using the statistical method of circularity determination is: The projection plane is calculated at an optional point on the inner boundary ring with the unit vector as the projection direction, an orthogonal two-dimensional plane coordinate system is established, and the expression is: , In the formula, denotes the unit vector, is an arbitrary vector in three-dimensional space, denotes the cross product result of the unit vectors and , is a unit vector in the orthogonal two-dimensional plane coordinate system of the projection plane, is another unit vector in the orthogonal two-dimensional plane coordinate system of the projection plane, the vertex projection is projected along the orthogonal direction of the unit vector to project the three-dimensional vertex onto the two-dimensional plane to obtain a two-dimensional point set .

[0036] Further, in step S3, the method for calculating the projection plane and vertex projection based on the unit vector, and performing principal component analysis using statistical methods for circularity determination, is as follows: The statistical method for determining circularity is used to perform principal component analysis, and the average value of all U coordinates of the projection point set is calculated, denoted as... Calculate the average of all V coordinates, denoted as . Calculate the following four key values: , In the formula, Used to measure the projection point set in The degree of dispersion in the coordinate direction, This represents the total number of projection points. No. Projection points Coordinate values All projection points The average value of the coordinates, Used to measure the projection point set in The degree of dispersion in the coordinate direction, It is the total number of projection points. It is the index of the projection point. No. Projection points Coordinate values All projection points The average value of the coordinates, Used to measure the set of projection points coordinates and The degree of covariance between coordinates is used to construct a 2×2 covariance matrix, and the maximum eigenvalues ​​of the principal component directions are obtained through eigenvalue decomposition. and minimum eigenvalue According to the judgment rules If so, it can be determined to be a roughly circular hole.

[0037] In this embodiment, a selected point on the boundary ring inside the hole is first taken as the origin. The projection direction is determined based on the unit vector. An orthogonal two-dimensional plane coordinate system is constructed through operations such as vector cross product (to obtain the coordinate axis unit vectors U and V). Then, the three-dimensional vertices are projected onto this plane along the orthogonal direction of the unit vector to form a two-dimensional point set. The mean values ​​of U and V coordinates are then calculated for the projected point set. Next, SUU, which reflects the degree of dispersion of U, SVV, which reflects the degree of dispersion of V, and SUV, which reflects the degree of covariance between U and V, are calculated. A covariance matrix is ​​constructed and eigenvalue decomposition is performed to obtain the largest eigenvalue. and minimum eigenvalue ,exist When determining whether a hole is roughly circular, for example, when analyzing a circular hole on a mechanical part, after inputting its triangular mesh model, the above process is followed to project vertices and analyze feature values ​​to determine whether it is a circular hole. By projecting onto a two-dimensional plane and combining principal component analysis and circularity determination, the discreteness and symmetry of the projected shape can be effectively judged, thereby identifying circular structures rather than elliptical or irregular holes. It does not depend on whether the hole is in a horizontal or vertical direction. A local coordinate system is constructed through a unit normal vector, which is applicable to hole identification in any direction, making it easier to accurately find the real circular hole and avoid misjudgment.

[0038] S4. Estimate the central axis and position of the hole based on the principal component analysis. Further, in step S4, the method for estimating the central axis and position of the hole based on the principal component analysis is as follows: Based on the principal component analysis, retain Holes Obtain the center point By calculating the geometric centers of all vertices of the annular patch, the central axis and position of the output hole are determined. And the direction is Calculate an infinite straight line. quantity ,expression: , In the formula, Indicates the presence of holes The relevant equation of the central axis line, It is a known point on the straight line. The parameter belongs to the set of real numbers. , It is the direction vector of the line. Corresponding to Components along the coordinate axes.

[0039] In this embodiment, based on the principal component analysis results, samples that meet the following criteria are first selected and retained. Holes The center point is obtained by calculating the geometric center of the vertex of the toroidal patch. , and then through And the direction is a vector. Using an infinite straight line as the central axis of the hole, when analyzing the triangular mesh model of mechanical parts, the identified circular hole candidates are screened by principal component analysis to determine the position and direction of their central axis, preparing for subsequent cylindrical assembly. It is compatible with various common mesh formats such as scanned point cloud, STL, and OBJ, and is suitable for reverse engineering, industrial vision, and CAD data repair, which helps to improve versatility. The mathematical form of the linear expression is clear, which facilitates integration with automated modeling, path planning, or robot control systems.

[0040] S5, automatically placing the cylinder model according to the hole center axis and position; Further, in step S5, the method for automatically placing the cylinder model according to the hole center axis and position is: According to the hole center axis and position, the cylinder model to be placed is imported, and the automatic approximation placement includes a translation transformation execution process, a rotation transformation execution process, and replication. The translation transformation execution process moves the cylinder according to its geometric center to , the expression is: , In the formula, represents the displacement vector of the th translation transformation, represents the target placement position point corresponding to the th hole center axis, refers to the initial geometric center position of the cylinder model, represents the new position vector of the th vertex of the cylinder after translation transformation, is the original position vector of the th vertex of the cylinder before translation transformation, is an index for traversing the vertices of the cylinder, represents the total number of vertices of the cylinder, the rotation transformation execution process calculates the cross product of the default axis of the cylinder and to obtain the rotation axis direction vector.

[0041] Further, in step S5, the method for automatically placing the cylinder model according to the hole center axis and position is: The rotation transformation execution process calculates the rotation angle: , In the formula, represents the th rotation angle, is the inverse cosine function, is the initial reference vector, is the dot product operation of another vector corresponding to the th and , represents the value range of , and each vertex of the cylinder is rotated angle around the rotation axis with the center point as the reference, the replication, through a batch assembly mechanism, first counts the number of holes that pass the verification , then independently performs calculation for each hole, and finally realizes multi-instance synchronous assembly.

[0042] In the present embodiment, the hole center axis direction determined according to step S4 is a unit vector and the position center point , a cylindrical model is imported, and the cylindrical geometric center is moved from the initial position to by translation transformation, the cross product of the initial reference vector of the cylinder and is calculated to determine the rotation axis, the rotation angle is calculated by , the cylinder is rotated around the rotation axis to align the axis with the hole center axis, and finally the number of passing holes is counted. The translation and rotation transformation are independently performed for each hole to realize the synchronous batch assembly of multiple cylinders. For example, in the assembly of automobile chassis parts, the center axis and position of each hole on the chassis grid model are determined, the bolt model is translated to the hole center and rotated to align the axis, and finally the bolts are batch copied to all hole positions to complete the automatic assembly. By using the double constraints of the main axis direction and the center point, the cylinder is accurately aligned with the hole direction and position. The method used is based on linear algebra and rigid transformation matrix, without complex physical simulation or manual intervention, and is suitable for modern graphics engine and three-dimensional modeling tool chain.

[0043] The above embodiments are only used to illustrate the technical solutions of the present application, but not to limit it; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for part of the technical features; and these modifications or replacements will not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for automatic recognition of circular holes based on mesh projection analysis and cylindrical assembly, characterized in that, The method comprises the following steps: S1, model input and hole boundary ring detection, retaining the inner boundary ring meeting the size and position conditions; S2, collecting ring-shaped facets according to the inner boundary ring, calculating the normal of a single facet, and then calculating the vector sum of the normals of all facets to obtain a unit vector; S3, calculating the projection plane and vertex projection according to the unit vector, and performing principal component analysis by using the statistical method of circularity determination; S4, estimating the hole center axis and position according to the principal component analysis; S5, placing a cylindrical model automatically approximated according to the hole center axis and position.

2. The method of claim 1, wherein, In step S1, the method for model input and hole boundary ring detection, retaining the inner boundary ring meeting the size and position conditions is as follows: The model input requires inputting a triangular mesh model, which needs to include a complete set of vertex coordinate sets and facet index sets, wherein each facet is composed of three ordered vertex indexes, and the expression is: , In the formula, represents a triangular mesh model, represents a vertex set, represents a face index set, is a specific vertex in the vertex set, represents the total number of vertices, each represents a vertex, represents each vertex is a point in a three-dimensional real space , is a specific face in the face index set, represents the total number of faces, each represents a face, represents the th face is composed of three vertices , is the index of the vertex in the vertex set , The manifold topology of the triangular mesh model is verified by the half-edge data structure, each edge of the triangular mesh model is strictly shared by 1-2 faces, the adjacent faces of each vertex of the triangular mesh model form a single connected ring, when the number of shared edges > 2 is found to be any one of a non-manifold edge or an isolated vertex, a preprocessing repair process is triggered, the hole boundary ring detection, based on the half-edge data structure, traverses all edges, counts the number of references of each physical edge, when one of the edges is referenced by only one face, then mark one of the edges as a candidate boundary edge.

3. The method of claim 2, wherein, In step S1, the method for model input and hole boundary ring detection, retaining the inner boundary ring meeting the size and position conditions is as follows: The starting point is selected from the unprocessed boundary edge, a depth-first search is performed along the vertex adjacent edge to search for the next candidate edge, the visited edge is excluded, and the iteration is connected until the path is closed with the first and last vertexes of the path coinciding, then a closed path is formed, the closed path is traversed by an inner ring screening mechanism, size filtering and position verification are performed, the size filtering calculates the diagonal length of the bounding box of the triangular mesh model, and the length of the closed path is ignored if the length is less than 50% of the diagonal length of the model bounding box, and the expression is: , wherein denotes the th closed path , the perimeter of the th closed path, denotes the th closed path, is the number of edges constituting the th closed path, denotes the coordinate vector of the th vertex on the closed path, is the coordinate vector of the next vertex of the th vertex on the closed path, is the operation of calculating the Euclidean distance between two vertices, is the operation of calculating the Euclidean distance between two vertices, is the operation of calculating the Euclidean distance between two vertices, is the operation of calculating the Euclidean distance between two vertices, is the operation of calculating the Euclidean distance between two vertices, is the operation of calculating the Euclidean distance between two vertices.

4. The method of claim 3, wherein, In step S1, the method for model input and hole boundary ring detection, retaining the inner boundary ring meeting the size and position conditions is as follows: The position verification first calculates the geometric center of the closed path, and the expression is: , In the formula, Indicates the first The geometric center of a closed path This represents the total number of vertices that make up the closed path. It is the index for summation. Indicates the first position on the closed path The coordinate vector of each vertex. The operation of computing the geometric center is performed first on... The coordinate vectors of the vertices Sum and then divide by the total number of vertices The result is the geometric center of the closed path. Radiation is emitted from the geometric center in either a positive or negative direction. The number of intersections with the surface of the triangular mesh model is counted. If the number of intersections is odd, the ray is located inside the triangular mesh model entity, and the closed path is retained. The outermost large boundary ring of the triangular mesh model is filtered out. The inner boundary ring with a perimeter and center located outside the entity is retained, satisfying the size and position conditions. Representative of the hole candidate.

5. The method of claim 4, wherein, In step S2, the method for collecting ring-shaped facets according to the inner boundary ring, calculating the normal of a single facet, and then calculating the vector sum of the normals of all facets to obtain a unit vector is as follows: Each inner boundary ring that passes the screening is denoted as a hole ring. , Collect all the hole rings, numbered with integers starting from 1. Generate a triangular facet sharing a vertex with any edge, and generate a loop of holes. Associative set of toroidal patches The calculation of the normal of a single patch is performed from the set of annular patches. Take the cross product of the two edge vectors of a facet and normalize it. Calculate the vector sum of the normals of all faces and normalize it to obtain the unit vector M. The expression is: , wherein denotes the resulting unit vector, the summation sign denotes a summation operation on the normal vectors of the The number of the hole ring is an integer starting from 1.​​​​​​​​​​​​​​ 6. The method of claim 5, wherein, In step S3, the method for calculating the projection plane and vertex projection according to the unit vector, and performing principal component analysis by using the statistical method of circularity determination is as follows: The calculation projection plane, optional point on the inner boundary ring The origin, the unit vector The projection direction, establish a two-dimensional orthogonal coordinate system, expression: , In the formula, Represents a unit vector. It is an arbitrary vector in three-dimensional space. Represents a unit vector and The result of the cross product, It is a unit vector in a two-dimensional coordinate system orthogonal to the projection plane. It is another unit vector in the orthogonal two-dimensional plane coordinate system of the projection plane, and the vertex projection is along the unit vector. Projecting along orthogonal directions, we can map the three-dimensional vertices onto a two-dimensional plane to obtain a two-dimensional point set. .

7. The method of claim 6, wherein, In step S3, the method for calculating the projection plane and vertex projection according to the unit vector, and performing principal component analysis by using the statistical method of circularity determination is as follows: The statistical method of roundness determination is used for principal component analysis, the average value of all U coordinates of the projection point set is calculated, denoted as The average value of all V coordinates is calculated, denoted as The following four key values are calculated: , In the formula, Used to measure the projection point set in The degree of dispersion in the coordinate direction, This represents the total number of projection points. No. Projection points Coordinate values All projection points The average value of the coordinates, Used to measure the projection point set in The degree of dispersion in the coordinate direction, It is the total number of projection points. It is the index of the projection point. No. Projection points Coordinate values All projection points The average value of the coordinates, Used to measure the set of projection points coordinates and The degree of covariance between coordinates is used to construct a 2×2 covariance matrix, and the maximum eigenvalues ​​of the principal component directions are obtained through eigenvalue decomposition. and minimum eigenvalue According to the judgment rules If so, it can be determined to be a roughly circular hole.

8. The method of claim 7, wherein, In step S4, the method for estimating the hole center axis and position according to the principal component analysis is as follows: According to the principal component analysis, the hole is retained , the center point is obtained, the output hole center axis and position are calculated by calculating the geometric center of all vertices of the annular face sheet, the infinite straight line is and the direction is , the number is calculated , and the expression is: , wherein represents the central axis straight line equation associated with the hole , is a known point on the straight line, is a parameter belonging to the real number set , is the direction vector of the straight line, respectively correspond to the components in the coordinate axis direction.

9. The method of claim 8, wherein, In step S5, the method for placing a cylindrical model automatically approximated according to the hole center axis and position is as follows: According to the hole center axis and position, a cylindrical model to be placed is introduced, and the automatic approximate placement includes a translation transformation execution process, a rotation transformation execution process and copying. The translation transformation execution process moves the cylindrical model according to its geometric center to the center axis of the hole, and the rotation transformation execution process rotates the cylindrical model to the position of the hole. Expression: , In the formula, represents the displacement vector of the th translation transformation, represents the target placement position point corresponding to the th hole center axis, refers to the initial geometric center position of the cylindrical model, represents the new position vector of the th vertex of the cylinder after translation transformation, is the original position vector of the th vertex of the cylinder before translation transformation, is an index for traversing the vertices of the cylinder, represents the total number of vertices of the cylinder, and the rotation transformation execution flow calculates the cross product of the default axis of the cylinder and to obtain the rotation axis direction vector.

10. The method of claim 8, wherein, In step S5, the method for placing a cylindrical model automatically approximated according to the hole center axis and position is as follows: The rotation transformation execution flow calculates the rotation angle: , In the formula, indicates the first rotation angle, is the inverse cosine function, is the initial reference vector, is another vector corresponding to the first rotation angle, is the dot product operation, indicates the value range of , with the center point as the reference, rotating each vertex of the cylinder around the rotation axis by an angle , the replication is realized through a batch assembly mechanism, first counting the number of verified holes , then performing calculation on each hole independently, and finally realizing multi-instance synchronous assembly.