An Assembly Hole Alignment Detection Method and System Based on Geometric Reasoning
Automatic detection of assembly holes is solved by automatically detecting assembly holes based on geometric inference, and the shortcomings of existing three-dimensional modeling software in hole alignment detection are achieved, and efficient and automated detection of assembly hole alignment is achieved.
Patent Information
- Application Number
- CN202410977508.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-22
- Publication Date
- 2025-07-22
- Estimated Expiration
- 2044-07-22
AI Technical Summary
The existing three-dimensional modeling software has limited functions and poor versatility when detecting the alignment of assembly holes, and cannot automatically determine the position where alignment needs to be detected between holes, and the manual detection method is cumbersome and inefficient.
Using a method based on geometric inference, the three-dimensional model of the assembly is analyzed, the boundary representation data of each sub-part is obtained, vertex and edge optimization is performed, hole units and features are identified, and the axial vectors of the holes are determined to automatically detect whether the holes are aligned.
It realizes universality and efficient automation of hole alignment detection in assembly bodies, can identify hole characteristics in various construction methods, quickly analyze the positional relationship between holes, reduce manual intervention, and improve detection efficiency.
Smart Images

Figure CN119004694B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of manufacturability analysis, and more specifically, relates to a method and system for detecting hole alignment of an assembly based on geometric reasoning. Background Art
[0002] In mechanical design, especially in the structural design of an assembly, the alignment of holes is particularly important for ensuring precise fit between components. The precise position and alignment of holes can prevent abnormal problems such as stress concentration and uneven force in the actual assembly process of the assembly, reduce wear of components, and extend their service life.
[0003] Currently, the detection of hole alignment between assemblies in the industry mainly relies on manual inspection. Although a few 3D modeling software (such as SolidWorks, etc.) have built-in hole alignment detection functions, the conditions for this function are restrictive. It can only detect holes modeled by the software's built-in "hole feature" function, and cannot identify holes cut out by other methods such as "extrusion" and "revolution", nor can it detect holes in parts imported from the outside, and alignment detection cannot be performed either.
[0004] Generally speaking, the current detection methods for hole alignment of an assembly mainly have the following deficiencies:
[0005] (1) The existing hole alignment detection functions in existing 3D modeling software are limited (it can only detect holes modeled by the software's built-in "hole feature" function, and cannot identify holes cut out by other methods such as "extrusion" and "revolution", nor can it detect holes in parts imported from the outside, and alignment detection cannot be performed either), and the versatility is poor.
[0006] (2) For the entire assembly, existing 3D modeling software cannot automatically determine which holes need to be detected for alignment, nor can it complete the detection of all holes at one time.
[0007] (3) The existing manual detection method is relatively cumbersome to operate, has low efficiency, and is prone to missing some areas that need to be detected. Summary of the Invention
[0008] In view of the above defects or improvement requirements of the prior art, the present invention provides a method and system for detecting hole alignment of an assembly based on geometric reasoning, aiming to solve the technical problems that the existing hole alignment detection functions in existing 3D modeling software are limited and have poor versatility, and that existing 3D modeling software cannot automatically determine which holes need to be detected for alignment, nor can it complete the detection of all holes at one time, and that the existing manual detection method is relatively cumbersome to operate, has low efficiency, and is prone to missing some areas that need to be detected.
[0009] To achieve the above object, according to one aspect of the present invention, there is provided a method for detecting hole alignment of an assembly based on geometric reasoning, including the following steps:
[0010] (1) Analyze the assembly to be detected to obtain the boundary representation Brep data of each sub-part in the assembly;
[0011] (2) For each sub-part in the assembly obtained in step (1), perform vertex optimization processing and edge optimization processing on its Brep data in sequence to obtain the optimized Brep data corresponding to the sub-part;
[0012] (3) For each sub-part in the assembly obtained in step (1), obtain each edge in the optimized Brep data corresponding to the sub-part obtained in step (2), obtain the concavity and convexity of the edge according to the connection situation of all adjacent faces of the edge, and fill the concavity and convexity of the edge into the Brep data to obtain the updated Brep data corresponding to the sub-part;
[0013] (4) For each sub-part in the assembly obtained in step (1), obtain the set of hole units corresponding to the sub-part according to the updated Brep data corresponding to the sub-part obtained in step (3);
[0014] (5) For each sub-part in the assembly obtained in step (1), obtain the set of hole features corresponding to the sub-part according to the set of hole units corresponding to the sub-part obtained in step (4).
[0015] (6) For each sub-part in the assembly obtained in step (1), obtain the type, in-coming machining surface ID in , out-coming machining surface ID out and axial vector V of each hole feature according to the set of hole features corresponding to the sub-part obtained in step (5);
[0016] (7) According to the type, in-coming machining surface ID in , out-coming machining surface ID out and axial vector V of each hole feature corresponding to each sub-part in the assembly obtained in step (6), obtain the assembly hole features corresponding to the assembly.
[0017] (8) Judge whether the axial vectors V1 and V2 of the two hole features corresponding to the assembly hole features obtained in step (7) are collinear. If they are collinear, it means that the two holes in the assembly hole features are aligned; otherwise, it means that the two holes are not aligned.
[0018] Preferably, step (1) is specifically as follows. First, use 3D modeling design software to open the assembly to be detected. Then, read the geometric data such as vertices, edges, and faces of each sub-part in the assembly through the secondary development interface provided by the 3D modeling design software, and remove the duplicate data among them. Subsequently, read the topological connection relationships among the geometric data in each sub-part through the secondary development interface, and remove the isolated (i.e., having no connection relationship with other geometric data) vertices, edges, or faces. Then, combine the geometric data and topological connection relationships of each sub-part obtained to form the Brep data of the sub-body.
[0019] Preferably, the process of vertex optimization processing for the Brep data of the sub-part in step (2) is specifically as follows. First, read all the vertices in the Brep data of the sub-part, and calculate the distance between every two vertices. If the distance between two vertices is less than 0.01 mm, then fit these two vertices into a new vertex, and the new vertex is the midpoint of the line connecting the two original vertices. Then, modify the edges connected to the original vertices in the Brep data to be connected to the new vertex. Finally, remove the two original vertices from the Brep data of the sub-part;
[0020] Edge optimization refers to fitting two edges with the same vertices and curve equations in the sub-part into one edge;
[0021] The process of edge optimization for the Brep data of the sub - part in step (2) is specifically as follows: First, read all the edges in the Brep data of the sub - part. Then, for every two edges E1 (whose two vertices are V1 and V2 and are straight - line edges) and E2 (whose two vertices are V2 and V3 and are straight - line edges) that have the same vertex, obtain the curve equation of edge E1: (x, y, z)=b*T1+(x1, y1, z1), where T1 is the straight - line direction vector and b is an arbitrary real number; obtain the curve equation of edge E2: (x, y, z)=d*T2+(x2, y2, z2), where T2 is the straight - line direction vector and d is an arbitrary real number. Then, determine whether T1 is equal to T2. If they are equal, it means that these two edges have the same direction vector and are connected. At this time, fit edges E1 and E2 into one edge E3, whose two vertices are V1 and V3, and the direction vector is equal to T2. Then, modify the topological relationship of all the faces connected to edges E1 and E2, connect them to the new edge E3, and keep the connection order of other edges on the face unchanged, and remove edges E1 and E2 from the Brep data. If they are not equal, it means that these two edges cannot be fitted, and continue to traverse the next pair of edges. Then, for every two circular - arc edges that have the same vertex, also use a similar method to determine whether they can be fitted into one circular - arc edge (since the curve equation of a circular arc in space can be expressed as a combination of a plane equation and a spherical - surface equation, the main parameters of the plane equation are the points on the plane and the plane normal vector, and the main parameters of the spherical - surface equation are the center of the sphere and the radius of the sphere. Therefore, it can be considered that if two circular - arc edges have the same center and radius, and the planes where they are located coincide, it means that these two circular - arc edges are fitted into one new circular - arc edge). If they can, after fitting, modify the topological relationship of all the faces connected to these two circular - arc edges, connect them to the new circular - arc edge, and keep the connection order of other edges on the face unchanged, and then remove these two circular - arc edges from the Brep data. If they cannot, it means that these two circular - arc edges cannot be fitted, and continue to traverse the next pair of circular - arc edges.
[0022] Preferably, the concavity and convexity of the edge described in step (3) refers to a topological relationship between the edge and the two adjacent faces.
[0023] For any point P on each edge E in the Brep data, if the included angle α between the two faces connected to the edge at this point P is greater than 180°, then the edge E is a convex edge; if the included angle α between the two faces connected to the edge at this point P is less than 180°, then the edge is a concave edge; if the included angle α between the two faces connected to the edge at this point P is equal to 180°, then the edge is a smooth edge.
[0024] The smooth edge is further divided into a smooth concave edge and a smooth convex edge. The smooth concave edge means that the normal vectors of two faces are in the same direction on edge E, but the normal vectors of the two faces are opposite near edge E; while the smooth convex edge is the opposite, which means that the normal vectors of two faces are opposite on edge E, but the normal vectors of the two faces are away from each other near edge E.
[0025] The process of obtaining the concavity and convexity of this edge according to the connection situation of all adjacent faces of this edge in step (3) includes the following sub-steps:
[0026] (3-1) For edge E, obtain a point P on edge E, and two faces A and B connected by edge E;
[0027] (3-2) Obtain the normal vector of face A at point P and obtain the normal vector of face B at point P
[0028] (3-3) Obtain the tangent vector at point P on edge E
[0029] (3-4) Obtain the normal vector obtained in step (3-2) and calculate their product, and judge whether it is not equal to 1. If so, go to step (3-5); otherwise, go to step (3-6);
[0030] (3-5) According to the normal vector and calculate the concavity and convexity factor d of edge E, and judge whether d>0. If so, it means that edge E is a convex edge, and then go to step (3-9); otherwise, it means that edge E is a concave edge, and then go to step (3-9).
[0031] Specifically, in this step, calculating the concavity and convexity factor d of edge E uses the formula
[0032] (3-6) Obtain a point P1 in face A to ensure that the length of vector (P, P1) is less than 1 mm and is perpendicular to vector and obtain a point P2 in face B to ensure that the length of vector (P, P2) is less than 1 mm and is perpendicular to vector ;
[0033] (3-7) Obtain the normal vector at point P1 in face A and the normal vector at point P2 in face B
[0034] (3-8) According to the normal vectors and Calculate the concavity factor k of edge E, and determine whether k > 0. If so, it indicates that edge E is a smooth convex edge, and then proceed to step (3-9); otherwise, it indicates that edge E is a smooth concave edge, and then proceed to step (3-9).
[0035] (3-9) Update the concavity situation of the calculated edge E to the Brep data, and the process ends.
[0036] Preferably, step (4) includes the following sub-steps:
[0037] (4-1) Set the counter i = 1, and initialize the hole unit set {holeunit c} of the sub-part to be empty;
[0038] (4-2) Determine whether i ≤ the total number face_size of the mid-face set in the updated Brep data Brep c holds. If so, read the i-th face Face c in the mid-face set of the updated Brep data Brep i , and then proceed to step (4-3); otherwise, the process ends;
[0039] (4-3) Determine whether the type of the i-th face Face c in the mid-face set of the updated Brep data Brep i is an inner cylindrical surface or an inner conical surface. If so, create a new concave connection face set {ConcaveFaces}, and add Face i to the concave connection face set {ConcaveFaces}, and then proceed to step (4-4); otherwise, set i = i + 1 and return to step (4-2);
[0040] (4-4) Set the counter j = 1;
[0041] (4-5) Determine whether j ≤ the total number total_size of the faces in the concave connection face set {ConcaveFaces} holds. If so, obtain the j-th face ConcaveFace j in the concave connection face set {ConcaveFaces}, and then proceed to step (4-6); otherwise, proceed to step (4-10);
[0042] (4-6) Set the counter k = 1;
[0043] (4-7) Determine whether k ≤ the total number edge_size of the edges in the concave connection face set {ConcaveFaces} holds. If so, obtain the j-th face ConcaveFace j in the concave connection face set {ConcaveFaces} and the k-th edge Edgek , then proceed to step (4-8); otherwise, set j = j + 1 and return to step (4-5);
[0044] (4-8) Determine whether the k-th edge Edge in the j-th face ConcaveFace of the concave connection face set {ConcaveFaces} j is a concave edge. If it is a concave edge, proceed to step (4-9); otherwise, set k = k + 1 and return to step (4-7); k
[0045] (4-9) Obtain the two adjacent faces (one of which is ConcaveFace c and the other is ConcaveFace k ) adjacent to the k-th edge Edge from the updated Brep data Brep j . Connect the concave edges of the two faces ConcaveFace x and add the other face ConcaveFace x to the concave connection face set {ConcaveFaces}. Set k = k + 1 and return to step (4-7); j x
[0046] (4-10) Set the counter m = 1 and initialize the hole unit face group set {holeunit} to be empty;
[0047] (4-11) Determine whether m ≤ the total number of elements concavefaces_size in the concave connection face set {ConcaveFaces} holds. If so, obtain the m-th face face in the concave connection face set {ConcaveFaces} m , otherwise proceed to step (4-18);
[0048] (4-12) Set the counter n = 1;
[0049] (4-13) Determine whether n ≤ the total number of elements size_n in the hole unit face group set {holeunit} holds. If so, obtain the n-th face group faces in the hole unit face group set {holeunit} n , then proceed to step (4-14); otherwise, create a new face group face m , add the face group face m to the face group face n , and after adding the face group face m , the face group faces nAdd to the hole unit face group set {holeunit} and return to step (4-11);
[0050] (4-14) Get the nth face group faces in the hole unit face group set {holeunit} n The first face in begin , and the mth face in the concave connected face set {ConcaveFaces} m , and determine whether the two faces are of the same type. If so, proceed to step (4-15), otherwise set n=n+1 and return to step (4-13);
[0051] (4-15) Determine the nth face group faces in the hole unit face group set {holeunit} n The first face in begin Is the type of a cylindrical or conical surface, a plane, or other types? If it is a cylindrical or conical surface, go to step (4-16); if it is a plane, go to step (4-17); if it is other types, set n = size n +1, and return to step (4-13);
[0052] (4-16) Determine the first face begin With the mth face m Are the axial vectors of the two faces collinear, and whether the two faces have the same generatrix edge? If so, the mth face m Add the nth face group faces to the hole unit face group set {holeunit} n , set m=m+1 and return to step (4-11); otherwise, set n=n+1 and return to step (4-13);
[0053] (4-17) Determine the first face begin With the mth face m Are they coplanar and have common edges? If so, add the mth face m Add the nth face group faces to the hole unit face group set {holeunit} n , set m=m+1 and return to step (4-11); otherwise, set n=n+1 and return to step (4-13);
[0054] (4-18) Set counter p = 1, cylsize = 0, planesize = 0, othersize = 0;
[0055] (4-19) Determine whether p ≤ size_n, the total number of elements in the set of hole unit surfaces {holeunit}, holds. If so, obtain the p-th surface group faces in the set of hole unit surfaces {holeunit} p ; Otherwise, go to step (4-24)
[0056] (4-20) Determine whether the type of the first surface in the p-th surface group faces in the set of hole unit surfaces {holeunit} p is a cylindrical surface, a conical surface, a plane, or other types. If it is a cylindrical surface or a conical surface, set cylsize = cylsize + 1, and then go to step (4-21); if it is a plane, set planesize = planesize + 1, p = p + 1, and return to step (4-19); if it is other types, set othersize = othersize + 1, p = p + 1, and return to step (4-19);
[0057] (4-21) Determine whether all the surfaces in the p-th surface group faces in the set of hole unit surfaces {holeunit} p can form a complete cylindrical surface or conical surface after merging. If so, set p = p + 1, and go to step (4-22); otherwise, set i = i + 1, and return to step (4-2);
[0058] (4-22) Obtain the convex edge group {edgeunit} in the p-th surface group faces in the set of hole unit surfaces {holeunit} p where the convex edge group is a group of arc edges connected end to end (not the edges where the cylindrical surface generatrices are located), each arc edge is a convex edge, and all the arc edges together form a complete circle, and obtain the surface face where the complete circle is located r ;
[0059] (4-23) Determine whether the convex edge group {edgeunit} is an inner ring or an outer ring with respect to the surface face r If it is an outer ring, set i = i + 1, and return to step (4-2); if it is an inner ring, go to step (4-24);
[0060] (4-24) Determine whether 0 < cylsize ≤ 2 and planesize ≤ 1 and othersize == 0 hold. If so, go to step (4-25); otherwise, set i = i + 1, and return to step (4-2);
[0061] (4-25) Use the set of hole unit surfaces {holeunit} to construct the hole unit hole_unit, as Figure 6as shown, and add the hole unit hole_unit to the set of hole units {holeunit c}, set i = i + 1, and return to step (4-2).
[0062] Preferably, step (5) specifically includes the following sub-steps:
[0063] (5-1) Set the counter t = 1 and initialize the set of hole features {hole} to be empty;
[0064] (5-2) Determine whether t ≤ the number of elements holeunit_size in the set of hole units {holeunit c} holds. If so, obtain the t-th hole unit holeunit c from the set of hole units {holeunit t}, and then go to step (5-3). Otherwise, go to step (5-5);
[0065] (5-3) Create a hole feature hole t , add the t-th hole unit holeunit t to the hole feature hole t . Among them, the convex edge group of the hole feature hole t is the convex edge group {edgeunit t} of the t-th hole unit holeunit t . The axial vector of the hole feature hole t is the axial vector of holeunit t . Then add the hole feature hole t to the set of hole features {hole};
[0066] (5-4) Set t = t + 1 and return to step (5-2);
[0067] (5-5) Set the counters j = 1, k = 2;
[0068] (5-6) Determine whether j < the number of hole features hole_size holds. If so, obtain the j-th hole feature hole j from the set of hole features {hole}, set k = j + 1, and go to step (5-7). Otherwise, the process ends;
[0069] (5-7) Determine whether j < k ≤ the number of hole features hole_size. If so, obtain the k-th hole feature hole k from the set of hole features {hole}, and then enter step (5-8); otherwise, set j = t + 1 and return to step (5-6);
[0070] (5 - 8) Determine whether the axial vector of the j-th hole feature hole j is coaxial with the axial vector of the k-th hole feature hole k . If so, go to step (5 - 9); otherwise, set k = k + 1 and return to step (5 - 7);
[0071] (5 - 9) Determine whether there is the same convex edge group in the convex edge group set {edgeunit j} of the j-th hole feature hole j} and the convex edge group set {edgeunit k} of the k-th hole feature hole k}. If not, set k = k + 1 and return to step (5 - 7); if so, delete the same convex edge group edgeunit same from the convex edge group set {edgeunit j} and the convex edge group set {edgeunit k}, add the elements in the convex edge group set {edgeunit k} to the convex edge group set {edgeunit j}, and then enter step (5 - 10);
[0072] (5 - 10) Add the hole unit holeunit k of the k-th hole feature hole k to the j-th hole feature hole j . Update the convex edge group set {edgeunit j} to the convex edge group set {edgeunit j} of the j-th hole feature hole j}, and delete the k-th hole feature hole k from the hole feature set {hole}, and then return to step (5 - 7);
[0073] Preferably, step (6) includes the following sub-steps:
[0074] (6 - 1) Set the counter u = 1;
[0075] (6 - 2) Determine whether u ≤ the total number of elements holesize in the hole feature set {hole} holds. If so, obtain the u-th hole feature hole u in the hole feature set {hole}, and enter step (6 - 3); otherwise, the process ends;
[0076] (6 - 3) Obtain the number of hole units corresponding to the u-th hole feature hoke u (such asFigure 7 As shown, if there is only one hole unit, it indicates that the u-th hole feature hoke u is a simple hole. According to the type of the side surface in the hole unit, the simple hole is divided into a simple cylindrical hole or a simple conical hole; if there are two hole units, then according to the type of the hole unit with the larger hole diameter, the hole feature is divided into a counterbore and a spotface; if there are more than two hole units, it indicates that the hole feature is a composite hole. At this time, the axial vector of the first hole unit inside is used as the axial vector holevec u of the u-th hole feature hoke u , and then go to step (6-4);
[0077] (6-3) Obtain the set of hole units {unit u} corresponding to the u-th hole feature hole u . Obtain the first hole unit holeunit u from the set of hole units {unit begin . The axial vector of this hole unit holeunit begin is the axial vector of the u-th hole feature hoke u , and then go to step (6-4);
[0078] (6-4) Obtain the number of hole units unitsize in the set of hole units {unit u} corresponding to the u-th hole feature hoke u , and judge whether 0 < unitsize ≤ 2 holds. If it is, go to step (6-5); otherwise, set u = u + 1 and return to step (6-2);
[0079] (6-5) Judge whether the number of all hole units unitsize in the set of hole units {unit u} corresponding to the u-th hole feature hoke u is equal to 1. If not, go to step (6-6); otherwise, it indicates that the hole feature hole u is a simple hole, and judge whether the type of the first surface in the first hole unit holeunit u in the set of hole units {unit begin} is a cylindrical surface or a conical surface. If it is a cylindrical surface, it indicates that the hole feature hole u is a simple cylindrical hole, and then go to step (6-7). If it is a conical surface, it indicates that the hole feature hole u is a simple conical hole, and then go to step (6-7);
[0080] (6-6) Judge the set of hole units {unit u} of the u-th hole feature hole u} is equal to 2, if not, set u = u + 1 and return to step (6-2); otherwise, obtain the hole unit set {unit u}holeunit with a larger diameter max , and judge holeunit max The type of the first face is cylindrical or conical. If it is cylindrical, it means the hole feature is hole. u If it is a countersunk hole, then go to step (6-7). If it is a conical surface, it means the hole feature is hole. u Countersink the hole, and then proceed to step (6-7);
[0081] (6-7) Get the u-th hole feature hole u The corresponding convex edge set {edgeunit u}, set the counter w = 1, initialize the hole feature hole u The machined face collection u} is empty;
[0082] (6-8) Determine whether there is a set of convex edge groups {edgeunit u edgeunitsize u If it is true, then get the convex edge group set {edgeunit u} The wth convex edge unit in w , then go to step (6-9); otherwise go to step (6-10);
[0083] (6-9) Get the convex edge group set {edgeunit u} The wth convex edge unit in w The first edge in begin , from the updated Brep data brep c Get the two faces adjacent to the edge y With face z , and judge face y Is it located in the hole feature hole u If yes, then face z Add to the machined face collection {machinedface u}, then go to step (6-10); otherwise, face y Add to the machined face collection {machinedface u}, set w=w+1, and return to step (6-8);
[0084] (6-10) Get the machined surface set {machinedface u}, the number of machined faces, machinedfacesize, to determine whether there is 0 <machinedfacesize≤2,如果存在,进入步骤(6-11);否则,u=u+1,返回步骤(6-2);
[0085] (6-11) Determine hole characteristics u The corresponding machined face set {machinedface u} is the number of machined faces machinedfacesize equal to 1, if so, the uth hole feature hole u ID of the entry machining surface in Set to the machined face collection {machinedface u}, set u = u + 1, and return to step (6-2); otherwise, go to step (6-12);
[0086] (6-12) Get the machined surface set {machinedface u}The first face in machinedface first and the second face machinedface second , get the hole feature hole u The corresponding hole unit set {unit u The first hole unit in first and the second hole unit second , determine the hole unit unit first Is the diameter greater than unit second If the diameter is, the hole feature hole u ID of the entry machining surface in Set to machinedface first , the hole feature hole u ID of the outgoing machining surface in Set to machinedface second , then go to step (6-13); otherwise, the hole feature hole u ID of the entry machining surface in Set to machinedface second , the hole feature hole u ID of the outgoing machining surface in Set to machinedface first ,like Figure 8 As shown;
[0087] (6-13) Set u = u + 1, and return to step (6-2).
[0088] Preferably, step (7) includes the following sub-steps:
[0089] (7-1) Set the counters c = 1, d = 2, and initialize the assembly hole feature set {assemblyholes} to be empty;
[0090] (7-2) Determine whether c < the total number of sub-parts part_size in the assembly. If so, obtain the hole feature set {hole c} corresponding to the c-th sub-part in the assembly, and proceed to step (7-3); otherwise, the process ends;
[0091] (7-3) Determine whether c < d ≤ the total number of sub-parts part_size in the assembly holds. If so, obtain the hole feature set {hole d} corresponding to the d-th sub-part in the assembly, and then transfer to step (7-4); otherwise, set c = c + 1, d = c + 1, and return to step (7-2);
[0092] (7-4) Set the counters cnt1 = 1, cnt2 = 1;
[0093] (7-5) Determine whether cnt1 ≤ the number size1 of the hole feature set {hole c} corresponding to the c-th sub-part holds. If so, obtain the cnt1-th hole feature hole cnt1 of the c-th sub-part in the assembly, set cnt2 = 1, and proceed to step (7-6); otherwise, set d = d + 1, and return to step (7-3);
[0094] (7-6) Determine whether cnt2 ≤ the number size2 of the hole feature set {hole d} holds. If so, obtain the cnt2-th hole feature hole cnt2 of the d-th sub-part in the assembly, and proceed to step (7-7); otherwise, set cnt1 = cnt1 + 1, and return to step (7-5);
[0095] (7-7) Determine whether the cnt1-th hole feature hole cnt1 of the c-th sub-part in the assembly has an outgoing machining surface ID out . If not, proceed to step (7-8); otherwise, transfer to step (7-9);
[0096] (7-8) Determine whether the outgoing machining surface ID cnt1 of the hole feature hole out ...cnt2 Inward machining surface ID in Whether they are parallel and the distance between them is less than the diameter of the hole feature hole cnt2 If so, go to step (7-11); otherwise, go to step (7-9);
[0097] (7-9) Judge whether there is an outward machining surface ID for the cnt2-th hole feature hole corresponding to the d-th sub-part in the assembly cnt2 If not, set cnt2 = cnt2 + 1 and return to step (7-6); otherwise, go to step (7-10); out If not, set cnt2 = cnt2 + 1 and return to step (7-6); otherwise, go to step (7-10);
[0098] (7-10) Judge whether the outward machining surface ID of the hole feature hole cnt2 is parallel to the inward machining surface ID of the hole feature hole out and the distance between them is less than the diameter of hole cnt1 If not, set cnt2 = cnt2 + 1 and return to step (7-6); otherwise, go to step (7-11); in If not, set cnt2 = cnt2 + 1 and return to step (7-6); otherwise, go to step (7-11); cnt1 If not, set cnt2 = cnt2 + 1 and return to step (7-6); otherwise, go to step (7-11);
[0099] (7-11) Add the two hole features {hole cnt1 , hole cnt2} to the assembly hole feature set {assemblyholes}, set cnt2 = cnt2 + 1 and return to step (7-6).
[0100] Preferably, step (8) includes the following sub-steps:
[0101] (8-1) Set the counter o = 1;
[0102] (8-2) Judge whether there is o ≤ the number of assembly hole features in the assembly hole feature set assemblyholes_size. If so, read the o-th assembly hole feature assemblyholes o ; otherwise, the process ends;
[0103] (8-3) Extract the two hole features in the o-th assembly hole feature assemblyholes in the assembly hole feature set o and respectively obtain the axial vectors Vec1 and Vec2 of these two hole features;
[0104] (8-4) Calculate the distance dis between Vec1 and Vec2 and judge whether there is dis ≤ 0.001mm. If so, it means that the two axial vectors are coaxial, that is, the o-th assembly hole feature assemblyholes oThe two holes are already aligned; otherwise, it indicates that the two holes in the o-th assembly hole feature assemblyholes o are not aligned and need to be adjusted. As Figure 9 shown, then proceed to step (8-5);
[0105] (8-5) o = o + 1, return to step (8-2).
[0106] According to another aspect of the present invention, there is provided an assembly hole alignment detection system based on geometric reasoning, including:
[0107] The first module is used to analyze the assembly to be detected to obtain the boundary representation Brep data of each sub-part in the assembly;
[0108] The second module is used to, for each sub-part in the assembly obtained by the first module, perform vertex optimization processing and edge optimization processing on its Brep data in sequence to obtain the optimized Brep data corresponding to the sub-part;
[0109] The third module is used to, for each sub-part in the assembly obtained by the first module, obtain each edge in the optimized Brep data corresponding to the sub-part obtained by the second module, obtain the concavity and convexity of the edge according to the connection situation of all adjacent faces of the edge, and fill the concavity and convexity of the edge into the Brep data to obtain the updated Brep data corresponding to the sub-part;
[0110] The fourth module is used to, for each sub-part in the assembly obtained by the first module, obtain the set of hole units corresponding to the sub-part according to the updated Brep data corresponding to the sub-part obtained by the third module;
[0111] The fifth module is used to, for each sub-part in the assembly obtained by the first module, obtain the set of hole features corresponding to the sub-part according to the set of hole units corresponding to the sub-part obtained by the fourth module.
[0112] The sixth module is used to, for each sub-part in the assembly obtained by the first module, obtain the type, in-coming machining surface ID in , out-coming machining surface ID out and axial vector V of each hole feature according to the set of hole features corresponding to the sub-part obtained by the fifth module;
[0113] The seventh module is used to obtain the assembly hole features corresponding to the assembly according to the type, in-coming machining surface ID in , out-coming machining surface ID out and axial vector V of each hole feature corresponding to each sub-part in the assembly obtained by the sixth module.
[0114] The eighth module is used to determine whether the axial vectors V1 and V2 of the two hole features corresponding to the assembly hole feature obtained by the seventh module are collinear. If they are collinear, it means that the two holes in the assembly hole feature are aligned; otherwise, it means that the two holes are not aligned.
[0115] Generally speaking, compared with the prior art, the above technical solution conceived by the present invention can achieve the following beneficial effects:
[0116] (1) The detection of hole alignment in the assembly has universality: Since the present invention adopts steps (1) to (5), it can identify the features of holes from the geometric data such as points, lines, and surfaces of the three-dimensional model of the assembly, combined with attributes such as concavity and convexity. It can not only identify the holes inserted through its own functions in three-dimensional design software, but also accurately identify the holes formed by modeling methods such as stretching and rotation.
[0117] (2) Quickly analyze the positional relationship between holes in different parts within the entire assembly and find all possible assembly hole combinations: Through the algorithms of steps (7) and (8) of the present invention, a technology for automatically identifying assembly holes in the three-dimensional model of the assembly is provided. This technology not only has high identification efficiency but also can be applied to various complex assembly model.
[0118] (3) Automatically detect whether the assembly holes are aligned without manual intervention: The present invention combines the hole feature recognition technology with the alignment detection technology of assembly holes, providing a fully automatic and non-manual intervention method to quickly and efficiently detect the alignment of holes in the assembly, giving full play to the capabilities of computer-aided design, enabling designers to quickly judge whether the three-dimensional model is reasonably designed during the process of model design. Brief Description of the Drawings
[0119] Figure 1 is the overall flowchart of the method for detecting the alignment of holes in an assembly based on geometric reasoning of the present invention;
[0120] Figure 2 is the boundary representation hierarchy diagram;
[0121] Figure 3 is the schematic diagram of calculating the concavity and convexity of edges in the Brep data of parts;
[0122] Figure 4 is the flowchart of hole unit recognition;
[0123] Figure 5 is the flowchart of hole feature recognition;
[0124] Figure 6 is the schematic diagram of different hole units;
[0125] Figure 7It is a schematic diagram of different hole features;
[0126] Figure 8 It is a schematic diagram of the axial direction of the hole feature, the convex edge group, the machined surface, etc.;
[0127] Figure 9 It is a schematic diagram of whether the assembly holes are aligned. c Detailed implementation manners
[0128] In order to make the objectives, technical solutions and advantages of the present invention clearer and more understandable, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0129] The basic idea of the present invention is to provide a method for detecting the alignment of holes in an assembly based on geometric reasoning, which analyzes the geometric structure and topological relationship of the three-dimensional model of the assembly. First, each hole unit in each sub-part is identified in a certain way, and then according to the association relationship of the hole units, the hole units are combined to form hole features. Then, according to the positional relationship of the hole features between different parts, it is determined which are the assembly holes. Finally, it is determined whether the axial vectors of two holes in the assembly hole combination are coaxial, and coaxial means that the holes are aligned.
[0130] As Figure 1 shown, the present invention provides a method for detecting the alignment of holes in an assembly based on geometric reasoning, including the following steps:
[0131] (1) Analyze the assembly to be detected to obtain the boundary representation (Brep) data of each sub-part in the assembly;
[0132] Specifically, in step (1), first, use a three-dimensional modeling design software (such as CREO, UG, etc.) to open the assembly to be detected. Then, read the geometric data such as vertices, edges and faces of each sub-part in the assembly through the secondary development interface provided by the three-dimensional modeling design software, and remove the duplicate data. Subsequently, read the topological connection relationship between the geometric data in each sub-part through the secondary development interface, and remove the isolated (that is, having no connection relationship with other geometric data) vertices, edges or faces. Then, combine the obtained geometric data and topological connection relationship of each sub-part to form the Brep data of the sub-part, as Figure 2 shown.
[0133] (2) For each sub-part in the assembly obtained in step (1), perform vertex optimization processing and edge optimization processing on its Brep data in sequence to obtain the optimized Brep data corresponding to the sub-part.
[0134] In this step, the process of vertex optimization processing on the Brep data of the sub-part is specifically as follows. First, read all the vertices in the Brep data of the sub-part and calculate the distance between every two vertices. If the distance between two vertices is less than 0.01 mm, then fit these two vertices into a new vertex, and the new vertex is the midpoint of the line connecting the two original vertices. Then, modify the edges connected to the original vertices in the Brep data to be connected to the new vertex. Finally, remove the two original vertices from the Brep data of the sub-part.
[0135] Edge optimization refers to fitting two edges with the same vertices and curve equations in the sub-part into one edge.
[0136] In this step, the process of edge optimization for the Brep data of the sub-part is specifically as follows: First, read all the edges in the Brep data of the sub-part; then, for every two edges E1 (whose two vertices are V1 and V2 and are straight edges) and E2 (whose two vertices are V2 and V3 and are straight edges) that have the same vertices, obtain the curve equation of edge E1: (x, y, z) = b * T1 + (x1, y1, z1), where T1 is the straight-line direction vector and b is an arbitrary real number; obtain the curve equation of edge E2: (x, y, z) = d * T2 + (x2, y2, z2), where T2 is the straight-line direction vector and d is an arbitrary real number; then, determine whether T1 is equal to T2. If they are equal, it means that these two edges have the same direction vector and are connected. At this time, fit edge E1 and E2 into one edge E3, whose two vertices are V1 and V3 and the direction vector is equal to T2; then, modify the topological relationship of all the faces connected to edge E1 and E2 and connect them to the new edge E3, and keep the connection order of the other edges on the face unchanged, and remove edge E1 and E2 from the Brep data. If they are not equal, it means that these two edges cannot be fitted, and continue to traverse the next pair of edges; then, for every two circular arc edges that have the same vertices, also use a similar method to determine whether they can be fitted into one circular arc edge (since the curve equation of a circular arc in space can be expressed as a combination of a plane equation and a spherical equation, the main parameters of the plane equation are the points on the plane and the normal vector of the plane, and the main parameters of the spherical equation are the center of the sphere and the radius of the sphere, so it can be considered that if two circular arc edges have the same center and radius and the planes where they are located coincide, it means that these two circular arc edges are fitted into one new circular arc edge). If they can, after fitting, modify the topological relationship of all the faces connected to these two circular arc edges and connect them to the new circular arc edge, and keep the connection order of the other edges on the face unchanged, and then remove these two circular arc edges from the Brep data. If they cannot, it means that these two circular arc edges cannot be fitted, and continue to traverse the next pair of circular arc edges.
[0137] (3) For each sub-part in the assembly obtained in step (1), obtain each edge in the optimized Brep data corresponding to this sub-part obtained in step (2), obtain the concavity and convexity of this edge according to the connection situation of all the adjacent faces of this edge, and fill the concavity and convexity of this edge into the Brep data to obtain the updated Brep data corresponding to this sub-part;
[0138] The concavity and convexity of the edge described in step (3) refers to a topological relationship between this edge and the two adjacent faces;
[0139] For any point P on each edge E in the Brep data, if the included angle α between the two faces connected to the edge at this point P is greater than 180°, then the edge E is a convex edge; if the included angle α between the two faces connected to the edge at this point P is less than 180°, then the edge is a concave edge; if the included angle α between the two faces connected to the edge at this point P is equal to 180°, then the edge is a smooth edge;
[0140] The smooth edges are further divided into smooth concave edges and smooth convex edges. A smooth concave edge means that the normal vectors of the two faces are in the same direction on the edge E, but the normal vectors of the two faces are opposite near the edge E; while a smooth convex edge is the opposite, indicating that the normal vectors of the two faces are opposite on the edge E, but the normal vectors of the two faces are separated near the edge E.
[0141] As Figure 3 shown, the process of obtaining the convexity and concavity of the edge according to the connection situation of all adjacent faces of this edge in step (3) includes the following sub-steps:
[0142] (3-1) For the edge E, obtain a point P on the edge E, and the two faces A and B connected by the edge E;
[0143] (3-2) Obtain the normal vector of face A at point P and obtain the normal vector of face B at point P
[0144] (3-3) Obtain the tangential vector at point P on the edge E
[0145] (3-4) Obtain the product of the normal vector obtained in step (3-2) and , and judge whether it is not equal to 1. If so, go to step (3-5); otherwise, go to step (3-6);
[0146] (3-5) According to the normal vector and calculate the convexity and concavity factor d of the edge E, and judge whether d > 0. If so, it means that the edge E is a convex edge, and then go to step (3-9); otherwise, it means that the edge E is a concave edge, and then go to step (3-9).
[0147] Specifically, in this step, the convexity and concavity factor d of the edge E is calculated using the formula
[0148] (3-6) Obtain a point P1 inside face A to ensure that the length of the vector (P, P1) is less than 1 mm and is perpendicular to the vector , and obtain a point P2 inside face B to ensure that the length of the vector (P, P2) is less than 1 mm and is perpendicular to the vector ;
[0149] (3 - 7) Obtain the normal vector at point P1 on plane A and the normal vector at point P2 on plane B
[0150] (3 - 8) According to the normal vectors and calculate the concavity - convexity factor k of edge E, and determine whether k > 0. If so, it indicates that edge E is a smooth convex edge, and then proceed to step (3 - 9); otherwise, it indicates that edge E is a smooth concave edge, and then proceed to step (3 - 9).
[0151] Specifically, in this step, the concavity - convexity factor k of edge E is calculated using the formula
[0152] (3 - 9) Update the concavity - convexity situation of the calculated edge E to the Brep data, and the process ends.
[0153] (4) For each sub - part in the assembly obtained in step (1), obtain the set of hole units corresponding to the sub - part according to the updated Brep data of the sub - part obtained in step (3);
[0154] As Figure 4 shown, step (4) includes the following sub - steps:
[0155] (4 - 1) Set the counter i = 1, and initialize the set of hole units {holeunit c} of the sub - part to be empty;
[0156] (4 - 2) Determine whether i ≤ the total number face_size of the face set in the updated Brep data Brep c holds. If so, read the i - th face Face c in the face set of the updated Brep data Brep i , and then proceed to step (4 - 3); otherwise, the process ends;
[0157] (4 - 3) Determine whether the type of the i - th face Face c in the face set of the updated Brep data Brep i is an inner cylindrical surface or an inner conical surface. If so, create a new set of concave connection faces {ConcaveFaces}, and add Face i to the set of concave connection faces {ConcaveFaces}, and then proceed to step (4 - 4); otherwise, set i = i + 1 and return to step (4 - 2);
[0158] (4 - 4) Set the counter j = 1;
[0159] (4-5) Determine whether j ≤ the total number of faces in the concave connection face set {ConcaveFaces} total_size holds. If so, get the jth face ConcaveFace in the concave connection face set {ConcaveFaces} j , then go to step (4-6), otherwise go to step (4-10);
[0160] (4-6) Set counter k = 1;
[0161] (4-7) Determine whether k ≤ the total number of edges edge_size in the concave connected face set {ConcaveFaces} holds. If so, obtain the jth face ConcaveFace in the concave connected face set {ConcaveFaces} j The kth edge in k , then go to step (4-8), otherwise set j=j+1 and return to step (4-5);
[0162] (4-8) Determine the jth face ConcaveFace in the concave connected face set {ConcaveFaces} j The kth edge in k Is it a concave edge? If it is a concave edge, go to step (4-9), otherwise set k=k+1 and return to step (4-7);
[0163] (4-9) From the updated Brep data Brep c Get the kth edge Edge k Two adjacent faces (one of which is ConcaveFace j , the other face is ConcaveFace x ), concave the two faces x With ConcaveFace j and connect the concave edges of the other face ConcaveFace x Also add it to the concave connected face set {ConcaveFaces}, set k = k + 1, and return to step (4-7);
[0164] (4-10) Set the counter m = 1, and initialize the hole unit face group set {holeunit} to empty;
[0165] (4-11) Determine whether m ≤ the total number of elements in the concave connected face set {ConcaveFaces} concavefaces_size holds. If so, get the mth face in the concave connected face set {ConcaveFaces} m , otherwise go to step (4-18);
[0166] (4 - 12) Set the counter n = 1;
[0167] (4 - 13) Determine whether n ≤ the total number size_n of elements in the set of hole unit surface groups {holeunit} holds. If so, obtain the nth surface group faces in the set of hole unit surface groups {holeunit} n , and then go to step (4 - 14); otherwise, create a new surface group faces m , and add the surface group face m to the surface group faces n , and add the surface group faces after adding the surface group face m to the set of hole unit surface groups {holeunit}, and return to step (4 - 11); n
[0168] (4 - 14) Obtain the first surface face in the nth surface group faces in the set of hole unit surface groups {holeunit} n and the mth surface face in the set of concave connection surfaces {ConcaveFaces} begin , and determine whether the two surfaces are of the same type. If so, go to step (4 - 15); otherwise, set n = n + 1 and return to step (4 - 13); m
[0169] (4 - 15) Determine whether the type of the first surface face in the nth surface group faces in the set of hole unit surface groups {holeunit} n is a cylindrical surface, a conical surface, a plane, or other types. If it is a cylindrical surface or a conical surface, go to step (4 - 16); if it is a plane, go to step (4 - 17); if it is other types, set n = size begin + 1 and return to step (4 - 13); n
[0170] (4 - 16) Determine whether the axial vectors of the first surface face begin and the mth surface face m are collinear, and whether the two surfaces have the same generatrix edge. If so, add the mth surface face m to the nth surface group faces in the set of hole unit surface groups {holeunit} n , set m = m + 1 and return to step (4 - 11); otherwise, set n = n + 1 and return to step (4 - 13);
[0171] (4 - 17) Determine the first surface face beginwith the m-th face m is coplanar with it and has a common edge. If so, add the m-th face m to the n-th face group faces in the set of hole unit faces {holeunit} n , set m = m + 1, and return to step (4-11); otherwise, set n = n + 1 and return to step (4-13);
[0172] (4-18) Set the counters p = 1, cylsize = 0, planesize = 0, othersize = 0;
[0173] (4-19) Determine whether p ≤ the total number of elements size_n in the set of hole unit faces {holeunit} holds. If so, obtain the p-th face group faces in the set of hole unit faces {holeunit} p ; otherwise, go to step (4-24)
[0174] (4-20) Determine whether the type of the first face in the p-th face group faces in the set of hole unit faces {holeunit} p is a cylindrical face or a conical face, a plane, or other types. If it is a cylindrical face or a conical face, set cylsize = cylsize + 1, and then go to step (4-21); if it is a plane, set planesize = planesize + 1, p = p + 1, and return to step (4-19); if it is other types, set othersize = othersize + 1, p = p + 1, and return to step (4-19);
[0175] (4-21) Determine whether all the faces in the p-th face group faces in the set of hole unit faces {holeunit} p can form a complete cylindrical face or conical face after merging. If so, set p = p + 1 and go to step (4-22); otherwise, set i = i + 1 and return to step (4-2);
[0176] (4-22) Obtain the convex edge group {edgeunit} in the p-th face group face in the set of hole unit faces {holeunit} p where the convex edge group is a group of arc edges connected end to end (not the edges where the cylindrical face generatrices are located), each arc edge is a convex edge, and all the arc edges together form a complete circle, and obtain the face face where the complete circle is located r ;
[0177] (4-23) Determine the convex edge group {edgeunit} relative to the face face rIs it the inner ring or the outer ring? If it is the outer ring, set i = i + 1 and return to step (4-2). If it is the inner ring, go to step (4-24);
[0178] (4-24) Determine whether 0 < cylsize ≤ 2, planesize ≤ 1, and othersize == 0 hold. If so, go to step (4-25); otherwise, set i = i + 1 and return to step (4-2);
[0179] (4-25) Use the hole unit face group set {holeunit} to construct the hole unit hole_unit as shown, and add the hole unit hole_unit to the hole unit set {holeunit Figure 6}, set i = i + 1, and return to step (4-2); c} and set i = i + 1, then return to step (4-2);
[0180] (5) For each sub-part in the assembly obtained in step (1), obtain the hole feature set corresponding to the sub-part according to the hole unit set corresponding to the sub-part obtained in step (4);
[0181] Specifically, as shown, this step specifically includes the following sub-steps: Figure 5 This step specifically includes the following sub-steps:
[0182] (5-1) Set the counter t = 1 and initialize the hole feature set {hole} to be empty;
[0183] (5-2) Determine whether t ≤ the number of elements holeunit_size in the hole unit set {holeunit c}. If so, obtain the t-th hole unit holeunit from the hole unit set {holeunit c}, and then go to step (5-3); otherwise, go to step (5-5); t}, and then go to step (5-3); otherwise, go to step (5-5);
[0184] (5-3) Create a hole feature hole t , add the t-th hole unit holeunit t to the hole feature hole t . The convex edge group of the hole feature hole t is the convex edge group {edgeunit t} of the t-th hole unit holeunit t . The axial vector of the hole feature hole t is the axial vector of holeunit t . Then add the hole feature hole t to the hole feature set {hole};
[0185] (5-4) Set t = t + 1, and return to step (5-2);
[0186] (5-5) Set counters j = 1, k = 2;
[0187] (5-6) Determine whether j < the number of hole features hole_size holds. If so, obtain the j-th hole feature hole from the set of hole features {hole}, set k = j + 1, and transfer to step (5-7); otherwise, end the process; j , set k = j + 1, and transfer to step (5-7); otherwise, end the process;
[0188] (5-7) Determine whether j < k ≤ the number of hole features hole_size. If so, obtain the k-th hole feature hole from the set of hole features {hole}, then enter step (5-8); otherwise, set j = t + 1, and return to step (5-6); k , then enter step (5-8); otherwise, set j = t + 1, and return to step (5-6);
[0189] (5-8) Determine whether the axial vector of the j-th hole feature hole j is coaxial with the axial vector of the k-th hole feature hole k . If so, transfer to step (5-9); otherwise, set k = k + 1, and return to step (5-7);
[0190] (5-9) Determine whether there is the same convex edge group in the set of convex edge groups {edgeunit j} of the j-th hole feature hole and the set of convex edge groups {edgeunit j} of the k-th hole feature hole. If not, set k = k + 1, and return to step (5-7); if so, delete the same convex edge group edgeunit k from the set of convex edge groups {edgeunit k} and the set of convex edge groups {edgeunit same}, add the elements of the set of convex edge groups {edgeunit j} to the set of convex edge groups {edgeunit k}, and then enter step (5-10); k} and the set of convex edge groups {edgeunit j}, and then enter step (5-10);
[0191] (5-10) Add the hole unit holeunit k of the k-th hole feature hole to the j-th hole feature hole k , update the set of convex edge groups {edgeunit j} to the j-th hole feature hole j , jSet of convex edge groups {edgeunit j}, and delete the k-th hole feature hole from the set of hole features {hole} k , and then return to steps (5-7);
[0192] The advantages of the above steps (1) to (5) are that the hole feature recognition is carried out from the geometric data such as points, lines, and surfaces of the 3D model, combined with attributes such as concavity and convexity. It can not only identify the holes inserted through its own functions in 3D design software, but also accurately identify the holes formed by modeling methods such as stretching and rotation. This method is universal and can accurately identify hole features constructed in various types and ways.
[0193] (6) For each sub-part in the assembly obtained in step (1), obtain the type, in-coming machining surface ID in of each hole feature in the set of hole features corresponding to this sub-part obtained in step (5) out and the out-coming machining surface ID
[0194] and the axial vector V;
[0195] (6-1) Set the counter u = 1;
[0196] (6-2) Determine whether u ≤ the total number of elements holesize in the set of hole features {hole} holds. If so, obtain the u-th hole feature hole in the set of hole features {hole} u , and enter step (6-3); otherwise, the process ends;
[0197] (6-3) Obtain the number of hole units corresponding to the u-th hole feature hole u (as shown in Figure 7 ). If there is only one hole unit, it means that the u-th hole feature hole u is a simple hole. According to the type of the side surface in the hole unit (cylindrical surface or conical surface), the simple hole is divided into a simple cylindrical hole or a simple conical hole; if there are two hole units, according to the type of the hole unit with the larger hole diameter (cylindrical hole unit or conical hole unit), the hole feature is divided into a counterbore and a spotface; if there are more than two hole units, it means that the hole feature is a composite hole. At this time, take the axial vector of the first hole unit inside as the axial vector holevec u of the u-th hole feature hole u , and then enter step (6-4);
[0198] (6-3) Obtain the set of hole units {unit u corresponding to the u-th hole feature hole u}, obtain the first hole unit holeunit from the set of hole units {unit u} begin . The axial vector of this hole unit holeunit begin is the axial vector of the u-th hole feature hole u . Then proceed to step (6-4);
[0199] (6-4) Obtain the set of hole units {unit u} corresponding to the u-th hole feature hole u}, and determine whether 0 < unitsize ≤ 2 holds. If so, proceed to step (6-5); otherwise, set u = u + 1 and return to step (6-2);
[0200] (6-5) Determine whether the number of all hole units in the set of hole units {unit u} corresponding to the u-th hole feature hole u is equal to 1. If not, proceed to step (6-6); otherwise, it indicates that the hole feature hole u is a simple hole, and determine whether the type of the first face in the first hole unit holeunit u in the set of hole units {unit begin is a cylindrical surface or a conical surface. If it is a cylindrical surface, it indicates that the hole feature hole u is a simple cylindrical hole, and then proceed to step (6-7). If it is a conical surface, it indicates that the hole feature hole u is a simple conical hole, and then proceed to step (6-7);
[0201] (6-6) Determine whether the number of hole units in the set of hole units {unit u} corresponding to the u-th hole feature hole u is equal to 2. If not, set u = u + 1 and return to step (6-2); otherwise, obtain the hole unit holeunit u with a larger diameter in the set of hole units {unit max}, and determine whether the type of the first face in holeunit max is a cylindrical surface or a conical surface. If it is a cylindrical surface, it indicates that the hole feature hole u is a counterbore hole, and then proceed to step (6-7). If it is a conical surface, it indicates that the hole feature hole u is a countersunk hole, and then proceed to step (6-7);
[0202] (6-7) Obtain the u-th hole feature hole uThe corresponding convex edge set {edgeunit u}, set the counter w = 1, initialize the hole feature hole u The machined face collection u} is empty;
[0203] (6-8) Determine whether there is a set of convex edge groups {edgeunit u edgeunitsize u If it is true, then get the convex edge group set {edgeunit u} The wth convex edge unit in w , then go to step (6-9); otherwise go to step (6-10);
[0204] (6-9) Get the convex edge group set {edgeunit u} The wth convex edge unit in w The first edge in begin , from the updated Brep data brep c Get the two faces adjacent to the edge y With face z , and judge face y Is it located in the hole feature hole u If yes, then face z Add to the machined face collection {machinedface u}, then go to step (6-10); otherwise, face y Add to the machined face collection {machinedface u}, set w=w+1, and return to step (6-8);
[0205] (6-10) Get the machined surface set {machinedface u}, the number of machined faces, machinedfacesize, to determine whether there is 0 <machinedfacesize≤2,如果存在,进入步骤(6-11);否则,u=u+1,返回步骤(6-2);
[0206] (6-11) Determine hole characteristics u The corresponding machined face set {machinedface u} is the number of machined faces machinedfacesize equal to 1, if so, the uth hole feature hole u ID of the entry machining surface inSet as the first face in the machined face set {machinedface u}, set u = u + 1, and return to step (6-2); otherwise, go to step (6-12);
[0207] (6-12) Obtain the first face machinedface u and the second face machinedface first in the machined face set {machinedface second}, obtain the first hole unit unit u and the second hole unit unit u in the hole unit set {unit first} corresponding to the hole feature hole second . Determine whether the diameter of the hole unit unit first is greater than that of unit second . If so, set the incoming machined face ID u of the hole feature hole in to machinedface first , set the outgoing machined face ID u of the hole feature hole in to machinedface second , and then go to step (6-13); otherwise, set the incoming machined face ID u of the hole feature hole in to machinedface second , set the outgoing machined face ID u of the hole feature hole in to machinedfacese first , as shown in Figure 8 ;
[0208] (6-13) Set u = u + 1, and return to step (6-2);
[0209] (7) According to the type, incoming machined face ID in , outgoing machined face ID out and axial vector V of each hole feature corresponding to each sub-part in the assembly obtained in step (6), obtain the assembly hole feature corresponding to the assembly.
[0210] In step (7), according to the relative position relationship between different hole features, determine which hole combinations can form an assembly hole feature.
[0211] This step specifically includes the following sub-steps:
[0212] (7-1) Set counters c = 1, d = 2, and initialize the assembly hole feature set {assemblyholes} to be empty;
[0213] (7-2) Determine if c < the total number of sub-parts part_size in the assembly. If so, obtain the hole feature set {hole c} corresponding to the c-th sub-part in the assembly, and proceed to step (7-3); otherwise, end the process;
[0214] (7-3) Determine if c < d ≤ the total number of sub-parts part_size in the assembly holds. If so, obtain the hole feature set {hole d} corresponding to the d-th sub-part in the assembly, then transfer to step (7-4); otherwise, set c = c + 1, d = c + 1, and return to step (7-2);
[0215] (7-4) Set counters cnt1 = 1, cnt2 = 1;
[0216] (7-5) Determine if cnt1 ≤ the number size1 of the hole feature set {hole c} corresponding to the c-th sub-part holds. If so, obtain the cnt1-th hole feature hole cnt1 corresponding to the c-th sub-part in the assembly, set cnt2 = 1, and proceed to step (7-6); otherwise, set d = d + 1, and return to step (7-3);
[0217] (7-6) Determine if cnt2 ≤ the number size2 of the hole feature set {hole d} holds. If so, obtain the cnt2-th hole feature hole cnt2 corresponding to the d-th sub-part in the assembly, and proceed to step (7-7); otherwise, set cnt1 = cnt1 + 1, and return to step (7-5);
[0218] (7-7) Determine if the cnt1-th hole feature hole cnt1 corresponding to the c-th sub-part in the assembly has an outgoing machining surface ID out . If not, proceed to step (7-8); otherwise, transfer to step (7-9);
[0219] (7-8) Determine if the outgoing machining surface ID cnt1 of the hole feature hole out is parallel to the incoming machining surface ID cnt2 of the hole feature hole in , and the distance between them is less than the hole feature hole cnt2If it is, proceed to step (7-11); otherwise, go to step (7-9).
[0220] (7-9) Determine whether there is an outgoing machining surface ID for the cnt2-th hole feature hole corresponding to the d-th sub-part in the assembly cnt2 If not, set cnt2 = cnt2 + 1 and return to step (7-6); otherwise, proceed to step (7-10). out If not, set cnt2 = cnt2 + 1 and return to step (7-6); otherwise, proceed to step (7-10).
[0221] (7-10) Determine whether the outgoing machining surface ID of the hole feature hole cnt2 is parallel to the incoming machining surface ID of the hole feature hole out and the distance between them is less than the diameter of hole cnt1 If not, set cnt2 = cnt2 + 1 and return to step (7-6); otherwise, proceed to step (7-11). in If not, set cnt2 = cnt2 + 1 and return to step (7-6); otherwise, proceed to step (7-11). cnt1 If not, set cnt2 = cnt2 + 1 and return to step (7-6); otherwise, proceed to step (7-11).
[0222] (7-11) Add the two hole features {hole cnt1 , hole cnt2} to the assembly hole feature set {assemblyholes}, set cnt2 = cnt2 + 1, and return to step (7-6).
[0223] (8) Determine whether the axial vectors V1 and V2 of the two hole features corresponding to the assembly hole feature obtained in step (7) are collinear. If they are collinear, it means the two holes in the assembly hole feature are aligned; otherwise, it means the two holes are not aligned.
[0224] Step (8) includes the following sub-steps:
[0225] (8-1) Set the counter o = 1;
[0226] (8-2) Determine whether there exists o ≤ the number of assembly hole features assemblyholes_size in the assembly hole feature set. If it exists, read the o-th assembly hole feature assemblyholes o ; otherwise, the process ends.
[0227] (8-3) Extract the two hole features in the o-th assembly hole feature assemblyholes in the assembly hole feature set o and respectively obtain the axial vectors Vec1 and Vec2 of these two hole features.
[0228] (8-4) Calculate the distance dis between Vec1 and Vec2, and determine whether there is a distance dis ≤ 0.001 mm. If so, it means that the two axial vectors are coaxial, that is, the two holes of the o-th assembly hole feature assemblyholes o are aligned; otherwise, it means that the two holes in the o-th assembly hole feature assemblyholes o are not aligned and need to be adjusted, as Figure 9 shown, and then go to step (8-5);
[0229] (8-5) o = o + 1, return to step (8-2);
[0230] The advantages of the above steps (7) and (8) are that, through the positional relationship between hole features, all assembly hole features in the entire assembly are automatically analyzed and obtained, and then it is automatically judged whether the two holes in the assembly hole feature are aligned. This technology not only has high recognition efficiency but also can be applied to various complex assembly models.
[0231] The present invention provides a method for detecting the alignment of assembly holes based on geometric reasoning. First, all the holes inside the assembly are identified in a geometric reasoning manner, and then, according to the relative positional relationship between the identified holes, the hole groups with close distances and requiring alignment verification are detected to quickly obtain the alignment situation of the assembly holes in the three-dimensional model of the assembly. Compared with manual detection, this method not only greatly improves the detection efficiency and accuracy but also has universality, supporting various styles of holes, and holes formed by modeling operations such as stretching or rotation can be normally identified and detected.
[0232] Those skilled in the art can easily understand that the above is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent replacements, and improvements made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. An assembly hole alignment detection method based on geometric reasoning, characterized in that, Including the following steps: (1) Analyze the assembly to be detected to obtain the boundary representation Brep data of each sub-part in the assembly; (2) For each sub-part in the assembly obtained in step (1), perform vertex optimization processing and edge optimization processing on its Brep data in sequence to obtain the optimized Brep data corresponding to the sub-part; (3) For each sub-part in the assembly obtained in step (1), obtain each edge in the optimized Brep data corresponding to the sub-part obtained in step (2), obtain the concavity and convexity of the edge according to the connection situation of all adjacent faces of the edge, and fill the concavity and convexity of the edge into the Brep data to obtain the updated Brep data corresponding to the sub-part; (4) For each sub-part in the assembly obtained in step (1), obtain the set of hole units corresponding to the sub-part according to the updated Brep data corresponding to the sub-part obtained in step (3); (5) For each sub-part in the assembly obtained in step (1), obtain the set of hole features corresponding to the sub-part according to the set of hole units corresponding to the sub-part obtained in step (4); For each sub-part in the assembly obtained in step (1), obtain the type, the ID of the incoming machining surface in , the ID of the outgoing machining surface out and the axial vector V for each hole feature according to the set of hole features corresponding to the sub-part obtained in step (5). (7)Based on the type, the in-ward machining surface ID in , the out-ward machining surface ID out of each hole feature corresponding to each sub-part in the assembly obtained in step (6), and the axial vector V, obtain the assembly hole feature corresponding to the assembly; Step (7) includes the following sub-steps: (7-1) Set counters c = 1, d = 2, and initialize the assembly hole feature set {assemblyholes} to be empty; (7-2) Determine whether c < the total number of sub-parts part_size in the assembly. If so, obtain the set of hole features {hole c} corresponding to the c-th sub-part in the assembly, and proceed to step (7-3); otherwise, the process ends; (7-3) Determine whether c < d ≤ the total number of sub-parts in the assembly part_size holds. If so, obtain the set of hole features {hole d} corresponding to the d-th sub-part in the assembly, and then proceed to step (7-4); otherwise, set c = c + 1, d = c + 1, and return to step (7-2); (7-4) Set counters cnt1 = 1, cnt2 = 1; (7-5) Determine whether cnt1 ≤ the number size1 of the hole feature set {hole c} corresponding to the c-th sub-part holds. If so, obtain the cnt1-th hole feature hole cnt1 corresponding to the c-th sub-part in the assembly, set cnt2 = 1, and proceed to step (7-6); otherwise, set d = d + 1, and return to step (7-3); (7-6) Determine whether cnt2 ≤ the number size2 of the hole feature set {hole d} holds. If so, obtain the cnt2-th hole feature hole corresponding to the d-th sub-part in the assembly cnt2 , and proceed to step (7-7); otherwise, set cnt1 = cnt1 + 1 and return to step (7-5); (7-7) Determine whether there is an outgoing machining surface ID for the hole feature hole corresponding to the cnt1-th hole of the c-th sub-part in the assembly cnt1 If not, proceed to step (7-8); otherwise, go to step (7-9); out If not, proceed to step (7-8); otherwise, go to step (7-9); (7 - 8) Determine the hole feature hole cnt1 The ID of the outgoing machining surface out and the hole feature hole cnt2 The ID of the incoming machining surface in Are they parallel, and the distance between them is less than the hole feature hole cnt2 Diameter. If so, go to step (7 - 11); otherwise, go to step (7 - 9). (7-9) Determine whether there is an out-facing machining surface ID for the cnt2-th hole feature hole corresponding to the d-th sub-part in the assembly cnt2 If not, set cnt2 = cnt2 + 1 and return to step (7-6), otherwise proceed to step (7-10); out (7-10) Determine the hole feature hole cnt2 The ID of the outgoing machining surface out and the hole feature hole cnt1 The ID of the incoming machining surface in are parallel, and the distance between the two is less than the diameter of hole cnt1 If not, set cnt2 = cnt2 + 1 and return to step (7-6); otherwise, proceed to step (7-11); (7-11) Add the two hole features {hole cnt1 , hole cnt2} to the assembly hole feature set {assemblyholes}, set cnt2 = cnt2 + 1, and return to step (7-6); (8) Determine whether the axial vectors V1 and V2 of the two hole features corresponding to the assembly hole feature obtained in step (7) are collinear. If they are collinear, it means that the two holes in the assembly hole feature are aligned; otherwise, it means that the two holes are not aligned.
2. The method for detecting the alignment of holes in an assembly based on geometric reasoning according to claim 1, wherein Step (1) is specifically as follows: First, open the assembly to be detected using 3D modeling design software. Then, read the geometric data such as vertices, edges, and faces of each sub-part in the assembly through the secondary development interface provided by the 3D modeling design software, and remove the duplicate data among them. Subsequently, read the topological connection relationships among the geometric data in each sub-part through the secondary development interface, and remove the isolated vertices, edges, or faces. Then, combine the geometric data and topological connection relationships of each sub-part obtained to form the Brep data of the sub-part.
3. The method for detecting hole alignment of an assembly based on geometric reasoning according to claim 1 or 2, characterized in that The process of performing vertex optimization processing on the Brep data of the sub-part in step (2) is specifically as follows: First, read all vertices in the Brep data of the sub-part and calculate the distance between every two vertices. If the distance between two vertices is less than 0.01 mm, then fit the two vertices into a new vertex, and the new vertex is the midpoint of the line connecting the two original vertices. Then, modify the edges connected to the original vertices in the Brep data to be connected to the new vertex. Finally, remove the two original vertices from the Brep data of the sub-part; Edge optimization refers to fitting two edges with the same vertices and curve equations in the sub-part into one edge; The process of edge optimization for the Brep data of the sub - part in step (2) is specifically as follows. First, read all the edges in the Brep data of the sub - part. Then, for every two edges E1 that have the same vertices, where the two vertices of edge E1 are V1 and V2 and it is a straight - line edge, and the two vertices of edge E2 are V2 and V3 and it is a straight - line edge, obtain the curve equation of edge E1: (x,y,z) = b*T1+(x1,y1,z1), where T1 is the straight - line direction vector and b is an arbitrary real number; obtain the curve equation of edge E2: (x,y,z) = d*T2+(x2,y2,z2), where T2 is the straight - line direction vector and d is an arbitrary real number. Then, determine whether T1 is equal to T2. If they are equal, it means that these two edges have the same direction vector and are connected. At this time, fit edge E1 and E2 into one edge E3, whose two vertices are V1 and V3, and the direction vector is equal to T2. Then, modify the topological relationship of all the faces connected to edge E1 and E2, connect them to the new edge E3, and keep the connection order of the other edges on the face unchanged, and remove edge E1 and E2 from the Brep data. If they are not equal, it means that these two edges cannot be fitted, and continue to traverse the next pair of edges. Then, for every two circular - arc edges that have the same vertices, also use a similar method to determine whether they can be fitted into one circular - arc edge. If they can, after fitting, modify the topological relationship of all the faces connected to these two circular - arc edges, connect them to the new circular - arc edge, and keep the connection order of the other edges on the face unchanged. Subsequently, remove these two circular - arc edges from the Brep data. If they cannot, it means that these two circular - arc edges cannot be fitted, and continue to traverse the next pair of circular - arc edges.
4. The method for detecting hole alignment of an assembly based on geometric reasoning according to claim 3, wherein The concavity and convexity of the edge described in step (3) refers to a topological relationship between the edge and the two adjacent faces. For any point P on each edge E in the Brep data, if the included angle α between the two faces connected to the edge at this point P is greater than 180°, then the edge E is a convex edge; if the included angle α between the two faces connected to the edge at this point P is less than 180°, then the edge is a concave edge; if the included angle α between the two faces connected to the edge at this point P is equal to 180°, then the edge is a smooth edge. Smooth edges are further divided into smooth concave edges and smooth convex edges. A smooth concave edge means that the normal vectors of the two faces are in the same direction on edge E, but the normal vectors of the two faces are opposite near edge E; while a smooth convex edge is the opposite, which means that the normal vectors of the two faces are in opposite directions on edge E, but the normal vectors of the two faces are separated near edge E. The process of obtaining the concavity and convexity of the edge according to the connection situation of all adjacent faces of this edge in step (3) includes the following sub - steps: (3 - 1) For edge E, obtain a point P on edge E, and the two faces A and B connected to edge E. (3-2) Obtain the normal vector of plane A at point P And obtain the normal vector of plane B at point P (3-3) Obtain the tangential vector at point P on edge E (3-4) Obtain the normal vector obtained in step (3-2) and take the product, and determine whether it is not equal to 1. If so, go to step (3-5); otherwise, go to step (3-6). (3 - 5) According to the normal vector and calculate the concavity - convexity factor d of edge E, and determine whether d >
0. If so, it indicates that edge E is a convex edge, and then proceed to step (3 - 9); otherwise, it indicates that edge E is a concave edge, and then proceed to step (3 - 9); Specifically, the concavity / convexity factor d of edge E in this step is calculated using the formula (3-6) Obtain a point P1 within plane A to ensure that the length of the vector (P, P1) is less than 1 mm and is perpendicular to the vector and obtain a point P2 within plane B to ensure that the length of the vector (P, P2) is less than 1 mm and is perpendicular to the vector ; (3-7) Obtain the normal vector at point P1 in plane A and the normal vector at point P2 in plane B (3 - 8) Calculate the concavity - convexity factor k of edge E according to the normal vectors and Calculate the concavity - convexity factor k of edge E, and determine whether k >
0. If so, it indicates that edge E is a smooth convex edge, and then proceed to step (3 - 9); otherwise, it indicates that edge E is a smooth concave edge, and then proceed to step (3 - 9); (3 - 9) Update the concavity and convexity situation of edge E calculated to the Brep data, and the process ends.
5. The method for detecting the alignment of holes in an assembly based on geometric reasoning according to claim 4, characterized in that, Step (4) includes the following sub - steps: (4-1) Set the counter i = 1 and initialize the set of hole units {holeunit c} to be empty; (4-2) Determine whether there is an i ≤ the total number of face_size of the updated Brep data Brep c If so, read the updated Brep data Brep c the i-th face Face in the mid-face set i , and then go to step (4-3); otherwise, the process ends; (4-3) Determine the updated Brep data Brep c the i-th face Face in the mid-face set i whether the type of is an inner cylindrical surface or an inner conical surface. If so, create a new concave connection face set {ConcaveFaces}, and add Face i to the concave connection face set {ConcaveFaces}, then go to step (4-4). Otherwise, set i = i + 1 and return to step (4-2); (4 - 4) Set the counter j = 1; (4-5) Determine whether it holds that j ≤ total_size, the total number of faces in the concave connection face set {ConcaveFaces}. If so, obtain the j-th face ConcaveFace in the concave connection face set {ConcaveFaces} j , then go to step (4-6); otherwise, go to step (4-10). (4 - 6) Set the counter k = 1; (4-7) Determine whether there is a situation where k ≤ edge_size, the total number of edges in the concave connection face set {ConcaveFaces}. If so, obtain the j-th face ConcaveFace in the concave connection face set {ConcaveFaces} j and the k-th edge Edge in it k , then go to step (4-8). Otherwise, set j = j + 1 and return to step (4-5); (4-8) Determine whether the k-th edge Edge in the j-th face ConcaveFace of the concave connection face set {ConcaveFaces} j is a concave edge. If it is a concave edge, go to step (4-9); otherwise, set k = k + 1 and return to step (4-7). k (4-9) From the updated Brep data Brep c Get the kth edge Edge k Two adjacent faces, one of which is a ConcaveFace j , the other face is ConcaveFace x , concatenate the two faces ConcaveFace x With ConcaveFace j and connect the concave edges of the other face ConcaveFace x Also add it to the concave connected face set {ConcaveFaces}, set k = k + 1, and return to step (4-7); (4-10) Set counter m = 1 and initialize the set of hole unit surface groups {holeunit} to be empty; (4-11) Determine whether m ≤ the total number concavefaces_size of elements in the concave connection surface set {ConcaveFaces} holds. If so, obtain the m-th face face in the concave connection surface set {ConcaveFaces} m , otherwise, go to step (4-18); (4-12) Set counter n = 1; (4-13) Determine whether n ≤ size_n, the total number of elements in the set of hole unit surfaces {holeunit}, holds. If so, obtain the nth surface group faces in the set of hole unit surfaces {holeunit} n , and then proceed to step (4-14); otherwise, create a new surface group faces m , and add the surface group face m to the surface group faces n . Then, add the surface group faces m after adding the surface group face n to the set of hole unit surfaces {holeunit}, and return to step (4-11); (4-14) Obtain the nth face group faces in the set of hole unit surface groups {holeunit} n the first face face in begin and the mth face face in the set of concave connection faces {ConcaveFaces} m and determine whether the two faces are of the same type. If so, go to step (4-15); otherwise, set n = n + 1 and return to step (4-13); (4-15) Judge the first face face in the nth face group faces in the set of hole unit surface groups {holeunit} n The type of the first face face in begin Is a cylindrical surface, a conical surface, a plane, or other type. If it is a cylindrical surface or a conical surface, go to step (4-16); if it is a plane, go to step (4-17); if it is other type, set n = size n +1, and return to step (4-13); (4-16) Determine the first face begin Whether the axial vector of the m-th face m is collinear with that of the first face, and whether the two faces have the same generatrix edge. If so, add the m-th face m to the n-th face group faces in the hole unit face group set {holeunit} n , set m = m + 1, and return to step (4-11); otherwise, set n = n + 1, and return to step (4-13); (4-17) Determine the first face begin and the m-th face m are coplanar and have a common edge. If so, add the m-th face m to the n-th face group faces in the set {holeunit} of hole unit faces n , set m = m + 1, and return to step (4-11); otherwise, set n = n + 1 and return to step (4-13); (4-18) Set counter p = 1, cylsize = 0, planesize = 0, othersize = 0; (4-19) Determine whether p ≤ size_n, the total number of elements in the set {holeunit} of hole unit surface groups holds. If so, obtain the p-th surface group faces in the set {holeunit} of hole unit surface groups p ; Otherwise, go to step (4-24) (4-20) Determine the type of the first face in the p-th face group faces in the set of hole unit surface groups {holeunit}, whether it is a cylindrical surface, a conical surface, a plane, or other types. If it is a cylindrical surface or a conical surface, then set cylsize = cylsize + 1, and then go to step (4-21); if it is a plane, then set planesize = planesize + 1, p = p + 1, and return to step (4-19); p If the type of the first face in it is a cylindrical surface or a conical surface, a plane, or other types. If it is a cylindrical surface or a conical surface, then set cylsize = cylsize + 1, and then go to step (4-21); if it is a plane, then set planesize = planesize + 1, p = p + 1, and return to step (4-19); If it is of other types, then set othersize = othersize + 1, p = p + 1, and return to step (4-19); (4-21) Determine whether all the faces in the p-th face group faces in the set of hole unit surface groups {holeunit} can form a complete cylindrical surface or conical surface after merging. If so, set p = p + 1 and go to step (4-22); otherwise, set i = i + 1 and return to step (4-2); p If so, set p = p + 1 and go to step (4-22); otherwise, set i = i + 1 and return to step (4-2); (4-22) Obtain the p-th face group faces in the set of hole unit surface groups {holeunit} p and the convex edge group {edgeunit} in it, where the convex edge group is a group of arc edges connected end to end, each arc edge is a convex edge, and all the arc edges together form a complete circle, and obtain the plane face where the complete circle is located r ; (4-23) Determine whether the convex edge group {edgeunit} is relative to the face face r is an inner ring or an outer ring. If it is an outer ring, set i = i + 1 and return to step (4-2). If it is an inner ring, go to step (4-24); (4-24) Determine whether 0 < cylsize ≤ 2, planesize ≤ 1, and othersize == 0 hold. If so, go to step (4-25); otherwise, set i = i + 1 and return to step (4-2); (4-25) Construct a hole unit hole_unit using the set of hole unit surface groups {holeunit}, and add the hole unit hole_unit to the set of hole units {holeunit c}, set i = i + 1, and return to step (4-2).
6. The method for detecting the alignment of holes in an assembly based on geometric reasoning according to claim 5, wherein Step (5) specifically includes the following sub-steps: (5-1) Set counter t = 1 and initialize the set of hole features {hole} to be empty; (5-2) Determine whether there is a hole unit set {holeunit c }The number of elements holeunit_size is true, if so, then from the hole unit set {holeunit c } to get the tth hole unit holeunit t , then go to step (5-3), otherwise go to step (5-5); (5-3) Create hole feature hole t , add the t-th hole unit holeunit t to the hole feature hole t , where the convex edge group of the hole feature hole t is the convex edge group of the t-th hole unit holeunit t {edgeunit t}, and the axial vector of the hole feature hole t is the axial vector of holeunit t . Then add the hole feature hole t to the set of hole features {hole}; (5-4) Set t = t + 1 and return to step (5-2); (5-5) Set counters j = 1 and k = 2; (5-6) Determine whether j < the number of hole features hole_size holds. If so, obtain the j-th hole feature hole from the set of hole features {hole} j , set k = j + 1, and go to step (5-7); otherwise, the process ends. (5-7) Determine whether there is a situation where j < k ≤ the number of hole features hole_size. If so, obtain the k-th hole feature hole from the set of hole features {hole}, k and then proceed to step (5-8); otherwise, set j = t + 1 and return to step (5-6); (5-8) Determine whether the axial vector of the j-th hole feature hole j is coaxial with the axial vector of the k-th hole feature hole k If so, go to step (5-9); otherwise, set k = k + 1 and return to step (5-7). (5 - 9) Determine the j-th hole feature hole j 's convex edge group set {edgeunit j} and the k-th hole feature hole k 's convex edge group set {edgeunit k} to check if there is the same convex edge group. If not, set k = k + 1 and return to step (5 - 7); if so, delete the same convex edge group edgeunit same from the convex edge group set {edgeunit j} and the convex edge group set {edgeunit k}, and add the elements of the convex edge group set {edgeunit k} to the convex edge group set {edgeunit j}, then enter step (5 - 10); (5 - 10) Add the k-th hole feature hole k 's hole unit holeunit k to the j-th hole feature hole j . Update the convex edge group set {edgeunit j} to the convex edge group set {edgeunit j} of the j-th hole feature hole j . Delete the k-th hole feature hole k from the hole feature set {hole}, and then return to step (5 - 7).
7. The method for detecting the alignment of holes in an assembly based on geometric reasoning according to claim 6, characterized in that, Step (6) includes the following sub-steps: (6-1) Set counter u = 1; (6-2) Determine whether it holds that u ≤ the total number of elements holesize in the hole feature set {hole}. If so, obtain the u-th hole feature hole in the hole feature set {hole} u , and proceed to step (6-3); otherwise, the process ends; (6-3) Obtain the u-th hole feature hole u The corresponding number of hole units. If there is only one hole unit, it means the u-th hole feature hole u Is a simple hole. According to the type of the side surface in the hole unit, the simple hole is divided into a simple cylindrical hole or a simple conical hole; if there are two hole units, then according to the type of the hole unit with the larger hole diameter, the hole feature is divided into a countersunk hole and a counterbored hole; if there are more than two hole units, it means that the hole feature is a composite hole. At this time, the axial vector of the first hole unit inside is used as the axial vector holevec of the u-th hole feature hole u of the hole u , and then go to step (6-4); (6-3) Obtain the u-th hole feature hole u The corresponding set of hole units {unit u}, obtain the first hole unit holeunit from the set of hole units {unit u}, begin The axial vector of this hole unit holeunit begin is the axial vector of the u-th hole feature hole u Then enter step (6-4); (6-4) Obtain the u-th hole feature hole u The corresponding set of hole units {unit u} to obtain the number of hole units unitsize in it, and determine whether 0 < unitsize ≤ 2 holds. If so, proceed to step (6-5); otherwise, set u = u + 1 and return to step (6-2); (6-5) Judge the u-th hole feature hole u Whether the number unitsize of all hole units in the corresponding hole unit set {unit u} is equal to 1. If not, go to step (6-6); otherwise, it means the hole feature hole u is a simple hole, and judge the type of the first surface in the first hole unit holeunit u in the hole unit set {unit begin} is a cylindrical surface or a conical surface. If it is a cylindrical surface, it means the hole feature hole u is a simple cylindrical hole, and then go to step (6-7). If it is a conical surface, it means the hole feature hole u is a simple conical hole, and then go to step (6-7); (6-6) Judge whether the number of hole units in the hole unit set {unit u} of the u-th hole feature hole u is equal to 2. If not, set u = u + 1 and return to step (6-2); otherwise, obtain the hole unit holeunit u with a larger diameter in the hole unit set {unit max}, and judge whether the type of the first surface in holeunit max is a cylindrical surface or a conical surface. If it is a cylindrical surface, it means that the hole feature hole u is a counterbore, and then enter step (6-7). If it is a conical surface, it means that the hole feature hole u is a countersink, and then enter step (6-7); (6 - 7) Obtain the u-th hole feature hole u The corresponding convex edge group set {edgeunit u}, set the counter w = 1, and initialize the hole feature hole u The machining surface set {machinedface u} is empty; (6-8) Determine whether there is a set of convex edge groups {edgeunit u }The number of convex edge groups in edgeunitsize u If it is true, then get the convex edge group set {edgeunit u } The wth convex edge unit in w , then go to step (6-9); otherwise go to step (6-10); (6 - 9) Obtain the w-th convex edge group edgeunit in the set of convex edge groups {edgeunit u}, w and obtain the first edge edge begin in it. Obtain the two adjacent faces face c of this edge from the updated Brep data brep y and face z . Then judge whether face y is located inside the hole feature hole u . If so, add the face face z to the set of machined faces {machinedface u}, and then enter step (6 - 10); otherwise, add the face face y to the set of machined faces {machinedface u}, set w = w + 1, and return to step (6 - 8); (6 - 10) Obtain the set of machined surfaces {machinedface u}, get the number of machined surfaces machinedfacesize in the set, and determine whether there exists 0 < machinedfacesize ≤ 2. If it exists, proceed to step (6 - 11); otherwise, u = u + 1, and return to step (6 - 2); (6-11) Determine the hole feature hole u Whether the number machinedfacesize of machined surfaces in the corresponding set of machined surfaces {machinedface u} is equal to 1. If so, set the in-going machining surface ID u of the u-th hole feature hole in to the first surface in the set of machined surfaces {machinedface u}, set u = u + 1, and return to step (6-2); otherwise, go to step (6-12); (6 - 12) Obtain the first face machinedface u and the second face machinedface first from the set of machined faces {machinedface second . Obtain the first hole unit unit u and the second hole unit unit u from the set of hole units {unit first} corresponding to the hole feature hole second . Determine whether the diameter of the hole unit unit first is greater than the diameter of unit second . If so, set the incoming machining face ID u of the hole feature hole in to machinedface first , set the outgoing machining face ID u of the hole feature hole in to machinedface second , and then proceed to step (6 - 13); otherwise, set the incoming machining face ID u of the hole feature hole in to machinedface second , set the outgoing machining face ID u of the hole feature hole in to machinedface first . (6-13) Set u = u + 1 and return to step (6-2); 8. The method for detecting the alignment of holes in an assembly based on geometric reasoning according to claim 7, characterized in that, Step (8) includes the following sub-steps: (8-1) Set counter o = 1; (8-2) Determine whether there exists \(o\leq\) the number of assembly hole features assemblyholes_size in the assembly hole feature set. If it exists, read the \(o\)-th assembly hole feature assemblyholes o ; otherwise, the process ends; (8-3) Extract the two hole features in the $o$-th assembly hole feature assemblyholes in the set of assembly hole features, and respectively obtain the axial vectors Vec1 and Vec2 of these two hole features; o (8-4) Calculate the distance dis between Vec1 and Vec2, and determine whether there is a distance dis ≤ 0.001 mm. If so, it means that the two axial vectors are coaxial, that is, the two holes of the o-th assembly hole feature assemblyholes o are already aligned; otherwise, it means that the two holes in the o-th assembly hole feature assemblyholes o are not aligned and need to be adjusted, and then proceed to step (8-5); (8-5) o = o + 1, return to step (8-2).
9. An assembly hole alignment detection system based on geometric reasoning, characterized in that, Include: The first module is used to analyze the assembly to be detected to obtain the boundary representation Brep data of each sub-part in the assembly; The second module is used to, for each sub-part in the assembly obtained by the first module, perform vertex optimization processing and edge optimization processing on its Brep data in sequence to obtain the optimized Brep data corresponding to the sub-part; The third module is used to, for each sub-part in the assembly obtained by the first module, obtain each edge in the optimized Brep data corresponding to the sub-part obtained by the second module, obtain the concavity and convexity of the edge according to the connection situation of all adjacent faces of the edge, and fill the concavity and convexity of the edge into the Brep data to obtain the updated Brep data corresponding to the sub-part; The fourth module is used to, for each sub-part in the assembly obtained by the first module, obtain the set of hole units corresponding to the sub-part according to the updated Brep data corresponding to the sub-part obtained by the third module; The fifth module is used to, for each sub-part in the assembly obtained by the first module, obtain the set of hole features corresponding to the sub-part according to the set of hole units corresponding to the sub-part obtained by the fourth module; The sixth module is configured to, for each sub-component in the assembly obtained by the first module, obtain the type, the ID of the incoming machining surface in in , the ID of the outgoing machining surface out out , and the axial vector V for each hole feature in the set of hole features corresponding to the sub-component obtained by the fifth module; The seventh module is used to obtain the assembly hole features corresponding to the assembly according to the type, in-coming machining surface ID in and out-coming machining surface ID out of each hole feature corresponding to each sub-part in the assembly obtained by the sixth module, and the axial vector V; The seventh module includes the following sub-modules: The first sub-module is used to set counters c = 1, d = 2 and initialize the set of assembly hole features {assemblyholes} to be empty; The second sub-module is used to determine whether c < the total number of sub-parts part_size in the assembly. If so, it obtains the set of hole features {hole c} corresponding to the c-th sub-part in the assembly and enters the third sub-module; otherwise, the process ends. The third sub-module is used to determine whether c < d ≤ part_size (the total number of sub-parts in the assembly) holds. If so, it obtains the set of hole features {hole d} corresponding to the d-th sub-part in the assembly, and then transfers to the fourth sub-module; otherwise, it sets c = c + 1, d = c + 1, and returns to the second sub-module; The fourth sub-module is used to set counters cnt1 = 1, cnt2 = 1; The fifth sub-module is used to determine whether cnt1 ≤ the number size1 of the hole feature set {hole c} corresponding to the c-th sub-part holds. If so, obtain the cnt1-th hole feature hole cnt1 corresponding to the c-th sub-part in the assembly, set cnt2 = 1, and enter the sixth sub-module; otherwise, set d = d + 1, and return to the third sub-module; The sixth sub-module is used to determine whether cnt2 ≤ the number size2 of the hole feature set {hole d} holds. If so, obtain the cnt2-th hole feature hole corresponding to the d-th sub-part in the assembly cnt2 , and enter the seventh sub-module; Otherwise, set cnt1 = cnt1 + 1 and return to the fifth sub-module; The seventh sub-module is used to determine whether there is an outgoing machining surface ID for the hole feature hole corresponding to the c-th sub-part in the assembly cnt1 If not, it enters the eighth sub-module; otherwise, it transfers to the ninth sub-module; out if it does not exist, it enters the eighth sub-module; otherwise, it transfers to the ninth sub-module; The eighth sub-module is used to determine the hole feature hole cnt1 of the outgoing machining surface ID out and the hole feature hole cnt2 of the incoming machining surface ID in are parallel, and the distance between the two is less than the hole feature hole cnt2 diameter. If so, transfer to the eleventh sub-module; otherwise, enter the ninth sub-module; The ninth sub-module is used to determine whether there is an outgoing machining surface ID for the hole feature hole corresponding to the d-th sub-part in the assembly cnt2 If not, set cnt2 = cnt2 + 1 and return to the sixth sub-module; otherwise, enter the tenth sub-module out The tenth sub-module is used to judge the hole feature hole cnt2 of the outgoing machining surface ID out and the hole feature hole cnt1 of the incoming machining surface ID in are parallel, and the distance between the two is less than the diameter of hole cnt1 If not, set cnt2 = cnt2 + 1 and return to the sixth sub-module; Otherwise, enter the eleventh sub-module; The eleventh sub-module is used to add two hole features {hole cnt1 , hole cnt2} to the assembly hole feature set {assemblyholes}, set cnt2 = cnt2 + 1, and return to the sixth sub-module; The eighth module is used to determine whether the axial vectors V1 and V2 of the two hole features corresponding to the assembly hole feature obtained by the seventh module are collinear. If they are collinear, it means that the two holes in the assembly hole feature are aligned; otherwise, it means that the two holes are not aligned.
Citation Information
Patent Citations
Method and system for judging bending and flattening interference of sheet metal part based on three-dimensional model
CN116561982A
Analysis and identification method for geometric topological features of three-dimensional model
CN117290290A